mirror of
https://github.com/Retrospring/retrospring.git
synced 2025-02-08 03:43:36 +01:00
Merge branch 'update-ruby' into 'master'
Update Ruby + some gems See merge request nilsding/retrospring!69
This commit is contained in:
commit
d9cff1c468
10 changed files with 95 additions and 69 deletions
|
@ -1 +1 @@
|
||||||
2.3.8
|
2.6.6
|
||||||
|
|
10
Gemfile
10
Gemfile
|
@ -18,15 +18,15 @@ gem 'sdoc', '~> 0.4.1', group: :doc
|
||||||
|
|
||||||
gem 'bcrypt', '~> 3.1.7'
|
gem 'bcrypt', '~> 3.1.7'
|
||||||
|
|
||||||
gem 'haml'
|
gem 'haml', '~> 4.0'
|
||||||
gem 'bootstrap-sass', '~> 3.2.0.1'
|
gem 'bootstrap-sass', '~> 3.4.0'
|
||||||
gem 'bootswatch-rails'
|
gem 'bootswatch-rails'
|
||||||
gem 'sweetalert-rails'
|
gem 'sweetalert-rails'
|
||||||
gem 'will_paginate'
|
gem 'will_paginate'
|
||||||
gem 'will_paginate-bootstrap'
|
gem 'will_paginate-bootstrap'
|
||||||
gem 'devise'
|
gem 'devise', '~> 4.0'
|
||||||
gem 'devise-i18n'
|
gem 'devise-i18n'
|
||||||
gem 'devise-async'
|
gem 'devise-async', git: "https://github.com/mhfs/devise-async.git", ref: "devise-4.x" # TODO: bring this to 1.0 after rails5 upgrade
|
||||||
gem 'bootstrap_form'
|
gem 'bootstrap_form'
|
||||||
gem 'font-kit-rails'
|
gem 'font-kit-rails'
|
||||||
gem 'nprogress-rails'
|
gem 'nprogress-rails'
|
||||||
|
@ -96,7 +96,7 @@ end
|
||||||
|
|
||||||
group :development, :test do
|
group :development, :test do
|
||||||
gem 'rake'
|
gem 'rake'
|
||||||
gem 'thin'
|
gem 'puma'
|
||||||
gem 'rspec-rails', '~> 3.5'
|
gem 'rspec-rails', '~> 3.5'
|
||||||
gem 'factory_girl_rails', require: false
|
gem 'factory_girl_rails', require: false
|
||||||
gem 'faker'
|
gem 'faker'
|
||||||
|
|
100
Gemfile.lock
100
Gemfile.lock
|
@ -1,3 +1,11 @@
|
||||||
|
GIT
|
||||||
|
remote: https://github.com/mhfs/devise-async.git
|
||||||
|
revision: 177f6363a002f7ff28f1d289c8cab7ad8d9cb8c5
|
||||||
|
ref: devise-4.x
|
||||||
|
specs:
|
||||||
|
devise-async (0.10.2)
|
||||||
|
devise (>= 4.0)
|
||||||
|
|
||||||
GIT
|
GIT
|
||||||
remote: https://github.com/retrospring/questiongenerator.git
|
remote: https://github.com/retrospring/questiongenerator.git
|
||||||
revision: c5f8362ff769425d42a94b3a611731eadaa5e0ca
|
revision: c5f8362ff769425d42a94b3a611731eadaa5e0ca
|
||||||
|
@ -48,15 +56,18 @@ GEM
|
||||||
airbrussh (1.1.2)
|
airbrussh (1.1.2)
|
||||||
sshkit (>= 1.6.1, != 1.7.0)
|
sshkit (>= 1.6.1, != 1.7.0)
|
||||||
arel (6.0.4)
|
arel (6.0.4)
|
||||||
bcrypt (3.1.11)
|
autoprefixer-rails (9.5.0)
|
||||||
|
execjs
|
||||||
|
bcrypt (3.1.12)
|
||||||
better_errors (2.1.1)
|
better_errors (2.1.1)
|
||||||
coderay (>= 1.0.0)
|
coderay (>= 1.0.0)
|
||||||
erubis (>= 2.6.6)
|
erubis (>= 2.6.6)
|
||||||
rack (>= 0.9.0)
|
rack (>= 0.9.0)
|
||||||
binding_of_caller (0.7.2)
|
binding_of_caller (0.7.2)
|
||||||
debug_inspector (>= 0.0.1)
|
debug_inspector (>= 0.0.1)
|
||||||
bootstrap-sass (3.2.0.2)
|
bootstrap-sass (3.4.1)
|
||||||
sass (~> 3.2)
|
autoprefixer-rails (>= 5.2.1)
|
||||||
|
sassc (>= 2.0.0)
|
||||||
bootstrap3-datetimepicker-rails (4.7.14)
|
bootstrap3-datetimepicker-rails (4.7.14)
|
||||||
momentjs-rails (>= 2.8.1)
|
momentjs-rails (>= 2.8.1)
|
||||||
bootstrap_form (2.6.0)
|
bootstrap_form (2.6.0)
|
||||||
|
@ -99,22 +110,18 @@ GEM
|
||||||
colorize (0.8.1)
|
colorize (0.8.1)
|
||||||
concurrent-ruby (1.0.5)
|
concurrent-ruby (1.0.5)
|
||||||
connection_pool (2.2.1)
|
connection_pool (2.2.1)
|
||||||
crass (1.0.2)
|
crass (1.0.4)
|
||||||
daemons (1.2.4)
|
|
||||||
database_cleaner (1.5.3)
|
database_cleaner (1.5.3)
|
||||||
debug_inspector (0.0.2)
|
debug_inspector (0.0.2)
|
||||||
delayed_paperclip (3.0.1)
|
delayed_paperclip (3.0.1)
|
||||||
activejob (>= 4.2)
|
activejob (>= 4.2)
|
||||||
paperclip (>= 3.3)
|
paperclip (>= 3.3)
|
||||||
devise (3.5.10)
|
devise (4.7.1)
|
||||||
bcrypt (~> 3.0)
|
bcrypt (~> 3.0)
|
||||||
orm_adapter (~> 0.1)
|
orm_adapter (~> 0.1)
|
||||||
railties (>= 3.2.6, < 5)
|
railties (>= 4.1.0)
|
||||||
responders
|
responders
|
||||||
thread_safe (~> 0.1)
|
|
||||||
warden (~> 1.2.3)
|
warden (~> 1.2.3)
|
||||||
devise-async (0.10.2)
|
|
||||||
devise (>= 3.2, < 4.0)
|
|
||||||
devise-i18n (1.1.2)
|
devise-i18n (1.1.2)
|
||||||
diff-lcs (1.3)
|
diff-lcs (1.3)
|
||||||
docile (1.1.5)
|
docile (1.1.5)
|
||||||
|
@ -122,8 +129,7 @@ GEM
|
||||||
unf (>= 0.0.5, < 1.0.0)
|
unf (>= 0.0.5, < 1.0.0)
|
||||||
equalizer (0.0.11)
|
equalizer (0.0.11)
|
||||||
erubis (2.7.0)
|
erubis (2.7.0)
|
||||||
eventmachine (1.2.3)
|
excon (0.73.0)
|
||||||
excon (0.55.0)
|
|
||||||
execjs (2.7.0)
|
execjs (2.7.0)
|
||||||
factory_girl (4.8.0)
|
factory_girl (4.8.0)
|
||||||
activesupport (>= 3.0.0)
|
activesupport (>= 3.0.0)
|
||||||
|
@ -301,7 +307,7 @@ GEM
|
||||||
guard (>= 2.0.0)
|
guard (>= 2.0.0)
|
||||||
haml (4.0.7)
|
haml (4.0.7)
|
||||||
tilt
|
tilt
|
||||||
hashie (3.5.5)
|
hashie (4.1.0)
|
||||||
hike (1.2.3)
|
hike (1.2.3)
|
||||||
http (2.2.1)
|
http (2.2.1)
|
||||||
addressable (~> 2.3)
|
addressable (~> 2.3)
|
||||||
|
@ -314,7 +320,8 @@ GEM
|
||||||
http_parser.rb (0.6.0)
|
http_parser.rb (0.6.0)
|
||||||
httparty (0.14.0)
|
httparty (0.14.0)
|
||||||
multi_xml (>= 0.5.2)
|
multi_xml (>= 0.5.2)
|
||||||
i18n (0.8.1)
|
i18n (0.9.5)
|
||||||
|
concurrent-ruby (~> 1.0)
|
||||||
i18n-js (3.0.0.rc10)
|
i18n-js (3.0.0.rc10)
|
||||||
i18n (~> 0.6)
|
i18n (~> 0.6)
|
||||||
inflecto (0.0.2)
|
inflecto (0.0.2)
|
||||||
|
@ -332,12 +339,21 @@ GEM
|
||||||
jquery-turbolinks (2.1.0)
|
jquery-turbolinks (2.1.0)
|
||||||
railties (>= 3.1.0)
|
railties (>= 3.1.0)
|
||||||
turbolinks
|
turbolinks
|
||||||
jquery-ui-rails (5.0.5)
|
jquery-ui-rails (6.0.1)
|
||||||
railties (>= 3.2.16)
|
railties (>= 3.2.16)
|
||||||
json (1.8.6)
|
json (1.8.6)
|
||||||
kaminari (0.17.0)
|
kaminari (1.2.0)
|
||||||
actionpack (>= 3.0.0)
|
activesupport (>= 4.1.0)
|
||||||
activesupport (>= 3.0.0)
|
kaminari-actionview (= 1.2.0)
|
||||||
|
kaminari-activerecord (= 1.2.0)
|
||||||
|
kaminari-core (= 1.2.0)
|
||||||
|
kaminari-actionview (1.2.0)
|
||||||
|
actionview
|
||||||
|
kaminari-core (= 1.2.0)
|
||||||
|
kaminari-activerecord (1.2.0)
|
||||||
|
activerecord
|
||||||
|
kaminari-core (= 1.2.0)
|
||||||
|
kaminari-core (1.2.0)
|
||||||
kgio (2.11.0)
|
kgio (2.11.0)
|
||||||
launchy (2.4.3)
|
launchy (2.4.3)
|
||||||
addressable (~> 2.3)
|
addressable (~> 2.3)
|
||||||
|
@ -347,7 +363,7 @@ GEM
|
||||||
rb-fsevent (~> 0.9, >= 0.9.4)
|
rb-fsevent (~> 0.9, >= 0.9.4)
|
||||||
rb-inotify (~> 0.9, >= 0.9.7)
|
rb-inotify (~> 0.9, >= 0.9.7)
|
||||||
ruby_dep (~> 1.2)
|
ruby_dep (~> 1.2)
|
||||||
loofah (2.2.3)
|
loofah (2.5.0)
|
||||||
crass (~> 1.0.2)
|
crass (~> 1.0.2)
|
||||||
nokogiri (>= 1.5.9)
|
nokogiri (>= 1.5.9)
|
||||||
lumberjack (1.0.11)
|
lumberjack (1.0.11)
|
||||||
|
@ -374,7 +390,8 @@ GEM
|
||||||
net-ssh (>= 2.6.5)
|
net-ssh (>= 2.6.5)
|
||||||
net-ssh (4.1.0)
|
net-ssh (4.1.0)
|
||||||
newrelic_rpm (4.2.0.334)
|
newrelic_rpm (4.2.0.334)
|
||||||
nokogiri (1.10.1)
|
nio4r (2.5.2)
|
||||||
|
nokogiri (1.10.9)
|
||||||
mini_portile2 (~> 2.4.0)
|
mini_portile2 (~> 2.4.0)
|
||||||
nokogumbo (2.0.1)
|
nokogumbo (2.0.1)
|
||||||
nokogiri (~> 1.8, >= 1.8.4)
|
nokogiri (~> 1.8, >= 1.8.4)
|
||||||
|
@ -383,8 +400,8 @@ GEM
|
||||||
shellany (~> 0.0)
|
shellany (~> 0.0)
|
||||||
nprogress-rails (0.2.0.2)
|
nprogress-rails (0.2.0.2)
|
||||||
oauth (0.5.1)
|
oauth (0.5.1)
|
||||||
omniauth (1.6.1)
|
omniauth (1.9.1)
|
||||||
hashie (>= 3.4.6, < 3.6.0)
|
hashie (>= 3.4.6)
|
||||||
rack (>= 1.6.2, < 3)
|
rack (>= 1.6.2, < 3)
|
||||||
omniauth-oauth (1.1.0)
|
omniauth-oauth (1.1.0)
|
||||||
oauth
|
oauth
|
||||||
|
@ -414,8 +431,10 @@ GEM
|
||||||
method_source (~> 0.8.1)
|
method_source (~> 0.8.1)
|
||||||
slop (~> 3.4)
|
slop (~> 3.4)
|
||||||
public_suffix (2.0.5)
|
public_suffix (2.0.5)
|
||||||
rack (1.6.11)
|
puma (4.3.3)
|
||||||
rack-pjax (1.0.0)
|
nio4r (~> 2.0)
|
||||||
|
rack (1.6.13)
|
||||||
|
rack-pjax (1.1.0)
|
||||||
nokogiri (~> 1.5)
|
nokogiri (~> 1.5)
|
||||||
rack (>= 1.1)
|
rack (>= 1.1)
|
||||||
rack-protection (1.5.5)
|
rack-protection (1.5.5)
|
||||||
|
@ -438,8 +457,8 @@ GEM
|
||||||
rails-assets-jquery (2.2.4)
|
rails-assets-jquery (2.2.4)
|
||||||
rails-deprecated_sanitizer (1.0.3)
|
rails-deprecated_sanitizer (1.0.3)
|
||||||
activesupport (>= 4.2.0.alpha)
|
activesupport (>= 4.2.0.alpha)
|
||||||
rails-dom-testing (1.0.8)
|
rails-dom-testing (1.0.9)
|
||||||
activesupport (>= 4.2.0.beta, < 5.0)
|
activesupport (>= 4.2.0, < 5.0)
|
||||||
nokogiri (~> 1.6)
|
nokogiri (~> 1.6)
|
||||||
rails-deprecated_sanitizer (>= 1.0.1)
|
rails-deprecated_sanitizer (>= 1.0.1)
|
||||||
rails-html-sanitizer (1.0.4)
|
rails-html-sanitizer (1.0.4)
|
||||||
|
@ -447,14 +466,14 @@ GEM
|
||||||
rails-i18n (4.0.9)
|
rails-i18n (4.0.9)
|
||||||
i18n (~> 0.7)
|
i18n (~> 0.7)
|
||||||
railties (~> 4.0)
|
railties (~> 4.0)
|
||||||
rails_admin (1.1.1)
|
rails_admin (1.4.3)
|
||||||
builder (~> 3.1)
|
builder (~> 3.1)
|
||||||
coffee-rails (~> 4.0)
|
coffee-rails (~> 4.0)
|
||||||
font-awesome-rails (>= 3.0, < 5)
|
font-awesome-rails (>= 3.0, < 5)
|
||||||
haml (~> 4.0)
|
haml (>= 4.0, < 6)
|
||||||
jquery-rails (>= 3.0, < 5)
|
jquery-rails (>= 3.0, < 5)
|
||||||
jquery-ui-rails (~> 5.0)
|
jquery-ui-rails (>= 5.0, < 7)
|
||||||
kaminari (~> 0.14)
|
kaminari (>= 0.14, < 2.0)
|
||||||
nested_form (~> 0.3)
|
nested_form (~> 0.3)
|
||||||
rack-pjax (>= 0.7)
|
rack-pjax (>= 0.7)
|
||||||
rails (>= 4.0, < 6)
|
rails (>= 4.0, < 6)
|
||||||
|
@ -466,7 +485,7 @@ GEM
|
||||||
rake (>= 0.8.7)
|
rake (>= 0.8.7)
|
||||||
thor (>= 0.18.1, < 2.0)
|
thor (>= 0.18.1, < 2.0)
|
||||||
raindrops (0.18.0)
|
raindrops (0.18.0)
|
||||||
rake (12.0.0)
|
rake (13.0.1)
|
||||||
rb-fsevent (0.9.8)
|
rb-fsevent (0.9.8)
|
||||||
rb-inotify (0.9.8)
|
rb-inotify (0.9.8)
|
||||||
ffi (>= 0.5.0)
|
ffi (>= 0.5.0)
|
||||||
|
@ -478,7 +497,7 @@ GEM
|
||||||
rdoc (4.3.0)
|
rdoc (4.3.0)
|
||||||
redcarpet (3.4.0)
|
redcarpet (3.4.0)
|
||||||
redis (3.3.3)
|
redis (3.3.3)
|
||||||
remotipart (1.3.1)
|
remotipart (1.4.4)
|
||||||
responders (2.4.1)
|
responders (2.4.1)
|
||||||
actionpack (>= 4.2.0, < 6.0)
|
actionpack (>= 4.2.0, < 6.0)
|
||||||
railties (>= 4.2.0, < 6.0)
|
railties (>= 4.2.0, < 6.0)
|
||||||
|
@ -513,6 +532,9 @@ GEM
|
||||||
sass (~> 3.2.2)
|
sass (~> 3.2.2)
|
||||||
sprockets (~> 2.8, < 3.0)
|
sprockets (~> 2.8, < 3.0)
|
||||||
sprockets-rails (~> 2.0)
|
sprockets-rails (~> 2.0)
|
||||||
|
sassc (2.0.1)
|
||||||
|
ffi (~> 1.9)
|
||||||
|
rake
|
||||||
sdoc (0.4.2)
|
sdoc (0.4.2)
|
||||||
json (~> 1.7, >= 1.7.7)
|
json (~> 1.7, >= 1.7.7)
|
||||||
rdoc (~> 4.0)
|
rdoc (~> 4.0)
|
||||||
|
@ -553,10 +575,6 @@ GEM
|
||||||
net-ssh (>= 2.8.0)
|
net-ssh (>= 2.8.0)
|
||||||
sweetalert-rails (1.1.3)
|
sweetalert-rails (1.1.3)
|
||||||
railties (>= 3.1.0)
|
railties (>= 3.1.0)
|
||||||
thin (1.7.0)
|
|
||||||
daemons (~> 1.0, >= 1.0.9)
|
|
||||||
eventmachine (~> 1.0, >= 1.0.4)
|
|
||||||
rack (>= 1, < 3)
|
|
||||||
thor (0.19.4)
|
thor (0.19.4)
|
||||||
thread_safe (0.3.6)
|
thread_safe (0.3.6)
|
||||||
tilt (1.4.1)
|
tilt (1.4.1)
|
||||||
|
@ -617,7 +635,7 @@ PLATFORMS
|
||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
bcrypt (~> 3.1.7)
|
bcrypt (~> 3.1.7)
|
||||||
better_errors
|
better_errors
|
||||||
bootstrap-sass (~> 3.2.0.1)
|
bootstrap-sass (~> 3.4.0)
|
||||||
bootstrap3-datetimepicker-rails (~> 4.7.14)
|
bootstrap3-datetimepicker-rails (~> 4.7.14)
|
||||||
bootstrap_form
|
bootstrap_form
|
||||||
bootswatch-rails
|
bootswatch-rails
|
||||||
|
@ -630,8 +648,8 @@ DEPENDENCIES
|
||||||
colorize
|
colorize
|
||||||
database_cleaner
|
database_cleaner
|
||||||
delayed_paperclip
|
delayed_paperclip
|
||||||
devise
|
devise (~> 4.0)
|
||||||
devise-async
|
devise-async!
|
||||||
devise-i18n
|
devise-i18n
|
||||||
factory_girl_rails
|
factory_girl_rails
|
||||||
fake_email_validator
|
fake_email_validator
|
||||||
|
@ -642,7 +660,7 @@ DEPENDENCIES
|
||||||
font-kit-rails
|
font-kit-rails
|
||||||
foreman
|
foreman
|
||||||
guard-brakeman
|
guard-brakeman
|
||||||
haml
|
haml (~> 4.0)
|
||||||
httparty
|
httparty
|
||||||
i18n-js (= 3.0.0.rc10)
|
i18n-js (= 3.0.0.rc10)
|
||||||
jbuilder (~> 2.2.4)
|
jbuilder (~> 2.2.4)
|
||||||
|
@ -660,6 +678,7 @@ DEPENDENCIES
|
||||||
pg
|
pg
|
||||||
pghero
|
pghero
|
||||||
poltergeist
|
poltergeist
|
||||||
|
puma
|
||||||
questiongenerator!
|
questiongenerator!
|
||||||
rails (~> 4.2.11, >= 4.2.11.1)
|
rails (~> 4.2.11, >= 4.2.11.1)
|
||||||
rails-assets-growl
|
rails-assets-growl
|
||||||
|
@ -682,7 +701,6 @@ DEPENDENCIES
|
||||||
sinatra
|
sinatra
|
||||||
spring (~> 1.3.5)
|
spring (~> 1.3.5)
|
||||||
sweetalert-rails
|
sweetalert-rails
|
||||||
thin
|
|
||||||
tiny-color-rails
|
tiny-color-rails
|
||||||
tumblr_client
|
tumblr_client
|
||||||
turbolinks (~> 2.5.3)
|
turbolinks (~> 2.5.3)
|
||||||
|
|
|
@ -31,11 +31,13 @@ $(document).on "click", "button[name=ab-smile-comment]", ->
|
||||||
showNotification translate('frontend.error.message'), false
|
showNotification translate('frontend.error.message'), false
|
||||||
complete: (jqxhr, status) ->
|
complete: (jqxhr, status) ->
|
||||||
btn.button "reset"
|
btn.button "reset"
|
||||||
if success
|
window.setTimeout ->
|
||||||
switch action
|
if success
|
||||||
when 'smile'
|
switch action
|
||||||
btn[0].dataset.action = 'unsmile'
|
when 'smile'
|
||||||
btn.html "<i class=\"fa fa-frown-o\"></i> <span id=\"ab-comment-smile-count-#{cid}\">#{count}</span>"
|
btn[0].dataset.action = 'unsmile'
|
||||||
when 'unsmile'
|
btn.html "<i class=\"fa fa-frown-o\"></i> <span id=\"ab-comment-smile-count-#{cid}\">#{count}</span>"
|
||||||
btn[0].dataset.action = 'smile'
|
when 'unsmile'
|
||||||
btn.html "<i class=\"fa fa-smile-o\"></i> <span id=\"ab-comment-smile-count-#{cid}\">#{count}</span>"
|
btn[0].dataset.action = 'smile'
|
||||||
|
btn.html "<i class=\"fa fa-smile-o\"></i> <span id=\"ab-comment-smile-count-#{cid}\">#{count}</span>"
|
||||||
|
, 20
|
||||||
|
|
|
@ -31,11 +31,13 @@ $(document).on "click", "button[name=ab-smile]", ->
|
||||||
showNotification translate('frontend.error.message'), false
|
showNotification translate('frontend.error.message'), false
|
||||||
complete: (jqxhr, status) ->
|
complete: (jqxhr, status) ->
|
||||||
btn.button "reset"
|
btn.button "reset"
|
||||||
if success
|
window.setTimeout ->
|
||||||
switch action
|
if success
|
||||||
when 'smile'
|
switch action
|
||||||
btn[0].dataset.action = 'unsmile'
|
when 'smile'
|
||||||
btn.html "<i class=\"fa fa-frown-o\"></i> <span id=\"ab-smile-count-#{aid}\">#{count}</span>"
|
btn[0].dataset.action = 'unsmile'
|
||||||
when 'unsmile'
|
btn.html "<i class=\"fa fa-frown-o\"></i> <span id=\"ab-smile-count-#{aid}\">#{count}</span>"
|
||||||
btn[0].dataset.action = 'smile'
|
when 'unsmile'
|
||||||
btn.html "<i class=\"fa fa-smile-o\"></i> <span id=\"ab-smile-count-#{aid}\">#{count}</span>"
|
btn[0].dataset.action = 'smile'
|
||||||
|
btn.html "<i class=\"fa fa-smile-o\"></i> <span id=\"ab-smile-count-#{aid}\">#{count}</span>"
|
||||||
|
, 20
|
||||||
|
|
|
@ -55,8 +55,8 @@ class ApplicationController < ActionController::Base
|
||||||
protected
|
protected
|
||||||
|
|
||||||
def configure_permitted_parameters
|
def configure_permitted_parameters
|
||||||
devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(:screen_name, :email, :password, :password_confirmation, :remember_me) }
|
devise_parameter_sanitizer.permit(:sign_up) { |u| u.permit(:screen_name, :email, :password, :password_confirmation, :remember_me) }
|
||||||
devise_parameter_sanitizer.for(:sign_in) { |u| u.permit(:login, :screen_name, :email, :password, :remember_me) }
|
devise_parameter_sanitizer.permit(:sign_in) { |u| u.permit(:login, :screen_name, :email, :password, :remember_me) }
|
||||||
devise_parameter_sanitizer.for(:account_update) { |u| u.permit(:screen_name, :email, :password, :password_confirmation, :current_password) }
|
devise_parameter_sanitizer.permit(:account_update) { |u| u.permit(:screen_name, :email, :password, :password_confirmation, :current_password) }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,6 +2,10 @@ class DiscoverController < ApplicationController
|
||||||
before_filter :authenticate_user!
|
before_filter :authenticate_user!
|
||||||
|
|
||||||
def index
|
def index
|
||||||
|
unless APP_CONFIG.dig(:features, :discover, :enabled) || current_user.mod?
|
||||||
|
return redirect_to root_path
|
||||||
|
end
|
||||||
|
|
||||||
top_x = 10 # only display the top X items
|
top_x = 10 # only display the top X items
|
||||||
|
|
||||||
@popular_answers = Answer.where("created_at > ?", Time.now.ago(1.week)).order(:smile_count).reverse_order.limit(top_x)
|
@popular_answers = Answer.where("created_at > ?", Time.now.ago(1.week)).order(:smile_count).reverse_order.limit(top_x)
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
%ul.nav.navbar-nav
|
%ul.nav.navbar-nav
|
||||||
= nav_entry t('views.navigation.timeline'), root_path
|
= nav_entry t('views.navigation.timeline'), root_path
|
||||||
= nav_entry t('views.navigation.inbox'), "/inbox", badge: inbox_count
|
= nav_entry t('views.navigation.inbox'), "/inbox", badge: inbox_count
|
||||||
- if APP_CONFIG.dig(:features, :discover, :enabled)
|
- if APP_CONFIG.dig(:features, :discover, :enabled) || current_user.mod?
|
||||||
= nav_entry t('views.navigation.discover'), discover_path
|
= nav_entry t('views.navigation.discover'), discover_path
|
||||||
%ul.nav.navbar-nav.navbar-right
|
%ul.nav.navbar-nav.navbar-right
|
||||||
- unless @user.nil?
|
- unless @user.nil?
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Devise::Async.backend = :sidekiq
|
Devise::Async.backend = :sidekiq
|
||||||
|
|
|
@ -104,7 +104,7 @@ Rails.application.routes.draw do
|
||||||
match '/unsubscribe', to: 'subscription#unsubscribe', via: :post, as: :unsubscribe_answer
|
match '/unsubscribe', to: 'subscription#unsubscribe', via: :post, as: :unsubscribe_answer
|
||||||
end
|
end
|
||||||
|
|
||||||
match '/discover', to: 'discover#index', via: :get, as: :discover if APP_CONFIG.dig(:features, :discover, :enabled)
|
match '/discover', to: 'discover#index', via: :get, as: :discover
|
||||||
match '/public', to: 'public#index', via: :get, as: :public_timeline if APP_CONFIG.dig(:features, :public, :enabled)
|
match '/public', to: 'public#index', via: :get, as: :public_timeline if APP_CONFIG.dig(:features, :public, :enabled)
|
||||||
match '/group/:group_name', to: 'group#index', via: :get, as: :group_timeline
|
match '/group/:group_name', to: 'group#index', via: :get, as: :group_timeline
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue