updated rails to 4.2.4
This commit is contained in:
parent
37697517df
commit
42e8bb11ea
55 changed files with 766 additions and 365 deletions
11
Gemfile
11
Gemfile
|
|
@ -1,7 +1,11 @@
|
||||||
source 'https://rubygems.org'
|
source 'https://rubygems.org'
|
||||||
|
|
||||||
# as web framework
|
# as web framework
|
||||||
gem 'rails', '~> 4.1'
|
gem 'rails', '~> 4.2', '>= 4.2.4'
|
||||||
|
|
||||||
|
# A set of Rails responders to dry up your application
|
||||||
|
# required for respond_with and the class-level respond_to methods in rails 4.2
|
||||||
|
gem 'responders', '~> 2.0'
|
||||||
|
|
||||||
# as the database for Active Record
|
# as the database for Active Record
|
||||||
gem 'mysql2'
|
gem 'mysql2'
|
||||||
|
|
@ -124,6 +128,9 @@ gem 'acts_as_list'
|
||||||
# for switch checkboxes
|
# for switch checkboxes
|
||||||
gem 'bootstrap-switch-rails', '~> 3.0.0'
|
gem 'bootstrap-switch-rails', '~> 3.0.0'
|
||||||
|
|
||||||
|
# responsible for comparing HTML doms and asserting that DOM elements are present in Rails applications
|
||||||
|
gem 'rails-dom-testing'
|
||||||
|
|
||||||
# Use guard and spring for testing in development
|
# Use guard and spring for testing in development
|
||||||
group :development do
|
group :development do
|
||||||
# rspec Guard rules
|
# rspec Guard rules
|
||||||
|
|
@ -139,6 +146,8 @@ group :development do
|
||||||
gem 'letter_opener'
|
gem 'letter_opener'
|
||||||
# mina is a blazing fast deployment system
|
# mina is a blazing fast deployment system
|
||||||
gem 'mina'
|
gem 'mina'
|
||||||
|
# debugging tool for your Ruby on Rails applications
|
||||||
|
gem 'web-console', '~> 2.0'
|
||||||
end
|
end
|
||||||
|
|
||||||
# Use rspec and capybara as testing framework
|
# Use rspec and capybara as testing framework
|
||||||
|
|
|
||||||
548
Gemfile.lock
548
Gemfile.lock
|
|
@ -1,434 +1,492 @@
|
||||||
GIT
|
GIT
|
||||||
remote: git://github.com/stefanpenner/country_select.git
|
remote: git://github.com/stefanpenner/country_select.git
|
||||||
revision: 585e9538a01ae9878e92f12a98261a09842ed015
|
revision: 2023cc8f0c07a6c98a3f1b03cccb065ca26b050d
|
||||||
specs:
|
specs:
|
||||||
country_select (2.1.0)
|
country_select (2.4.0)
|
||||||
countries (~> 0.9, >= 0.9.3)
|
countries (~> 1.1.0)
|
||||||
|
sort_alphabetical (~> 1.0)
|
||||||
|
|
||||||
GEM
|
GEM
|
||||||
remote: https://rubygems.org/
|
remote: https://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
actionmailer (4.1.8)
|
actionmailer (4.2.4)
|
||||||
actionpack (= 4.1.8)
|
actionpack (= 4.2.4)
|
||||||
actionview (= 4.1.8)
|
actionview (= 4.2.4)
|
||||||
|
activejob (= 4.2.4)
|
||||||
mail (~> 2.5, >= 2.5.4)
|
mail (~> 2.5, >= 2.5.4)
|
||||||
actionpack (4.1.8)
|
rails-dom-testing (~> 1.0, >= 1.0.5)
|
||||||
actionview (= 4.1.8)
|
actionpack (4.2.4)
|
||||||
activesupport (= 4.1.8)
|
actionview (= 4.2.4)
|
||||||
rack (~> 1.5.2)
|
activesupport (= 4.2.4)
|
||||||
|
rack (~> 1.6)
|
||||||
rack-test (~> 0.6.2)
|
rack-test (~> 0.6.2)
|
||||||
actionview (4.1.8)
|
rails-dom-testing (~> 1.0, >= 1.0.5)
|
||||||
activesupport (= 4.1.8)
|
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
||||||
|
actionview (4.2.4)
|
||||||
|
activesupport (= 4.2.4)
|
||||||
builder (~> 3.1)
|
builder (~> 3.1)
|
||||||
erubis (~> 2.7.0)
|
erubis (~> 2.7.0)
|
||||||
active_model_serializers (0.8.1)
|
rails-dom-testing (~> 1.0, >= 1.0.5)
|
||||||
activemodel (>= 3.0)
|
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
||||||
activemodel (4.1.8)
|
active_model_serializers (0.9.3)
|
||||||
activesupport (= 4.1.8)
|
activemodel (>= 3.2)
|
||||||
|
activejob (4.2.4)
|
||||||
|
activesupport (= 4.2.4)
|
||||||
|
globalid (>= 0.3.0)
|
||||||
|
activemodel (4.2.4)
|
||||||
|
activesupport (= 4.2.4)
|
||||||
builder (~> 3.1)
|
builder (~> 3.1)
|
||||||
activerecord (4.1.8)
|
activerecord (4.2.4)
|
||||||
activemodel (= 4.1.8)
|
activemodel (= 4.2.4)
|
||||||
activesupport (= 4.1.8)
|
activesupport (= 4.2.4)
|
||||||
arel (~> 5.0.0)
|
arel (~> 6.0)
|
||||||
activesupport (4.1.8)
|
activesupport (4.2.4)
|
||||||
i18n (~> 0.6, >= 0.6.9)
|
i18n (~> 0.7)
|
||||||
json (~> 1.7, >= 1.7.7)
|
json (~> 1.7, >= 1.7.7)
|
||||||
minitest (~> 5.1)
|
minitest (~> 5.1)
|
||||||
thread_safe (~> 0.1)
|
thread_safe (~> 0.3, >= 0.3.4)
|
||||||
tzinfo (~> 1.1)
|
tzinfo (~> 1.1)
|
||||||
activeuuid (0.5.0)
|
activeuuid (0.6.1)
|
||||||
activerecord (>= 3.1)
|
activerecord (>= 3.1)
|
||||||
uuidtools
|
uuidtools
|
||||||
acts_as_commentable_with_threading (1.2.0)
|
acts_as_commentable_with_threading (2.0.0)
|
||||||
|
activerecord (>= 4.0)
|
||||||
|
activesupport (>= 4.0)
|
||||||
|
awesome_nested_set (>= 3.0)
|
||||||
|
acts_as_list (0.7.2)
|
||||||
activerecord (>= 3.0)
|
activerecord (>= 3.0)
|
||||||
activesupport (>= 3.0)
|
addressable (2.3.8)
|
||||||
awesome_nested_set (>= 2.0)
|
ahoy_matey (1.2.1)
|
||||||
acts_as_list (0.4.0)
|
|
||||||
activerecord (>= 3.0)
|
|
||||||
addressable (2.3.6)
|
|
||||||
ahoy_matey (1.0.0)
|
|
||||||
addressable
|
addressable
|
||||||
browser (>= 0.4.0)
|
browser (>= 0.4.0)
|
||||||
|
errbase
|
||||||
geocoder
|
geocoder
|
||||||
referer-parser
|
rails
|
||||||
|
referer-parser (>= 0.3.0)
|
||||||
request_store
|
request_store
|
||||||
user_agent_parser
|
user_agent_parser
|
||||||
uuidtools
|
uuidtools
|
||||||
arel (5.0.1.20140414130214)
|
arel (6.0.3)
|
||||||
ast (2.0.0)
|
ast (2.1.0)
|
||||||
autoprefixer-rails (5.1.9)
|
astrolabe (1.3.1)
|
||||||
|
parser (~> 2.2)
|
||||||
|
autoprefixer-rails (6.0.3)
|
||||||
execjs
|
execjs
|
||||||
json
|
json
|
||||||
awesome_nested_set (3.0.0.rc.5)
|
awesome_nested_set (3.0.2)
|
||||||
activerecord (>= 4.0.0, < 5)
|
activerecord (>= 4.0.0, < 5)
|
||||||
axlsx (2.0.1)
|
axlsx (2.0.1)
|
||||||
htmlentities (~> 4.3.1)
|
htmlentities (~> 4.3.1)
|
||||||
nokogiri (>= 1.4.1)
|
nokogiri (>= 1.4.1)
|
||||||
rubyzip (~> 1.0.0)
|
rubyzip (~> 1.0.0)
|
||||||
axlsx_rails (0.2.0)
|
axlsx_rails (0.4.0)
|
||||||
axlsx (>= 2.0.1)
|
axlsx (>= 2.0.1)
|
||||||
rails (>= 3.1)
|
rails (>= 3.1)
|
||||||
bcrypt (3.1.7)
|
bcrypt (3.1.10)
|
||||||
|
binding_of_caller (0.7.2)
|
||||||
|
debug_inspector (>= 0.0.1)
|
||||||
bootstrap-sass (3.3.4.1)
|
bootstrap-sass (3.3.4.1)
|
||||||
autoprefixer-rails (>= 5.0.0.1)
|
autoprefixer-rails (>= 5.0.0.1)
|
||||||
sass (>= 3.2.19)
|
sass (>= 3.2.19)
|
||||||
bootstrap-switch-rails (3.0.2)
|
bootstrap-switch-rails (3.0.2)
|
||||||
bootstrap3-datetimepicker-rails (3.0.3)
|
bootstrap3-datetimepicker-rails (3.0.3)
|
||||||
momentjs-rails (>= 2.8.1)
|
momentjs-rails (>= 2.8.1)
|
||||||
browser (0.6.0)
|
browser (1.0.1)
|
||||||
builder (3.2.2)
|
builder (3.2.2)
|
||||||
byebug (3.1.2)
|
byebug (6.0.2)
|
||||||
columnize (~> 0.8)
|
cancancan (1.13.1)
|
||||||
debugger-linecache (~> 1.2)
|
capybara (2.5.0)
|
||||||
cancancan (1.8.4)
|
|
||||||
capybara (2.2.1)
|
|
||||||
mime-types (>= 1.16)
|
mime-types (>= 1.16)
|
||||||
nokogiri (>= 1.3.3)
|
nokogiri (>= 1.3.3)
|
||||||
rack (>= 1.0.0)
|
rack (>= 1.0.0)
|
||||||
rack-test (>= 0.5.4)
|
rack-test (>= 0.5.4)
|
||||||
xpath (~> 2.0)
|
xpath (~> 2.0)
|
||||||
celluloid (0.15.2)
|
chart-js-rails (0.0.9)
|
||||||
timers (~> 1.1.0)
|
|
||||||
celluloid-io (0.15.0)
|
|
||||||
celluloid (>= 0.15.0)
|
|
||||||
nio4r (>= 0.5.0)
|
|
||||||
chart-js-rails (0.0.6)
|
|
||||||
railties (> 3.1)
|
railties (> 3.1)
|
||||||
chronic (0.10.2)
|
chronic (0.10.2)
|
||||||
climate_control (0.0.3)
|
climate_control (0.0.3)
|
||||||
activesupport (>= 3.0)
|
activesupport (>= 3.0)
|
||||||
cliver (0.3.2)
|
cliver (0.3.2)
|
||||||
cocaine (0.5.4)
|
cocaine (0.5.7)
|
||||||
climate_control (>= 0.0.3, < 1.0)
|
climate_control (>= 0.0.3, < 1.0)
|
||||||
cocoon (1.2.6)
|
cocoon (1.2.6)
|
||||||
coderay (1.1.0)
|
coderay (1.1.0)
|
||||||
coffee-rails (4.0.1)
|
coffee-rails (4.1.0)
|
||||||
coffee-script (>= 2.2.0)
|
coffee-script (>= 2.2.0)
|
||||||
railties (>= 4.0.0, < 5.0)
|
railties (>= 4.0.0, < 5.0)
|
||||||
coffee-script (2.2.0)
|
coffee-script (2.4.1)
|
||||||
coffee-script-source
|
coffee-script-source
|
||||||
execjs
|
execjs
|
||||||
coffee-script-source (1.7.0)
|
coffee-script-source (1.9.1.1)
|
||||||
columnize (0.8.9)
|
countries (1.1.0)
|
||||||
countries (0.9.3)
|
|
||||||
currencies (~> 0.4.2)
|
currencies (~> 0.4.2)
|
||||||
coveralls (0.7.0)
|
i18n_data (~> 0.7.0)
|
||||||
multi_json (~> 1.3)
|
coveralls (0.8.3)
|
||||||
rest-client
|
json (~> 1.8)
|
||||||
simplecov (>= 0.7)
|
rest-client (>= 1.6.8, < 2)
|
||||||
term-ansicolor
|
simplecov (~> 0.10.0)
|
||||||
thor
|
term-ansicolor (~> 1.3)
|
||||||
|
thor (~> 0.19.1)
|
||||||
currencies (0.4.2)
|
currencies (0.4.2)
|
||||||
d3_rails (3.4.6)
|
d3_rails (3.5.6)
|
||||||
railties (>= 3.1.0)
|
railties (>= 3.1.0)
|
||||||
daemons (1.1.9)
|
daemons (1.2.3)
|
||||||
database_cleaner (1.3.0)
|
database_cleaner (1.5.1)
|
||||||
debugger-linecache (1.2.0)
|
debug_inspector (0.0.2)
|
||||||
delayed_job (4.0.2)
|
delayed_job (4.1.1)
|
||||||
activesupport (>= 3.0, < 4.2)
|
activesupport (>= 3.0, < 5.0)
|
||||||
delayed_job_active_record (4.0.1)
|
delayed_job_active_record (4.1.0)
|
||||||
activerecord (>= 3.0, < 4.2)
|
activerecord (>= 3.0, < 5)
|
||||||
delayed_job (>= 3.0, < 4.1)
|
delayed_job (>= 3.0, < 5)
|
||||||
devise (3.2.4)
|
devise (3.5.2)
|
||||||
bcrypt (~> 3.0)
|
bcrypt (~> 3.0)
|
||||||
orm_adapter (~> 0.1)
|
orm_adapter (~> 0.1)
|
||||||
railties (>= 3.2.6, < 5)
|
railties (>= 3.2.6, < 5)
|
||||||
|
responders
|
||||||
thread_safe (~> 0.1)
|
thread_safe (~> 0.1)
|
||||||
warden (~> 1.2.3)
|
warden (~> 1.2.3)
|
||||||
devise_ichain_authenticatable (0.3.1)
|
devise_ichain_authenticatable (0.3.1)
|
||||||
devise (>= 2.2)
|
devise (>= 2.2)
|
||||||
diff-lcs (1.2.5)
|
diff-lcs (1.2.5)
|
||||||
docile (1.1.3)
|
docile (1.1.5)
|
||||||
|
domain_name (0.5.25)
|
||||||
|
unf (>= 0.0.5, < 1.0.0)
|
||||||
|
errbase (0.0.3)
|
||||||
erubis (2.7.0)
|
erubis (2.7.0)
|
||||||
execjs (2.5.2)
|
execjs (2.6.0)
|
||||||
factory_girl (4.4.0)
|
factory_girl (4.5.0)
|
||||||
activesupport (>= 3.0.0)
|
activesupport (>= 3.0.0)
|
||||||
factory_girl_rails (4.4.1)
|
factory_girl_rails (4.5.0)
|
||||||
factory_girl (~> 4.4.0)
|
factory_girl (~> 4.5.0)
|
||||||
railties (>= 3.0.0)
|
railties (>= 3.0.0)
|
||||||
faraday (0.9.0)
|
faraday (0.9.2)
|
||||||
multipart-post (>= 1.2, < 3)
|
multipart-post (>= 1.2, < 3)
|
||||||
ffi (1.9.3)
|
ffi (1.9.10)
|
||||||
font-awesome-rails (4.1.0.0)
|
font-awesome-rails (4.4.0.0)
|
||||||
railties (>= 3.2, < 5.0)
|
railties (>= 3.2, < 5.0)
|
||||||
formatador (0.2.4)
|
formatador (0.2.5)
|
||||||
formtastic (2.3.0.rc3)
|
formtastic (2.3.1)
|
||||||
actionpack (>= 3.0)
|
actionpack (>= 3.0)
|
||||||
formtastic-bootstrap (3.0.0)
|
formtastic-bootstrap (3.0.0)
|
||||||
formtastic (>= 2.2)
|
formtastic (>= 2.2)
|
||||||
geocoder (1.2.2)
|
geocoder (1.2.11)
|
||||||
|
globalid (0.3.6)
|
||||||
|
activesupport (>= 4.1.0)
|
||||||
gravtastic (3.2.6)
|
gravtastic (3.2.6)
|
||||||
guard (2.6.0)
|
guard (2.13.0)
|
||||||
formatador (>= 0.2.4)
|
formatador (>= 0.2.4)
|
||||||
listen (~> 2.7)
|
listen (>= 2.7, <= 4.0)
|
||||||
lumberjack (~> 1.0)
|
lumberjack (~> 1.0)
|
||||||
|
nenv (~> 0.1)
|
||||||
|
notiffany (~> 0.0)
|
||||||
pry (>= 0.9.12)
|
pry (>= 0.9.12)
|
||||||
|
shellany (~> 0.0)
|
||||||
thor (>= 0.18.1)
|
thor (>= 0.18.1)
|
||||||
guard-rspec (4.2.8)
|
guard-rspec (4.2.10)
|
||||||
guard (~> 2.1)
|
guard (~> 2.1)
|
||||||
rspec (>= 2.14, < 4.0)
|
rspec (>= 2.14, < 4.0)
|
||||||
haml (4.0.5)
|
haml (4.0.7)
|
||||||
tilt
|
tilt
|
||||||
haml-rails (0.5.3)
|
haml-rails (0.9.0)
|
||||||
actionpack (>= 4.0.1)
|
actionpack (>= 4.0.1)
|
||||||
activesupport (>= 4.0.1)
|
activesupport (>= 4.0.1)
|
||||||
haml (>= 3.1, < 5.0)
|
haml (>= 4.0.6, < 5.0)
|
||||||
|
html2haml (>= 1.0.1)
|
||||||
railties (>= 4.0.1)
|
railties (>= 4.0.1)
|
||||||
hashie (2.1.1)
|
hashie (3.4.2)
|
||||||
hike (1.2.3)
|
|
||||||
hoptoad_notifier (2.4.11)
|
hoptoad_notifier (2.4.11)
|
||||||
activesupport
|
activesupport
|
||||||
builder
|
builder
|
||||||
htmlentities (4.3.1)
|
html2haml (2.0.0)
|
||||||
i18n (0.6.11)
|
erubis (~> 2.7.0)
|
||||||
inversion (0.12.3)
|
haml (~> 4.0.0)
|
||||||
loggability (~> 0.4)
|
nokogiri (~> 1.6.0)
|
||||||
|
ruby_parser (~> 3.5)
|
||||||
|
htmlentities (4.3.4)
|
||||||
|
http-cookie (1.0.2)
|
||||||
|
domain_name (~> 0.5)
|
||||||
|
i18n (0.7.0)
|
||||||
|
i18n_data (0.7.0)
|
||||||
|
inversion (0.18.0)
|
||||||
|
loggability (~> 0.11)
|
||||||
jquery-datatables-rails (2.2.3)
|
jquery-datatables-rails (2.2.3)
|
||||||
jquery-rails
|
jquery-rails
|
||||||
sass-rails
|
sass-rails
|
||||||
jquery-rails (3.1.2)
|
jquery-rails (4.0.5)
|
||||||
railties (>= 3.0, < 5.0)
|
rails-dom-testing (~> 1.0)
|
||||||
|
railties (>= 4.2.0)
|
||||||
thor (>= 0.14, < 2.0)
|
thor (>= 0.14, < 2.0)
|
||||||
json (1.8.1)
|
json (1.8.3)
|
||||||
jwt (1.0.0)
|
jwt (1.5.1)
|
||||||
launchy (2.4.2)
|
launchy (2.4.3)
|
||||||
addressable (~> 2.3)
|
addressable (~> 2.3)
|
||||||
leaflet-rails (0.7.4)
|
leaflet-rails (0.7.4)
|
||||||
letter_opener (1.2.0)
|
letter_opener (1.4.1)
|
||||||
launchy (~> 2.2)
|
launchy (~> 2.2)
|
||||||
listen (2.7.2)
|
listen (3.0.3)
|
||||||
celluloid (>= 0.15.2)
|
|
||||||
celluloid-io (>= 0.15.0)
|
|
||||||
rb-fsevent (>= 0.9.3)
|
rb-fsevent (>= 0.9.3)
|
||||||
rb-inotify (>= 0.9)
|
rb-inotify (>= 0.9)
|
||||||
loggability (0.11.0)
|
loggability (0.11.0)
|
||||||
lumberjack (1.0.5)
|
loofah (2.0.3)
|
||||||
|
nokogiri (>= 1.5.9)
|
||||||
|
lumberjack (1.0.9)
|
||||||
mail (2.6.3)
|
mail (2.6.3)
|
||||||
mime-types (>= 1.16, < 3)
|
mime-types (>= 1.16, < 3)
|
||||||
method_source (0.8.2)
|
method_source (0.8.2)
|
||||||
mime-types (2.4.3)
|
mime-types (2.6.2)
|
||||||
mina (0.3.0)
|
mimemagic (0.3.0)
|
||||||
open4
|
mina (0.3.7)
|
||||||
|
open4 (~> 1.3.4)
|
||||||
rake
|
rake
|
||||||
mini_portile (0.6.0)
|
mini_portile (0.6.2)
|
||||||
minitest (5.4.3)
|
minitest (5.8.1)
|
||||||
momentjs-rails (2.8.1)
|
momentjs-rails (2.10.6)
|
||||||
railties (>= 3.1)
|
railties (>= 3.1)
|
||||||
monetize (0.3.0)
|
monetize (1.1.0)
|
||||||
money (~> 6.1.0.beta1)
|
money (~> 6.5.0)
|
||||||
money (6.1.1)
|
money (6.5.1)
|
||||||
i18n (~> 0.6.4)
|
i18n (>= 0.6.4, <= 0.7.0)
|
||||||
money-rails (0.12.0)
|
money-rails (1.4.1)
|
||||||
activesupport (>= 3.0)
|
activesupport (>= 3.0)
|
||||||
monetize (~> 0.3.0)
|
monetize (~> 1.1.0)
|
||||||
money (~> 6.1.1)
|
money (~> 6.5.0)
|
||||||
railties (>= 3.0)
|
railties (>= 3.0)
|
||||||
multi_json (1.10.1)
|
multi_json (1.11.2)
|
||||||
multi_xml (0.5.5)
|
multi_xml (0.5.5)
|
||||||
multipart-post (2.0.0)
|
multipart-post (2.0.0)
|
||||||
mysql2 (0.3.16)
|
mysql2 (0.4.1)
|
||||||
|
nenv (0.2.0)
|
||||||
netrc (0.10.3)
|
netrc (0.10.3)
|
||||||
nio4r (1.1.0)
|
nokogiri (1.6.6.2)
|
||||||
nokogiri (1.6.2.1)
|
mini_portile (~> 0.6.0)
|
||||||
mini_portile (= 0.6.0)
|
notiffany (0.0.8)
|
||||||
oauth2 (0.9.4)
|
nenv (~> 0.1)
|
||||||
|
shellany (~> 0.0)
|
||||||
|
oauth2 (1.0.0)
|
||||||
faraday (>= 0.8, < 0.10)
|
faraday (>= 0.8, < 0.10)
|
||||||
jwt (~> 1.0)
|
jwt (~> 1.0)
|
||||||
multi_json (~> 1.3)
|
multi_json (~> 1.3)
|
||||||
multi_xml (~> 0.5)
|
multi_xml (~> 0.5)
|
||||||
rack (~> 1.2)
|
rack (~> 1.2)
|
||||||
omniauth (1.2.1)
|
omniauth (1.2.2)
|
||||||
hashie (>= 1.2, < 3)
|
hashie (>= 1.2, < 4)
|
||||||
rack (~> 1.0)
|
rack (~> 1.0)
|
||||||
omniauth-facebook (1.6.0)
|
omniauth-facebook (2.0.1)
|
||||||
omniauth-oauth2 (~> 1.1)
|
omniauth-oauth2 (~> 1.2)
|
||||||
omniauth-github (1.1.2)
|
omniauth-github (1.1.2)
|
||||||
omniauth (~> 1.0)
|
omniauth (~> 1.0)
|
||||||
omniauth-oauth2 (~> 1.1)
|
omniauth-oauth2 (~> 1.1)
|
||||||
omniauth-google-oauth2 (0.2.4)
|
omniauth-google-oauth2 (0.2.8)
|
||||||
omniauth (~> 1.0)
|
addressable (~> 2.3)
|
||||||
omniauth-oauth2 (~> 1.1)
|
jwt (~> 1.0)
|
||||||
omniauth-oauth2 (1.1.2)
|
|
||||||
faraday (>= 0.8, < 0.10)
|
|
||||||
multi_json (~> 1.3)
|
multi_json (~> 1.3)
|
||||||
oauth2 (~> 0.9.3)
|
omniauth (>= 1.1.1)
|
||||||
|
omniauth-oauth2 (>= 1.1.1)
|
||||||
|
omniauth-oauth2 (1.4.0)
|
||||||
|
oauth2 (~> 1.0)
|
||||||
omniauth (~> 1.2)
|
omniauth (~> 1.2)
|
||||||
omniauth-openid (1.0.1)
|
omniauth-openid (1.0.1)
|
||||||
omniauth (~> 1.0)
|
omniauth (~> 1.0)
|
||||||
rack-openid (~> 1.3.1)
|
rack-openid (~> 1.3.1)
|
||||||
open4 (1.3.3)
|
open4 (1.3.4)
|
||||||
orm_adapter (0.5.0)
|
orm_adapter (0.5.0)
|
||||||
paper_trail (3.0.1)
|
paper_trail (4.0.0)
|
||||||
activerecord (>= 3.0, < 5.0)
|
activerecord (>= 3.0, < 6.0)
|
||||||
activesupport (>= 3.0, < 5.0)
|
activesupport (>= 3.0, < 6.0)
|
||||||
paperclip (4.1.1)
|
request_store (~> 1.1)
|
||||||
activemodel (>= 3.0.0)
|
paperclip (4.3.1)
|
||||||
activesupport (>= 3.0.0)
|
activemodel (>= 3.2.0)
|
||||||
cocaine (~> 0.5.3)
|
activesupport (>= 3.2.0)
|
||||||
|
cocaine (~> 0.5.5)
|
||||||
mime-types
|
mime-types
|
||||||
parser (2.2.0.pre.3)
|
mimemagic (= 0.3.0)
|
||||||
|
parser (2.2.3.0)
|
||||||
ast (>= 1.1, < 3.0)
|
ast (>= 1.1, < 3.0)
|
||||||
slop (~> 3.4, >= 3.4.5)
|
pdf-core (0.6.0)
|
||||||
pdf-core (0.2.5)
|
phantomjs (1.9.8.0)
|
||||||
phantomjs (1.9.7.1)
|
|
||||||
piwik_analytics (1.0.2)
|
piwik_analytics (1.0.2)
|
||||||
actionpack
|
actionpack
|
||||||
activesupport
|
activesupport
|
||||||
rails (>= 3.0.0)
|
rails (>= 3.0.0)
|
||||||
poltergeist (1.5.1)
|
poltergeist (1.7.0)
|
||||||
capybara (~> 2.1)
|
capybara (~> 2.1)
|
||||||
cliver (~> 0.3.1)
|
cliver (~> 0.3.1)
|
||||||
multi_json (~> 1.0)
|
multi_json (~> 1.0)
|
||||||
websocket-driver (>= 0.2.0)
|
websocket-driver (>= 0.2.0)
|
||||||
powerpack (0.0.9)
|
powerpack (0.1.1)
|
||||||
prawn (1.0.0)
|
prawn (2.0.2)
|
||||||
pdf-core (~> 0.2.2)
|
pdf-core (~> 0.6.0)
|
||||||
ttfunk (~> 1.1.1)
|
ttfunk (~> 1.4.0)
|
||||||
prawn_rails (0.0.11)
|
prawn_rails (0.0.11)
|
||||||
prawn (>= 0.11.1)
|
prawn (>= 0.11.1)
|
||||||
railties (>= 3.0.0)
|
railties (>= 3.0.0)
|
||||||
protected_attributes (1.0.7)
|
protected_attributes (1.1.3)
|
||||||
activemodel (>= 4.0.1, < 5.0)
|
activemodel (>= 4.0.1, < 5.0)
|
||||||
pry (0.9.12.6)
|
pry (0.10.3)
|
||||||
coderay (~> 1.0)
|
coderay (~> 1.1.0)
|
||||||
method_source (~> 0.8)
|
method_source (~> 0.8.1)
|
||||||
slop (~> 3.4)
|
slop (~> 3.4)
|
||||||
quiet_assets (1.0.2)
|
quiet_assets (1.1.0)
|
||||||
railties (>= 3.1, < 5.0)
|
railties (>= 3.1, < 5.0)
|
||||||
rack (1.5.2)
|
rack (1.6.4)
|
||||||
rack-openid (1.3.1)
|
rack-openid (1.3.1)
|
||||||
rack (>= 1.1.0)
|
rack (>= 1.1.0)
|
||||||
ruby-openid (>= 2.1.8)
|
ruby-openid (>= 2.1.8)
|
||||||
rack-test (0.6.2)
|
rack-test (0.6.3)
|
||||||
rack (>= 1.0)
|
rack (>= 1.0)
|
||||||
rails (4.1.8)
|
rails (4.2.4)
|
||||||
actionmailer (= 4.1.8)
|
actionmailer (= 4.2.4)
|
||||||
actionpack (= 4.1.8)
|
actionpack (= 4.2.4)
|
||||||
actionview (= 4.1.8)
|
actionview (= 4.2.4)
|
||||||
activemodel (= 4.1.8)
|
activejob (= 4.2.4)
|
||||||
activerecord (= 4.1.8)
|
activemodel (= 4.2.4)
|
||||||
activesupport (= 4.1.8)
|
activerecord (= 4.2.4)
|
||||||
|
activesupport (= 4.2.4)
|
||||||
bundler (>= 1.3.0, < 2.0)
|
bundler (>= 1.3.0, < 2.0)
|
||||||
railties (= 4.1.8)
|
railties (= 4.2.4)
|
||||||
sprockets-rails (~> 2.0)
|
sprockets-rails
|
||||||
|
rails-deprecated_sanitizer (1.0.3)
|
||||||
|
activesupport (>= 4.2.0.alpha)
|
||||||
|
rails-dom-testing (1.0.7)
|
||||||
|
activesupport (>= 4.2.0.beta, < 5.0)
|
||||||
|
nokogiri (~> 1.6.0)
|
||||||
|
rails-deprecated_sanitizer (>= 1.0.1)
|
||||||
|
rails-html-sanitizer (1.0.2)
|
||||||
|
loofah (~> 2.0)
|
||||||
rails-observers (0.1.2)
|
rails-observers (0.1.2)
|
||||||
activemodel (~> 4.0)
|
activemodel (~> 4.0)
|
||||||
railties (4.1.8)
|
railties (4.2.4)
|
||||||
actionpack (= 4.1.8)
|
actionpack (= 4.2.4)
|
||||||
activesupport (= 4.1.8)
|
activesupport (= 4.2.4)
|
||||||
rake (>= 0.8.7)
|
rake (>= 0.8.7)
|
||||||
thor (>= 0.18.1, < 2.0)
|
thor (>= 0.18.1, < 2.0)
|
||||||
rainbow (2.0.0)
|
rainbow (2.0.0)
|
||||||
rake (10.3.2)
|
rake (10.4.2)
|
||||||
rb-fsevent (0.9.4)
|
rb-fsevent (0.9.6)
|
||||||
rb-inotify (0.9.4)
|
rb-inotify (0.9.5)
|
||||||
ffi (>= 0.5.0)
|
ffi (>= 0.5.0)
|
||||||
rdoc (4.1.1)
|
rdoc (4.2.0)
|
||||||
json (~> 1.4)
|
|
||||||
rdoc-generator-fivefish (0.1.0)
|
rdoc-generator-fivefish (0.1.0)
|
||||||
inversion (~> 0.12)
|
inversion (~> 0.12)
|
||||||
loggability (~> 0.6)
|
loggability (~> 0.6)
|
||||||
rdoc (~> 4.0)
|
rdoc (~> 4.0)
|
||||||
yajl-ruby (~> 1.1)
|
yajl-ruby (~> 1.1)
|
||||||
redcarpet (3.2.3)
|
redcarpet (3.3.3)
|
||||||
referer-parser (0.2.1)
|
referer-parser (0.3.0)
|
||||||
request_store (1.0.6)
|
request_store (1.2.0)
|
||||||
rest-client (1.7.3)
|
responders (2.1.0)
|
||||||
|
railties (>= 4.2.0, < 5)
|
||||||
|
rest-client (1.8.0)
|
||||||
|
http-cookie (>= 1.0.2, < 2.0)
|
||||||
mime-types (>= 1.16, < 3.0)
|
mime-types (>= 1.16, < 3.0)
|
||||||
netrc (~> 0.7)
|
netrc (~> 0.7)
|
||||||
rolify (3.4.0)
|
rolify (4.1.1)
|
||||||
rspec (3.0.0)
|
rspec (3.3.0)
|
||||||
rspec-core (~> 3.0.0)
|
rspec-core (~> 3.3.0)
|
||||||
rspec-expectations (~> 3.0.0)
|
rspec-expectations (~> 3.3.0)
|
||||||
rspec-mocks (~> 3.0.0)
|
rspec-mocks (~> 3.3.0)
|
||||||
rspec-activemodel-mocks (1.0.1)
|
rspec-activemodel-mocks (1.0.2)
|
||||||
activemodel (>= 3.0)
|
activemodel (>= 3.0)
|
||||||
activesupport (>= 3.0)
|
activesupport (>= 3.0)
|
||||||
rspec-mocks (>= 2.99, < 4.0)
|
rspec-mocks (>= 2.99, < 4.0)
|
||||||
rspec-core (3.0.2)
|
rspec-core (3.3.2)
|
||||||
rspec-support (~> 3.0.0)
|
rspec-support (~> 3.3.0)
|
||||||
rspec-expectations (3.0.2)
|
rspec-expectations (3.3.1)
|
||||||
diff-lcs (>= 1.2.0, < 2.0)
|
diff-lcs (>= 1.2.0, < 2.0)
|
||||||
rspec-support (~> 3.0.0)
|
rspec-support (~> 3.3.0)
|
||||||
rspec-mocks (3.0.2)
|
rspec-mocks (3.3.2)
|
||||||
rspec-support (~> 3.0.0)
|
diff-lcs (>= 1.2.0, < 2.0)
|
||||||
rspec-rails (3.0.0)
|
rspec-support (~> 3.3.0)
|
||||||
actionpack (>= 3.0)
|
rspec-rails (3.3.3)
|
||||||
activesupport (>= 3.0)
|
actionpack (>= 3.0, < 4.3)
|
||||||
railties (>= 3.0)
|
activesupport (>= 3.0, < 4.3)
|
||||||
rspec-core (~> 3.0.0)
|
railties (>= 3.0, < 4.3)
|
||||||
rspec-expectations (~> 3.0.0)
|
rspec-core (~> 3.3.0)
|
||||||
rspec-mocks (~> 3.0.0)
|
rspec-expectations (~> 3.3.0)
|
||||||
rspec-support (~> 3.0.0)
|
rspec-mocks (~> 3.3.0)
|
||||||
rspec-support (3.0.2)
|
rspec-support (~> 3.3.0)
|
||||||
rubocop (0.24.1)
|
rspec-support (3.3.0)
|
||||||
json (>= 1.7.7, < 2)
|
rubocop (0.34.2)
|
||||||
parser (>= 2.2.0.pre.3, < 3.0)
|
astrolabe (~> 1.3)
|
||||||
powerpack (~> 0.0.6)
|
parser (>= 2.2.2.5, < 3.0)
|
||||||
|
powerpack (~> 0.1)
|
||||||
rainbow (>= 1.99.1, < 3.0)
|
rainbow (>= 1.99.1, < 3.0)
|
||||||
ruby-progressbar (~> 1.4)
|
ruby-progressbar (~> 1.4)
|
||||||
ruby-openid (2.5.0)
|
ruby-openid (2.7.0)
|
||||||
ruby-progressbar (1.5.1)
|
ruby-progressbar (1.7.5)
|
||||||
|
ruby_parser (3.7.1)
|
||||||
|
sexp_processor (~> 4.1)
|
||||||
rubyzip (1.0.0)
|
rubyzip (1.0.0)
|
||||||
sass (3.2.19)
|
sass (3.4.19)
|
||||||
sass-rails (4.0.4)
|
sass-rails (5.0.4)
|
||||||
railties (>= 4.0.0, < 5.0)
|
railties (>= 4.0.0, < 5.0)
|
||||||
sass (~> 3.2.2)
|
sass (~> 3.1)
|
||||||
sprockets (~> 2.8, < 2.12)
|
sprockets (>= 2.8, < 4.0)
|
||||||
sprockets-rails (~> 2.0)
|
sprockets-rails (>= 2.0, < 4.0)
|
||||||
|
tilt (>= 1.1, < 3)
|
||||||
|
sexp_processor (4.6.0)
|
||||||
|
shellany (0.0.1)
|
||||||
shoulda (3.5.0)
|
shoulda (3.5.0)
|
||||||
shoulda-context (~> 1.0, >= 1.0.1)
|
shoulda-context (~> 1.0, >= 1.0.1)
|
||||||
shoulda-matchers (>= 1.4.1, < 3.0)
|
shoulda-matchers (>= 1.4.1, < 3.0)
|
||||||
shoulda-context (1.2.1)
|
shoulda-context (1.2.1)
|
||||||
shoulda-matchers (2.6.1)
|
shoulda-matchers (2.8.0)
|
||||||
activesupport (>= 3.0.0)
|
activesupport (>= 3.0.0)
|
||||||
simplecov (0.8.2)
|
simplecov (0.10.0)
|
||||||
docile (~> 1.1.0)
|
docile (~> 1.1.0)
|
||||||
multi_json
|
json (~> 1.8)
|
||||||
simplecov-html (~> 0.8.0)
|
simplecov-html (~> 0.10.0)
|
||||||
simplecov-html (0.8.0)
|
simplecov-html (0.10.0)
|
||||||
slop (3.6.0)
|
slop (3.6.0)
|
||||||
spring (1.1.2)
|
sort_alphabetical (1.0.2)
|
||||||
spring-commands-rspec (1.0.2)
|
unicode_utils (>= 1.2.2)
|
||||||
|
spring (1.4.0)
|
||||||
|
spring-commands-rspec (1.0.4)
|
||||||
spring (>= 0.9.1)
|
spring (>= 0.9.1)
|
||||||
sprockets (2.11.3)
|
sprockets (3.4.0)
|
||||||
hike (~> 1.2)
|
rack (> 1, < 3)
|
||||||
multi_json (~> 1.0)
|
sprockets-rails (2.3.3)
|
||||||
rack (~> 1.0)
|
|
||||||
tilt (~> 1.1, != 1.3.0)
|
|
||||||
sprockets-rails (2.2.0)
|
|
||||||
actionpack (>= 3.0)
|
actionpack (>= 3.0)
|
||||||
activesupport (>= 3.0)
|
activesupport (>= 3.0)
|
||||||
sprockets (>= 2.8, < 4.0)
|
sprockets (>= 2.8, < 4.0)
|
||||||
sqlite3 (1.3.9)
|
sqlite3 (1.3.11)
|
||||||
term-ansicolor (1.3.0)
|
term-ansicolor (1.3.2)
|
||||||
tins (~> 1.0)
|
tins (~> 1.0)
|
||||||
thor (0.19.1)
|
thor (0.19.1)
|
||||||
thread_safe (0.3.4)
|
thread_safe (0.3.5)
|
||||||
tilt (1.4.1)
|
tilt (2.0.1)
|
||||||
timecop (0.7.1)
|
timecop (0.8.0)
|
||||||
timers (1.1.0)
|
tins (1.6.0)
|
||||||
tins (1.1.0)
|
transitions (0.2.1)
|
||||||
transitions (0.1.12)
|
ttfunk (1.4.0)
|
||||||
ttfunk (1.1.1)
|
turbolinks (2.5.3)
|
||||||
turbolinks (2.2.2)
|
|
||||||
coffee-rails
|
coffee-rails
|
||||||
tzinfo (1.2.2)
|
tzinfo (1.2.2)
|
||||||
thread_safe (~> 0.1)
|
thread_safe (~> 0.1)
|
||||||
uglifier (2.5.0)
|
uglifier (2.7.2)
|
||||||
execjs (>= 0.3.0)
|
execjs (>= 0.3.0)
|
||||||
json (>= 1.8.0)
|
json (>= 1.8.0)
|
||||||
user_agent_parser (2.1.5)
|
unf (0.1.4)
|
||||||
uuidtools (2.1.4)
|
unf_ext
|
||||||
|
unf_ext (0.0.7.1)
|
||||||
|
unicode_utils (1.4.0)
|
||||||
|
user_agent_parser (2.3.0)
|
||||||
|
uuidtools (2.1.5)
|
||||||
warden (1.2.3)
|
warden (1.2.3)
|
||||||
rack (>= 1.0)
|
rack (>= 1.0)
|
||||||
websocket-driver (0.3.3)
|
web-console (2.2.1)
|
||||||
whenever (0.9.2)
|
activemodel (>= 4.0)
|
||||||
activesupport (>= 2.3.4)
|
binding_of_caller (>= 0.7.2)
|
||||||
|
railties (>= 4.0)
|
||||||
|
sprockets-rails (>= 2.0, < 4.0)
|
||||||
|
websocket-driver (0.6.2)
|
||||||
|
websocket-extensions (>= 0.1.0)
|
||||||
|
websocket-extensions (0.1.2)
|
||||||
|
whenever (0.9.4)
|
||||||
chronic (>= 0.6.3)
|
chronic (>= 0.6.3)
|
||||||
xpath (2.0.0)
|
xpath (2.0.0)
|
||||||
nokogiri (~> 1.3)
|
nokogiri (~> 1.3)
|
||||||
yajl-ruby (1.2.0)
|
yajl-ruby (1.2.1)
|
||||||
|
|
||||||
PLATFORMS
|
PLATFORMS
|
||||||
ruby
|
ruby
|
||||||
|
|
@ -487,10 +545,12 @@ DEPENDENCIES
|
||||||
prawn_rails
|
prawn_rails
|
||||||
protected_attributes
|
protected_attributes
|
||||||
quiet_assets
|
quiet_assets
|
||||||
rails (~> 4.1)
|
rails (~> 4.2, >= 4.2.4)
|
||||||
|
rails-dom-testing
|
||||||
rails-observers
|
rails-observers
|
||||||
rdoc-generator-fivefish
|
rdoc-generator-fivefish
|
||||||
redcarpet
|
redcarpet
|
||||||
|
responders (~> 2.0)
|
||||||
rolify
|
rolify
|
||||||
rspec-activemodel-mocks
|
rspec-activemodel-mocks
|
||||||
rspec-rails
|
rspec-rails
|
||||||
|
|
@ -503,4 +563,8 @@ DEPENDENCIES
|
||||||
transitions
|
transitions
|
||||||
turbolinks
|
turbolinks
|
||||||
uglifier (>= 1.3.0)
|
uglifier (>= 1.3.0)
|
||||||
|
web-console (~> 2.0)
|
||||||
whenever
|
whenever
|
||||||
|
|
||||||
|
BUNDLED WITH
|
||||||
|
1.10.6
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,9 @@ fieldset {
|
||||||
margin: 20px 0 20px 0;
|
margin: 20px 0 20px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.bootstrap-switch { height: 1.7em }
|
.bootstrap-switch {
|
||||||
|
height: 1.7em
|
||||||
|
}
|
||||||
|
|
||||||
.comment-reply{
|
.comment-reply{
|
||||||
padding-top: 40px;
|
padding-top: 40px;
|
||||||
|
|
@ -72,3 +74,13 @@ p.comment-body {
|
||||||
#account-already {
|
#account-already {
|
||||||
font-size: 0.6em;
|
font-size: 0.6em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* comments views pane: use padding-bottom before next comment box */
|
||||||
|
.panel.panel-default .panel-body .notifications {
|
||||||
|
padding-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* comments views pane: use padding-bottom after each comment */
|
||||||
|
.panel.panel-default .panel-body .notifications p {
|
||||||
|
padding-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
|
||||||
30
app/controllers/admin/comments_controller.rb
Normal file
30
app/controllers/admin/comments_controller.rb
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
module Admin
|
||||||
|
class CommentsController < Admin::BaseController
|
||||||
|
load_and_authorize_resource :conference, find_by: :short_title
|
||||||
|
load_and_authorize_resource
|
||||||
|
|
||||||
|
|
||||||
|
def index
|
||||||
|
# All available comments, grouped and sorted
|
||||||
|
@comments = grouped_comments(accessible_ordered_comments)
|
||||||
|
|
||||||
|
# Grouped, sorted, available comments, posted since current_user last login
|
||||||
|
@unread_comments = grouped_comments(accessible_ordered_comments.find_since_last_login(current_user))
|
||||||
|
|
||||||
|
# Grouped, sorted, available comments, posted by current_user
|
||||||
|
@posted_comments = grouped_comments(accessible_ordered_comments.find_comments_by_user(current_user))
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
# Returning all available comments, ordered by created_at: :desc and by event.title
|
||||||
|
def accessible_ordered_comments
|
||||||
|
Comment.accessible_by(current_ability).joins('INNER JOIN events ON commentable_id = events.id').order('events.title', 'comments.created_at DESC')
|
||||||
|
end
|
||||||
|
|
||||||
|
# Grouping all comments by conference, and by event. It returns {:conference => {:event => [{comment_2}, {comment_1 }]}}
|
||||||
|
def grouped_comments(remarks)
|
||||||
|
remarks.group_by{ |comment| comment.commentable.conference }.map {|conference, comments| [conference, comments.group_by{|comment| comment.commentable}]}.to_h
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
@ -27,7 +27,6 @@ module Admin
|
||||||
@recent_users = User.limit(5).order(created_at: :desc)
|
@recent_users = User.limit(5).order(created_at: :desc)
|
||||||
@recent_events = Event.limit(5).order(created_at: :desc)
|
@recent_events = Event.limit(5).order(created_at: :desc)
|
||||||
@recent_registrations = Registration.limit(5).order(created_at: :desc)
|
@recent_registrations = Registration.limit(5).order(created_at: :desc)
|
||||||
|
|
||||||
@top_submitter = Conference.get_top_submitter
|
@top_submitter = Conference.get_top_submitter
|
||||||
|
|
||||||
@submissions = {}
|
@submissions = {}
|
||||||
|
|
|
||||||
|
|
@ -179,12 +179,12 @@ module Admin
|
||||||
def update_state(transition, notice, mail = false, subject = false, send_mail = false)
|
def update_state(transition, notice, mail = false, subject = false, send_mail = false)
|
||||||
alert = @event.update_state(transition, mail, subject, send_mail, params[:send_mail].blank?)
|
alert = @event.update_state(transition, mail, subject, send_mail, params[:send_mail].blank?)
|
||||||
|
|
||||||
if !alert.blank?
|
if alert.blank?
|
||||||
flash[:error] = error
|
|
||||||
return redirect_back_or_to(admin_conference_events_path(conference_id: @conference.short_title)) && return
|
|
||||||
else
|
|
||||||
flash[:notice] = notice
|
flash[:notice] = notice
|
||||||
redirect_back_or_to(admin_conference_events_path(conference_id: @conference.short_title)) && return
|
redirect_back_or_to(admin_conference_events_path(conference_id: @conference.short_title)) && return
|
||||||
|
else
|
||||||
|
flash[:error] = alert
|
||||||
|
return redirect_back_or_to(admin_conference_events_path(conference_id: @conference.short_title)) && return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -17,9 +17,9 @@ module Admin
|
||||||
@registration.update_attributes(registration_params)
|
@registration.update_attributes(registration_params)
|
||||||
if @registration.save
|
if @registration.save
|
||||||
redirect_to admin_conference_registrations_path(@conference.short_title),
|
redirect_to admin_conference_registrations_path(@conference.short_title),
|
||||||
notice: 'Successfully updated registration!'
|
notice: "Successfully updated registration for #{@registration.user.email}!"
|
||||||
else
|
else
|
||||||
flash[:error] = "An error prohibited the Registration for #{@conference.title}: "\
|
flash[:error] = "An error prohibited the Registration for #{@registration.user.email}: "\
|
||||||
"#{@registration.errors.full_messages.join('. ')}."
|
"#{@registration.errors.full_messages.join('. ')}."
|
||||||
render :edit
|
render :edit
|
||||||
end
|
end
|
||||||
|
|
@ -56,7 +56,7 @@ module Admin
|
||||||
permit(
|
permit(
|
||||||
:conference_id, :arrival, :departure,
|
:conference_id, :arrival, :departure,
|
||||||
:volunteer,
|
:volunteer,
|
||||||
vchoice_ids: [], qanswer_ids: [],
|
vchoice_ids: [], qanswer_ids: [], event_ids: [],
|
||||||
qanswers_attributes: [],
|
qanswers_attributes: [],
|
||||||
user_attributes: [
|
user_attributes: [
|
||||||
:id, :name, :tshirt, :mobile, :volunteer_experience, :languages,
|
:id, :name, :tshirt, :mobile, :volunteer_experience, :languages,
|
||||||
|
|
|
||||||
|
|
@ -278,4 +278,8 @@ module ApplicationHelper
|
||||||
new_user_registration_path
|
new_user_registration_path
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def unread_notifications(user)
|
||||||
|
Comment.accessible_by(current_ability).find_since_last_login(user)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -80,6 +80,22 @@ class Mailbot < ActionMailer::Base
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def send_notification_email_for_comment(comment)
|
||||||
|
@comment = comment
|
||||||
|
@event = @comment.commentable
|
||||||
|
@conference = @event.conference
|
||||||
|
recipients = User.comment_notifiable(@conference) # with scope
|
||||||
|
recipients.each do |user|
|
||||||
|
@user = user
|
||||||
|
mail(to: @user.email,
|
||||||
|
from: @conference.contact.email,
|
||||||
|
reply_to: @conference.contact.email,
|
||||||
|
template_path: 'admin/emails',
|
||||||
|
template_name: 'comment_template',
|
||||||
|
subject: "New comment has been posted for #{@event.title}")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def build_email(conference, to, subject, body)
|
def build_email(conference, to, subject, body)
|
||||||
mail(to: to,
|
mail(to: to,
|
||||||
from: conference.contact.email,
|
from: conference.contact.email,
|
||||||
|
|
|
||||||
|
|
@ -88,12 +88,13 @@ class Ability
|
||||||
# Abilities from not_signed_in and signed_in are also inherited
|
# Abilities from not_signed_in and signed_in are also inherited
|
||||||
signed_in(user)
|
signed_in(user)
|
||||||
|
|
||||||
signed_in_with_organizer_role(user)
|
signed_in_with_organizer_role(user) if user.has_role? :organizer, :any
|
||||||
signed_in_with_cfp_role(user)
|
signed_in_with_cfp_role(user) if user.has_role? :cfp, :any
|
||||||
signed_in_with_info_desk_role(user)
|
signed_in_with_info_desk_role(user) if user.has_role? :info_desk, :any
|
||||||
signed_in_with_volunteers_coordinator_role(user)
|
signed_in_with_volunteers_coordinator_role(user) if user.has_role? :volunteer_coordinator, :any
|
||||||
|
|
||||||
# for users with any role
|
# for users with any role
|
||||||
|
can :access, Admin
|
||||||
can [:show], Conference
|
can [:show], Conference
|
||||||
can :index, Commercial, commercialable_type: 'Conference'
|
can :index, Commercial, commercialable_type: 'Conference'
|
||||||
cannot [:edit, :update, :destroy], Question, global: true
|
cannot [:edit, :update, :destroy], Question, global: true
|
||||||
|
|
@ -137,6 +138,8 @@ class Ability
|
||||||
can :manage, Sponsor, conference_id: conf_ids_for_organizer
|
can :manage, Sponsor, conference_id: conf_ids_for_organizer
|
||||||
can :manage, SponsorshipLevel, conference_id: conf_ids_for_organizer
|
can :manage, SponsorshipLevel, conference_id: conf_ids_for_organizer
|
||||||
can :manage, Ticket, conference_id: conf_ids_for_organizer
|
can :manage, Ticket, conference_id: conf_ids_for_organizer
|
||||||
|
can :index, Comment, commentable_type: 'Event',
|
||||||
|
commentable_id: Event.where(conference_id: conf_ids_for_organizer).pluck(:id)
|
||||||
end
|
end
|
||||||
|
|
||||||
def signed_in_with_cfp_role(user)
|
def signed_in_with_cfp_role(user)
|
||||||
|
|
@ -155,6 +158,8 @@ class Ability
|
||||||
can :manage, CallForPaper, conference_id: conf_ids_for_cfp
|
can :manage, CallForPaper, conference_id: conf_ids_for_cfp
|
||||||
can :manage, Commercial, commercialable_type: 'Event',
|
can :manage, Commercial, commercialable_type: 'Event',
|
||||||
commercialable_id: Event.where(conference_id: conf_ids_for_cfp).pluck(:id)
|
commercialable_id: Event.where(conference_id: conf_ids_for_cfp).pluck(:id)
|
||||||
|
can :index, Comment, commentable_type: 'Event',
|
||||||
|
commentable_id: Event.where(conference_id: conf_ids_for_cfp).pluck(:id)
|
||||||
end
|
end
|
||||||
|
|
||||||
def signed_in_with_info_desk_role(user)
|
def signed_in_with_info_desk_role(user)
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ class Comment < ActiveRecord::Base
|
||||||
attr_accessible :commentable, :body, :user_id
|
attr_accessible :commentable, :body, :user_id
|
||||||
validates_presence_of :body
|
validates_presence_of :body
|
||||||
validates_presence_of :user
|
validates_presence_of :user
|
||||||
|
after_create :send_notification
|
||||||
|
|
||||||
# NOTE: install the acts_as_votable plugin if you
|
# NOTE: install the acts_as_votable plugin if you
|
||||||
# want user to vote on the quality of comments.
|
# want user to vote on the quality of comments.
|
||||||
|
|
@ -40,9 +41,18 @@ class Comment < ActiveRecord::Base
|
||||||
where(commentable_type: commentable_str.to_s, commentable_id: commentable_id).order('created_at DESC')
|
where(commentable_type: commentable_str.to_s, commentable_id: commentable_id).order('created_at DESC')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
scope :find_since_last_login, lambda { |user|
|
||||||
|
where(created_at: (user.last_sign_in_at..Time.now)).order(created_at: :desc)
|
||||||
|
}
|
||||||
# Helper class method to look up a commentable object
|
# Helper class method to look up a commentable object
|
||||||
# given the commentable class name and id
|
# given the commentable class name and id
|
||||||
def self.find_commentable(commentable_str, commentable_id)
|
def self.find_commentable(commentable_str, commentable_id)
|
||||||
commentable_str.constantize.find(commentable_id)
|
commentable_str.constantize.find(commentable_id)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def send_notification
|
||||||
|
Mailbot.delay.send_notification_email_for_comment(self)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -114,17 +114,17 @@ class Conference < ActiveRecord::Base
|
||||||
before_create :add_color
|
before_create :add_color
|
||||||
|
|
||||||
def date_range_string
|
def date_range_string
|
||||||
startstr = "Unknown - "
|
startstr = 'Unknown - '
|
||||||
endstr = "Unknown"
|
endstr = 'Unknown'
|
||||||
if start_date.month == end_date.month && start_date.year == end_date.year
|
if start_date.month == end_date.month && start_date.year == end_date.year
|
||||||
startstr = start_date.strftime("%B %d - ")
|
startstr = start_date.strftime('%B %d - ')
|
||||||
endstr = end_date.strftime("%d, %Y")
|
endstr = end_date.strftime('%d, %Y')
|
||||||
elsif start_date.month != end_date.month && start_date.year == end_date.year
|
elsif start_date.month != end_date.month && start_date.year == end_date.year
|
||||||
startstr = start_date.strftime("%B %d - ")
|
startstr = start_date.strftime('%B %d - ')
|
||||||
endstr = end_date.strftime("%B %d, %Y")
|
endstr = end_date.strftime('%B %d, %Y')
|
||||||
else
|
else
|
||||||
startstr = start_date.strftime("%B %d, %Y - ")
|
startstr = start_date.strftime('%B %d, %Y - ')
|
||||||
endstr = end_date.strftime("%B %d, %Y")
|
endstr = end_date.strftime('%B %d, %Y')
|
||||||
end
|
end
|
||||||
|
|
||||||
result = startstr + endstr
|
result = startstr + endstr
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ class EmailSettings < ActiveRecord::Base
|
||||||
h['registration_end_date'] = conference.registration_period.end_date
|
h['registration_end_date'] = conference.registration_period.end_date
|
||||||
end
|
end
|
||||||
|
|
||||||
if !event.nil?
|
if event
|
||||||
h['eventtitle'] = event.title
|
h['eventtitle'] = event.title
|
||||||
h['proposalslink'] = Rails.application.routes.url_helpers.conference_proposal_index_url(
|
h['proposalslink'] = Rails.application.routes.url_helpers.conference_proposal_index_url(
|
||||||
conference.short_title, host: CONFIG['url_for_emails'])
|
conference.short_title, host: CONFIG['url_for_emails'])
|
||||||
|
|
@ -67,6 +67,8 @@ class EmailSettings < ActiveRecord::Base
|
||||||
parse_template(conf_update_template, values)
|
parse_template(conf_update_template, values)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
def parse_template(text, values)
|
def parse_template(text, values)
|
||||||
values.each do |key, value|
|
values.each do |key, value|
|
||||||
if value.kind_of?(Date)
|
if value.kind_of?(Date)
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,9 @@ class User < ActiveRecord::Base
|
||||||
|
|
||||||
before_create :setup_role
|
before_create :setup_role
|
||||||
|
|
||||||
|
# add scope
|
||||||
|
scope :comment_notifiable, ->(conference) {joins(:roles).where('roles.name IN (?)', [:organizer, :cfp]).where('roles.resource_type = ? AND roles.resource_id = ?', 'Conference', conference.id)}
|
||||||
|
|
||||||
# Include default devise modules. Others available are:
|
# Include default devise modules. Others available are:
|
||||||
# :token_authenticatable, :confirmable,
|
# :token_authenticatable, :confirmable,
|
||||||
# :lockable, :timeoutable and :omniauthable
|
# :lockable, :timeoutable and :omniauthable
|
||||||
|
|
|
||||||
12
app/views/admin/comments/_all_comments.html.haml
Normal file
12
app/views/admin/comments/_all_comments.html.haml
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
- @comments.each do |conference, events|
|
||||||
|
.panel.panel-default
|
||||||
|
.panel-heading
|
||||||
|
%h4.title.panel-title= conference.title
|
||||||
|
.panel-body
|
||||||
|
- events.each do |event, comments|
|
||||||
|
.notifications
|
||||||
|
%h4.title= link_to event.title, admin_conference_event_path(event.conference.short_title, event)
|
||||||
|
%hr
|
||||||
|
- comments.each do |comment|
|
||||||
|
%h5.strong Posted by: #{comment.user.name} | Created at: #{comment.created_at}
|
||||||
|
%p= comment.body
|
||||||
12
app/views/admin/comments/_posted_comments.html.haml
Normal file
12
app/views/admin/comments/_posted_comments.html.haml
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
- @posted_comments.each do |conference, events|
|
||||||
|
.panel.panel-default
|
||||||
|
.panel-heading
|
||||||
|
%h4.title.panel-title= conference.title
|
||||||
|
.panel-body
|
||||||
|
- events.each do |event, comments|
|
||||||
|
.notifications
|
||||||
|
%h4.title= link_to event.title, admin_conference_event_path(event.conference.short_title, event)
|
||||||
|
%hr
|
||||||
|
- comments.each do |comment|
|
||||||
|
%h5.strong Created at: #{comment.created_at}
|
||||||
|
%p= comment.body
|
||||||
12
app/views/admin/comments/_unread_comments.html.haml
Normal file
12
app/views/admin/comments/_unread_comments.html.haml
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
- @unread_comments.each do |conference, events|
|
||||||
|
.panel.panel-default
|
||||||
|
.panel-heading
|
||||||
|
%h4.title.panel-title= conference.title
|
||||||
|
.panel-body
|
||||||
|
- events.each do |event, comments|
|
||||||
|
.notifications
|
||||||
|
%h4.title= link_to event.title, admin_conference_event_path(event.conference.short_title, event)
|
||||||
|
%hr
|
||||||
|
- comments.each do |comment|
|
||||||
|
%h5.strong Posted by: #{comment.user.name} | Created at: #{comment.created_at}
|
||||||
|
%p= comment.body
|
||||||
24
app/views/admin/comments/index.html.haml
Normal file
24
app/views/admin/comments/index.html.haml
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
%h1 Comments
|
||||||
|
%br
|
||||||
|
.row
|
||||||
|
.col-md-12
|
||||||
|
%ul.nav.nav-tabs#commentsTable
|
||||||
|
%li.active
|
||||||
|
%a{:href=>"#unread_comments", "data-toggle"=>"tab"}
|
||||||
|
%span.fa.fa-comment
|
||||||
|
Unread
|
||||||
|
%li
|
||||||
|
%a{:href=>"#posted_comments", "data-toggle"=>"tab"}
|
||||||
|
%span.fa.fa-pencil
|
||||||
|
Posted
|
||||||
|
%li
|
||||||
|
%a{:href=>"#all_comments", "data-toggle"=>"tab"}
|
||||||
|
%span.fa.fa-comments-o
|
||||||
|
All
|
||||||
|
.tab-content
|
||||||
|
.tab-pane.active#unread_comments
|
||||||
|
= render partial: 'unread_comments'
|
||||||
|
.tab-pane#posted_comments
|
||||||
|
= render partial: 'posted_comments'
|
||||||
|
.tab-pane#all_comments
|
||||||
|
= render partial: 'all_comments'
|
||||||
10
app/views/admin/emails/comment_template.text.erb
Normal file
10
app/views/admin/emails/comment_template.text.erb
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
Dear <%= @user.name %>,
|
||||||
|
|
||||||
|
User <%= @comment.user.name %> posted a new comment for event <%= @event.title %> of <%= @conference.short_title %> .
|
||||||
|
|
||||||
|
"<%= @comment.body %>"
|
||||||
|
|
||||||
|
To reply to this comment, please go to <%= h( admin_conference_event_url(@conference.short_title, @event)) %>
|
||||||
|
|
||||||
|
Best wishes,
|
||||||
|
<%= @conference.short_title %> Team
|
||||||
|
|
@ -9,6 +9,7 @@
|
||||||
%table.table.table-hover#event_types
|
%table.table.table-hover#event_types
|
||||||
%thead
|
%thead
|
||||||
%th Title
|
%th Title
|
||||||
|
%th Description
|
||||||
%th Length
|
%th Length
|
||||||
%th Abstract Length
|
%th Abstract Length
|
||||||
%th Color
|
%th Color
|
||||||
|
|
@ -18,6 +19,8 @@
|
||||||
%tr
|
%tr
|
||||||
%td
|
%td
|
||||||
= event_type.title
|
= event_type.title
|
||||||
|
%td
|
||||||
|
= event_type.description
|
||||||
%td
|
%td
|
||||||
= event_type.length
|
= event_type.length
|
||||||
Minutes
|
Minutes
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,14 @@
|
||||||
= javascript_tag "$('label[avgrate=true]').prevAll().andSelf().addClass('bright');"
|
= javascript_tag "$('label[avgrate=true]').prevAll().andSelf().addClass('bright');"
|
||||||
- else
|
- else
|
||||||
= label_tag "label_rating", "", :class => "avgrating"
|
= label_tag "label_rating", "", :class => "avgrating"
|
||||||
|
%br
|
||||||
|
- voted = event.voted?(event, current_user)
|
||||||
|
- if voted
|
||||||
|
%span.label.label-success
|
||||||
|
Your rating: #{voted.rating}
|
||||||
|
- else
|
||||||
|
%span.label.label-danger
|
||||||
|
Not rated
|
||||||
- else
|
- else
|
||||||
0/#{@conference.call_for_paper.rating}
|
0/#{@conference.call_for_paper.rating}
|
||||||
%br
|
%br
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,6 @@
|
||||||
= q.title
|
= q.title
|
||||||
|
|
||||||
%b A:
|
%b A:
|
||||||
- registration.qanswers.where(:question_id => q.id).each do |qa|
|
- registration.qanswers.where(question_id: q.id).each do |qa|
|
||||||
= qa.answer.title
|
= qa.answer.title
|
||||||
%br
|
%br
|
||||||
|
|
@ -2,25 +2,17 @@
|
||||||
.col-md-12
|
.col-md-12
|
||||||
.page-header
|
.page-header
|
||||||
%h1
|
%h1
|
||||||
Edit registration of #{@user.username} for #{@conference.short_title}
|
Registration for #{@user.username}
|
||||||
.row
|
.row
|
||||||
.col-md-8
|
.col-md-6
|
||||||
= semantic_form_for(@registration, :url => admin_conference_registration_path(@conference.short_title, @registration)) do |f|
|
= semantic_form_for(@registration, url: admin_conference_registration_path(@conference.short_title, @registration)) do |f|
|
||||||
= f.inputs 'Personal Information' do
|
= f.inputs 'Personal Information' do
|
||||||
= f.fields_for :user do |u|
|
= f.fields_for :user do |u|
|
||||||
= u.input :name, as: :string
|
= u.input :name, as: :string
|
||||||
= u.input :nickname, as: :string
|
= u.input :nickname, as: :string
|
||||||
= u.input :affiliation, placeholder: 'Company/User Group/nothing', as: :string
|
= u.input :affiliation, placeholder: 'Company/User Group/nothing', as: :string
|
||||||
= f.inputs 'Registration Information' do
|
= f.inputs 'Registration Information' do
|
||||||
- @conference.questions.each do |q|
|
= render partial: 'conference_registrations/registration_info', locals: { f: f }
|
||||||
%h5
|
|
||||||
= "Q: #{q.title}"
|
|
||||||
- if q.question_type.id == 1 || q.question_type.id == 2 # yes/no or single choice
|
|
||||||
= f.input :qanswers, :collection => q.qanswers, :as => :select, :input_html => { :multiple => false }, :label => false, :include_blank => "Please make your choice",
|
|
||||||
:member_label => Proc.new {|a| a.answer.title}
|
|
||||||
- if q.question_type.id == 3 # multiple choice
|
|
||||||
= f.input :qanswers, :collection => q.qanswers, :as => :check_boxes, :label => false,
|
|
||||||
:member_label => Proc.new {|a| a.answer.title}
|
|
||||||
|
|
||||||
-# Not necessary
|
-# Not necessary
|
||||||
- if @conference.social_events.count > 0
|
- if @conference.social_events.count > 0
|
||||||
|
|
@ -28,4 +20,4 @@
|
||||||
%br Yes, I'll be attending...
|
%br Yes, I'll be attending...
|
||||||
%br
|
%br
|
||||||
= f.input :social_events, as: :check_boxes, label: false, collection: @conference.social_events
|
= f.input :social_events, as: :check_boxes, label: false, collection: @conference.social_events
|
||||||
= f.action :submit, button_html: { value: 'Edit Registration', class: 'btn btn-primary' }
|
= f.action :submit, button_html: { class: 'btn btn-primary' }
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,8 @@
|
||||||
= "(#{@registrations.length})" if @registrations
|
= "(#{@registrations.length})" if @registrations
|
||||||
.btn-group.pull-right
|
.btn-group.pull-right
|
||||||
- if can? :read, Registration
|
- if can? :read, Registration
|
||||||
= link_to "Export PDF", admin_conference_registrations_path(@conference.short_title, :format => :pdf), :class => "btn btn-default"
|
= link_to 'Export PDF', admin_conference_registrations_path(@conference.short_title, format: :pdf), class: 'btn btn-success'
|
||||||
= link_to "Export XLS", {:format => :xlsx}, :class => "btn btn-default"
|
= link_to 'Export XLS', {format: :xlsx}, class: 'btn btn-success'
|
||||||
%p.text-muted
|
%p.text-muted
|
||||||
All the people who registered to your event
|
All the people who registered to your event
|
||||||
%table.table.table-hover.datatable#registrations
|
%table.table.table-hover.datatable#registrations
|
||||||
|
|
@ -32,12 +32,12 @@
|
||||||
= registration.email
|
= registration.email
|
||||||
%td
|
%td
|
||||||
- if registration.arrival
|
- if registration.arrival
|
||||||
= registration.arrival.strftime("%d %b %H:%M")
|
= registration.arrival.strftime('%d %b %H:%M')
|
||||||
- else
|
- else
|
||||||
n/a
|
n/a
|
||||||
%td
|
%td
|
||||||
- if registration.departure
|
- if registration.departure
|
||||||
= registration.departure.strftime("%d %b %H:%M")
|
= registration.departure.strftime('%d %b %H:%M')
|
||||||
- else
|
- else
|
||||||
n/a
|
n/a
|
||||||
-if @conference.questions.any?
|
-if @conference.questions.any?
|
||||||
|
|
@ -47,7 +47,7 @@
|
||||||
= check_box_tag "#{@conference.short_title}_#{registration.id}", registration.id, registration.attended,
|
= check_box_tag "#{@conference.short_title}_#{registration.id}", registration.id, registration.attended,
|
||||||
class: 'switch-checkbox', method: :patch,
|
class: 'switch-checkbox', method: :patch,
|
||||||
url: toggle_attendance_admin_conference_registration_path(@conference.short_title, id: registration.id)+"?attended=",
|
url: toggle_attendance_admin_conference_registration_path(@conference.short_title, id: registration.id)+"?attended=",
|
||||||
data: { size: "small",
|
data: { size: 'small',
|
||||||
on_color: 'success',
|
on_color: 'success',
|
||||||
off_color: 'warning',
|
off_color: 'warning',
|
||||||
on_text: 'Present',
|
on_text: 'Present',
|
||||||
|
|
@ -61,7 +61,7 @@
|
||||||
.questions{class: "question#{index}", style: 'display:none;'}
|
.questions{class: "question#{index}", style: 'display:none;'}
|
||||||
= render partial: 'questions', locals: { registration: registration }
|
= render partial: 'questions', locals: { registration: registration }
|
||||||
|
|
||||||
.modal.fade{ id: "questions", 'role' => 'dialog', 'aria-hidden' => 'true' }
|
.modal.fade{ id: 'questions', 'role' => 'dialog', 'aria-hidden' => 'true' }
|
||||||
.modal-dialog
|
.modal-dialog
|
||||||
.modal-content
|
.modal-content
|
||||||
.modal-header
|
.modal-header
|
||||||
|
|
|
||||||
|
|
@ -4,19 +4,19 @@
|
||||||
.page-header
|
.page-header
|
||||||
%h2 Upcoming Conferences
|
%h2 Upcoming Conferences
|
||||||
- @current.each do |conference|
|
- @current.each do |conference|
|
||||||
= render :partial => "conference_details", :locals => {:conference => conference}
|
= render partial: 'conference_details', locals: { conference: conference }
|
||||||
-if @antiquated and @antiquated.any?
|
-if @antiquated and @antiquated.any?
|
||||||
.row
|
.row
|
||||||
.col-md-12
|
.col-md-12
|
||||||
%p.text-right
|
%p.text-right
|
||||||
%button{:type=>"button", :class=>"btn btn-link btn-sm", "data-toggle"=>"collapse", "data-target"=>"#antiquated", "aria-expanded"=>"true", "aria-controls"=>"antiquated"}
|
%button{ type: 'button', class: 'btn btn-link btn-sm', 'data-toggle' => 'collapse', 'data-target' => '#antiquated', 'aria-expanded' => 'true', 'aria-controls' => 'antiquated'}
|
||||||
Older conferences
|
Older conferences
|
||||||
= "(#{@antiquated.count})"
|
= "(#{@antiquated.count})"
|
||||||
%i.fa.fa-chevron-right
|
%i.fa.fa-chevron-right
|
||||||
%i.fa.fa-chevron-down{:style => 'display: none'}
|
%i.fa.fa-chevron-down{ style: 'display: none' }
|
||||||
#antiquated.collapse
|
#antiquated.collapse
|
||||||
- @antiquated.each do |conference|
|
- @antiquated.each do |conference|
|
||||||
= render :partial => "conference_details", :locals => {:conference => conference}
|
= render partial: 'conference_details', locals: { conference: conference}
|
||||||
|
|
||||||
-content_for :script_body do
|
-content_for :script_body do
|
||||||
:javascript
|
:javascript
|
||||||
|
|
|
||||||
|
|
@ -21,14 +21,7 @@
|
||||||
= semantic_form_for(@registration, url: conference_conference_registrations_path(@conference.short_title)) do |f|
|
= semantic_form_for(@registration, url: conference_conference_registrations_path(@conference.short_title)) do |f|
|
||||||
= render partial: 'devise/shared/sign_up_form_embedded'
|
= render partial: 'devise/shared/sign_up_form_embedded'
|
||||||
|
|
||||||
- if @conference.questions.any?
|
= render partial: 'registration_info', locals: { f: f }
|
||||||
= render partial: 'questions', locals: { f: f }
|
|
||||||
- if @conference.events.workshops.any?
|
|
||||||
=f.inputs 'Register to Workshops' do
|
|
||||||
= f.input :events, as: :check_boxes, label: false, collection: @conference.events.workshops
|
|
||||||
= f.inputs 'Your Travel Info' do
|
|
||||||
= f.input :arrival, as: :string, label: 'Your arrival time', input_html: { value: (f.object.arrival.to_formatted_s(:db_without_seconds) unless f.object.arrival.nil?), id: 'registration-arrival-datepicker', readonly: 'readonly' }
|
|
||||||
= f.input :departure, as: :string, label: 'Your departure time', input_html: { value: (f.object.departure.to_formatted_s(:db_without_seconds) unless f.object.departure.nil?), id: 'registration-departure-datepicker', readonly: 'readonly' }
|
|
||||||
.row
|
.row
|
||||||
.col-md-12
|
.col-md-12
|
||||||
%p.pull-right
|
%p.pull-right
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
- if @conference.questions.any?
|
||||||
|
= render partial: 'conference_registrations/questions', locals: { f: f }
|
||||||
|
- if @conference.events.workshops.any?
|
||||||
|
=f.inputs 'Pre-registration required for the following:' do
|
||||||
|
= f.input :events, as: :check_boxes, label: false, collection: @conference.events.workshops
|
||||||
|
= f.inputs 'Your Travel Info' do
|
||||||
|
= f.input :arrival, as: :string, label: 'Your arrival time', input_html: { value: (f.object.arrival.to_formatted_s(:db_without_seconds) unless f.object.arrival.nil?), id: 'registration-arrival-datepicker', readonly: 'readonly' }
|
||||||
|
= f.input :departure, as: :string, label: 'Your departure time', input_html: { value: (f.object.departure.to_formatted_s(:db_without_seconds) unless f.object.departure.nil?), id: 'registration-departure-datepicker', readonly: 'readonly' }
|
||||||
|
|
@ -29,9 +29,14 @@
|
||||||
Dashboard
|
Dashboard
|
||||||
- if can? :show, @conference
|
- if can? :show, @conference
|
||||||
%li{:class=> "#{active_nav_li(edit_admin_conference_path(@conference.short_title))}"}
|
%li{:class=> "#{active_nav_li(edit_admin_conference_path(@conference.short_title))}"}
|
||||||
|
- if can? :edit, @conference
|
||||||
= link_to(edit_admin_conference_path(@conference.short_title)) do
|
= link_to(edit_admin_conference_path(@conference.short_title)) do
|
||||||
%span.fa.fa-home
|
%span.fa.fa-home
|
||||||
Basics
|
Basics
|
||||||
|
- else
|
||||||
|
%a
|
||||||
|
%span.fa.fa-home
|
||||||
|
Basics
|
||||||
%ul
|
%ul
|
||||||
- if can? :update, Contact.new(conference_id: @conference.id)
|
- if can? :update, Contact.new(conference_id: @conference.id)
|
||||||
%li{:class=> "#{active_nav_li(edit_admin_conference_contact_path(@conference.short_title))}"}
|
%li{:class=> "#{active_nav_li(edit_admin_conference_contact_path(@conference.short_title))}"}
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@
|
||||||
%ul.nav.navbar-nav#splash-nav
|
%ul.nav.navbar-nav#splash-nav
|
||||||
= content_for :splash_nav
|
= content_for :splash_nav
|
||||||
-if user_signed_in?
|
-if user_signed_in?
|
||||||
|
.btn-group.pull-right
|
||||||
%ul.nav.navbar-nav.navbar-right
|
%ul.nav.navbar-nav.navbar-right
|
||||||
%li.dropdown
|
%li.dropdown
|
||||||
%a.dropdown-toggle{"data-toggle" => "dropdown", :href => "#", id: "current-user-detail"}
|
%a.dropdown-toggle{"data-toggle" => "dropdown", :href => "#", id: "current-user-detail"}
|
||||||
|
|
@ -24,6 +25,22 @@
|
||||||
%b.caret
|
%b.caret
|
||||||
%ul.dropdown-menu
|
%ul.dropdown-menu
|
||||||
= render 'layouts/user_menu'
|
= render 'layouts/user_menu'
|
||||||
|
- if can? :index, Comment
|
||||||
|
%ul.nav.navbar-nav.navbar-right
|
||||||
|
%li.dropdown
|
||||||
|
%a.dropdown-toggle{"data-toggle" => "dropdown", :href => "#"}
|
||||||
|
- if unread_notifications(current_user)
|
||||||
|
Notifications (#{unread_notifications(current_user).length})
|
||||||
|
%span.fa.fa-comment
|
||||||
|
%b.caret
|
||||||
|
%ul.dropdown-menu
|
||||||
|
- if unread_notifications(current_user).length > 0
|
||||||
|
%li.dropdown-header Last 5 Comments for:
|
||||||
|
- unread_notifications(current_user).limit(5).group_by{ |comment| comment.commentable}.each do |event, comments|
|
||||||
|
%li= link_to("#{event.title}(#{comments.count})", admin_conference_event_path(event.conference.short_title, event.id))
|
||||||
|
%li.divider
|
||||||
|
%li= link_to "See all unread Comments (#{unread_notifications(current_user).length})", admin_comments_path
|
||||||
|
%li= link_to 'See all Comments', admin_comments_path(anchor: 'all_comments')
|
||||||
- else
|
- else
|
||||||
%ul.nav.navbar-nav.navbar-right
|
%ul.nav.navbar-nav.navbar-right
|
||||||
- if CONFIG['authentication']['ichain']['enabled']
|
- if CONFIG['authentication']['ichain']['enabled']
|
||||||
|
|
|
||||||
2
app/views/layouts/_unread_comment.html.haml
Normal file
2
app/views/layouts/_unread_comment.html.haml
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
%li= link_to("New comment for: #{unread_comment.commentable.title}", admin_conference_event_path(unread_comment.commentable.conference.short_title, unread_comment.commentable_id))
|
||||||
|
|
||||||
|
|
@ -21,14 +21,15 @@
|
||||||
= link_to(destroy_user_session_path, :method=>'delete') do
|
= link_to(destroy_user_session_path, :method=>'delete') do
|
||||||
%span.fa.fa-minus
|
%span.fa.fa-minus
|
||||||
Sign out
|
Sign out
|
||||||
- if can? :manage, Conference
|
- if can? :access, Admin
|
||||||
%li.divider
|
%li.divider
|
||||||
%li
|
%li
|
||||||
= link_to(admin_conference_index_path()) do
|
|
||||||
- if Conference.any?
|
- if Conference.any?
|
||||||
|
= link_to(admin_conference_index_path()) do
|
||||||
%span.fa.fa-home
|
%span.fa.fa-home
|
||||||
Administration
|
Administration
|
||||||
- else
|
- if can? :create, Conference
|
||||||
|
=link_to(new_admin_conference_path) do
|
||||||
%span.fa.fa-plus
|
%span.fa.fa-plus
|
||||||
Create Conference
|
Create Conference
|
||||||
-if @conference and @conference.id and can? :show, @conference
|
-if @conference and @conference.id and can? :show, @conference
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,9 @@
|
||||||
.tabbable
|
.tabbable
|
||||||
%ul.nav.nav-tabs
|
%ul.nav.nav-tabs
|
||||||
%li.active
|
%li.active
|
||||||
= link_to "Proposal", "#proposal-content", "data-toggle"=>"tab"
|
= link_to 'Proposal', '#proposal-content', 'data-toggle' => 'tab'
|
||||||
%li
|
%li
|
||||||
= link_to 'Commercials', '#commercials-content', 'data-toggle'=>'tab'
|
= link_to 'Commercials', '#commercials-content', 'data-toggle' => 'tab'
|
||||||
.tab-content
|
.tab-content
|
||||||
#proposal-content.tab-pane.active
|
#proposal-content.tab-pane.active
|
||||||
= render 'proposal/proposal_form'
|
= render 'proposal/proposal_form'
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
= link_to 'Edit', edit_conference_proposal_commercial_path(@conference.short_title, @event.id, commercial.id), class: 'btn btn-primary'
|
= link_to 'Edit', edit_conference_proposal_commercial_path(@conference.short_title, @event.id, commercial.id), class: 'btn btn-primary'
|
||||||
- if can? :destroy, commercial
|
- if can? :destroy, commercial
|
||||||
= link_to 'Delete', conference_proposal_commercial_path(@conference.short_title, @event.id, commercial.id),
|
= link_to 'Delete', conference_proposal_commercial_path(@conference.short_title, @event.id, commercial.id),
|
||||||
:method => :delete, :data => { :confirm => 'Are you sure?' }, class: 'btn btn-danger'
|
method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-danger'
|
||||||
- if can? :create, @event.commercials.new
|
- if can? :create, @event.commercials.new
|
||||||
%hr
|
%hr
|
||||||
= link_to 'Add Commercial', new_conference_proposal_commercial_path(@conference.short_title, @event.id), class: 'btn btn-primary'
|
= link_to 'Add Commercial', new_conference_proposal_commercial_path(@conference.short_title, @event.id), class: 'btn btn-primary'
|
||||||
|
|
|
||||||
|
|
@ -43,11 +43,11 @@
|
||||||
= f.input :is_highlight
|
= f.input :is_highlight
|
||||||
|
|
||||||
%p.text-right
|
%p.text-right
|
||||||
= link_to '#description', "data-toggle"=>"collapse" do
|
= link_to '#description', 'data-toggle' => 'collapse' do
|
||||||
Do you require something special?
|
Do you require something special?
|
||||||
.collapse#description
|
.collapse#description
|
||||||
= f.input :description, input_html: { rows: 5 }, label: 'Requirements', placeholder: 'Eg. Whiteboard, printer, or something like that.'
|
= f.input :description, input_html: { rows: 5 }, label: 'Requirements', placeholder: 'Eg. Whiteboard, printer, or something like that.'
|
||||||
|
|
||||||
|
|
||||||
%p.text-right
|
%p.text-right
|
||||||
= f.action :submit, :as => :button, :button_html => {:class => "btn btn-success"}, label: 'Update Proposal'
|
= f.submit 'Update Proposal', class: 'btn btn-success'
|
||||||
|
|
|
||||||
|
|
@ -11,11 +11,11 @@
|
||||||
- if !current_user
|
- if !current_user
|
||||||
%legend
|
%legend
|
||||||
%span
|
%span
|
||||||
=link_to('#signup', role: 'tab', "aria-controls" => "home", "data-toggle" => "tab") do
|
=link_to('#signup', role: 'tab', 'aria-controls' => 'home', 'data-toggle' => 'tab') do
|
||||||
= CONFIG['name']
|
= CONFIG['name']
|
||||||
Account
|
Account
|
||||||
%span.pull-right#account-already
|
%span.pull-right#account-already
|
||||||
=link_to('#signin', role: 'tab', "aria-controls" => "home", "data-toggle" => "tab") do
|
=link_to('#signin', role: 'tab', 'aria-controls' => 'home', 'data-toggle' => 'tab') do
|
||||||
Already have an account?
|
Already have an account?
|
||||||
.tab-content
|
.tab-content
|
||||||
.tab-pane.active{role: 'tabpanel', id: 'signup'}
|
.tab-pane.active{role: 'tabpanel', id: 'signup'}
|
||||||
|
|
@ -25,7 +25,7 @@
|
||||||
= render partial: 'devise/shared/sign_up_form_embedded'
|
= render partial: 'devise/shared/sign_up_form_embedded'
|
||||||
|
|
||||||
= f.inputs name: 'Proposal Information' do
|
= f.inputs name: 'Proposal Information' do
|
||||||
= f.input :title, as: :string, required: true
|
= f.input :title, as: :string, required: true, input_html: { required: true }
|
||||||
= f.input :event_type_id, as: :select,
|
= f.input :event_type_id, as: :select,
|
||||||
collection: @conference.event_types.map {|type| ["#{type.title} - #{show_time(type.length)}", type.id,
|
collection: @conference.event_types.map {|type| ["#{type.title} - #{show_time(type.length)}", type.id,
|
||||||
data: { min_words: type.minimum_abstract_length, max_words: type.maximum_abstract_length }]},
|
data: { min_words: type.minimum_abstract_length, max_words: type.maximum_abstract_length }]},
|
||||||
|
|
@ -38,7 +38,7 @@
|
||||||
:javascript
|
:javascript
|
||||||
$("##{@conference.event_types.first.id}-help").collapse('show');
|
$("##{@conference.event_types.first.id}-help").collapse('show');
|
||||||
|
|
||||||
= f.input :abstract, input_html: { rows: 5 },
|
= f.input :abstract, input_html: { rows: 5, required: true },
|
||||||
required: true, hint: link_to('Tips to improve your presentations', 'http://blog.hubspot.com/blog/tabid/6307/bid/5975/10-Rules-to-Instantly-Improve-Your-Presentations.aspx')
|
required: true, hint: link_to('Tips to improve your presentations', 'http://blog.hubspot.com/blog/tabid/6307/bid/5975/10-Rules-to-Instantly-Improve-Your-Presentations.aspx')
|
||||||
|
|
||||||
%p
|
%p
|
||||||
|
|
@ -55,12 +55,13 @@
|
||||||
= f.input :require_registration, label: 'Require participants to register to your event'
|
= f.input :require_registration, label: 'Require participants to register to your event'
|
||||||
|
|
||||||
%p.text-right
|
%p.text-right
|
||||||
= link_to '#description', "data-toggle"=>"collapse", id: 'description_link' do
|
= link_to '#description', 'data-toggle' => 'collapse', id: 'description_link' do
|
||||||
Do you require something special?
|
Do you require something special?
|
||||||
.collapse#description
|
.collapse#description
|
||||||
= f.input :description, input_html: { rows: 5 }, label: 'Requirements', placeholder: 'Eg. Whiteboard, printer, or something like that.'
|
= f.input :description, input_html: { rows: 5 }, label: 'Requirements', placeholder: 'Eg. Whiteboard, printer, or something like that.'
|
||||||
|
|
||||||
%p.text-right
|
%p.text-right
|
||||||
= f.action :submit, :as => :button, :button_html => {:class => "btn btn-success"}, label: 'Create Proposal'
|
= f.submit 'Create Proposal', class: 'btn btn-success'
|
||||||
|
|
||||||
.tab-pane{role: 'tabpanel', id: 'signin'}
|
.tab-pane{role: 'tabpanel', id: 'signin'}
|
||||||
= render partial: 'devise/shared/sign_in_form_embedded'
|
= render partial: 'devise/shared/sign_in_form_embedded'
|
||||||
|
|
|
||||||
3
bin/bundle
Executable file
3
bin/bundle
Executable file
|
|
@ -0,0 +1,3 @@
|
||||||
|
#!/usr/bin/env ruby
|
||||||
|
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
|
||||||
|
load Gem.bin_path('bundler', 'bundle')
|
||||||
|
|
@ -1,6 +1,4 @@
|
||||||
#!/usr/bin/env ruby
|
#!/usr/bin/env ruby
|
||||||
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
|
|
||||||
|
|
||||||
APP_PATH = File.expand_path('../../config/application', __FILE__)
|
APP_PATH = File.expand_path('../../config/application', __FILE__)
|
||||||
require File.expand_path('../../config/boot', __FILE__)
|
require_relative '../config/boot'
|
||||||
require 'rails/commands'
|
require 'rails/commands'
|
||||||
|
|
|
||||||
4
bin/rake
Executable file
4
bin/rake
Executable file
|
|
@ -0,0 +1,4 @@
|
||||||
|
#!/usr/bin/env ruby
|
||||||
|
require_relative '../config/boot'
|
||||||
|
require 'rake'
|
||||||
|
Rake.application.run
|
||||||
29
bin/setup
Executable file
29
bin/setup
Executable file
|
|
@ -0,0 +1,29 @@
|
||||||
|
#!/usr/bin/env ruby
|
||||||
|
require 'pathname'
|
||||||
|
|
||||||
|
# path to your application root.
|
||||||
|
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
|
||||||
|
|
||||||
|
Dir.chdir APP_ROOT do
|
||||||
|
# This script is a starting point to setup your application.
|
||||||
|
# Add necessary setup steps to this file:
|
||||||
|
|
||||||
|
puts "== Installing dependencies =="
|
||||||
|
system "gem install bundler --conservative"
|
||||||
|
system "bundle check || bundle install"
|
||||||
|
|
||||||
|
# puts "\n== Copying sample files =="
|
||||||
|
# unless File.exist?("config/database.yml")
|
||||||
|
# system "cp config/database.yml.sample config/database.yml"
|
||||||
|
# end
|
||||||
|
|
||||||
|
puts "\n== Preparing database =="
|
||||||
|
system "bin/rake db:setup"
|
||||||
|
|
||||||
|
puts "\n== Removing old logs and tempfiles =="
|
||||||
|
system "rm -f log/*"
|
||||||
|
system "rm -rf tmp/cache"
|
||||||
|
|
||||||
|
puts "\n== Restarting application server =="
|
||||||
|
system "touch tmp/restart.txt"
|
||||||
|
end
|
||||||
|
|
@ -37,6 +37,9 @@ module Osem
|
||||||
|
|
||||||
# Configure the default encoding used in templates for Ruby 1.9.
|
# Configure the default encoding used in templates for Ruby 1.9.
|
||||||
config.encoding = 'utf-8'
|
config.encoding = 'utf-8'
|
||||||
|
# Do not swallow errors in after_commit/after_rollback callbacks.
|
||||||
|
config.active_record.raise_in_transactional_callbacks = true
|
||||||
|
|
||||||
|
|
||||||
# Configure sensitive parameters which will be filtered from the log file.
|
# Configure sensitive parameters which will be filtered from the log file.
|
||||||
config.filter_parameters += [:password]
|
config.filter_parameters += [:password]
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
# Set up gems listed in the Gemfile.
|
|
||||||
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
|
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
|
||||||
|
|
||||||
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
|
require 'bundler/setup' # Set up gems listed in the Gemfile.
|
||||||
|
|
|
||||||
|
|
@ -35,8 +35,9 @@ Osem::Application.configure do
|
||||||
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
||||||
# config.force_ssl = true
|
# config.force_ssl = true
|
||||||
|
|
||||||
# See everything in the log (default is :info)
|
# See everything in the log. Set to `:info` to match the current default, or set to `:debug` to opt-into
|
||||||
# config.log_level = :debug
|
# the future default.
|
||||||
|
config.log_level = :info
|
||||||
|
|
||||||
# Prepend all log lines with the following tags
|
# Prepend all log lines with the following tags
|
||||||
# config.log_tags = [ :subdomain, :uuid ]
|
# config.log_tags = [ :subdomain, :uuid ]
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,9 @@ Osem::Application.configure do
|
||||||
# Print deprecation notices to the stderr
|
# Print deprecation notices to the stderr
|
||||||
config.active_support.deprecation = :stderr
|
config.active_support.deprecation = :stderr
|
||||||
|
|
||||||
|
# Randomize/sort the order test cases are executed.
|
||||||
|
config.active_support.test_order = :sorted # or `:random`
|
||||||
|
|
||||||
# Set the detault url for action mailer
|
# Set the detault url for action mailer
|
||||||
config.action_mailer.default_url_options = { host: 'localhost:3000' }
|
config.action_mailer.default_url_options = { host: 'localhost:3000' }
|
||||||
|
|
||||||
|
|
|
||||||
11
config/initializers/assets.rb
Normal file
11
config/initializers/assets.rb
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
# Be sure to restart your server when you modify this file.
|
||||||
|
|
||||||
|
# Version of your assets, change this if you want to expire all your assets.
|
||||||
|
Rails.application.config.assets.version = '1.0'
|
||||||
|
|
||||||
|
# Add additional assets to the asset load path
|
||||||
|
# Rails.application.config.assets.paths << Emoji.images_path
|
||||||
|
|
||||||
|
# Precompile additional assets.
|
||||||
|
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
|
||||||
|
# Rails.application.config.assets.precompile += %w( search.js )
|
||||||
3
config/initializers/cookies_serializer.rb
Normal file
3
config/initializers/cookies_serializer.rb
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
# Be sure to restart your server when you modify this file.
|
||||||
|
|
||||||
|
Rails.application.config.action_dispatch.cookies_serializer = :marshal
|
||||||
4
config/initializers/filter_parameter_logging.rb
Normal file
4
config/initializers/filter_parameter_logging.rb
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
# Be sure to restart your server when you modify this file.
|
||||||
|
|
||||||
|
# Configure sensitive parameters which will be filtered from the log file.
|
||||||
|
Rails.application.config.filter_parameters += [:password]
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
# Be sure to restart your server when you modify this file.
|
# Be sure to restart your server when you modify this file.
|
||||||
#
|
|
||||||
# This file contains settings for ActionController::ParamsWrapper which
|
# This file contains settings for ActionController::ParamsWrapper which
|
||||||
# is enabled by default.
|
# is enabled by default.
|
||||||
|
|
||||||
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
|
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
|
||||||
ActiveSupport.on_load(:action_controller) do
|
ActiveSupport.on_load(:action_controller) do
|
||||||
wrap_parameters format: [:json]
|
wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Disable root element in JSON by default.
|
# To enable root element in JSON for ActiveRecord objects.
|
||||||
ActiveSupport.on_load(:active_record) do
|
# ActiveSupport.on_load(:active_record) do
|
||||||
self.include_root_in_json = false
|
# self.include_root_in_json = true
|
||||||
end
|
# end
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ Osem::Application.routes.draw do
|
||||||
namespace :admin do
|
namespace :admin do
|
||||||
resources :users
|
resources :users
|
||||||
resources :people
|
resources :people
|
||||||
|
resources :comments, only: [:index]
|
||||||
resources :conference do
|
resources :conference do
|
||||||
member do
|
member do
|
||||||
get :roles
|
get :roles
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
class ChangePostalcodeFormatInVenues < ActiveRecord::Migration
|
||||||
|
def up
|
||||||
|
change_column :venues, :postalcode, :string
|
||||||
|
end
|
||||||
|
|
||||||
|
def down
|
||||||
|
raise ActiveRecord::IrreversibleMigration.new('Cannot reverse migration.')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
#
|
#
|
||||||
# It's strongly recommended that you check this file into your version control system.
|
# It's strongly recommended that you check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema.define(version: 20150415121038) do
|
ActiveRecord::Schema.define(version: 20150929142405) do
|
||||||
|
|
||||||
create_table "ahoy_events", force: true do |t|
|
create_table "ahoy_events", force: true do |t|
|
||||||
t.uuid "visit_id"
|
t.uuid "visit_id"
|
||||||
|
|
@ -515,7 +515,7 @@ ActiveRecord::Schema.define(version: 20150415121038) do
|
||||||
t.integer "photo_file_size"
|
t.integer "photo_file_size"
|
||||||
t.datetime "photo_updated_at"
|
t.datetime "photo_updated_at"
|
||||||
t.string "street"
|
t.string "street"
|
||||||
t.integer "postalcode"
|
t.string "postalcode"
|
||||||
t.string "city"
|
t.string "city"
|
||||||
t.string "country"
|
t.string "country"
|
||||||
t.string "latitude"
|
t.string "latitude"
|
||||||
|
|
|
||||||
59
spec/controllers/admin/comments_controller_spec.rb
Normal file
59
spec/controllers/admin/comments_controller_spec.rb
Normal file
|
|
@ -0,0 +1,59 @@
|
||||||
|
require 'spec_helper'
|
||||||
|
|
||||||
|
describe Admin::CommentsController, type: :controller do
|
||||||
|
|
||||||
|
# It is necessary to use bang version of let to build roles before user
|
||||||
|
let(:conference) { create(:conference) }
|
||||||
|
let!(:first_user) { create(:user) }
|
||||||
|
let!(:organizer_role) { create(:role, name: 'organizer', resource: conference) }
|
||||||
|
let(:organizer) { create(:user, role_ids: organizer_role.id, last_sign_in_at: Time.now - 1.day) }
|
||||||
|
let(:participant) { create(:user) }
|
||||||
|
let(:event) { create(:event, conference: conference) }
|
||||||
|
let(:comment) { create(:comment, commentable_type: 'Event', commentable_id: event.id) }
|
||||||
|
|
||||||
|
context 'not logged in user' do
|
||||||
|
describe 'GET #index' do
|
||||||
|
it 'renders the :index template' do
|
||||||
|
comment
|
||||||
|
get :index
|
||||||
|
expect(response).to redirect_to(user_session_path)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'logged in as admin, organizer or cfp' do
|
||||||
|
before :each do
|
||||||
|
sign_in(organizer)
|
||||||
|
comment
|
||||||
|
end
|
||||||
|
describe 'GET #index' do
|
||||||
|
it 'populates a hash with comments' do
|
||||||
|
get :index
|
||||||
|
expect(assigns(:comments)).to be_a(Hash)
|
||||||
|
# assigns(:comments).first returns an array of first pair key-value from hash.
|
||||||
|
# Calling again 'first' returns the key, meaning the Conference object.
|
||||||
|
expect(assigns(:comments).first.first.title).to eq(comment.commentable.conference.title)
|
||||||
|
end
|
||||||
|
it 'has status 200: OK' do
|
||||||
|
get :index
|
||||||
|
expect(response).to have_http_status(:ok)
|
||||||
|
end
|
||||||
|
it 'renders the :index template' do
|
||||||
|
get :index
|
||||||
|
expect(response).to render_template(:index)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'logged in with any other role or normal user' do
|
||||||
|
describe 'GET#index' do
|
||||||
|
it 'requires organizer privileges' do
|
||||||
|
sign_in(participant)
|
||||||
|
comment
|
||||||
|
get :index
|
||||||
|
expect(response).to redirect_to(root_path)
|
||||||
|
expect(flash[:alert]).to match('You are not authorized to access this area!')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
9
spec/factories/comments.rb
Normal file
9
spec/factories/comments.rb
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
# Read about factories at https://github.com/thoughtbot/factory_girl
|
||||||
|
|
||||||
|
FactoryGirl.define do
|
||||||
|
factory :comment do
|
||||||
|
body 'Most interresting comment ever, created by a girl.'
|
||||||
|
user
|
||||||
|
association :commentable, factory: :event
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
@ -47,6 +47,7 @@ FactoryGirl.define do
|
||||||
event.difficulty_level = build(:difficulty_level, conference: event.conference)
|
event.difficulty_level = build(:difficulty_level, conference: event.conference)
|
||||||
event.track = build(:track, conference: event.conference)
|
event.track = build(:track, conference: event.conference)
|
||||||
event.room = build(:room, conference: event.conference)
|
event.room = build(:room, conference: event.conference)
|
||||||
|
event.comment_threads << build(:comment, commentable: event)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,8 @@ feature 'Has correct abilities' do
|
||||||
visit admin_conference_path(conference2.short_title)
|
visit admin_conference_path(conference2.short_title)
|
||||||
|
|
||||||
expect(page).to have_selector('li.nav-header.nav-header-bigger a', text: 'Dashboard')
|
expect(page).to have_selector('li.nav-header.nav-header-bigger a', text: 'Dashboard')
|
||||||
expect(page).to have_link('Basics', href: "/admin/conference/#{conference2.short_title}/edit")
|
expect(page).to_not have_link('Basics', href: "/admin/conference/#{conference2.short_title}/edit")
|
||||||
|
expect(page).to have_text('Basics')
|
||||||
expect(page).to_not have_link('Contact', href: "/admin/conference/#{conference2.short_title}/contact/edit")
|
expect(page).to_not have_link('Contact', href: "/admin/conference/#{conference2.short_title}/contact/edit")
|
||||||
expect(page).to have_link('Commercials', href: "/admin/conference/#{conference2.short_title}/commercials")
|
expect(page).to have_link('Commercials', href: "/admin/conference/#{conference2.short_title}/commercials")
|
||||||
expect(page).to have_link('Events', href: "/admin/conference/#{conference2.short_title}/events")
|
expect(page).to have_link('Events', href: "/admin/conference/#{conference2.short_title}/events")
|
||||||
|
|
@ -176,7 +177,8 @@ feature 'Has correct abilities' do
|
||||||
visit admin_conference_path(conference3.short_title)
|
visit admin_conference_path(conference3.short_title)
|
||||||
|
|
||||||
expect(page).to have_selector('li.nav-header.nav-header-bigger a', text: 'Dashboard')
|
expect(page).to have_selector('li.nav-header.nav-header-bigger a', text: 'Dashboard')
|
||||||
expect(page).to have_link('Basics', href: "/admin/conference/#{conference3.short_title}/edit")
|
expect(page).to_not have_link('Basics', href: "/admin/conference/#{conference2.short_title}/edit")
|
||||||
|
expect(page).to have_text('Basics')
|
||||||
expect(page).to_not have_link('Contact', href: "/admin/conference/#{conference3.short_title}/contact/edit")
|
expect(page).to_not have_link('Contact', href: "/admin/conference/#{conference3.short_title}/contact/edit")
|
||||||
expect(page).to have_link('Commercials', href: "/admin/conference/#{conference3.short_title}/commercials")
|
expect(page).to have_link('Commercials', href: "/admin/conference/#{conference3.short_title}/commercials")
|
||||||
expect(page).to_not have_link('Events', href: "/admin/conference/#{conference3.short_title}/events")
|
expect(page).to_not have_link('Events', href: "/admin/conference/#{conference3.short_title}/events")
|
||||||
|
|
|
||||||
|
|
@ -141,6 +141,8 @@ describe 'User' do
|
||||||
it{ should_not be_able_to(:manage, other_event.difficulty_level) }
|
it{ should_not be_able_to(:manage, other_event.difficulty_level) }
|
||||||
it{ should be_able_to(:manage, event.commercials.first) }
|
it{ should be_able_to(:manage, event.commercials.first) }
|
||||||
it{ should_not be_able_to(:manage, other_event.commercials.first) }
|
it{ should_not be_able_to(:manage, other_event.commercials.first) }
|
||||||
|
it{ should be_able_to(:index, event.comment_threads.first) }
|
||||||
|
it{ should_not be_able_to(:index, other_event.comment_threads.first) }
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when user has the role cfp' do
|
context 'when user has the role cfp' do
|
||||||
|
|
@ -198,6 +200,8 @@ describe 'User' do
|
||||||
it{ should_not be_able_to(:manage, other_event.difficulty_level) }
|
it{ should_not be_able_to(:manage, other_event.difficulty_level) }
|
||||||
it{ should be_able_to(:manage, event.commercials.first) }
|
it{ should be_able_to(:manage, event.commercials.first) }
|
||||||
it{ should_not be_able_to(:manage, other_event.commercials.first) }
|
it{ should_not be_able_to(:manage, other_event.commercials.first) }
|
||||||
|
it{ should be_able_to(:index, event.comment_threads.first) }
|
||||||
|
it{ should_not be_able_to(:index, other_event.comment_threads.first) }
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when user has the role info_desk' do
|
context 'when user has the role info_desk' do
|
||||||
|
|
@ -255,6 +259,8 @@ describe 'User' do
|
||||||
it{ should_not be_able_to(:manage, other_event.difficulty_level) }
|
it{ should_not be_able_to(:manage, other_event.difficulty_level) }
|
||||||
it{ should_not be_able_to(:manage, event.commercials.first) }
|
it{ should_not be_able_to(:manage, event.commercials.first) }
|
||||||
it{ should_not be_able_to(:manage, other_event.commercials.first) }
|
it{ should_not be_able_to(:manage, other_event.commercials.first) }
|
||||||
|
it{ should_not be_able_to(:index, event.comment_threads.first) }
|
||||||
|
it{ should_not be_able_to(:index, other_event.comment_threads.first) }
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when user has the role volunteers_coordinator' do
|
context 'when user has the role volunteers_coordinator' do
|
||||||
|
|
@ -312,6 +318,8 @@ describe 'User' do
|
||||||
it{ should_not be_able_to(:manage, other_event.difficulty_level) }
|
it{ should_not be_able_to(:manage, other_event.difficulty_level) }
|
||||||
it{ should_not be_able_to(:manage, event.commercials.first) }
|
it{ should_not be_able_to(:manage, event.commercials.first) }
|
||||||
it{ should_not be_able_to(:manage, other_event.commercials.first) }
|
it{ should_not be_able_to(:manage, other_event.commercials.first) }
|
||||||
|
it{ should_not be_able_to(:index, event.comment_threads.first) }
|
||||||
|
it{ should_not be_able_to(:index, other_event.comment_threads.first) }
|
||||||
it 'should be_able to :manage Vposition'
|
it 'should be_able to :manage Vposition'
|
||||||
it 'should be_able to :manage Vday'
|
it 'should be_able to :manage Vday'
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue