Browse Source

Fixed admin edit page

development
Godwin 8 years ago
parent
commit
364c4909b2
  1. 2
      app/assets/stylesheets/_application.scss
  2. 1
      app/controllers/application_controller.rb
  3. 4
      app/helpers/application_helper.rb
  4. 2
      app/views/conferences/admin/_schedule.html.haml

2
app/assets/stylesheets/_application.scss

@ -2036,13 +2036,13 @@ table.schedule {
} }
} }
#main .columns & form { #main .columns & form {
margin-top: 0; margin-top: 0;
button { button {
margin-top: 0.5em; margin-top: 0.5em;
float: left; float: left;
z-index: 1;
} }
} }
} }

1
app/controllers/application_controller.rb

@ -571,6 +571,7 @@ class ApplicationController < LinguaFrancaApplicationController
@schedule.each do | day, data | @schedule.each do | day, data |
@schedule[day][:times] = data[:times].sort.to_h @schedule[day][:times] = data[:times].sort.to_h
@schedule[day][:locations][0] = :add if @schedule[day][:locations].size > 0
data[:times].each do | time, time_data | data[:times].each do | time, time_data |
if time_data[:type] == :workshop && time_data[:item].present? && time_data[:item][:workshops].present? if time_data[:type] == :workshop && time_data[:item].present? && time_data[:item][:workshops].present?

4
app/helpers/application_helper.rb

@ -966,12 +966,14 @@ module ApplicationHelper
def admin_menu def admin_menu
steps = '' steps = ''
first = true
admin_steps.each do | step | admin_steps.each do | step |
steps += content_tag(:li, class: (step.to_s == @admin_step ? :current : nil)) do steps += content_tag(:li, class: (step.to_s == @admin_step ? :current : nil)) do
link_to _("menu.submenu.admin.#{step.to_s.titlecase.gsub(/\s/, '_')}"), step == :edit ? link_to _("menu.submenu.admin.#{step.to_s.titlecase.gsub(/\s/, '_')}"), first ?
register_step_path(@this_conference.slug, :administration) : register_step_path(@this_conference.slug, :administration) :
administration_step_path(@this_conference.slug, step.to_s) administration_step_path(@this_conference.slug, step.to_s)
end end
first = false
end end
content_tag :ul, steps.html_safe, id: 'registration-admin-menu' content_tag :ul, steps.html_safe, id: 'registration-admin-menu'
end end

2
app/views/conferences/admin/_schedule.html.haml

@ -20,7 +20,7 @@
%tr %tr
%th.corner %th.corner
- data[:locations].each do | id, location | - data[:locations].each do | id, location |
%th=location.title %th=location.is_a?(Symbol) ? '' : location.title
%th.status %th.status
%tbody %tbody
- data[:times].each do | time, time_data | - data[:times].each do | time, time_data |

Loading…
Cancel
Save