Group proposals by user
This commit is contained in:
parent
752fc6262a
commit
8f2707ffe7
4
TODO
4
TODO
|
@ -11,8 +11,8 @@
|
|||
- sponsorships#index -> generate token, links to send around
|
||||
- scheduling -> calendar with events
|
||||
|
||||
- proposals#index -> undecided events, grouped by user
|
||||
- events#index -> approved events
|
||||
- # proposals#index -> undecided events, grouped by user
|
||||
- # events#index -> approved events
|
||||
|
||||
- users:
|
||||
- # edit profile: image upload and stuff
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
module Management
|
||||
# TODO (2015-07-19) Group by user
|
||||
class PropositionsController < ManagementController
|
||||
def index
|
||||
@conference = find_conference
|
||||
@proposed_events = Event.undecided
|
||||
@events_by_proposer = @conference.events.undecided.group_by(&:proposer)
|
||||
end
|
||||
|
||||
private
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
module Proposable
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
def proposer
|
||||
proposition.proposer
|
||||
end
|
||||
|
||||
included do
|
||||
has_one :proposition, as: :proposable
|
||||
|
||||
|
|
|
@ -10,14 +10,18 @@
|
|||
tr
|
||||
th = Event.human_attribute_name :title
|
||||
th = Event.human_attribute_name :subtitle
|
||||
th = Event.human_attribute_name :user
|
||||
th = Event.human_attribute_name :length
|
||||
th = Event.human_attribute_name :language
|
||||
th.actions
|
||||
tbody
|
||||
- @events.each do |event|
|
||||
- proposer = event.proposer
|
||||
|
||||
tr
|
||||
td= event.title
|
||||
td= event.subtitle
|
||||
td= link_to proposer.personal_profile(@conference).name, [:management, @conference, proposer]
|
||||
td #{event.length} minutes
|
||||
td= event.language
|
||||
|
||||
|
|
|
@ -14,7 +14,12 @@
|
|||
th = Event.human_attribute_name :language
|
||||
th.actions
|
||||
tbody
|
||||
- @proposed_events.each do |event|
|
||||
- @events_by_proposer.each do |proposer, events|
|
||||
- profile = proposer.personal_profile(@conference)
|
||||
tr
|
||||
th[colspan="5"]= link_to profile.name, [:management, @conference, proposer]
|
||||
|
||||
- events.each do |event|
|
||||
tr
|
||||
td= event.title
|
||||
td= event.subtitle
|
||||
|
|
Loading…
Reference in New Issue