From 364c4909b2f1eda067a2f0591c4ee04be1adff17 Mon Sep 17 00:00:00 2001 From: Godwin Date: Mon, 15 Aug 2016 21:23:59 -0700 Subject: [PATCH] Fixed admin edit page --- app/assets/stylesheets/_application.scss | 2 +- app/controllers/application_controller.rb | 1 + app/helpers/application_helper.rb | 4 +++- app/views/conferences/admin/_schedule.html.haml | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/assets/stylesheets/_application.scss b/app/assets/stylesheets/_application.scss index 49f3be0..09c56fc 100644 --- a/app/assets/stylesheets/_application.scss +++ b/app/assets/stylesheets/_application.scss @@ -2036,13 +2036,13 @@ table.schedule { } } - #main .columns & form { margin-top: 0; button { margin-top: 0.5em; float: left; + z-index: 1; } } } diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 73f9b7d..1f475e2 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -571,6 +571,7 @@ class ApplicationController < LinguaFrancaApplicationController @schedule.each do | day, data | @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 | if time_data[:type] == :workshop && time_data[:item].present? && time_data[:item][:workshops].present? diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 13d7b88..3c69c33 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -966,12 +966,14 @@ module ApplicationHelper def admin_menu steps = '' + first = true admin_steps.each do | step | 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) : administration_step_path(@this_conference.slug, step.to_s) end + first = false end content_tag :ul, steps.html_safe, id: 'registration-admin-menu' end diff --git a/app/views/conferences/admin/_schedule.html.haml b/app/views/conferences/admin/_schedule.html.haml index 31dcc64..a078ba3 100644 --- a/app/views/conferences/admin/_schedule.html.haml +++ b/app/views/conferences/admin/_schedule.html.haml @@ -20,7 +20,7 @@ %tr %th.corner - data[:locations].each do | id, location | - %th=location.title + %th=location.is_a?(Symbol) ? '' : location.title %th.status %tbody - data[:times].each do | time, time_data |