fix conflicts
This commit is contained in:
parent
e2fb434dc7
commit
71dfb3b7e4
34 changed files with 160 additions and 211 deletions
|
|
@ -5,7 +5,7 @@ module Admin
|
|||
|
||||
def index
|
||||
authorize! :update, Question.new(conference_id: @conference.id)
|
||||
@questions = Question.where(:global => true).all | Question.where(:conference_id => @conference.id)
|
||||
@questions = Question.where(global: true).all | Question.where(conference_id: @conference.id)
|
||||
@questions_conference = @conference.questions
|
||||
@new_question = @conference.questions.new
|
||||
end
|
||||
|
|
@ -33,25 +33,25 @@ module Admin
|
|||
# GET questions/1/edit
|
||||
def edit
|
||||
if @question.global == true && !(current_user.has_role? :organizer, @conference)
|
||||
redirect_to(admin_conference_questions_path(:conference_id => @conference.short_title), :alert => "Sorry, you cannot edit global questions. Create a new one.")
|
||||
redirect_to(admin_conference_questions_path(conference_id: @conference.short_title), alert: "Sorry, you cannot edit global questions. Create a new one.")
|
||||
end
|
||||
end
|
||||
|
||||
# PUT questions/1
|
||||
def update
|
||||
if @question.update_attributes(params[:question])
|
||||
redirect_to(admin_conference_questions_path(:conference_id => @conference.short_title), :notice => "Question '#{@question.title}' for #{@conference.short_title} successfully updated.")
|
||||
redirect_to(admin_conference_questions_path(conference_id: @conference.short_title), notice: "Question '#{@question.title}' for #{@conference.short_title} successfully updated.")
|
||||
else
|
||||
redirect_to(admin_conference_questions_path(:conference_id => @conference.short_title), :notice => "Update of questions for #{@conference.short_title} failed.")
|
||||
redirect_to(admin_conference_questions_path(conference_id: @conference.short_title), notice: "Update of questions for #{@conference.short_title} failed.")
|
||||
end
|
||||
end
|
||||
|
||||
# Update questions used for the conference
|
||||
def update_conference
|
||||
if @conference.update_attributes(params[:conference])
|
||||
redirect_to(admin_conference_questions_path(:conference_id => @conference.short_title), :notice => "Questions for #{@conference.short_title} successfully updated.")
|
||||
redirect_to(admin_conference_questions_path(conference_id: @conference.short_title), notice: "Questions for #{@conference.short_title} successfully updated.")
|
||||
else
|
||||
redirect_to(admin_conference_questions_path(:conference_id => @conference.short_title), :notice => "Update of questions for #{@conference.short_title} failed.")
|
||||
redirect_to(admin_conference_questions_path(conference_id: @conference.short_title), notice: "Update of questions for #{@conference.short_title} failed.")
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -82,7 +82,7 @@ module Admin
|
|||
flash[:error] = "You must be an admin to delete a question."
|
||||
end
|
||||
|
||||
@questions = Question.where(:global => true).all | Question.where(:conference_id => @conference.id)
|
||||
@questions = Question.where(global: true).all | Question.where(conference_id: @conference.id)
|
||||
@questions_conference = @conference.questions
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -9,9 +9,9 @@ module Admin
|
|||
|
||||
def update
|
||||
if @conference.update_attributes(params[:conference])
|
||||
redirect_to(admin_conference_social_events_path(:conference_id => @conference.short_title), :notice => 'Social events were successfully updated.')
|
||||
redirect_to(admin_conference_social_events_path(conference_id: @conference.short_title), notice: 'Social events were successfully updated.')
|
||||
else
|
||||
redirect_to(admin_conference_social_events_path(:conference_id => @conference.short_title), :notice => 'Social events update failed.')
|
||||
redirect_to(admin_conference_social_events_path(conference_id: @conference.short_title), notice: 'Social events update failed.')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -20,28 +20,16 @@ module Admin
|
|||
end
|
||||
|
||||
def update
|
||||
params[:user].delete :roles_attributes if params[:user]
|
||||
@user.update_attributes!(params[:user])
|
||||
redirect_to admin_users_path, notice: "Updated #{@user.email}"
|
||||
end
|
||||
|
||||
def add_role
|
||||
role = params[:user][:roles_attributes][:"0"]
|
||||
@user.add_role role['name'].parameterize.underscore.to_sym, Conference.find(role['resource_id'])
|
||||
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.js
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
def edit
|
||||
end
|
||||
|
||||
def destroy
|
||||
@user.destroy
|
||||
redirect_to admin_users_path, notice: "User #{@user.name} (#{@user.email})got deleted"
|
||||
redirect_to admin_users_path, notice: "User got deleted"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ module Admin
|
|||
if @conference.use_vpositions
|
||||
@volunteers = @conference.registrations.joins(:vchoices).uniq
|
||||
else
|
||||
@volunteers = @conference.registrations.where(:volunteer => true)
|
||||
@volunteers = @conference.registrations.where(volunteer: true)
|
||||
end
|
||||
else
|
||||
authorize! :index, :volunteer
|
||||
|
|
@ -26,9 +26,9 @@ module Admin
|
|||
if (current_user.has_role? :organizer, @conference) || (current_user.has_role? :volunteer_coordinator, @conference)
|
||||
begin
|
||||
@conference.update_attributes!(params[:conference])
|
||||
redirect_to(admin_conference_volunteers_info_path(:conference_id => params[:conference_id]), :notice => "Volunteering options were successfully updated.")
|
||||
redirect_to(admin_conference_volunteers_info_path(conference_id: params[:conference_id]), notice: "Volunteering options were successfully updated.")
|
||||
rescue Exception => e
|
||||
redirect_to(admin_conference_volunteers_info_path(:conference_id => params[:conference_id]), :alert => "Volunteering options update failed: #{e.message}")
|
||||
redirect_to(admin_conference_volunteers_info_path(conference_id: params[:conference_id]), alert: "Volunteering options update failed: #{e.message}")
|
||||
end
|
||||
else
|
||||
authorize! :index, :volunteer
|
||||
|
|
|
|||
|
|
@ -67,7 +67,6 @@ class EventAttachmentsController < ApplicationController
|
|||
|
||||
respond_to do |format|
|
||||
if @upload.save
|
||||
<<<<<<< HEAD
|
||||
format.html do
|
||||
render json: [@upload.to_jq_upload].to_json,
|
||||
content_type: 'text/html',
|
||||
|
|
@ -77,15 +76,6 @@ class EventAttachmentsController < ApplicationController
|
|||
render json: [@upload.to_jq_upload].to_json, status: :created,
|
||||
location: conference_proposal_event_attachment_path(@upload.event.conference.short_title, @upload.event, @upload)
|
||||
end
|
||||
=======
|
||||
format.html {
|
||||
render :json => [@upload.to_jq_upload].to_json,
|
||||
:content_type => 'text/html',
|
||||
:layout => false
|
||||
}
|
||||
format.json { render json: {files: [@upload.to_jq_upload]}, status: :created,
|
||||
location: conference_proposal_event_attachment_path(@upload.event.conference.short_title, @upload.event, @upload) }
|
||||
>>>>>>> authorization with cancancan
|
||||
else
|
||||
format.html { render action: "new" }
|
||||
format.json { render json: @upload.errors, status: :unprocessable_entity }
|
||||
|
|
|
|||
|
|
@ -1,8 +1,5 @@
|
|||
class ScheduleController < ApplicationController
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
authorize_resource class: false
|
||||
>>>>>>> authorization with cancancan
|
||||
layout "application"
|
||||
|
||||
def index
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
class Campaign < ActiveRecord::Base
|
||||
attr_accessible :name, :target_ids, :conference_id,
|
||||
:utm_source, :utm_medium, :utm_term, :utm_content, :utm_campaign
|
||||
attr_accessible :name, :utm_source, :utm_medium, :utm_term,
|
||||
:utm_content, :utm_campaign, :target_ids, :conference_id
|
||||
|
||||
validates :name, :utm_campaign, presence: true
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ class EventAttachment < ActiveRecord::Base
|
|||
|
||||
has_attached_file :attachment, path: ":rails_root/storage/:rails_env/attachments/:id/:style/:basename.:extension"
|
||||
include Rails.application.routes.url_helpers
|
||||
do_not_validate_attachment_file_type :attachment
|
||||
|
||||
def to_jq_upload
|
||||
{
|
||||
|
|
|
|||
|
|
@ -3,12 +3,7 @@
|
|||
= f.input :is_admin, hint: 'An admin can create a new conference, manage users and make other users admins.'
|
||||
= f.input :name, :as => :string
|
||||
= f.input :email
|
||||
= f.input :affiliation, as: :string
|
||||
= f.input :biography, input_html: { rows: 5, "onkeyup" => "word_count(this, 'biography-count', 150)" }
|
||||
You have used
|
||||
%span#biography-count #{@user.biography_word_count}
|
||||
words. Biographies are limited to 150 words.
|
||||
%br
|
||||
%br
|
||||
= f.input :affiliation, :as => :string
|
||||
= f.input :biography, :input_html => {:rows => 10}
|
||||
= f.actions do
|
||||
= f.action :submit, button_html: { class: 'btn btn-primary' }
|
||||
= f.action :submit, :button_html => {:class => "btn btn-primary"}
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@
|
|||
data.formData = inputs.serializeArray();
|
||||
});
|
||||
$.getJSON($('#fileupload').prop('action'), function (files) {
|
||||
var fu = $('#fileupload').data('blueimpFileupload'),
|
||||
var fu = $('#fileupload').data('fileupload'),
|
||||
template;
|
||||
fu._adjustMaxNumberOfFiles(-files.length);
|
||||
template = fu._renderDownload(files)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
.row
|
||||
.col-md-12
|
||||
= simple_format(@conference.call_for_papers.description) if @conference.call_for_papers
|
||||
= simple_format(@conference.call_for_papers.description)
|
||||
.row
|
||||
.col-md-12
|
||||
= render 'proposal_form'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue