Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions app/controllers/manage/configs_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ class Manage::ConfigsController < Manage::ApplicationController

def index
@config = HackathonConfig.get_all
@basics = ['name', 'event_start_date', 'digital_hackathon'].freeze
@questionnaire_settings = ['accepting_questionnaires', 'last_day_to_apply', 'auto_late_waitlist', 'disabled_fields'].freeze
@styling = ['default_page_title', 'homepage_url', 'logo_asset', 'email_banner_asset', 'favicon_asset', 'custom_css'].freeze
@communications = ['email_from', 'disclaimer_message', 'thanks_for_applying_message', 'thanks_for_rsvp_message', 'questionnaires_closed_message', 'bus_captain_notes']
@legal = ['agreement_pdf_asset'].freeze
respond_with(HackathonConfig.get_all)
end

Expand Down
153 changes: 140 additions & 13 deletions app/views/manage/configs/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,53 @@

.row
.col-lg-6.mb-3
- @config.each_key do |key|
- value = @config[key]
.card.mb-3
.card-body
.card.mb-3
.card-body
%h4.card-title The Basics
%h6.card-subtitle.mb-2.text-muted
Core information about your hackathon.
- @basics.each_entry do |key|
- value = HackathonConfig[key]
%hr
%p.mb-1
= link_to edit_manage_config_path(key), class: 'icon-space-r' do
%span.fa.fa-pencil
%b
= t("simple_form.labels.hackathon_config.#{key}")
%p.text-muted= t("simple_form.hints.hackathon_config.#{key}").html_safe
- if value.nil? || value == ''
%p.mb-0
%span.badge.badge-secondary Not set
- else
%pre.mb-0= value
- if value.is_a?(String)
- images = ['.ico', '.jpg', '.jpeg', '.png', '.gif', '.svg'].freeze
- links = ['http://', 'https://'].freeze
- if value.end_with?(*images)
%br
= image_tag value, style: 'max-height: 100px;', class: 'img-thumbnail img-template'
- elsif value.start_with?(*links)
%br
= link_to value, target: 'blank' do
%span
%span.fa.fa-external-link.icon-space-r-half
Open link
.card.mb-3
.card-body
%h4.card-title
Applying to
= HackathonConfig['name']
%h6.card-subtitle.mb-2.text-muted
Configuring Questionnaires for your hackathon.
- @questionnaire_settings.each_entry do |key|
- value = HackathonConfig[key]
%hr
%p.mb-1
= link_to edit_manage_config_path(key), class: 'icon-space-r' do
%span.fa.fa-pencil
%b
= t("simple_form.labels.hackathon_config.#{key}")
&nbsp;
%small
%code= key
%p.text-muted= t("simple_form.hints.hackathon_config.#{key}").html_safe
- if key == 'custom_css'
%p
= link_to enter_theming_editor_manage_configs_path do
%span.fa.fa-paint-brush.icon-space-r-half
Interactive editor
- if key == 'disabled_fields'
- cleaned_value = value
- cleaned_value = cleaned_value.join(' ') if cleaned_value.is_a?(Array)
Expand All @@ -45,11 +74,109 @@
%span
%span.fa.fa-external-link.icon-space-r-half
Open link
.card.mb-3
.card-body
%h4.card-title
Styling for
= HackathonConfig['name']
%h6.card-subtitle.mb-2.text-muted
Matching your hackathon's style.
- @styling.each_entry do |key|
- value = HackathonConfig[key]
%hr
%p.mb-1
= link_to edit_manage_config_path(key), class: 'icon-space-r' do
%span.fa.fa-pencil
%b
= t("simple_form.labels.hackathon_config.#{key}")
%p.text-muted= t("simple_form.hints.hackathon_config.#{key}").html_safe
- if key == 'custom_css'
%p
= link_to enter_theming_editor_manage_configs_path do
%span.fa.fa-paint-brush.icon-space-r-half
Interactive editor
- if value.nil? || value == ''
%p.mb-0
%span.badge.badge-secondary Not set
- else
%pre.mb-0= value
- if value.is_a?(String)
- images = ['.ico', '.jpg', '.jpeg', '.png', '.gif', '.svg'].freeze
- links = ['http://', 'https://'].freeze
- if value.end_with?(*images)
%br
= image_tag value, style: 'max-height: 100px;', class: 'img-thumbnail img-template'
- elsif value.start_with?(*links)
%br
= link_to value, target: 'blank' do
%span
%span.fa.fa-external-link.icon-space-r-half
Open link
.card.mb-3
.card-body
%h4.card-title
Communications
%h6.card-subtitle.mb-2.text-muted
Get the word out.
- @communications.each_entry do |key|
- value = HackathonConfig[key]
%hr
%p.mb-1
= link_to edit_manage_config_path(key), class: 'icon-space-r' do
%span.fa.fa-pencil
%b
= t("simple_form.labels.hackathon_config.#{key}")
%p.text-muted= t("simple_form.hints.hackathon_config.#{key}").html_safe
- if value.nil? || value == ''
%p.mb-0
%span.badge.badge-secondary Not set
- else
%pre.mb-0= value
- if value.is_a?(String)
- images = ['.ico', '.jpg', '.jpeg', '.png', '.gif', '.svg'].freeze
- links = ['http://', 'https://'].freeze
- if value.end_with?(*images)
%br
= image_tag value, style: 'max-height: 100px;', class: 'img-thumbnail img-template'
- elsif value.start_with?(*links)
%br
= link_to value, target: 'blank' do
%span
%span.fa.fa-external-link.icon-space-r-half
Open link
.card.mb-3
.card-body
%h4.card-title
Legal
%h6.card-subtitle.mb-2.text-muted
Agreements for your hackers.
- @legal.each_entry do |key|
- value = HackathonConfig[key]
%hr
%p.mb-1
= link_to edit_manage_config_path(key), class: 'icon-space-r' do
%span.fa.fa-pencil
%b
= t("simple_form.labels.hackathon_config.#{key}")
%p.text-muted= t("simple_form.hints.hackathon_config.#{key}").html_safe
%pre.mb-0= value
- if value.is_a?(String)
- images = ['.ico', '.jpg', '.jpeg', '.png', '.gif', '.svg'].freeze
- links = ['http://', 'https://'].freeze
- if value.end_with?(*images)
%br
= image_tag value, style: 'max-height: 100px;', class: 'img-thumbnail img-template'
- elsif value.start_with?(*links)
%br
= link_to value, target: 'blank' do
%span
%span.fa.fa-external-link.icon-space-r-half
Open link

.col-lg-6.mb-3
.card.mb-3
.card-body
%h5.card-title Environment Variables
%h4.card-title Environment Variables
%h6.card-subtitle.mb-2.text-muted
Environment variables are configured on the production server.
= render 'docs_link', title: 'Environment variable documentation', url: 'https://coderit.org/hackathon-manager/docs/deployment-environment-variables'
Expand Down