diff --git a/app/controllers/admin/attendee_applications_controller.rb b/app/controllers/admin/attendee_applications_controller.rb index 7498a36..ecbb263 100644 --- a/app/controllers/admin/attendee_applications_controller.rb +++ b/app/controllers/admin/attendee_applications_controller.rb @@ -1,5 +1,5 @@ module Admin - class AttendeeApplicationsController < ApplicationController + class AttendeeApplicationsController < AdminController before_action :set_event before_action :set_attendee_application, only: [:show, :edit, :update, :destroy, :accept, :reject] before_action :set_statuses, only: [:new, :edit, :create, :update] @@ -19,7 +19,7 @@ def edit end def create - @attendee_application = @event.attendee_applications.build(attendee_application_params) + @attendee_application = @event.attendee_applications.build(attendee_application_params) if @attendee_application.save redirect_to [:admin, @event, @attendee_application], notice: 'Attendee application was successfully created.' @@ -66,7 +66,7 @@ def reject end end end - + private # Use callbacks to share common setup or constraints between actions. def set_attendee_application diff --git a/app/controllers/admin/coach_applications_controller.rb b/app/controllers/admin/coach_applications_controller.rb index 5ad96f5..e1dce1d 100644 --- a/app/controllers/admin/coach_applications_controller.rb +++ b/app/controllers/admin/coach_applications_controller.rb @@ -1,5 +1,5 @@ module Admin - class CoachApplicationsController < ApplicationController + class CoachApplicationsController < AdminController before_action :set_event before_action :set_coach_application, only: [:show, :edit, :update, :destroy] before_action :set_statuses, only: [:new, :edit, :create, :update] @@ -19,7 +19,7 @@ def edit end def create - @coach_application = @event.coach_applications.build(coach_application_params) + @coach_application = @event.coach_applications.build(coach_application_params) if @coach_application.save redirect_to [:admin, @event, @coach_application], notice: 'Coach application was successfully created.' @@ -41,7 +41,7 @@ def destroy redirect_to admin_event_coach_applications_url, notice: 'Coach application was successfully destroyed.' end - + private # Use callbacks to share common setup or constraints between actions. def set_coach_application diff --git a/app/views/admin/attendee_applications/edit.html.slim b/app/views/admin/attendee_applications/edit.html.slim index 079b754..82f4006 100644 --- a/app/views/admin/attendee_applications/edit.html.slim +++ b/app/views/admin/attendee_applications/edit.html.slim @@ -1,3 +1,2 @@ -h1 - | Editing attendee_application +- content_for(:title, "Editing attendee_application") = render 'form' diff --git a/app/views/admin/attendee_applications/index.html.slim b/app/views/admin/attendee_applications/index.html.slim index 99c6725..b487de9 100644 --- a/app/views/admin/attendee_applications/index.html.slim +++ b/app/views/admin/attendee_applications/index.html.slim @@ -1,5 +1,4 @@ -h1 - | Attendee Applications +- content_for(:title, "Attendee Applications") h2 = @event.title p diff --git a/app/views/admin/attendee_applications/new.html.slim b/app/views/admin/attendee_applications/new.html.slim index 2c19f50..ea86f67 100644 --- a/app/views/admin/attendee_applications/new.html.slim +++ b/app/views/admin/attendee_applications/new.html.slim @@ -1,3 +1,2 @@ -h1 - | New attendee_application +- content_for(:title, "New attendee_application") = render 'form' diff --git a/app/views/admin/attendee_applications/show.html.slim b/app/views/admin/attendee_applications/show.html.slim index 0818dce..7c4189a 100644 --- a/app/views/admin/attendee_applications/show.html.slim +++ b/app/views/admin/attendee_applications/show.html.slim @@ -1,6 +1,4 @@ -h1 - | Application for - = @event.title +- content_for(:title, "Application for #{@event.title}") h2 = @attendee_application.first_name + ' ' + @attendee_application.last_name p @@ -36,5 +34,5 @@ h3 p = attendee_self_care_url(@attendee_application) = link_to 'Edit', edit_admin_event_attendee_application_path(@event, @attendee_application) -| | +| | = link_to 'Back', admin_event_attendee_applications_path diff --git a/app/views/admin/coach_applications/edit.html.slim b/app/views/admin/coach_applications/edit.html.slim index a5ee289..c231a4c 100644 --- a/app/views/admin/coach_applications/edit.html.slim +++ b/app/views/admin/coach_applications/edit.html.slim @@ -1,3 +1,2 @@ -h1 - | Editing coach application +- content_for(:title, "Editing coach application") = render 'form' diff --git a/app/views/admin/coach_applications/index.html.slim b/app/views/admin/coach_applications/index.html.slim index 21cbc69..1c07f2e 100644 --- a/app/views/admin/coach_applications/index.html.slim +++ b/app/views/admin/coach_applications/index.html.slim @@ -1,5 +1,4 @@ -h1 - | Coach Applications +- content_for(:title, "Coach Applications") h2 = @event.title table diff --git a/app/views/admin/coach_applications/new.html.slim b/app/views/admin/coach_applications/new.html.slim index c36b226..02bc142 100644 --- a/app/views/admin/coach_applications/new.html.slim +++ b/app/views/admin/coach_applications/new.html.slim @@ -1,3 +1,2 @@ -h1 - | New coach application +- content_for(:title, "New coach application") = render 'form' diff --git a/app/views/admin/coach_applications/new_email.html.slim b/app/views/admin/coach_applications/new_email.html.slim index 35e155e..9d405ac 100644 --- a/app/views/admin/coach_applications/new_email.html.slim +++ b/app/views/admin/coach_applications/new_email.html.slim @@ -1,3 +1,2 @@ -h1 - | New email to all coaches +- content_for(:title, "New email to all coaches") = render 'form_email' diff --git a/app/views/admin/coach_applications/show.html.slim b/app/views/admin/coach_applications/show.html.slim index ae25914..2c9e475 100644 --- a/app/views/admin/coach_applications/show.html.slim +++ b/app/views/admin/coach_applications/show.html.slim @@ -1,6 +1,4 @@ -h1 - | Coach Application for - = @event.title +- content_for(:title, "Coach Application for #{@event.title}") h2 = @coach_application.first_name + ' ' + @coach_application.last_name p @@ -24,5 +22,5 @@ h3 p = coach_self_care_url(@coach_application) = link_to 'Edit', edit_admin_event_coach_application_path(@event, @coach_application) -| | +| | = link_to 'Back', admin_event_coach_applications_path diff --git a/app/views/admin/events/edit.html.slim b/app/views/admin/events/edit.html.slim index f6afb2a..45154c0 100644 --- a/app/views/admin/events/edit.html.slim +++ b/app/views/admin/events/edit.html.slim @@ -1,5 +1,4 @@ -h1 - | Editing event +- content_for(:title, "Editing event") = render 'form' = link_to 'Show', [:admin, @event] | | diff --git a/app/views/admin/events/index.html.slim b/app/views/admin/events/index.html.slim index e2758bd..879b656 100644 --- a/app/views/admin/events/index.html.slim +++ b/app/views/admin/events/index.html.slim @@ -1,45 +1,43 @@ -h1.text-center - | Events -.row - .large-12.large-centered.columns - table[style="width: 100%;"] - thead - tr - th - | Title - th - | Description - th - | Event date - th - | Coach dinner date - th - | Coach reg - th - | Attendee reg - th[colspan="5"] - tbody - - @events.each do |event| - tr - td - = event.title - td - = event.description - td - = event.event_date - td - = event.coach_dinner_date - td - == "#{event.coach_reg_start} - #{event.coach_reg_end}" - td - == "#{event.attendee_reg_start} - #{event.attendee_reg_end}" - td - = link_to t('.coach_applications'), [:admin, event, :coach_applications] - td - = link_to t('.attendee_applications'), [:admin, event, :attendee_applications] - td - = link_to 'Edit', edit_admin_event_path(event) - td - = link_to 'Destroy', [:admin, event], method: :delete, data: { confirm: 'Are you sure?' } - .text-center - = link_to 'New Event', new_admin_event_path +- content_for(:title, "Events") + +table[style="width: 100%;"] + thead + tr + th + | Title + th + | Description + th + | Event date + th + | Coach dinner date + th + | Coach reg + th + | Attendee reg + th[colspan="5"] + tbody + - @events.each do |event| + tr + td + = event.title + td + = event.description + td + = event.event_date + td + = event.coach_dinner_date + td + == "#{event.coach_reg_start} - #{event.coach_reg_end}" + td + == "#{event.attendee_reg_start} - #{event.attendee_reg_end}" + td + = link_to t('.coach_applications'), [:admin, event, :coach_applications] + td + = link_to t('.attendee_applications'), [:admin, event, :attendee_applications] + td + = link_to 'Edit', edit_admin_event_path(event) + td + = link_to 'Destroy', [:admin, event], method: :delete, data: { confirm: 'Are you sure?' } +.text-center + = link_to 'New Event', new_admin_event_path diff --git a/app/views/admin/events/new.html.slim b/app/views/admin/events/new.html.slim index 8195b59..a5b3114 100644 --- a/app/views/admin/events/new.html.slim +++ b/app/views/admin/events/new.html.slim @@ -1,4 +1,3 @@ -h1 - | New event +- content_for(:title, "New event") = render 'form' = link_to 'Back', admin_events_path diff --git a/app/views/admin/events/show.html.slim b/app/views/admin/events/show.html.slim index 27f5bc1..2232a4b 100644 --- a/app/views/admin/events/show.html.slim +++ b/app/views/admin/events/show.html.slim @@ -1,3 +1,4 @@ +- content_for(:title, "Event") p strong | Title: diff --git a/app/views/layouts/admin.html.slim b/app/views/layouts/admin.html.slim index d932d86..2b595b6 100644 --- a/app/views/layouts/admin.html.slim +++ b/app/views/layouts/admin.html.slim @@ -1,8 +1,10 @@ doctype html html head + meta[charset="utf-8"] title - | RailsgirlshhRegistration + = yield(:title) if content_for?(:title) + | Admin – RailsGirls = stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true = javascript_include_tag 'application' = csrf_meta_tags @@ -15,4 +17,8 @@ html - if n = notice .alert-box.success.radius[data-alert] = n - = yield + + h2.text-center= yield(:title) + .row + .large-12.large-centered.columns + = yield