Initial work on propositions, filter events correctly

This commit is contained in:
Andrew Radev 2015-07-19 12:01:36 +03:00
parent c6750d3a1a
commit 1bec127503
7 changed files with 52 additions and 3 deletions

5
TODO
View File

@ -7,12 +7,13 @@
- # Create a conference, halls, tracks - # Create a conference, halls, tracks
- # Starting a CFP - # Starting a CFP
- # conferences#show -> admin dashboard - # conferences#show -> admin dashboard
- proposals#index -> grouped by user
- volunteers#index -> approved volunteers - volunteers#index -> approved volunteers
- # events#index -> approved events
- sponsorships#index -> generate token, links to send around - sponsorships#index -> generate token, links to send around
- scheduling -> calendar with events - scheduling -> calendar with events
- proposals#index -> undecided events, grouped by user
- events#index -> approved events
- users: - users:
- # edit profile: image upload and stuff - # edit profile: image upload and stuff
- # show profile - # show profile

View File

@ -3,7 +3,7 @@ module Management
def index def index
@conference = find_conference @conference = find_conference
# TODO (2015-07-14) Scoped by conference? Why no conference_id # TODO (2015-07-14) Scoped by conference? Why no conference_id
@events = Event.all @events = Event.approved
end end
def show def show

View File

@ -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

View File

@ -26,6 +26,9 @@ nav.navbar.navbar-static-top.navbar-inverse role="navigation"
li class="#{'active' if controller_name == 'volunteerships'}" li class="#{'active' if controller_name == 'volunteerships'}"
= link_to '#' do = link_to '#' do
=> icon 'hand-o-up', t('activerecord.models.volunteership', count: 2).mb_chars.capitalize, class: 'fa-fw' => 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 ul.nav.navbar-nav.navbar-right
li.dropdown li.dropdown

View File

@ -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])

View File

@ -76,6 +76,9 @@ bg:
one: Уъркшоп one: Уъркшоп
other: Уъркшопи other: Уъркшопи
event: event:
one: Събитие
other: Събития
proposition:
one: Предложение one: Предложение
other: Предложения other: Предложения
track: track:

View File

@ -7,6 +7,7 @@ Rails.application.routes.draw do
resources :conferences do resources :conferences do
resources :events resources :events
resources :volunteers resources :volunteers
resources :propositions
resources :sponsorship_offers resources :sponsorship_offers
resource :call_for_participation, only: [:create, :destroy] resource :call_for_participation, only: [:create, :destroy]