mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
apply StringLiterals cop (remove double quotes, unless there is string interpolation)
This commit is contained in:
parent
f91467a00a
commit
b7c45718d8
45 changed files with 275 additions and 109 deletions
|
|
@ -111,11 +111,8 @@ Style/CaseEquality:
|
|||
Style/ClassAndModuleChildren:
|
||||
Enabled: true
|
||||
|
||||
# Offense count: 577
|
||||
# Cop supports --auto-correct.
|
||||
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
||||
Style/StringLiterals:
|
||||
Enabled: false
|
||||
Enabled: true
|
||||
|
||||
Style/TrailingBlankLines:
|
||||
Enabled: true
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ guard_opts = {
|
|||
cmd: 'spring rspec'
|
||||
}
|
||||
|
||||
def model_specs ; "spec/models" end
|
||||
def model_specs ; 'spec/models' end
|
||||
|
||||
def model_spec(model)
|
||||
"spec/models/#{model}_spec.rb"
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ module Admin
|
|||
else
|
||||
redirect_to(admin_conference_callforpapers_path(
|
||||
id: @conference.short_title),
|
||||
alert: "Updating call for papers failed. #{@cfp.errors.to_a.join(". ")}.")
|
||||
alert: "Updating call for papers failed. #{@cfp.errors.to_a.join('. ')}.")
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -44,7 +44,7 @@ module Admin
|
|||
else
|
||||
redirect_to(admin_conference_callforpapers_path(
|
||||
id: @conference.short_title),
|
||||
alert: "Creating the call for papers failed. #{@cfp.errors.to_a.join(". ")}.")
|
||||
alert: "Creating the call for papers failed. #{@cfp.errors.to_a.join('. ')}.")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -13,18 +13,18 @@ module Admin
|
|||
begin
|
||||
@conference.use_difficulty_levels = false
|
||||
@conference.save!
|
||||
flash[:error] = "You cannot enable the usage of difficulty levels without having set any levels."
|
||||
flash[:error] = 'You cannot enable the usage of difficulty levels without having set any levels.'
|
||||
redirect_to(admin_conference_difficulty_levels_path(conference_id: @conference.short_title))
|
||||
rescue ActiveRecord::RecordInvalid
|
||||
flash[:error] = "Something went wrong. Difficulty Levels update failed."
|
||||
flash[:error] = 'Something went wrong. Difficulty Levels update failed.'
|
||||
redirect_to(admin_conference_difficulty_levels_path(conference_id: @conference.short_title))
|
||||
end
|
||||
else
|
||||
flash[:notice] = "Difficulty Levels were successfully updated."
|
||||
flash[:notice] = 'Difficulty Levels were successfully updated.'
|
||||
redirect_to(admin_conference_difficulty_levels_path(conference_id: @conference.short_title))
|
||||
end
|
||||
else
|
||||
flash[:error] = "Difficulty Levels update failed."
|
||||
flash[:error] = 'Difficulty Levels update failed.'
|
||||
redirect_to(admin_conference_difficulty_levels_path(conference_id: @conference.short_title))
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ module Admin
|
|||
# GET questions/1/edit
|
||||
def edit
|
||||
if @question.global
|
||||
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
|
||||
|
||||
|
|
@ -73,13 +73,13 @@ module Admin
|
|||
flash[:notice] = "Deleted question: #{@question.title} and its answers: #{@question.answers.map {|a| a.title}.join ','}"
|
||||
end
|
||||
rescue ActiveRecord::RecordInvalid
|
||||
flash[:error] = "Could not delete question."
|
||||
flash[:error] = 'Could not delete question.'
|
||||
end
|
||||
else
|
||||
flash[:error] = "You cannot delete global questions."
|
||||
flash[:error] = 'You cannot delete global questions.'
|
||||
end
|
||||
else
|
||||
flash[:error] = "You must be an admin to delete a question."
|
||||
flash[:error] = 'You must be an admin to delete a question.'
|
||||
end
|
||||
|
||||
@questions = Question.where(global: true).all | Question.where(conference_id: @conference.id)
|
||||
|
|
|
|||
19
app/controllers/admin/supporters_controller.rb
Normal file
19
app/controllers/admin/supporters_controller.rb
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
module Admin
|
||||
class SupportersController < Admin::BaseController
|
||||
load_and_authorize_resource :conference, find_by: :short_title
|
||||
load_and_authorize_resource through: :conference
|
||||
|
||||
def index
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.json { render json: DatatableSupporters.new(@conference.supporter_registrations, view_context) }
|
||||
end
|
||||
end
|
||||
|
||||
def create
|
||||
params[:supporter_registration][:conference_id] = @conference.id
|
||||
SupporterRegistration.create!(params[:supporter_registration])
|
||||
redirect_to(admin_conference_supporters_path(conference_id: @conference.short_title), notice: 'Supporter added')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -25,7 +25,7 @@ module Admin
|
|||
def update
|
||||
if can_manage_volunteers(@conference)
|
||||
if @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.')
|
||||
else
|
||||
redirect_to(admin_conference_volunteers_info_path(conference_id: params[:conference_id]), alert: "Volunteering options update failed: #{@conference.errors.full_messages.join '. '}")
|
||||
end
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ class ApplicationController < ActionController::Base
|
|||
check_authorization unless: :devise_controller?
|
||||
|
||||
def store_location
|
||||
session[:return_to] = request.fullpath if request.get? && controller_name != "user_sessions" && controller_name != "sessions"
|
||||
session[:return_to] = request.fullpath if request.get? && controller_name != 'user_sessions' && controller_name != 'sessions'
|
||||
end
|
||||
|
||||
def after_sign_in_path_for(resource)
|
||||
|
|
@ -49,7 +49,7 @@ class ApplicationController < ActionController::Base
|
|||
end
|
||||
|
||||
rescue_from CanCan::AccessDenied do |exception|
|
||||
Rails.logger.debug("Access denied!")
|
||||
Rails.logger.debug('Access denied!')
|
||||
redirect_to root_path, alert: exception.message
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -9,14 +9,14 @@ class ConferenceController < ApplicationController
|
|||
subscription = Subscription.new(user_id: current_user.id, conference_id: conference.id)
|
||||
begin
|
||||
subscription.save!
|
||||
flash[:success] = "You have been subscribed to receive Email Notifications from this Conference."
|
||||
flash[:success] = 'You have been subscribed to receive Email Notifications from this Conference.'
|
||||
redirect_to root_path
|
||||
rescue ActiveRecord::RecordInvalid
|
||||
flash[:error] = subscription.errors.full_messages.to_sentence
|
||||
redirect_to root_path
|
||||
end
|
||||
else
|
||||
flash[:notice] = "Already Subscribed"
|
||||
flash[:notice] = 'Already Subscribed'
|
||||
redirect_to root_path
|
||||
end
|
||||
end
|
||||
|
|
@ -25,7 +25,7 @@ class ConferenceController < ApplicationController
|
|||
conference = Conference.find_by_short_title(params[:id])
|
||||
subscription = current_user.subscriptions.where(conference_id: conference.id).first
|
||||
if subscription.blank?
|
||||
flash[:notice] = "Already Unsubscribed"
|
||||
flash[:notice] = 'Already Unsubscribed'
|
||||
redirect_to root_path
|
||||
else
|
||||
begin
|
||||
|
|
@ -41,6 +41,6 @@ class ConferenceController < ApplicationController
|
|||
|
||||
def gallery_photos
|
||||
@photos = @conference.photos
|
||||
render "photos", formats: [:js]
|
||||
render 'photos', formats: [:js]
|
||||
end
|
||||
end
|
||||
|
|
|
|||
110
app/controllers/event_attachments_controller.rb
Normal file
110
app/controllers/event_attachments_controller.rb
Normal file
|
|
@ -0,0 +1,110 @@
|
|||
class EventAttachmentsController < ApplicationController
|
||||
load_and_authorize_resource :conference, find_by: :short_title
|
||||
load_and_authorize_resource :proposal, class: Event
|
||||
load_and_authorize_resource :upload, class: EventAttachment, through: :proposal
|
||||
before_filter :verify_user
|
||||
skip_before_filter :verify_user, only: [:show]
|
||||
|
||||
def index
|
||||
@uploads = @proposal.event_attachments
|
||||
@uploads = @uploads.map{|upload| upload.to_jq_upload }
|
||||
|
||||
respond_to do |format|
|
||||
format.html # index.html.erb
|
||||
format.json { render json: @uploads.to_json}
|
||||
end
|
||||
end
|
||||
|
||||
def show
|
||||
if @upload.public?
|
||||
send_file @upload.attachment.path
|
||||
return
|
||||
end
|
||||
|
||||
if current_user.nil?
|
||||
verify_user
|
||||
return
|
||||
end
|
||||
|
||||
if organizer_or_admin? || current_user == upload.event.submitter
|
||||
send_file @upload.attachment.path
|
||||
else
|
||||
raise ActionController::RoutingError.new('Not Found')
|
||||
end
|
||||
end
|
||||
|
||||
def new
|
||||
@upload = EventAttachment.new
|
||||
|
||||
respond_to do |format|
|
||||
format.html # new.html.erb
|
||||
format.json { render json: @upload }
|
||||
end
|
||||
end
|
||||
|
||||
def edit; end
|
||||
|
||||
def create
|
||||
params[:event_attachment][:title] = params[:title][0]
|
||||
params[:event_attachment][:public] = false
|
||||
params[:event_attachment][:event_id] = params[:proposal_id]
|
||||
|
||||
if cannot? :create, EventAttachment
|
||||
begin
|
||||
current_user.events.find(params[:proposal_id])
|
||||
rescue
|
||||
# They certainly aren't allowed to attach a file to someone else's proposal
|
||||
raise ActionController::RoutingError.new('Invalid proposal')
|
||||
end
|
||||
end
|
||||
|
||||
if params.has_key?(:public)
|
||||
params[:event_attachment][:public] = true
|
||||
end
|
||||
@upload = EventAttachment.new(params[:event_attachment])
|
||||
|
||||
respond_to do |format|
|
||||
if @upload.save
|
||||
format.html do
|
||||
render json: [@upload.to_jq_upload].to_json,
|
||||
content_type: 'text/html',
|
||||
layout: false
|
||||
end
|
||||
format.json do
|
||||
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
|
||||
else
|
||||
format.html { render action: 'new' }
|
||||
format.json { render json: @upload.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def update
|
||||
respond_to do |format|
|
||||
if @upload.update_attributes(params[:upload])
|
||||
format.html { redirect_to @upload, notice: 'Upload was successfully updated.' }
|
||||
format.json { head :no_content }
|
||||
else
|
||||
format.html { render action: 'edit' }
|
||||
format.json { render json: @upload.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def destroy
|
||||
if can? :destroy, @proposal
|
||||
@upload = @proposal.event_attachments.find(params[:id])
|
||||
end
|
||||
|
||||
@upload.destroy if !@upload.nil?
|
||||
|
||||
respond_to do |format|
|
||||
|
||||
format.html { redirect_back_or_to conference_proposal_index_path(@conference.short_title), notice: "Deleted successfully attachment '#{@upload.title}' for proposal '#{@proposal.title}'" }
|
||||
|
||||
format.json { head :no_content }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -4,7 +4,7 @@ class HomeController < ApplicationController
|
|||
|
||||
def index
|
||||
@today = Date.current
|
||||
@current = Conference.where("end_date >= ?", @today).order("start_date ASC")
|
||||
@current = Conference.where('end_date >= ?', @today).order('start_date ASC')
|
||||
end
|
||||
|
||||
def respond_to_options
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ class ProposalController < ApplicationController
|
|||
end
|
||||
|
||||
redirect_to(conference_proposal_index_path(conference_id: @conference.short_title),
|
||||
notice: "Proposal was successfully updated.")
|
||||
notice: 'Proposal was successfully updated.')
|
||||
end
|
||||
|
||||
def destroy
|
||||
|
|
@ -92,7 +92,7 @@ class ProposalController < ApplicationController
|
|||
|
||||
@event.save(validate: false)
|
||||
redirect_to(conference_proposal_index_path(conference_id: @conference.short_title),
|
||||
notice: "Proposal was successfully withdrawn.")
|
||||
notice: 'Proposal was successfully withdrawn.')
|
||||
end
|
||||
|
||||
def confirm
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
class ScheduleController < ApplicationController
|
||||
authorize_resource class: false
|
||||
layout "application"
|
||||
layout 'application'
|
||||
|
||||
def index
|
||||
@conference = Conference.
|
||||
|
|
@ -11,9 +11,9 @@ class ScheduleController < ApplicationController
|
|||
@dates = @conference.start_date..@conference.end_date
|
||||
|
||||
if @dates == Date.current
|
||||
@today = Date.current.strftime("%Y-%m-%d")
|
||||
@today = Date.current.strftime('%Y-%m-%d')
|
||||
else
|
||||
@today = @conference.start_date.strftime("%Y-%m-%d")
|
||||
@today = @conference.start_date.strftime('%Y-%m-%d')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -92,17 +92,17 @@ module ApplicationHelper
|
|||
|
||||
def getdatetime(registration, field)
|
||||
if registration.send(field.to_sym).kind_of?(String)
|
||||
DateTime.parse(registration.send(field.to_sym)).strftime("%d %b %H:%M") if registration.send(field.to_sym)
|
||||
DateTime.parse(registration.send(field.to_sym)).strftime('%d %b %H:%M') if registration.send(field.to_sym)
|
||||
else
|
||||
registration.send(field.to_sym).strftime("%d %b %H:%M") if registration.send(field.to_sym)
|
||||
registration.send(field.to_sym).strftime('%d %b %H:%M') if registration.send(field.to_sym)
|
||||
end
|
||||
end
|
||||
|
||||
def getdate(var)
|
||||
if var.kind_of?(String)
|
||||
DateTime.parse(var).strftime("%a, %d %b")
|
||||
DateTime.parse(var).strftime('%a, %d %b')
|
||||
else
|
||||
var.strftime("%a, %d %b")
|
||||
var.strftime('%a, %d %b')
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -122,24 +122,24 @@ module ApplicationHelper
|
|||
end
|
||||
|
||||
def pre_registered(event)
|
||||
@conference.events.joins(:registrations).where("events.id = ?", event.id)
|
||||
@conference.events.joins(:registrations).where('events.id = ?', event.id)
|
||||
end
|
||||
|
||||
def add_association_link(association_name, form_builder, div_class, html_options = {})
|
||||
link_to_add_association "Add " + association_name.to_s.singularize, form_builder, div_class, html_options.merge(class: "assoc btn btn-success")
|
||||
link_to_add_association 'Add ' + association_name.to_s.singularize, form_builder, div_class, html_options.merge(class: 'assoc btn btn-success')
|
||||
end
|
||||
|
||||
def remove_association_link(association_name, form_builder)
|
||||
link_to_remove_association("Remove " + association_name.to_s.singularize, form_builder, class: "assoc btn btn-danger") + tag(:hr)
|
||||
link_to_remove_association('Remove ' + association_name.to_s.singularize, form_builder, class: 'assoc btn btn-danger') + tag(:hr)
|
||||
end
|
||||
|
||||
def dynamic_association(association_name, title, form_builder, options = {})
|
||||
render "shared/dynamic_association", association_name: association_name, title: title, f: form_builder, hint: options[:hint]
|
||||
render 'shared/dynamic_association', association_name: association_name, title: title, f: form_builder, hint: options[:hint]
|
||||
end
|
||||
|
||||
# Same as redirect_to(:back) if there is a valid HTTP referer, otherwise redirect_to()
|
||||
def redirect_back_or_to(options = {}, response_status = {})
|
||||
if request.env["HTTP_REFERER"]
|
||||
if request.env['HTTP_REFERER']
|
||||
redirect_to(:back)
|
||||
else
|
||||
redirect_to(options, response_status)
|
||||
|
|
@ -148,7 +148,7 @@ module ApplicationHelper
|
|||
|
||||
# TODO Output better html
|
||||
def format_comments(comment, padding = 0)
|
||||
result = ""
|
||||
result = ''
|
||||
result += "<div style='padding-left:#{padding}px'>"
|
||||
result += "<div class='well'>"
|
||||
result += "<b>#{comment.user.name}</b> <i>#{comment.created_at}</i><br><br>"
|
||||
|
|
@ -160,12 +160,12 @@ module ApplicationHelper
|
|||
result += "<input name='authenticity_token' type='hidden' value='#{form_authenticity_token}' />"
|
||||
result += "<textarea name='comment'></textarea>"
|
||||
result += "<button class='btn btn-primary pull-right' name='button' type='submit'>Add Reply</button>"
|
||||
result += "</form></div></div>"
|
||||
result += "</div>"
|
||||
result += '</form></div></div>'
|
||||
result += '</div>'
|
||||
#result += edit_admin_conference_event_path(@conference.short_title, @event)
|
||||
comment.children.each do |child|
|
||||
result += format_comments(child, 50)
|
||||
result += "</div>"
|
||||
result += '</div>'
|
||||
end
|
||||
|
||||
result
|
||||
|
|
@ -181,7 +181,7 @@ module ApplicationHelper
|
|||
markdown.render(text).html_safe
|
||||
end
|
||||
|
||||
def markdown_hint(text="")
|
||||
def markdown_hint(text='')
|
||||
markdown("#{text} Please look at #{link_to '**Markdown Syntax**', 'https://daringfireball.net/projects/markdown/syntax', target: '_blank'} to format your text")
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
module ProposalHelper
|
||||
def generate_abstract_length_js(conference)
|
||||
str = ""
|
||||
str = ''
|
||||
conference.event_types.map do |t|
|
||||
str += "if ($('select option:selected').text() == '#{t.title}') {\n"
|
||||
str += "str = '#{t.maximum_abstract_length}';\n"
|
||||
|
|
|
|||
14
app/helpers/registration_helper.rb
Normal file
14
app/helpers/registration_helper.rb
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
module RegistrationHelper
|
||||
def generate_supporter_level_js(conference)
|
||||
str = ''
|
||||
conference.supporter_levels.map do |t|
|
||||
next if t.url.empty?
|
||||
|
||||
str += "if ($('#registration_supporter_registration_attributes_supporter_level_id option:selected').text() == '#{t.title}') {\n"
|
||||
str += "console.log('#{t.title}');\n"
|
||||
str += "str = 'If you have a confirmation or registration code, enter it here. Otherwise, you can purchase a <i>#{t.title}</i> ticket <a href=\"#{t.url}\" target=_new>here</a>, if you need to.';\n"
|
||||
str += "}\n\n"
|
||||
end.join("\n")
|
||||
str
|
||||
end
|
||||
end
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
class Mailbot < ActionMailer::Base
|
||||
default from: "no-reply@example.com"
|
||||
default from: 'no-reply@example.com'
|
||||
|
||||
def registration_mail(conference, person)
|
||||
build_email(conference,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
module Ahoy
|
||||
class Event < ActiveRecord::Base
|
||||
self.table_name = "ahoy_events"
|
||||
self.table_name = 'ahoy_events'
|
||||
|
||||
belongs_to :visit
|
||||
belongs_to :user
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ class Contact < ActiveRecord::Base
|
|||
|
||||
validates :conference, presence: true
|
||||
# Conferences only have one contact
|
||||
validates :conference_id, uniqueness: {message: "has already contact details"}
|
||||
validates :conference_id, uniqueness: {message: 'has already contact details'}
|
||||
|
||||
validates :facebook, :twitter, :googleplus, :instagram,
|
||||
format: URI::regexp(%w(http https)), allow_blank: true
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ class Datatable
|
|||
sort_by << "#{sort_column(colnum)} #{sort_direction(colnum)}"
|
||||
colnum += 1
|
||||
end
|
||||
sort_by.join(", ")
|
||||
sort_by.join(', ')
|
||||
end
|
||||
|
||||
def sorted? index=0
|
||||
|
|
@ -93,6 +93,6 @@ class Datatable
|
|||
|
||||
def sort_direction index=0
|
||||
index = "sSortDir_#{index}"
|
||||
params[index] == "desc" ? "desc" : "asc"
|
||||
params[index] == 'desc' ? 'desc' : 'asc'
|
||||
end
|
||||
end
|
||||
|
|
|
|||
26
app/models/event_attachment.rb
Normal file
26
app/models/event_attachment.rb
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
class EventAttachment < ActiveRecord::Base
|
||||
has_paper_trail
|
||||
|
||||
belongs_to :event
|
||||
attr_accessible :public, :attachment, :event_id, :title
|
||||
|
||||
has_attached_file :attachment, path: ':rails_root/storage/:rails_env/attachments/:id/:style/:basename.:extension'
|
||||
include Rails.application.routes.url_helpers
|
||||
|
||||
def to_jq_upload
|
||||
{
|
||||
'name' => read_attribute(:attachment_file_name),
|
||||
'size' => read_attribute(:attachment_file_size),
|
||||
'title' => read_attribute(:title),
|
||||
'public' => read_attribute(:public),
|
||||
#"url" => attachment.url(:original),
|
||||
'url' => conference_proposal_event_attachment_path(self.event.conference.short_title, self.event_id, self.id),
|
||||
'delete_url' => conference_proposal_event_attachment_path(self.event.conference.short_title, self.event_id, self.id),
|
||||
'delete_type' => 'DELETE'
|
||||
}
|
||||
end
|
||||
#:path => ":rails_root/public/system/:attachment/:id/:style/:filename",
|
||||
# :url => "/system/:attachment/:id/:style/:filename"
|
||||
|
||||
#has_paper_trail :meta => {:associated_id => :event_id, :associated_type => "Event"}
|
||||
end
|
||||
|
|
@ -3,7 +3,7 @@ class Photo < ActiveRecord::Base
|
|||
belongs_to :conference
|
||||
validates_presence_of :picture
|
||||
has_attached_file :picture,
|
||||
styles: { thumb: "100x100>", large: "300x300>", banner: "600x300>" }
|
||||
styles: { thumb: '100x100>', large: '300x300>', banner: '600x300>' }
|
||||
|
||||
validates_attachment_content_type :picture,
|
||||
content_type: [/jpg/, /jpeg/, /png/, /gif/],
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class Visit < ActiveRecord::Base
|
||||
has_many :ahoy_events, class_name: "Ahoy::Event"
|
||||
has_many :ahoy_events, class_name: 'Ahoy::Event'
|
||||
belongs_to :user
|
||||
end
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ module Osem
|
|||
# config.i18n.default_locale = :de
|
||||
|
||||
# Configure the default encoding used in templates for Ruby 1.9.
|
||||
config.encoding = "utf-8"
|
||||
config.encoding = 'utf-8'
|
||||
|
||||
# Configure sensitive parameters which will be filtered from the log file.
|
||||
config.filter_parameters += [:password]
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
require File.expand_path('../application', __FILE__)
|
||||
|
||||
# Load the configuration file
|
||||
path = Rails.root.join("config", "config.yml")
|
||||
path = Rails.root.join('config', 'config.yml')
|
||||
begin
|
||||
CONFIG = YAML.load_file(path)[Rails.env]
|
||||
rescue
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ Osem::Application.configure do
|
|||
|
||||
# Configure static asset server for tests with Cache-Control for performance
|
||||
config.serve_static_assets = true
|
||||
config.static_cache_control = "public, max-age=3600"
|
||||
config.static_cache_control = 'public, max-age=3600'
|
||||
|
||||
# Do not eager load code on boot.
|
||||
config.eager_load = false
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ Formtastic::FormBuilder.include_blank_for_select_by_default = false
|
|||
# '<abbr title="required">*</abbr>'. In other words, if you configure formtastic.required
|
||||
# in your locale, it will replace the abbr title properly. But if you don't want to use
|
||||
# abbr tag, you can simply give a string as below
|
||||
Formtastic::FormBuilder.required_string = "(required)"
|
||||
Formtastic::FormBuilder.required_string = '(required)'
|
||||
|
||||
# Set the string that will be appended to the labels/fieldsets which are optional
|
||||
# Defaults to an empty string ("") and also accepts procs (see required_string above)
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Time::DATE_FORMATS[:db_without_seconds] = "%Y-%m-%d %H:%M"
|
||||
Time::DATE_FORMATS[:db_without_seconds] = '%Y-%m-%d %H:%M'
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ Osem::Application.routes.draw do
|
|||
end
|
||||
end
|
||||
|
||||
patch "/questions/update_conference" => "questions#update_conference"
|
||||
patch '/questions/update_conference' => 'questions#update_conference'
|
||||
resources :questions
|
||||
|
||||
resources :events do
|
||||
|
|
@ -91,7 +91,7 @@ Osem::Application.routes.draw do
|
|||
resources :conference, only: [:show] do
|
||||
resources :proposal do
|
||||
resources :commercials, except: [:show, :index]
|
||||
resources :event_attachment, controller: "event_attachments"
|
||||
resources :event_attachment, controller: 'event_attachments'
|
||||
member do
|
||||
patch '/confirm' => 'proposal#confirm'
|
||||
patch '/restart' => 'proposal#restart'
|
||||
|
|
@ -103,13 +103,13 @@ Osem::Application.routes.draw do
|
|||
resources :ticket_purchases, only: [:create, :destroy]
|
||||
|
||||
resource :schedule, only: [] do
|
||||
get "/" => "schedule#index"
|
||||
get '/' => 'schedule#index'
|
||||
end
|
||||
|
||||
member do
|
||||
get "gallery_photos"
|
||||
patch "subscription" => "conference#subscribe"
|
||||
delete "subscription" => "conference#unsubscribe"
|
||||
get 'gallery_photos'
|
||||
patch 'subscription' => 'conference#subscribe'
|
||||
delete 'subscription' => 'conference#unsubscribe'
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -129,7 +129,7 @@ Osem::Application.routes.draw do
|
|||
end
|
||||
end
|
||||
|
||||
get "/admin" => redirect("/admin/conference")
|
||||
get '/admin' => redirect('/admin/conference')
|
||||
|
||||
root to: 'home#index', via: [:get, :options]
|
||||
end
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@ class DeviseCreateUsers < ActiveRecord::Migration
|
|||
def up
|
||||
create_table(:users) do |t|
|
||||
## Database authenticatable
|
||||
t.string :email, null: false, default: ""
|
||||
t.string :encrypted_password, null: false, default: ""
|
||||
t.string :email, null: false, default: ''
|
||||
t.string :encrypted_password, null: false, default: ''
|
||||
|
||||
## Recoverable
|
||||
t.string :reset_password_token
|
||||
|
|
|
|||
|
|
@ -2,10 +2,10 @@ class CreatePeopleTable < ActiveRecord::Migration
|
|||
def up
|
||||
create_table :people do |t|
|
||||
t.string :guid, null: false
|
||||
t.string :first_name, default: ""
|
||||
t.string :last_name, default: ""
|
||||
t.string :public_name, default: ""
|
||||
t.string :company, default: ""
|
||||
t.string :first_name, default: ''
|
||||
t.string :last_name, default: ''
|
||||
t.string :public_name, default: ''
|
||||
t.string :company, default: ''
|
||||
t.string :email, null: false
|
||||
t.boolean :email_public
|
||||
t.string :avatar_file_name
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ class CreateTracksTable < ActiveRecord::Migration
|
|||
t.references :conference
|
||||
t.string :name, null: false
|
||||
t.text :description
|
||||
t.string :color, default: "#ffffff"
|
||||
t.string :color, default: '#ffffff'
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@ class CreateEventsTable < ActiveRecord::Migration
|
|||
t.string :title, null: false
|
||||
t.string :subtitle
|
||||
t.integer :time_slots
|
||||
t.string :state, null: false, default: "new"
|
||||
t.string :progress, null: false, default: "new"
|
||||
t.string :state, null: false, default: 'new'
|
||||
t.string :progress, null: false, default: 'new'
|
||||
t.string :language
|
||||
t.datetime :start_time
|
||||
t.text :abstract
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ class CreateEventPeopleTable < ActiveRecord::Migration
|
|||
t.references :proposal
|
||||
t.references :person
|
||||
t.references :event
|
||||
t.string :event_role, null: false, default: "participant"
|
||||
t.string :event_role, null: false, default: 'participant'
|
||||
t.string :comment
|
||||
|
||||
t.timestamps
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
class CreateComments < ActiveRecord::Migration
|
||||
def self.up
|
||||
create_table :comments do |t|
|
||||
t.string :title, limit: 50, default: ""
|
||||
t.string :title, limit: 50, default: ''
|
||||
t.text :comment
|
||||
t.references :commentable, polymorphic: true
|
||||
t.references :user
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ class CreateDifficultyLevels < ActiveRecord::Migration
|
|||
t.references :conference
|
||||
t.string :title
|
||||
t.text :description
|
||||
t.string :color, default: "#ffffff"
|
||||
t.string :color, default: '#ffffff'
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
|
|
|||
|
|
@ -14,9 +14,9 @@ user.skip_confirmation!
|
|||
user.save!
|
||||
|
||||
# Questions
|
||||
qtype_yesno = QuestionType.create(title: "Yes/No")
|
||||
QuestionType.create(title: "Single Choice")
|
||||
QuestionType.create(title: "Multiple Choice")
|
||||
qtype_yesno = QuestionType.create(title: 'Yes/No')
|
||||
QuestionType.create(title: 'Single Choice')
|
||||
QuestionType.create(title: 'Multiple Choice')
|
||||
|
||||
answer_yes = Answer.create(title: 'Yes')
|
||||
answer_no = Answer.create(title: 'No')
|
||||
|
|
|
|||
|
|
@ -15,13 +15,13 @@ FactoryGirl.define do
|
|||
updated_conference_registration_dates_subject 'Conference registration dates have been updated'
|
||||
updated_conference_registration_dates_template 'Sample Conference\n New Dates: January 17 - 21 2014'
|
||||
send_on_venue_update true
|
||||
venue_update_subject "Venue has been updated"
|
||||
venue_update_template "Venue has been Updated to Sample Location"
|
||||
venue_update_subject 'Venue has been updated'
|
||||
venue_update_template 'Venue has been Updated to Sample Location'
|
||||
registration_subject 'Lorem Ipsum Dolsum'
|
||||
registration_email_template 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit'
|
||||
call_for_papers_dates_updates_subject "Call for Papers dates have been updated"
|
||||
call_for_papers_dates_updates_template "Please checkout the new updates to submit your proposal for Sample Conference"
|
||||
call_for_papers_schedule_public_subject "Sample Conference Cfp schedule is Public"
|
||||
call_for_papers_schedule_public_template "Call for Papers schedule is Public.Checkout the link"
|
||||
call_for_papers_dates_updates_subject 'Call for Papers dates have been updated'
|
||||
call_for_papers_dates_updates_template 'Please checkout the new updates to submit your proposal for Sample Conference'
|
||||
call_for_papers_schedule_public_subject 'Sample Conference Cfp schedule is Public'
|
||||
call_for_papers_schedule_public_template 'Call for Papers schedule is Public.Checkout the link'
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ feature EventType do
|
|||
value).to eq('300')
|
||||
|
||||
# Remove event type
|
||||
within("div.nested-fields:nth-of-type(3)") do
|
||||
within('div.nested-fields:nth-of-type(3)') do
|
||||
click_link 'Remove event_type'
|
||||
end
|
||||
expect(page.all('div.nested-fields').count == 2).to be true
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ feature Openid do
|
|||
visit '/accounts/sign_in'
|
||||
|
||||
mock_auth_new_user
|
||||
within("#openidlinks") do
|
||||
within('#openidlinks') do
|
||||
click_link 'omniauth-google'
|
||||
end
|
||||
expect(flash).to eq('test-1@gmail.com signed in successfully with google')
|
||||
|
|
@ -30,7 +30,7 @@ feature Openid do
|
|||
visit '/accounts/sign_in'
|
||||
|
||||
mock_auth_existing_user_participant
|
||||
within("#openidlinks") do
|
||||
within('#openidlinks') do
|
||||
click_link 'omniauth-google'
|
||||
end
|
||||
expect(flash).to eq('test-participant-1@google.com signed in successfully with google')
|
||||
|
|
@ -42,7 +42,7 @@ feature Openid do
|
|||
OmniAuth.config.mock_auth[:google] = :invalid_credentials
|
||||
visit '/accounts/sign_in'
|
||||
expect(page.has_content?('or sign in using')).to be true
|
||||
within("#openidlinks") do
|
||||
within('#openidlinks') do
|
||||
click_link 'omniauth-google'
|
||||
end
|
||||
|
||||
|
|
@ -60,7 +60,7 @@ feature Openid do
|
|||
visit '/accounts/edit'
|
||||
|
||||
mock_auth_new_user
|
||||
within("#openidlinks") do
|
||||
within('#openidlinks') do
|
||||
click_link 'omniauth-google'
|
||||
end
|
||||
expect(flash).to eq('test-participant-1@google.com signed in successfully with google')
|
||||
|
|
@ -77,7 +77,7 @@ feature Openid do
|
|||
visit '/accounts/sign_in'
|
||||
|
||||
mock_auth_existing_user_participant
|
||||
within("#openidlinks") do
|
||||
within('#openidlinks') do
|
||||
click_link 'omniauth-google'
|
||||
end
|
||||
expect(flash).to eq('test-participant-1@google.com signed in successfully with google')
|
||||
|
|
@ -90,7 +90,7 @@ feature Openid do
|
|||
visit '/accounts/edit'
|
||||
|
||||
mock_auth_new_user
|
||||
within("#openidlinks") do
|
||||
within('#openidlinks') do
|
||||
click_link 'omniauth-google'
|
||||
end
|
||||
expect(flash).to eq('test-participant-1@google.com signed in successfully with google')
|
||||
|
|
@ -106,7 +106,7 @@ feature Openid do
|
|||
|
||||
visit '/accounts/sign_in'
|
||||
mock_auth_new_user_fb
|
||||
within("#openidlinks") do
|
||||
within('#openidlinks') do
|
||||
click_link 'omniauth-facebook'
|
||||
end
|
||||
expect(flash).to eq('test-participant-1@google.com signed in successfully with facebook')
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ feature Photo do
|
|||
click_button 'Save Photo'
|
||||
|
||||
expect(flash).
|
||||
to eq("A error prohibited this Photo from being saved: Picture content type is invalid. Picture is invalid.")
|
||||
to eq('A error prohibited this Photo from being saved: Picture content type is invalid. Picture is invalid.')
|
||||
expect(Photo.count).to eq(expected_count)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -3,9 +3,9 @@
|
|||
RSpec.configure do |config|
|
||||
config.after(:each, type: :feature) do
|
||||
ename = RSpec.current_example.full_description
|
||||
ename = ename.gsub " ", "_"
|
||||
ename = ename.gsub ' ', '_'
|
||||
ename.downcase!
|
||||
ename = ename + ".html"
|
||||
ename = ename + '.html'
|
||||
if RSpec.current_example.exception.present?
|
||||
save_page(ename)
|
||||
else
|
||||
|
|
|
|||
|
|
@ -16,11 +16,11 @@ describe 'admin/conference/roles' do
|
|||
expect(rendered).to include("Add role 'Organizer' to user:")
|
||||
expect(rendered).to include('Add role')
|
||||
expect(rendered).to include('Users with role Organizer')
|
||||
expect(rendered).to have_selector("table thead th:nth-of-type(1)", text: 'ID')
|
||||
expect(rendered).to have_selector("table thead th:nth-of-type(2)", text: 'Name')
|
||||
expect(rendered).to have_selector("table thead th:nth-of-type(3)", text: 'Email')
|
||||
expect(rendered).to have_selector("table tbody tr:nth-of-type(1) td:nth-of-type(1)", text: organizer.id)
|
||||
expect(rendered).to have_selector("table tbody tr:nth-of-type(1) td:nth-of-type(2)", text: 'test name')
|
||||
expect(rendered).to have_selector("table tbody tr:nth-of-type(1) td:nth-of-type(3)", text: 'test@email.com')
|
||||
expect(rendered).to have_selector('table thead th:nth-of-type(1)', text: 'ID')
|
||||
expect(rendered).to have_selector('table thead th:nth-of-type(2)', text: 'Name')
|
||||
expect(rendered).to have_selector('table thead th:nth-of-type(3)', text: 'Email')
|
||||
expect(rendered).to have_selector('table tbody tr:nth-of-type(1) td:nth-of-type(1)', text: organizer.id)
|
||||
expect(rendered).to have_selector('table tbody tr:nth-of-type(1) td:nth-of-type(2)', text: 'test name')
|
||||
expect(rendered).to have_selector('table tbody tr:nth-of-type(1) td:nth-of-type(3)', text: 'test@email.com')
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -18,15 +18,15 @@ describe 'admin/emails/index' do
|
|||
to include('Conference dates have been updated')
|
||||
expect(rendered).
|
||||
to include('Conference registration dates have been updated')
|
||||
expect(rendered).to include("Venue has been updated")
|
||||
expect(rendered).to include("Venue has been Updated to Sample Location")
|
||||
expect(rendered).to include('Venue has been updated')
|
||||
expect(rendered).to include('Venue has been Updated to Sample Location')
|
||||
expect(rendered).
|
||||
to include("Call for Papers dates have been updated")
|
||||
to include('Call for Papers dates have been updated')
|
||||
expect(rendered).
|
||||
to include("Please checkout the new updates to submit your proposal for Sample Conference")
|
||||
to include('Please checkout the new updates to submit your proposal for Sample Conference')
|
||||
expect(rendered).
|
||||
to include("Sample Conference Cfp schedule is Public")
|
||||
to include('Sample Conference Cfp schedule is Public')
|
||||
expect(rendered).
|
||||
to include("Call for Papers schedule is Public.Checkout the link")
|
||||
to include('Call for Papers schedule is Public.Checkout the link')
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe 'home/index' do
|
||||
it "renders _conference partial for each conference" do
|
||||
allow(view).to receive(:date_string).and_return("January 17 - 21 2014")
|
||||
it 'renders _conference partial for each conference' do
|
||||
allow(view).to receive(:date_string).and_return('January 17 - 21 2014')
|
||||
assign(:current, [create(:conference), create(:conference)])
|
||||
render
|
||||
expect(view).to render_template(partial: "_conference_details", count: 2)
|
||||
expect(view).to render_template(partial: '_conference_details', count: 2)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue