diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 412a04ff..0765d9ae 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1,4 +1,13 @@ module ApplicationHelper + + def active_nav_li(link) + if current_page?(link) + return 'active' + else + return '' + end + end + def getdatetime(registration, field) if registration.send(field.to_sym).kind_of?(String) DateTime.parse(registration.send(field.to_sym)).strftime("%d %b %H:%M") if registration.send(field.to_sym) diff --git a/app/views/admin/callforpapers/show.html.haml b/app/views/admin/callforpapers/show.html.haml index f342534e..5852e74b 100644 --- a/app/views/admin/callforpapers/show.html.haml +++ b/app/views/admin/callforpapers/show.html.haml @@ -1,7 +1,7 @@ .container-fluid .row-fluid .span3 - = render 'admin/conference/sidebar', :activated => "Call for Papers" + = render 'admin/conference/sidebar' .span9 = semantic_form_for(@cfp, :url => admin_conference_cfp_update_path(@conference.short_title),:html => {:multipart => true}) do |f| = f.input :start_date, :as => :string, :input_html => { :id => "conference-start-datepicker", :readonly => "readonly" } diff --git a/app/views/admin/conference/_sidebar.html.haml b/app/views/admin/conference/_sidebar.html.haml index 0e4bd9a9..5084b6ff 100644 --- a/app/views/admin/conference/_sidebar.html.haml +++ b/app/views/admin/conference/_sidebar.html.haml @@ -3,55 +3,27 @@ %li.nav-header =@conference.short_title Settings - - if activated == "Conference" - %li.active= link_to "Conference", "#" - - else - %li= link_to "Conference", admin_conference_path(@conference.short_title) - - if activated == "Levels" - %li.active= link_to "Supporter Levels", "#" - - else - %li= link_to "Supporter Levels", admin_conference_supporter_levels_path(@conference.short_title) - - if activated == "Call for Papers" - %li.active= link_to "Call for Papers", "#" - - else - %li= link_to "Call for Papers", admin_conference_cfp_info_path(@conference.short_title) - - if activated == "Venue" - %li.active= link_to "Venue", "#" - - else - %li= link_to "Venue", admin_conference_venue_info_path(@conference.short_title) - - if activated == "Rooms" - %li.active= link_to "Rooms", "#" - - else - %li= link_to "Rooms", admin_conference_rooms_list_path(@conference.short_title) - - if activated == "Tracks" - %li.active= link_to "Tracks", "#" - - else - %li= link_to "Tracks", admin_conference_tracks_list_path(@conference.short_title) - - if activated == "Event Types" - %li.active= link_to "Event Types", "#" - - else - %li= link_to "Event Types", admin_conference_eventtype_list_path(@conference.short_title) - - if activated == "Difficulty Levels" - %li.active= link_to "Difficulty Levels", "#" - - else - %li= link_to "Difficulty Levels", admin_conference_difficulty_levels_path(@conference.short_title) - - if activated == "Social Events" - %li.active= link_to "Social Events", "#" - - else - %li= link_to "Social Events", admin_conference_social_events_path(@conference.short_title) - - if activated == "Emails" - %li.active= link_to "Emails", "#" - - else - %li= link_to "Emails", admin_conference_email_settings_path(@conference.short_title) - - if activated == "Diet" - %li.active= link_to "Dietary Choices", "#" - - else - %li= link_to "Dietary Choices", admin_conference_dietary_list_path(@conference.short_title) - - if activated == "Questions" - %li.active= link_to "Questions", "#" - - else - %li= link_to "Questions", admin_conference_questions_path(@conference.short_title) - - if activated == "volunteers" - %li.active= link_to "Volunteer Options", "#" - - else - %li= link_to "Volunteer Options", admin_conference_volunteer_options_path(@conference.short_title) + %li{:class=> active_nav_li(admin_conference_path(@conference.short_title))} + = link_to "Conference", admin_conference_path(@conference.short_title) + %li{:class=> active_nav_li(admin_conference_venue_info_path(@conference.short_title))} + = link_to "Venue", admin_conference_venue_info_path(@conference.short_title) + %li{:class=> active_nav_li(admin_conference_cfp_info_path(@conference.short_title))} + = link_to "Call for Papers", admin_conference_cfp_info_path(@conference.short_title) + %li{:class=> active_nav_li(admin_conference_rooms_list_path(@conference.short_title))} + = link_to "Rooms", admin_conference_rooms_list_path(@conference.short_title) + %li{:class=> active_nav_li(admin_conference_tracks_list_path(@conference.short_title))} + = link_to "Tracks", admin_conference_tracks_list_path(@conference.short_title) + %li{:class=> active_nav_li(admin_conference_eventtype_list_path(@conference.short_title))} + = link_to "Event Types", admin_conference_eventtype_list_path(@conference.short_title) + %li{:class=> active_nav_li(admin_conference_difficulty_levels_path(@conference.short_title))} + = link_to "Difficulty Levels", admin_conference_difficulty_levels_path(@conference.short_title) + %li{:class=> active_nav_li(admin_conference_social_events_path(@conference.short_title))} + = link_to "Social Events", admin_conference_social_events_path(@conference.short_title) + %li{:class=> active_nav_li(admin_conference_supporter_levels_path(@conference.short_title))} + = link_to "Supporter Levels", admin_conference_supporter_levels_path(@conference.short_title) + %li{:class=> active_nav_li(admin_conference_email_settings_path(@conference.short_title))} + = link_to "Emails", admin_conference_email_settings_path(@conference.short_title) + %li{:class=> active_nav_li(admin_conference_questions_path(@conference.short_title))} + = link_to "Questions", admin_conference_questions_path(@conference.short_title) + %li{:class=> active_nav_li(admin_conference_volunteers_info_path(@conference.short_title))} + = link_to "Volunteers", admin_conference_volunteers_info_path(@conference.short_title) diff --git a/app/views/admin/conference/show.html.haml b/app/views/admin/conference/show.html.haml index dcad569d..40a8665b 100644 --- a/app/views/admin/conference/show.html.haml +++ b/app/views/admin/conference/show.html.haml @@ -1,7 +1,7 @@ .container-fluid .row-fluid .span3 - = render 'admin/conference/sidebar', :activated => "Conference" + = render 'admin/conference/sidebar' .span9 = semantic_form_for(@conference, :url => admin_conference_path(@conference.short_title),:html => {:multipart => true}) do |f| = f.input :title, :hint => "The full name of the conference, such as 'OpenSUSE Conference 2013'" @@ -17,4 +17,4 @@ = image_tag @conference.logo(:thumb) = f.input :logo, :label => "Conference Logo", :hint => "This will be displayed on the front page." = f.input :html_export_path, :hint => "The path for static HTML exports" - = f.action :submit, :as => :button, :button_html => {:class => "btn btn-primary"} \ No newline at end of file + = f.action :submit, :as => :button, :button_html => {:class => "btn btn-primary"} diff --git a/app/views/admin/difficulty_levels/index.html.haml b/app/views/admin/difficulty_levels/index.html.haml index c720a402..9e9dc591 100644 --- a/app/views/admin/difficulty_levels/index.html.haml +++ b/app/views/admin/difficulty_levels/index.html.haml @@ -1,9 +1,9 @@ .container-fluid .row-fluid .span3 - = render 'admin/conference/sidebar', :activated => "Difficulty Levels" + = render 'admin/conference/sidebar' .span9 = semantic_form_for(@conference, :url => admin_conference_difficulty_levels_path(@conference.short_title)) do |f| = f.input :use_difficulty_levels, :label => false = dynamic_association :difficulty_levels, "Difficulty_Levels", f - = f.action :submit, :as => :button, :button_html => {:class => "btn btn-primary"} \ No newline at end of file + = f.action :submit, :as => :button, :button_html => {:class => "btn btn-primary"} diff --git a/app/views/admin/emails/show.html.haml b/app/views/admin/emails/show.html.haml index ce434195..93877eb7 100644 --- a/app/views/admin/emails/show.html.haml +++ b/app/views/admin/emails/show.html.haml @@ -1,7 +1,7 @@ .container-fluid .row-fluid .span3 - = render 'admin/conference/sidebar', :activated => "Emails" + = render 'admin/conference/sidebar' .span9 = link_to "Template Help", "#", :id => "template-help-link" #template-help @@ -47,4 +47,4 @@ $("#template-help-link").click(function() { $("#template-help").toggle(); }); - }); \ No newline at end of file + }); diff --git a/app/views/admin/eventtype/event_type_list.html.haml b/app/views/admin/eventtype/event_type_list.html.haml index d1715ce5..980a06e3 100644 --- a/app/views/admin/eventtype/event_type_list.html.haml +++ b/app/views/admin/eventtype/event_type_list.html.haml @@ -1,8 +1,8 @@ .container-fluid .row-fluid .span3 - = render 'admin/conference/sidebar', :activated => "Event Types" + = render 'admin/conference/sidebar' .span9 = semantic_form_for(@conference, :url => admin_conference_eventtype_update_path(@conference.short_title)) do |f| = dynamic_association :event_types, "Event Types", f - = f.action :submit, :as => :button, :button_html => {:class => "btn btn-primary"} \ No newline at end of file + = f.action :submit, :as => :button, :button_html => {:class => "btn btn-primary"} diff --git a/app/views/admin/questions/index.html.haml b/app/views/admin/questions/index.html.haml index f0631d97..0dd69e4b 100644 --- a/app/views/admin/questions/index.html.haml +++ b/app/views/admin/questions/index.html.haml @@ -1,7 +1,7 @@ .container-fluid .row-fluid .span3 - = render 'admin/conference/sidebar', :activated => "Questions" + = render 'admin/conference/sidebar' .span9 .pull-right %b= link_to "Create New Question","#", "data-toggle" => "modal", "data-target" => "#new-question", :class => "btn btn-success" @@ -28,4 +28,4 @@ Save .pull-right %button{:class=> "btn btn-danger", "data-dismiss"=> "modal", "aria-hidden"=>"true"} - Cancel \ No newline at end of file + Cancel diff --git a/app/views/admin/registrations/edit.html.haml b/app/views/admin/registrations/edit.html.haml index f93341de..0b59f383 100644 --- a/app/views/admin/registrations/edit.html.haml +++ b/app/views/admin/registrations/edit.html.haml @@ -18,7 +18,7 @@ = p.text_field :company, :placeholder => "Company/User Group/nothing", :as => :string = f.inputs "Registration Information" do - - if @conference.use_supporter_levels? + - if @conference.use_supporter_levels? and @conference.supporter_levels.length > 0 = f.semantic_fields_for :supporter_registration do |reg| = reg.input :supporter_level, :as => :select, :collection => @conference.supporter_levels = reg.input :code, :label => "Confirmation or registration code (if applicable)" @@ -35,11 +35,6 @@ %br = f.input :social_events, :as => :check_boxes, :label => false, :collection => @conference.social_events - - if @conference.use_dietary_choices? - = f.inputs "Food" do - = f.input :dietary_choice, :collection => [["None", nil]] + @conference.dietary_choices.map {|x| [x.title, x.id]}, - :include_blank => false, :label => "Special Dietary Restriction" - = f.input :other_dietary_choice, :input_html => {:rows => "2", :class => "span6"}, :label => "Other Dietary Restictions (please describe)" = f.action :submit, :button_html => { :value => "Edit Registration", :class => "btn btn-primary" } :javascript $("#registration_supporter_registration_attributes_supporter_level_id").change(function () { @@ -69,4 +64,4 @@ onSelect: function(selected) { $("#registration-arrival-datepicker").datepicker("option","maxDate", selected) } - }); \ No newline at end of file + }); diff --git a/app/views/admin/registrations/new.html.haml b/app/views/admin/registrations/new.html.haml index f4c64d8c..627f9857 100644 --- a/app/views/admin/registrations/new.html.haml +++ b/app/views/admin/registrations/new.html.haml @@ -19,7 +19,7 @@ = p.text_field :company, :placeholder => "Company/User Group/nothing", :as => :string = f.inputs "Registration Information" do - - if @conference.use_supporter_levels? + - if @conference.use_supporter_levels? and @conference.supporter_levels.length > 0 = f.semantic_fields_for @supporter_registration do |reg| = reg.input :supporter_level, :as => :select, :collection => @conference.supporter_levels = reg.input :code, :label => "Confirmation or registration code (if applicable)" @@ -36,11 +36,6 @@ %br = f.input :social_events, :as => :check_boxes, :label => false, :collection => @conference.social_events - - if @conference.use_dietary_choices? - = f.inputs "Food" do - = f.input :dietary_choice, :collection => [["None", nil]] + @conference.dietary_choices.map {|x| [x.title, x.id]}, - :include_blank => false, :label => "Special Dietary Restriction" - = f.input :other_dietary_choice, :input_html => {:rows => "2", :class => "span6"}, :label => "Other Dietary Restictions (please describe)" = f.action :submit, :button_html => { :value => "Create", :class => "btn btn-primary"} :javascript diff --git a/app/views/admin/rooms/rooms_list.html.haml b/app/views/admin/rooms/rooms_list.html.haml index 76c9b7eb..be23c863 100644 --- a/app/views/admin/rooms/rooms_list.html.haml +++ b/app/views/admin/rooms/rooms_list.html.haml @@ -1,8 +1,8 @@ .container-fluid .row-fluid .span3 - = render 'admin/conference/sidebar', :activated => "Rooms" + = render 'admin/conference/sidebar' .span9 = semantic_form_for(@conference, :url => admin_conference_rooms_update_path(@conference.short_title)) do |f| = dynamic_association :rooms, "Rooms", f - = f.action :submit, :as => :button, :button_html => {:class => "btn btn-primary"} \ No newline at end of file + = f.action :submit, :as => :button, :button_html => {:class => "btn btn-primary"} diff --git a/app/views/admin/social_events/social_events_list.html.haml b/app/views/admin/social_events/social_events_list.html.haml index c2b8a762..02a2ed12 100644 --- a/app/views/admin/social_events/social_events_list.html.haml +++ b/app/views/admin/social_events/social_events_list.html.haml @@ -1,8 +1,8 @@ .container-fluid .row-fluid .span3 - = render 'admin/conference/sidebar', :activated => "Social Events" + = render 'admin/conference/sidebar' .span9 = semantic_form_for(@conference, :url => admin_conference_social_events_path(@conference.short_title)) do |f| = dynamic_association :social_events, "Social Events", f - = f.action :submit, :as => :button, :button_html => {:class => "btn btn-primary"} \ No newline at end of file + = f.action :submit, :as => :button, :button_html => {:class => "btn btn-primary"} diff --git a/app/views/admin/supporter_levels/supporter_levels.html.haml b/app/views/admin/supporter_levels/supporter_levels.html.haml index 0c619057..22f9e954 100644 --- a/app/views/admin/supporter_levels/supporter_levels.html.haml +++ b/app/views/admin/supporter_levels/supporter_levels.html.haml @@ -1,9 +1,9 @@ .container-fluid .row-fluid .span3 - = render 'admin/conference/sidebar', :activated => "Levels" + = render 'admin/conference/sidebar' .span9 = semantic_form_for(@conference, :url => admin_conference_supporter_levels_path(@conference.short_title)) do |f| = f.input :use_supporter_levels, :label => false = dynamic_association :supporter_levels, "Supporter Levels", f - = f.action :submit, :as => :button, :button_html => {:class => "btn btn-primary"} \ No newline at end of file + = f.action :submit, :as => :button, :button_html => {:class => "btn btn-primary"} diff --git a/app/views/admin/tracks/tracks_list.html.haml b/app/views/admin/tracks/tracks_list.html.haml index 7ada0212..a167a51d 100644 --- a/app/views/admin/tracks/tracks_list.html.haml +++ b/app/views/admin/tracks/tracks_list.html.haml @@ -1,8 +1,8 @@ .container-fluid .row-fluid .span3 - = render 'admin/conference/sidebar', :activated => "Tracks" + = render 'admin/conference/sidebar' .span9 = semantic_form_for(@conference, :url => admin_conference_tracks_update_path(@conference.short_title)) do |f| = dynamic_association :tracks, "Tracks", f - = f.action :submit, :as => :button, :button_html => {:class => "btn btn-primary"} \ No newline at end of file + = f.action :submit, :as => :button, :button_html => {:class => "btn btn-primary"} diff --git a/app/views/admin/venue/venue_info.html.haml b/app/views/admin/venue/venue_info.html.haml index cdbda54d..eaaeb792 100644 --- a/app/views/admin/venue/venue_info.html.haml +++ b/app/views/admin/venue/venue_info.html.haml @@ -1,11 +1,11 @@ .container-fluid .row-fluid .span3 - = render 'admin/conference/sidebar', :activated => "Venue" + = render 'admin/conference/sidebar' .span9 = semantic_form_for(@venue, :url => admin_conference_venue_update_path(@conference.short_title),:html => {:multipart => true}) do |f| = f.input :name, :input_html => {:rows => 1} = f.input :address, :input_html => {:rows => 1} = f.input :website = f.input :description, :input_html => { :rows => 10, :cols => 20 } - = f.action :submit, :as => :button, :button_html => {:class => "btn btn-primary"} \ No newline at end of file + = f.action :submit, :as => :button, :button_html => {:class => "btn btn-primary"} diff --git a/app/views/admin/volunteers/index.html.haml b/app/views/admin/volunteers/index.html.haml index 2f82b3f2..489cdd66 100644 --- a/app/views/admin/volunteers/index.html.haml +++ b/app/views/admin/volunteers/index.html.haml @@ -1,9 +1,9 @@ .container-fluid .row-fluid .span3 - = render 'admin/conference/sidebar', :activated => "Volunteers" + = render 'admin/conference/sidebar' .span9 - = semantic_form_for(@conference, :url => admin_conference_volunteer_options_update_path(@conference.short_title)) do |f| + = semantic_form_for(@conference, :url => admin_conference_volunteers_update_path(@conference.short_title)) do |f| = f.action :submit, :as => :button, :button_html => {:class => "btn btn-primary"} %br %br @@ -12,4 +12,4 @@ = dynamic_association :vdays, "Volunteer Days", f .span5 = f.input :use_vpositions, :label => false - = dynamic_association :vpositions, "Volunteer positions", f \ No newline at end of file + = dynamic_association :vpositions, "Volunteer positions", f diff --git a/app/views/conference_registration/_registration.html.haml b/app/views/conference_registration/_registration.html.haml index ced7e675..0a09da39 100644 --- a/app/views/conference_registration/_registration.html.haml +++ b/app/views/conference_registration/_registration.html.haml @@ -16,7 +16,7 @@ %br = f.fields_for :person do |p| = p.text_field :public_name, :for => :person - - if @conference.use_supporter_levels? + - if @conference.use_supporter_levels? and @conference.supporter_levels.length > 0 = f.semantic_fields_for :supporter_registration do |reg| = reg.input :supporter_level, :as => :select, :collection => @conference.supporter_levels = reg.input :code, :label => "Confirmation or registration code (if applicable)" @@ -38,11 +38,6 @@ %br Yes, I'll be attending... %br = f.input :social_events, :as => :check_boxes, :label => false - - if @conference.use_dietary_choices? - = f.inputs "Food" do - = f.input :dietary_choice, :collection => [["None", nil]] + @conference.dietary_choices.map {|x| [x.title, x.id]}, - :include_blank => false, :label => "Special Dietary Restriction" - = f.input :other_dietary_choice, :input_html => {:rows => "2"}, :label => "Other Dietary Restictions (please describe)" :javascript $("#registration_supporter_registration_attributes_supporter_level_id").change(function () { diff --git a/app/views/conference_registration/register.html.haml b/app/views/conference_registration/register.html.haml index a749d3d4..60f6b320 100644 --- a/app/views/conference_registration/register.html.haml +++ b/app/views/conference_registration/register.html.haml @@ -12,7 +12,7 @@ = render :partial => "questions", :locals => {:f => f} %br - - if @conference.use_supporter_levels? && @conference.supporter_levels.count > 0 + - if @conference.use_supporter_levels? && @conference.supporter_levels.length > 0 = f.semantic_fields_for :supporter_registration do |reg| = reg.input :supporter_level, :as => :select, :collection => @conference.supporter_levels = reg.input :code, :label => "Confirmation or registration code (if applicable)" @@ -32,11 +32,6 @@ %br Yes, I'll be attending... %br = f.input :social_events, :as => :check_boxes, :label => false - - if @conference.use_dietary_choices? - = f.inputs "Food" do - = f.input :dietary_choice, :collection => [["None", nil]] + @conference.dietary_choices.map {|x| [x.title, x.id]}, - :include_blank => false, :label => "Special Dietary Restriction" - = f.input :other_dietary_choice, :input_html => {:rows => "2"}, :label => "Other Dietary Restictions (please describe)" .tabbable %ul.nav.nav-tabs %li.active diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb index f45fb7eb..fb2da032 100644 --- a/app/views/home/index.html.erb +++ b/app/views/home/index.html.erb @@ -19,13 +19,16 @@
<%= conference.date_range_string %> + <% if conference.venue.name and conference.venue.website and conference.venue.address %>

- <%= link_to conference.venue.name, conference.venue.website, :target => "_new" %> - , - <%= link_to conference.venue.address, "http://maps.google.com/maps?q=#{conference.venue.address}", :target => "_new" %> + <%= link_to conference.venue.name, conference.venue.website %>, + <%= link_to conference.venue.address, "http://maps.google.com/maps?q=#{conference.venue.address}" %> + <% end -%> + <% if conference.venue.description %> <%= simple_format(conference.venue.description, class: 'lead') %> + <% end -%>