Merge 6beb9f68ab into d2cfb56ea5
This commit is contained in:
commit
b5d253ff76
3 changed files with 22 additions and 0 deletions
11
app/helpers/admin/conference_helper.rb
Normal file
11
app/helpers/admin/conference_helper.rb
Normal 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
|
||||||
|
|
@ -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
|
%h1
|
||||||
%span.fa.fa-tachometer
|
%span.fa.fa-tachometer
|
||||||
Dashboard for #{@conference.title}
|
Dashboard for #{@conference.title}
|
||||||
|
|
|
||||||
|
|
@ -13,3 +13,6 @@
|
||||||
# ActiveSupport::Inflector.inflections do |inflect|
|
# ActiveSupport::Inflector.inflections do |inflect|
|
||||||
# inflect.acronym 'RESTful'
|
# inflect.acronym 'RESTful'
|
||||||
# end
|
# end
|
||||||
|
ActiveSupport::Inflector.inflections do |inflect|
|
||||||
|
inflect.irregular "was", "were"
|
||||||
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue