diff --git a/TODO b/TODO index 0c2d6e6..b36fa48 100644 --- a/TODO +++ b/TODO @@ -7,12 +7,13 @@ - # Create a conference, halls, tracks - # Starting a CFP - # conferences#show -> admin dashboard - - proposals#index -> grouped by user - volunteers#index -> approved volunteers - - # events#index -> approved events - sponsorships#index -> generate token, links to send around - scheduling -> calendar with events + - proposals#index -> undecided events, grouped by user + - events#index -> approved events + - users: - # edit profile: image upload and stuff - # show profile diff --git a/app/controllers/management/events_controller.rb b/app/controllers/management/events_controller.rb index 45d15d2..6e51681 100644 --- a/app/controllers/management/events_controller.rb +++ b/app/controllers/management/events_controller.rb @@ -3,7 +3,7 @@ module Management def index @conference = find_conference # TODO (2015-07-14) Scoped by conference? Why no conference_id - @events = Event.all + @events = Event.approved end def show diff --git a/app/controllers/management/propositions_controller.rb b/app/controllers/management/propositions_controller.rb new file mode 100644 index 0000000..05b7d7a --- /dev/null +++ b/app/controllers/management/propositions_controller.rb @@ -0,0 +1,15 @@ +module Management + # TODO (2015-07-19) Group by user + class PropositionsController < ManagementController + def index + @conference = find_conference + @proposed_events = Event.undecided + end + + private + + def find_conference + Conference.find(params[:conference_id]) + end + end +end diff --git a/app/views/layouts/management/_navigation.html.slim b/app/views/layouts/management/_navigation.html.slim index e808d2f..be138bf 100644 --- a/app/views/layouts/management/_navigation.html.slim +++ b/app/views/layouts/management/_navigation.html.slim @@ -26,6 +26,9 @@ nav.navbar.navbar-static-top.navbar-inverse role="navigation" li class="#{'active' if controller_name == 'volunteerships'}" = link_to '#' do => icon 'hand-o-up', t('activerecord.models.volunteership', count: 2).mb_chars.capitalize, class: 'fa-fw' + li class="#{'active' if controller_name == 'propositions'}" + = link_to [:management, current_conference, :propositions] do + => icon 'question', Proposition.model_name.human(count: 2).mb_chars.capitalize, class: 'fa-fw' ul.nav.navbar-nav.navbar-right li.dropdown diff --git a/app/views/management/propositions/index.html.slim b/app/views/management/propositions/index.html.slim new file mode 100644 index 0000000..c6c7d67 --- /dev/null +++ b/app/views/management/propositions/index.html.slim @@ -0,0 +1,26 @@ +.row + .col-lg-12 + .panel.panel-default + .panel-heading + h2.panel-title= Event.model_name.human(count: 2).mb_chars.capitalize + + .panel-body + table.table.table-striped.table-hover.record-table + thead + tr + th = Event.human_attribute_name :title + th = Event.human_attribute_name :subtitle + th = Event.human_attribute_name :length + th = Event.human_attribute_name :language + th.actions + tbody + - @proposed_events.each do |event| + tr + td= event.title + td= event.subtitle + td #{event.length} minutes + td= event.language + + td.actions + div.btn-group.btn-group-sm + = action_buttons(@conference, event, [:show, :edit, :destroy]) diff --git a/config/locales/bg.yml b/config/locales/bg.yml index dd16602..54d0a60 100644 --- a/config/locales/bg.yml +++ b/config/locales/bg.yml @@ -76,6 +76,9 @@ bg: one: Уъркшоп other: Уъркшопи event: + one: Събитие + other: Събития + proposition: one: Предложение other: Предложения track: diff --git a/config/routes.rb b/config/routes.rb index e7e84dd..9303a22 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -7,6 +7,7 @@ Rails.application.routes.draw do resources :conferences do resources :events resources :volunteers + resources :propositions resources :sponsorship_offers resource :call_for_participation, only: [:create, :destroy]