This commit is contained in:
Carlos Coêlho 2016-03-14 21:48:04 +00:00
commit b5d253ff76
3 changed files with 22 additions and 0 deletions

View file

@ -0,0 +1,11 @@
module Admin
module ConferenceHelper
def withdrawn_events?(conference)
conference.program.events.where(state: :withdrawn).empty?
end
def withdrawn_events_count(conference)
conference.program.events.where(state: :withdrawn).count
end
end
end

View file

@ -1,3 +1,11 @@
- if !withdrawn_events?(@conference)
.alert.alert-warning.alert-dismissible{role: 'alert'}
%button.close{data: {dismiss: 'alert'}, aria: {label: 'Close'}, type: 'button'}
%span{aria: {hidden: 'true'}}
×
Sadly #{pluralize(withdrawn_events_count(@conference), 'event')} #{'was'.pluralize(withdrawn_events_count(@conference))} withdrawn.
= link_to 'Click here', admin_conference_program_events_path(@conference.short_title)
%h1
%span.fa.fa-tachometer
Dashboard for #{@conference.title}

View file

@ -13,3 +13,6 @@
# ActiveSupport::Inflector.inflections do |inflect|
# inflect.acronym 'RESTful'
# end
ActiveSupport::Inflector.inflections do |inflect|
inflect.irregular "was", "were"
end