From c280919d29850ec356200a45b4078cb075ee5861 Mon Sep 17 00:00:00 2001 From: Lillie Chilen Date: Sat, 16 Mar 2013 21:33:12 -0700 Subject: [PATCH] Add RSVP details to volunteer role assignment page * Show assigned roles totals on organizer console * Various copy edits --- app/controllers/events_controller.rb | 9 +++++ app/views/events/organize.html.erb | 34 ++++++++++--------- app/views/events/show.html.erb | 6 +--- app/views/events/volunteer_emails.erb | 1 - app/views/rsvps/_form.html.erb | 5 +-- app/views/rsvps/edit.html.erb | 4 ++- app/views/rsvps/new.html.erb | 4 ++- app/views/volunteers/index.html.erb | 10 +++--- spec/requests/event_listing_request_spec.rb | 2 +- .../event_organizer_dashboard_request_spec.rb | 26 -------------- 10 files changed, 43 insertions(+), 58 deletions(-) diff --git a/app/controllers/events_controller.rb b/app/controllers/events_controller.rb index f3285c3de..ab223d6ce 100644 --- a/app/controllers/events_controller.rb +++ b/app/controllers/events_controller.rb @@ -50,6 +50,15 @@ def volunteer_emails end def organize + @volunteer_rsvps = @event.volunteer_rsvps + @volunteer_counts = { + VolunteerAssignment::UNASSIGNED => 0, + VolunteerAssignment::TEACHER => 0, + VolunteerAssignment::TA => 0, + } + @volunteer_rsvps.each do |rsvp| + @volunteer_counts[rsvp.volunteer_assignment_id] += 1 + end end protected diff --git a/app/views/events/organize.html.erb b/app/views/events/organize.html.erb index 60061162f..240ca7c1b 100644 --- a/app/views/events/organize.html.erb +++ b/app/views/events/organize.html.erb @@ -21,7 +21,7 @@ ] %>

Volunteer Teaching Preference Totals

-

You can assign people's roles on the Manage Volunteers page.

+

You can see individual preferences and assign teaching roles on the <%= link_to('Manage Volunteers', event_volunteers_path(@event)) %> page.

@@ -43,21 +43,23 @@
-
-

Willing to Teach: <%= teachers_count(@event.volunteer_rsvps) %>

- <%= partitioned_volunteer_list(@event.volunteer_rsvps, :teachers) %> - -

Willing to TA: <%= tas_count(@event.volunteer_rsvps) %>

- <%= partitioned_volunteer_list(@event.volunteer_rsvps, :tas) %> - -

Willing to Teach or TA: <%= teach_or_ta_count(@event.volunteer_rsvps) %>

- <%= partitioned_volunteer_list(@event.volunteer_rsvps, :teach_or_tas) %> - -

Not Interested in Teaching: <%= not_teach_or_ta_count(@event.volunteer_rsvps) %>

- <%= partitioned_volunteer_list(@event.volunteer_rsvps, :not_teach_or_tas) %> - -

All Volunteers: <%= @event.volunteer_rsvps.length %>

-
+

Volunteer Assignment Totals

+ + + + + + + + + + + + + + + +
UnassignedTeachersTAs
<%= @volunteer_counts[VolunteerAssignment::UNASSIGNED] %><%= @volunteer_counts[VolunteerAssignment::TEACHER] %><%= @volunteer_counts[VolunteerAssignment::TA] %>
<%= render 'shared/actions', links: [ ['Back', events_path], diff --git a/app/views/events/show.html.erb b/app/views/events/show.html.erb index e7dab01b7..8f8a3f3da 100644 --- a/app/views/events/show.html.erb +++ b/app/views/events/show.html.erb @@ -1,8 +1,4 @@ -
-
-

<%= @event.title %>

-
-
+<%= render 'header' %>
diff --git a/app/views/events/volunteer_emails.erb b/app/views/events/volunteer_emails.erb index b479db4c1..cf7cbd9da 100644 --- a/app/views/events/volunteer_emails.erb +++ b/app/views/events/volunteer_emails.erb @@ -9,7 +9,6 @@ <% @volunteers.each do |volunteer| %> - <% end %> diff --git a/app/views/rsvps/_form.html.erb b/app/views/rsvps/_form.html.erb index c5990415f..4f1acb5f1 100644 --- a/app/views/rsvps/_form.html.erb +++ b/app/views/rsvps/_form.html.erb @@ -18,18 +18,19 @@
- <%= f.label :teaching_experience, "Teaching Experience" %> + <%= f.label :teaching_experience, "What's your experience with teaching?" %> <%= f.text_area :teaching_experience, rows: 5, cols: 80, maxlength: Rsvp::MAX_EXPERIENCE_LENGTH %>
Teaching preference? +

If you're happy to do either, leave this section blank.

<%= f.label :teaching, class: 'checkbox' do %> <%= f.check_box :teaching %> Teaching <% end %> <%= f.label :taing, class: 'checkbox' do %> - <%= f.check_box :taing %> Taing + <%= f.check_box :taing %> TAing <% end %>
diff --git a/app/views/rsvps/edit.html.erb b/app/views/rsvps/edit.html.erb index 65f80f2fe..ea57b18e4 100644 --- a/app/views/rsvps/edit.html.erb +++ b/app/views/rsvps/edit.html.erb @@ -1,3 +1,5 @@ -

Edit RSVP

+<%= render 'events/header' %> + +

Edit RSVP

<%= render 'form' %> \ No newline at end of file diff --git a/app/views/rsvps/new.html.erb b/app/views/rsvps/new.html.erb index 9a8344784..a48585ab6 100644 --- a/app/views/rsvps/new.html.erb +++ b/app/views/rsvps/new.html.erb @@ -1,4 +1,6 @@ -

RSVP

+<%= render 'events/header' %> + +

RSVP

<%= render 'form' %> diff --git a/app/views/volunteers/index.html.erb b/app/views/volunteers/index.html.erb index f0380cf0a..6ea8dbd37 100644 --- a/app/views/volunteers/index.html.erb +++ b/app/views/volunteers/index.html.erb @@ -1,20 +1,20 @@ <%= render 'events/header' %> -

Volunteer Assignments

-

Event: <%= link_to " #{@event.title}", event_path(@event)%>

-

- <%= "When: #{formatted_session_datetime(@event.event_sessions.first)}" %> -

+

Assign Volunteer Teaching Roles

<%= volunteer.first_name %> <%= volunteer.last_name %>: <%= volunteer.email %>
+ + <% @volunteer_rsvps.each do |rsvp| %> + +
NameSubject ExperienceTeaching Experience Volunteer's Preference Assignment
<%= rsvp.user.full_name %><%= rsvp.subject_experience %><%= rsvp.teaching_experience %> <%= rsvp.formatted_preference %> <%= form_for([@event, rsvp], method: :put, url: event_volunteer_path(@event, rsvp.id), remote: true) do %> diff --git a/spec/requests/event_listing_request_spec.rb b/spec/requests/event_listing_request_spec.rb index df9149441..5177c3dcf 100644 --- a/spec/requests/event_listing_request_spec.rb +++ b/spec/requests/event_listing_request_spec.rb @@ -122,7 +122,7 @@ it "allows user to edit volunteer responsibilities" do click_link("Edit RSVP") uncheck 'Teaching' - check 'Taing' + check 'TAing' uncheck "Installfest" check "Curriculum" diff --git a/spec/requests/event_organizer_dashboard_request_spec.rb b/spec/requests/event_organizer_dashboard_request_spec.rb index d82587414..9431b772b 100644 --- a/spec/requests/event_organizer_dashboard_request_spec.rb +++ b/spec/requests/event_organizer_dashboard_request_spec.rb @@ -25,32 +25,6 @@ page.should have_content("Volunteer Assignment") end - it "shows all volunteer information" do - 4.times { create(:rsvp, event: @event, teaching: true) } - 3.times { create(:rsvp, event: @event, taing: true) } - 2.times { create(:rsvp, event: @event, teaching: true, taing: true) } - 1.times { create(:rsvp, event: @event) } - - volunteer = create(:user) - create(:rsvp, user: volunteer, event: @event, teaching: true) - - visit organize_event_path(@event) - page.should have_content(volunteer.email) - page.should have_content(volunteer.full_name) - page.should have_content("#{volunteer.full_name} - #{volunteer.email}") - - page.should have_content("Willing to Teach: 5") - page.should have_content("Willing to TA: 3") - page.should have_content("Willing to Teach or TA: 2") - page.should have_content("Not Interested in Teaching: 1") - page.should have_content("All Volunteers: 11") - - page.should have_css('.teach', count: 5) - page.should have_css('.ta', count: 3) - page.should have_css('.both', count: 2) - page.should have_css('.none', count: 1) - end - it "lets the user check in volunteers", js: true do user1 = create(:user, first_name: 'Anthony') user2 = create(:user, first_name: 'Bapp')