Rename 'ConferenceController' to 'ConferencesController', and 'ProposalController' to 'ProposalsController'
This commit is contained in:
parent
0b6550d060
commit
daf1f805bd
71 changed files with 225 additions and 191 deletions
|
|
@ -1,5 +1,5 @@
|
|||
module Admin
|
||||
class ConferenceController < Admin::BaseController
|
||||
class ConferencesController < Admin::BaseController
|
||||
load_and_authorize_resource :conference, find_by: :short_title
|
||||
load_resource :program, through: :conference, singleton: true, except: :index
|
||||
load_resource :user, only: [:remove_user]
|
||||
|
|
@ -30,7 +30,7 @@ class ApplicationController < ActionController::Base
|
|||
(!session[:return_to] ||
|
||||
session[:return_to] &&
|
||||
session[:return_to] == root_path)
|
||||
admin_conference_index_path
|
||||
admin_conferences_path
|
||||
else
|
||||
session[:return_to] || root_path
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
class ConferenceController < ApplicationController
|
||||
class ConferencesController < ApplicationController
|
||||
protect_from_forgery with: :null_session
|
||||
before_filter :respond_to_options
|
||||
before_action :respond_to_options
|
||||
load_and_authorize_resource find_by: :short_title
|
||||
load_resource :program, through: :conference, singleton: true, except: :index
|
||||
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
class ProposalController < ApplicationController
|
||||
before_filter :authenticate_user!, except: [:show, :new, :create]
|
||||
class ProposalsController < ApplicationController
|
||||
before_action :authenticate_user!, except: [:show, :new, :create]
|
||||
load_resource :conference, find_by: :short_title
|
||||
load_resource :program, through: :conference, singleton: true
|
||||
load_and_authorize_resource :event, parent: false, through: :program
|
||||
|
|
@ -20,7 +20,7 @@ class ProposalController < ApplicationController
|
|||
|
||||
def new
|
||||
@user = User.new
|
||||
@url = conference_program_proposal_index_path(@conference.short_title)
|
||||
@url = conference_program_proposals_path(@conference.short_title)
|
||||
@languages = @program.languages_list
|
||||
end
|
||||
|
||||
|
|
@ -30,7 +30,7 @@ class ProposalController < ApplicationController
|
|||
end
|
||||
|
||||
def create
|
||||
@url = conference_program_proposal_index_path(@conference.short_title)
|
||||
@url = conference_program_proposals_path(@conference.short_title)
|
||||
|
||||
# We allow proposal submission and sign up on same page.
|
||||
# If user is not signed in then first create new user and then sign them in
|
||||
|
|
@ -55,7 +55,7 @@ class ProposalController < ApplicationController
|
|||
event_role: 'speaker')
|
||||
if @event.save
|
||||
ahoy.track 'Event submission', title: 'New submission'
|
||||
redirect_to conference_program_proposal_index_path(@conference.short_title), notice: 'Proposal was successfully submitted.'
|
||||
redirect_to conference_program_proposals_path(@conference.short_title), notice: 'Proposal was successfully submitted.'
|
||||
else
|
||||
flash[:error] = "Could not submit proposal: #{@event.errors.full_messages.join(', ')}"
|
||||
render action: 'new'
|
||||
|
|
@ -66,7 +66,7 @@ class ProposalController < ApplicationController
|
|||
@url = conference_program_proposal_path(@conference.short_title, params[:id])
|
||||
|
||||
if @event.update(event_params)
|
||||
redirect_to conference_program_proposal_index_path(conference_id: @conference.short_title),
|
||||
redirect_to conference_program_proposals_path(conference_id: @conference.short_title),
|
||||
notice: 'Proposal was successfully updated.'
|
||||
else
|
||||
flash[:error] = "Could not update proposal: #{@event.errors.full_messages.join(', ')}"
|
||||
|
|
@ -86,10 +86,10 @@ class ProposalController < ApplicationController
|
|||
end
|
||||
|
||||
if @event.save
|
||||
redirect_to conference_program_proposal_index_path(conference_id: @conference.short_title),
|
||||
redirect_to conference_program_proposals_path(conference_id: @conference.short_title),
|
||||
notice: 'Proposal was successfully withdrawn.'
|
||||
else
|
||||
redirect_to conference_program_proposal_index_path(conference_id: @conference.short_title),
|
||||
redirect_to conference_program_proposals_path(conference_id: @conference.short_title),
|
||||
error: "Could not withdraw proposal: #{@event.errors.full_messages.join(', ')}"
|
||||
end
|
||||
end
|
||||
|
|
@ -107,14 +107,14 @@ class ProposalController < ApplicationController
|
|||
|
||||
if @event.save
|
||||
if @conference.user_registered?(current_user)
|
||||
redirect_to conference_program_proposal_index_path(@conference.short_title),
|
||||
redirect_to conference_program_proposals_path(@conference.short_title),
|
||||
notice: 'The proposal was confirmed.'
|
||||
else
|
||||
redirect_to new_conference_conference_registration_path(conference_id: @conference.short_title),
|
||||
alert: 'The proposal was confirmed. Please register to attend the conference.'
|
||||
end
|
||||
else
|
||||
redirect_to conference_program_proposal_index_path(conference_id: @conference.short_title),
|
||||
redirect_to conference_program_proposals_path(conference_id: @conference.short_title),
|
||||
error: "Could not confirm proposal: #{@event.errors.full_messages.join(', ')}"
|
||||
end
|
||||
end
|
||||
|
|
@ -126,16 +126,16 @@ class ProposalController < ApplicationController
|
|||
begin
|
||||
@event.restart
|
||||
rescue Transitions::InvalidTransition
|
||||
redirect_to conference_program_proposal_index_path(conference_id: @conference.short_title),
|
||||
redirect_to conference_program_proposals_path(conference_id: @conference.short_title),
|
||||
error: "The proposal can't be re-submitted."
|
||||
return
|
||||
end
|
||||
|
||||
if @event.save
|
||||
redirect_to conference_program_proposal_index_path(conference_id: @conference.short_title),
|
||||
redirect_to conference_program_proposals_path(conference_id: @conference.short_title),
|
||||
notice: "The proposal was re-submitted. The #{@conference.short_title} organizers will review it again."
|
||||
else
|
||||
redirect_to conference_program_proposal_index_path(conference_id: @conference.short_title),
|
||||
redirect_to conference_program_proposals_path(conference_id: @conference.short_title),
|
||||
error: "Could not re-submit proposal: #{@event.errors.full_messages.join(', ')}"
|
||||
end
|
||||
end
|
||||
|
|
@ -38,12 +38,12 @@ module ApplicationHelper
|
|||
"Registered: #{event.registrations.count}"
|
||||
end
|
||||
|
||||
# Set resource_name for devise so that we can call the devise help links (views/devise/shared/_links) from anywhere (eg sign_up form in proposal#new)
|
||||
# Set resource_name for devise so that we can call the devise help links (views/devise/shared/_links) from anywhere (eg sign_up form in proposals#new)
|
||||
def resource_name
|
||||
:user
|
||||
end
|
||||
|
||||
# Set devise_mapping for devise so that we can call the devise help links (views/devise/shared/_links) from anywhere (eg sign_up form in proposal#new)
|
||||
# Set devise_mapping for devise so that we can call the devise help links (views/devise/shared/_links) from anywhere (eg sign_up form in proposals#new)
|
||||
def devise_mapping
|
||||
@devise_mapping ||= Devise.mappings[:user]
|
||||
end
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ class EmailSettings < ActiveRecord::Base
|
|||
|
||||
if event
|
||||
h['eventtitle'] = event.title
|
||||
h['proposalslink'] = Rails.application.routes.url_helpers.conference_program_proposal_index_url(
|
||||
h['proposalslink'] = Rails.application.routes.url_helpers.conference_program_proposals_url(
|
||||
conference.short_title, host: (ENV['OSEM_HOSTNAME'] || 'localhost:3000'))
|
||||
end
|
||||
h
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
.row
|
||||
.col-md-8
|
||||
= semantic_form_for(@conference, :url => admin_conference_index_path) do |f|
|
||||
= semantic_form_for(@conference, :url => admin_conferences_path) do |f|
|
||||
= f.inputs 'Basic Information' do
|
||||
= f.input :title, hint: "The name of your conference as it shall appear throughout the site. Example: 'OpenSUSE Conference 2013'",
|
||||
input_html: { required: 'required' }
|
||||
|
|
@ -35,7 +35,7 @@
|
|||
%b Highlight
|
||||
%td
|
||||
= check_box_tag @conference.short_title, @event.id, @event.is_highlight,
|
||||
method: :patch, url: "/admin/conference/#{@conference.short_title}/program/events/#{@event.id}?event[is_highlight]=",
|
||||
method: :patch, url: "/admin/conferences/#{@conference.short_title}/program/events/#{@event.id}?event[is_highlight]=",
|
||||
class: 'switch-checkbox', data: { size: 'small',
|
||||
off_color: 'warning',
|
||||
on_text: 'Yes',
|
||||
|
|
@ -91,7 +91,7 @@
|
|||
%b Requires Registration
|
||||
%td
|
||||
= check_box_tag @conference.short_title, @event.id, @event.require_registration,
|
||||
method: :patch, url: "/admin/conference/#{@conference.short_title}/program/events/#{@event.id}?event[require_registration]=",
|
||||
method: :patch, url: "/admin/conferences/#{@conference.short_title}/program/events/#{@event.id}?event[require_registration]=",
|
||||
class: 'switch-checkbox', data: { size: 'small',
|
||||
off_color: 'warning',
|
||||
on_text: 'Yes',
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
= render 'proposal/form'
|
||||
= render 'proposals/form'
|
||||
|
|
@ -9,11 +9,11 @@
|
|||
All the submissions of your speakers
|
||||
.row
|
||||
.col-md-4
|
||||
= render partial: 'admin/conference/doughnut_chart', locals: {title: 'Events state', data: @event_distribution}
|
||||
= render partial: 'admin/conferences/doughnut_chart', locals: {title: 'Events state', data: @event_distribution}
|
||||
.col-md-4
|
||||
= render partial: 'admin/conference/doughnut_chart', locals: {title: 'Confirmed events scheduled', data: @scheduled_event_distribution}
|
||||
= render partial: 'admin/conferences/doughnut_chart', locals: {title: 'Confirmed events scheduled', data: @scheduled_event_distribution}
|
||||
.col-md-4
|
||||
= render partial: 'admin/conference/doughnut_chart', locals: {title: 'Tracks of confirmed events', data: @tracks_distribution_confirmed}
|
||||
= render partial: 'admin/conferences/doughnut_chart', locals: {title: 'Tracks of confirmed events', data: @tracks_distribution_confirmed}
|
||||
.row
|
||||
.col-md-12
|
||||
%div.margin-event-table
|
||||
|
|
@ -85,7 +85,7 @@
|
|||
|
||||
%td.text-center{'data-order' => "#{event.require_registration}"}
|
||||
= check_box_tag @conference.short_title, event.id, event.require_registration,
|
||||
method: :patch, url: "/admin/conference/#{@conference.short_title}/program/events/#{event.id}?event[require_registration]=",
|
||||
method: :patch, url: "/admin/conferences/#{@conference.short_title}/program/events/#{event.id}?event[require_registration]=",
|
||||
class: 'switch-checkbox', data: { size: 'small',
|
||||
off_color: 'warning',
|
||||
on_text: 'Yes',
|
||||
|
|
@ -96,7 +96,7 @@
|
|||
|
||||
%td.text-center{'data-order' => "#{event.is_highlight}"}
|
||||
= check_box_tag @conference.short_title, event.id, event.is_highlight,
|
||||
method: :patch, url: "/admin/conference/#{@conference.short_title}/program/events/#{event.id}?event[is_highlight]=",
|
||||
method: :patch, url: "/admin/conferences/#{@conference.short_title}/program/events/#{event.id}?event[is_highlight]=",
|
||||
class: 'switch-checkbox', data: { size: 'small',
|
||||
off_color: 'warning',
|
||||
on_text: 'Yes',
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
%td= event_registration.email
|
||||
%td= event_registration.created_at
|
||||
%td
|
||||
= check_box_tag @conference.short_title, @event.id, event_registration.attended, class: 'switch-checkbox', method: :patch, url: "/admin/conference/#{@conference.short_title}/program/events/#{@event.id}/toggle_attendance?events_registration_id=#{event_registration.id}&&event_registration[attended]=",
|
||||
= check_box_tag @conference.short_title, @event.id, event_registration.attended, class: 'switch-checkbox', method: :patch, url: "/admin/conferences/#{@conference.short_title}/program/events/#{@event.id}/toggle_attendance?events_registration_id=#{event_registration.id}&&event_registration[attended]=",
|
||||
data: { size: 'small',
|
||||
off_color: 'danger',
|
||||
on_text: 'Yes',
|
||||
|
|
|
|||
|
|
@ -12,10 +12,10 @@
|
|||
%p.text-muted
|
||||
All the people who registered to your event
|
||||
.col-md-4
|
||||
= render partial: 'admin/conference/doughnut_chart', locals: {title: 'Affiliation', data: @affiliation_distribution}
|
||||
= render partial: 'admin/conferences/doughnut_chart', locals: {title: 'Affiliation', data: @affiliation_distribution}
|
||||
- unless @conference.pending?
|
||||
.col-md-4
|
||||
= render partial: 'admin/conference/doughnut_chart', locals: {title: 'Attended registrations', data: @registration_distribution}
|
||||
= render partial: 'admin/conferences/doughnut_chart', locals: {title: 'Attended registrations', data: @registration_distribution}
|
||||
.row
|
||||
.col-md-12
|
||||
%div.margin-event-table
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
- if ( can? :toggle_user, @role )
|
||||
%td.text-right
|
||||
= hidden_field_tag "role[user_ids][]", nil
|
||||
= check_box_tag @conference.short_title, @role.id, (@role.user_ids.include? user.id), method: :post, url: "/admin/conference/#{@conference.short_title}/roles/#{@role.name}/toggle_user?user[email]=#{user.email}&user[state]=", class: 'switch-checkbox', data: { size: 'small', off_color: 'warning', on_text: 'Yes', off_text: 'No' }
|
||||
= check_box_tag @conference.short_title, @role.id, (@role.user_ids.include? user.id), method: :post, url: "/admin/conferences/#{@conference.short_title}/roles/#{@role.name}/toggle_user?user[email]=#{user.email}&user[state]=", class: 'switch-checkbox', data: { size: 'small', off_color: 'warning', on_text: 'Yes', off_text: 'No' }
|
||||
%td= user.id
|
||||
%td= user.name
|
||||
%td= user.email
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
.row
|
||||
.col-md-6
|
||||
- if @conference.venue.location?
|
||||
= render 'conference/venue_map'
|
||||
= render '/conferences/venue_map'
|
||||
-else
|
||||
- if @venue.commercial.nil?
|
||||
.row
|
||||
|
|
|
|||
|
|
@ -40,4 +40,4 @@
|
|||
.row
|
||||
.col-md-12.text-center
|
||||
%p.cta-button
|
||||
= link_to "Submit your paper now", conference_program_proposal_index_path(@conference.short_title), class: 'btn btn-success btn-lg text-center'
|
||||
= link_to "Submit your paper now", conference_program_proposals_path(@conference.short_title), class: 'btn btn-success btn-lg text-center'
|
||||
|
|
@ -31,7 +31,7 @@
|
|||
- if conference.registration_limit_exceeded?
|
||||
Sorry, no places left
|
||||
- if !current_user.nil? && current_user.proposal_count(conference) > 0
|
||||
= link_to "My Proposals", conference_program_proposal_index_path(conference.short_title), :class =>"btn btn-default"
|
||||
= link_to "My Proposals", conference_program_proposals_path(conference.short_title), :class =>"btn btn-default"
|
||||
- elsif can? :new, conference.program.events.new
|
||||
= link_to "Submit Proposal", new_conference_program_proposal_path(conference.short_title), :class =>"btn btn-default"
|
||||
- if current_user.nil? || !current_user.subscribed?(conference)
|
||||
|
|
@ -37,4 +37,4 @@
|
|||
.row
|
||||
.col-md-12.text-center
|
||||
%p.cta-button
|
||||
= link_to "Submit your paper now", conference_proposal_index_path(@conference.short_title), class: 'btn btn-success btn-lg text-center'
|
||||
= link_to "Submit your paper now", conference_proposals_path(@conference.short_title), class: 'btn btn-success btn-lg text-center'
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
%li
|
||||
%a.smoothscroll{ href: '#venue' } Venue
|
||||
-if @conference.venue.location?
|
||||
= render 'conference/venue_map'
|
||||
= render '/conferences/venue_map'
|
||||
-else
|
||||
.container
|
||||
.row
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
%span.caret
|
||||
%ul.dropdown-menu{role:'menu'}
|
||||
%li
|
||||
= link_to(admin_conference_index_path) do
|
||||
= link_to(admin_conferences_path) do
|
||||
%span.fa.fa-home
|
||||
All Conferences
|
||||
- @conferences.each do |conference|
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
%span.caret
|
||||
%ul.dropdown-menu{role: 'menu'}
|
||||
%li
|
||||
= link_to(admin_conference_index_path) do
|
||||
= link_to(admin_conferences_path) do
|
||||
%span.fa.fa-home
|
||||
All Conferences
|
||||
- @conferences.each do |conference|
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
Edit Profile
|
||||
-if @conference and @conference.program
|
||||
%li
|
||||
= link_to(conference_program_proposal_index_path(@conference.short_title)) do
|
||||
= link_to(conference_program_proposals_path(@conference.short_title)) do
|
||||
%span.fa.fa-comment
|
||||
My Submissions
|
||||
%li
|
||||
|
|
@ -25,7 +25,7 @@
|
|||
%li.divider
|
||||
%li
|
||||
- if Conference.any?
|
||||
= link_to(admin_conference_index_path()) do
|
||||
= link_to(admin_conferences_path()) do
|
||||
%span.fa.fa-home
|
||||
Administration
|
||||
- if can? :create, Conference
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
= link_to 'Commercials', '#commercials-content', 'data-toggle' => 'tab'
|
||||
.tab-content
|
||||
#proposal-content.tab-pane.active
|
||||
= render 'proposal/proposal_form'
|
||||
= render 'proposals/proposal_form'
|
||||
#commercials-content.tab-pane
|
||||
%p.text-muted
|
||||
You can add commercials for your proposal. These commercials will be displayed on the
|
||||
Loading…
Add table
Add a link
Reference in a new issue