Merge 0fdef06ebf into 137d997793
This commit is contained in:
commit
b2f9b6790a
6 changed files with 112 additions and 0 deletions
|
|
@ -59,6 +59,11 @@ class ConferencesController < ApplicationController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def user_proposals
|
||||||
|
event_types = EventType.where(title: 'Talk').collect(&:id)
|
||||||
|
@events = Event.includes(program: :conference).where(event_type_id: event_types).order(created_at: :desc)
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def conference_finder_conditions
|
def conference_finder_conditions
|
||||||
|
|
|
||||||
|
|
@ -113,6 +113,8 @@ class Ability
|
||||||
can [:edit, :update], Track do |track|
|
can [:edit, :update], Track do |track|
|
||||||
user == track.submitter && !(track.accepted? || track.confirmed?)
|
user == track.submitter && !(track.accepted? || track.confirmed?)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
can :user_proposals, Conference
|
||||||
end
|
end
|
||||||
|
|
||||||
# Abilities for users with roles wandering around in non-admin views.
|
# Abilities for users with roles wandering around in non-admin views.
|
||||||
|
|
|
||||||
30
app/views/conferences/_tooltip.html.haml
Normal file
30
app/views/conferences/_tooltip.html.haml
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
- progress_status = event.progress_status
|
||||||
|
%ul.list-unstyled
|
||||||
|
- if can? :create, conference.registrations.new
|
||||||
|
%li{'class'=>class_for_todo(progress_status['registered'])}
|
||||||
|
%span{'class'=>icon_for_todo(progress_status['registered'])}
|
||||||
|
- if progress_status['registered']
|
||||||
|
Speaker(s) registered to the conference
|
||||||
|
- else
|
||||||
|
= link_to 'Speaker(s) not registered to the conference', new_conference_conference_registration_path(event.program.conference.short_title)
|
||||||
|
%li{'class'=>class_for_todo(progress_status['biographies'])}
|
||||||
|
%span{'class'=>icon_for_todo(progress_status['biographies'])}
|
||||||
|
- if progress_status['biographies']
|
||||||
|
Speakers have filled out their biographies
|
||||||
|
- elsif current_user.biography.blank? && event.speakers.include?(current_user)
|
||||||
|
= link_to 'Fill out your biography', edit_user_path(current_user)
|
||||||
|
- else
|
||||||
|
Speakers' biographies missing
|
||||||
|
%li{'class'=>class_for_todo(progress_status['subtitle'])}
|
||||||
|
%span{'class'=>icon_for_todo(progress_status['subtitle'])}
|
||||||
|
= link_to 'Add a subtitle', edit_conference_program_proposal_path(event.program.conference.short_title, event)
|
||||||
|
%li{'class'=>class_for_todo(progress_status['commercials'])}
|
||||||
|
%span{'class'=>icon_for_todo(progress_status['commercials'])}
|
||||||
|
= link_to 'Add a commercial', edit_conference_program_proposal_path(event.program.conference.short_title, event, anchor: 'commercials-content')
|
||||||
|
- unless progress_status['track'].nil?
|
||||||
|
%li{'class'=>class_for_todo(progress_status['track'])}
|
||||||
|
%span{'class'=>icon_for_todo(progress_status['track'])}
|
||||||
|
= link_to 'Add a track', edit_conference_program_proposal_path(event.program.conference.short_title, event)
|
||||||
|
%li{'class'=>class_for_todo(progress_status['difficulty_level'])}
|
||||||
|
%span{'class'=>icon_for_todo(progress_status['difficulty_level'])}
|
||||||
|
= link_to 'Add a difficulty level', edit_conference_program_proposal_path(event.program.conference.short_title, event)
|
||||||
66
app/views/conferences/user_proposals.html.haml
Normal file
66
app/views/conferences/user_proposals.html.haml
Normal file
|
|
@ -0,0 +1,66 @@
|
||||||
|
.container
|
||||||
|
.row
|
||||||
|
.col-md-12.page-header
|
||||||
|
%h1
|
||||||
|
User Proposals
|
||||||
|
|
||||||
|
|
||||||
|
%table.table.table-striped#events{ style: "margin-top: 30px;" }
|
||||||
|
- @events.each do |event|
|
||||||
|
%tr
|
||||||
|
%td{ style: "padding:20px 8px 20px 8px;" }
|
||||||
|
%span{ title: event.state.humanize,
|
||||||
|
class: "fa #{event_status_icon(event)}" }
|
||||||
|
|
||||||
|
%td.col-md-7{ style: "padding:20px 8px 20px 8px;" }
|
||||||
|
= link_to event.title, conference_program_proposal_path(event.conference.short_title, event.id)
|
||||||
|
%br
|
||||||
|
%small.text-muted
|
||||||
|
= event.event_type.title
|
||||||
|
= "(#{event.event_type.length} min)"
|
||||||
|
= "in #{event.track.name}" if event.track
|
||||||
|
- if event.require_registration
|
||||||
|
%br
|
||||||
|
= link_to registered_text(event), registrations_conference_program_proposal_path(event.conference.short_title, event), class: 'btn btn-xs btn-danger'
|
||||||
|
|
||||||
|
%td.col-md-2{ style: "padding:20px 8px 20px 8px;" }
|
||||||
|
= link_to 'Complete your proposal', 'javascript: void(0)', "type"=>"button", "data-trigger"=>"focus", "data-toggle"=>"popover", "title"=>"Your todo list", "data-content"=>"#{render partial: 'tooltip', locals: { event: event,conference: event.conference } }"
|
||||||
|
- if can? :create, event.conference.registrations.new
|
||||||
|
- progress_percentage = event.calculate_progress
|
||||||
|
.progress
|
||||||
|
%div{ class: "progress-bar #{event_progress_color(progress_percentage)}",
|
||||||
|
style: "width:#{progress_percentage}%;" }
|
||||||
|
= event.progress_status.reject{ |_key, value| value || value.nil? }.length
|
||||||
|
left
|
||||||
|
- else
|
||||||
|
:ruby
|
||||||
|
progress_list = event.progress_status
|
||||||
|
progress_percentage = (100 * progress_list.values.count(true) / (progress_list.values.compact.count-1)).to_s
|
||||||
|
.progress
|
||||||
|
%div{ class: "progress-bar #{event_progress_color(progress_percentage)}", style: "width:#{progress_percentage}%;" }
|
||||||
|
= event.progress_status.reject{ |_key, value| value || value.nil? }.length-1
|
||||||
|
left
|
||||||
|
%td.col-md-3{ style: "padding:20px 0px 20px 0px;" }
|
||||||
|
.pull-right
|
||||||
|
- if event.transition_possible? :confirm
|
||||||
|
= link_to 'Confirm',
|
||||||
|
confirm_conference_program_proposal_path(event.conference.short_title, event),
|
||||||
|
method: :patch, class: 'btn btn-mini btn-success', id: "confirm_proposal_#{event.id}"
|
||||||
|
|
||||||
|
- if event.transition_possible? :withdraw
|
||||||
|
- if can? :update, event
|
||||||
|
= link_to 'Withdraw', withdraw_conference_program_proposal_path(event.conference.short_title, event.id), method: :patch,
|
||||||
|
data: { confirm: 'Are you sure you want to withdraw this proposal?' }, class: 'btn btn-mini btn-warning',
|
||||||
|
id: "delete_proposal_#{event.id}"
|
||||||
|
- else
|
||||||
|
= link_to 'Withdraw', withdraw_conference_program_proposal_path(event.conference.short_title, event.id), method: :patch,
|
||||||
|
data: { confirm: 'Are you sure you want to withdraw this proposal?' }, class: 'btn disabled btn-mini btn-warning',
|
||||||
|
id: "delete_proposal_#{event.id}"
|
||||||
|
- if event.state == 'withdrawn' || event.state == 'rejected'
|
||||||
|
= link_to 'Re-Submit',
|
||||||
|
restart_conference_program_proposal_path(event.conference.short_title, event.id),
|
||||||
|
method: :patch, class: 'btn btn-mini btn-success', id: "review_event_#{event.id}"
|
||||||
|
- if can? :update, event
|
||||||
|
= link_to 'Edit', edit_conference_program_proposal_path(event.conference.short_title,event.id), class: 'btn btn-default', id: "edit_proposal_#{event.id}"
|
||||||
|
- else
|
||||||
|
= link_to 'Edit', edit_conference_program_proposal_path(event.conference.short_title,event.id), class: 'btn btn-default disabled', id: "edit_proposal_#{event.id}"
|
||||||
|
|
@ -1,3 +1,7 @@
|
||||||
|
%li
|
||||||
|
= link_to(user_proposals_conferences_path) do
|
||||||
|
%span.fa.fa-comment
|
||||||
|
User Proposals
|
||||||
- unless ENV['OSEM_ICHAIN_ENABLED'] == 'true'
|
- unless ENV['OSEM_ICHAIN_ENABLED'] == 'true'
|
||||||
%li
|
%li
|
||||||
= link_to(edit_user_registration_path) do
|
= link_to(edit_user_registration_path) do
|
||||||
|
|
|
||||||
|
|
@ -150,12 +150,17 @@ Osem::Application.routes.draw do
|
||||||
get '/revision_history/:id/revert_object' => 'versions#revert_object', as: 'revision_history_revert_object'
|
get '/revision_history/:id/revert_object' => 'versions#revert_object', as: 'revision_history_revert_object'
|
||||||
get '/revision_history/:id/revert_attribute' => 'versions#revert_attribute', as: 'revision_history_revert_attribute'
|
get '/revision_history/:id/revert_attribute' => 'versions#revert_attribute', as: 'revision_history_revert_attribute'
|
||||||
end
|
end
|
||||||
|
|
||||||
resources :organizations, only: [:index] do
|
resources :organizations, only: [:index] do
|
||||||
member do
|
member do
|
||||||
get :conferences
|
get :conferences
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
resources :conferences, only: [:index, :show] do
|
resources :conferences, only: [:index, :show] do
|
||||||
|
collection do
|
||||||
|
get :user_proposals
|
||||||
|
end
|
||||||
resources :booths do
|
resources :booths do
|
||||||
member do
|
member do
|
||||||
patch :withdraw
|
patch :withdraw
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue