Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve admin layout #30

Merged
merged 5 commits into from
Dec 25, 2014
Merged
Show file tree
Hide file tree
Changes from 4 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
6 changes: 3 additions & 3 deletions app/controllers/admin/attendee_applications_controller.rb
Original file line number Diff line number Diff line change
@@ -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]
Expand All @@ -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.'
Expand Down Expand Up @@ -66,7 +66,7 @@ def reject
end
end
end

private
# Use callbacks to share common setup or constraints between actions.
def set_attendee_application
Expand Down
6 changes: 3 additions & 3 deletions app/controllers/admin/coach_applications_controller.rb
Original file line number Diff line number Diff line change
@@ -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]
Expand All @@ -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.'
Expand All @@ -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
Expand Down
3 changes: 1 addition & 2 deletions app/views/admin/attendee_applications/edit.html.slim
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
h1
| Editing attendee_application
- content_for(:title, "Editing attendee_application")
= render 'form'
3 changes: 1 addition & 2 deletions app/views/admin/attendee_applications/index.html.slim
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
h1
| Attendee Applications
- content_for(:title, "Attendee Applications")
h2
= @event.title
p
Expand Down
3 changes: 1 addition & 2 deletions app/views/admin/attendee_applications/new.html.slim
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
h1
| New attendee_application
- content_for(:title, "New attendee_application")
= render 'form'
4 changes: 1 addition & 3 deletions app/views/admin/attendee_applications/show.html.slim
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
h1
| Application for
= @event.title
- content_for(:title, "Application for #{@event.title}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

) is missing

h2
= @attendee_application.first_name + ' ' + @attendee_application.last_name
p
Expand Down
3 changes: 1 addition & 2 deletions app/views/admin/coach_applications/edit.html.slim
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
h1
| Editing coach application
- content_for(:title, "Editing coach application")
= render 'form'
3 changes: 1 addition & 2 deletions app/views/admin/coach_applications/index.html.slim
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
h1
| Coach Applications
- content_for(:title, "Coach Applications")
h2
= @event.title
table
Expand Down
3 changes: 1 addition & 2 deletions app/views/admin/coach_applications/new.html.slim
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
h1
| New coach application
- content_for(:title, "New coach application")
= render 'form'
3 changes: 1 addition & 2 deletions app/views/admin/coach_applications/new_email.html.slim
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
h1
| New email to all coaches
- content_for(:title, "New email to all coaches")
= render 'form_email'
4 changes: 1 addition & 3 deletions app/views/admin/coach_applications/show.html.slim
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
h1
| Coach Application for
= @event.title
- content_for(:title, "Coach Application for #{@event.title}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

) is missing

h2
= @coach_application.first_name + ' ' + @coach_application.last_name
p
Expand Down
3 changes: 1 addition & 2 deletions app/views/admin/events/edit.html.slim
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
h1
| Editing event
- content_for(:title, "Editing event")
= render 'form'
= link_to 'Show', [:admin, @event]
| |
Expand Down
88 changes: 43 additions & 45 deletions app/views/admin/events/index.html.slim
Original file line number Diff line number Diff line change
@@ -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}&nbsp;- #{event.coach_reg_end}"
td
== "#{event.attendee_reg_start}&nbsp;- #{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}&nbsp;- #{event.coach_reg_end}"
td
== "#{event.attendee_reg_start}&nbsp;- #{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
3 changes: 1 addition & 2 deletions app/views/admin/events/new.html.slim
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
h1
| New event
- content_for(:title, "New event")
= render 'form'
= link_to 'Back', admin_events_path
1 change: 1 addition & 0 deletions app/views/admin/events/show.html.slim
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
- content_for(:title, "Event")
p
strong
| Title:
Expand Down
10 changes: 8 additions & 2 deletions app/views/layouts/admin.html.slim
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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