show no of pre-registered people in proposal list

This commit is contained in:
differentreality 2013-07-11 08:21:02 +03:00
parent 1bd779b6c1
commit 3192ad9d4c
2 changed files with 6 additions and 0 deletions

View file

@ -1,5 +1,9 @@
module ApplicationHelper module ApplicationHelper
def pre_registered(event)
@conference.events.joins(:registrations).where("events.id = ?", event.id)
end
def add_association_link(association_name, form_builder, div_class, html_options = {}) def add_association_link(association_name, form_builder, div_class, html_options = {})
link_to_add_association "Add " + association_name.to_s.singularize, form_builder, div_class, html_options.merge(:class => "assoc btn btn-success") link_to_add_association "Add " + association_name.to_s.singularize, form_builder, div_class, html_options.merge(:class => "assoc btn btn-success")
end end

View file

@ -21,6 +21,8 @@
= link_to event.title, conference_proposal_path(@conference.short_title, event.id) = link_to event.title, conference_proposal_path(@conference.short_title, event.id)
%td %td
= event.public_state = event.public_state
- if event.state == 'confirmed' && event.require_registration == true
(Pre-registered: #{pre_registered(event).count})
- if event.confirmed? && !@conference.user_registered?(current_user) - if event.confirmed? && !@conference.user_registered?(current_user)
%br %br
= link_to "Register to attend", register_conference_path(@conference.short_title), :style => "font-size:10px;" = link_to "Register to attend", register_conference_path(@conference.short_title), :style => "font-size:10px;"