Skip to content

Commit 274a4cd

Browse files
authored
Merge pull request #477 from coopdevs/develop
Release v1.12.0
2 parents 937b3a2 + d0f2bbf commit 274a4cd

File tree

16 files changed

+717
-79
lines changed

16 files changed

+717
-79
lines changed

Gemfile

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,22 +48,23 @@ group :development do
4848
gem 'airbrussh', require: false
4949
gem 'localeapp', '2.1.1', require: false
5050
gem 'letter_opener', '1.4.1'
51-
gem 'dotenv-rails', '2.5.0'
51+
gem 'dotenv-rails', '~> 2.7.1'
5252
end
5353

5454
group :development, :test do
55-
gem "rspec-rails", '~> 3.7.2'
5655
gem "byebug"
5756
end
5857

5958
group :test do
59+
gem "rspec-rails", '~> 3.8.2'
6060
gem "database_cleaner", '1.6.2'
6161
gem 'shoulda-matchers', '~> 3.1.2'
6262
gem 'fabrication'
63-
gem 'faker'
64-
gem 'capybara', '~> 2.7'
65-
gem 'capybara-selenium', '~> 0.0.6'
66-
gem 'chromedriver-helper', '~> 1.0'
63+
gem 'faker', '~> 1.9'
64+
gem 'capybara', '~> 3.13'
65+
gem 'selenium-webdriver', '~> 3.141'
66+
gem 'chromedriver-helper', '~> 2.1'
67+
gem 'simplecov', '~> 0.16.1', require: false
6768
end
6869

6970
group :production do

Gemfile.lock

Lines changed: 43 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -86,19 +86,17 @@ GEM
8686
capistrano-rbenv (2.1.3)
8787
capistrano (~> 3.1)
8888
sshkit (~> 1.3)
89-
capybara (2.18.0)
89+
capybara (3.13.2)
9090
addressable
9191
mini_mime (>= 0.1.3)
92-
nokogiri (>= 1.3.3)
93-
rack (>= 1.0.0)
94-
rack-test (>= 0.5.4)
95-
xpath (>= 2.0, < 4.0)
96-
capybara-selenium (0.0.6)
97-
capybara
98-
selenium-webdriver
92+
nokogiri (~> 1.8)
93+
rack (>= 1.6.0)
94+
rack-test (>= 0.6.3)
95+
regexp_parser (~> 1.2)
96+
xpath (~> 3.2)
9997
childprocess (0.9.0)
10098
ffi (~> 1.0, >= 1.0.11)
101-
chromedriver-helper (1.2.0)
99+
chromedriver-helper (2.1.0)
102100
archive-zip (~> 0.10)
103101
nokogiri (~> 1.8)
104102
chronic (0.10.2)
@@ -124,12 +122,13 @@ GEM
124122
responders
125123
warden (~> 1.2.3)
126124
diff-lcs (1.3)
125+
docile (1.3.1)
127126
domain_name (0.5.20170223)
128127
unf (>= 0.0.5, < 1.0.0)
129-
dotenv (2.5.0)
130-
dotenv-rails (2.5.0)
131-
dotenv (= 2.5.0)
132-
railties (>= 3.2, < 6.0)
128+
dotenv (2.7.1)
129+
dotenv-rails (2.7.1)
130+
dotenv (= 2.7.1)
131+
railties (>= 3.2, < 6.1)
133132
elasticsearch (1.0.8)
134133
elasticsearch-api (= 1.0.7)
135134
elasticsearch-transport (= 1.0.7)
@@ -149,11 +148,11 @@ GEM
149148
tzinfo
150149
execjs (2.6.0)
151150
fabrication (2.11.3)
152-
faker (1.4.3)
153-
i18n (~> 0.5)
151+
faker (1.9.3)
152+
i18n (>= 0.7)
154153
faraday (0.9.1)
155154
multipart-post (>= 1.2, < 3)
156-
ffi (1.9.25)
155+
ffi (1.10.0)
157156
formtastic (3.1.5)
158157
actionpack (>= 3.2.13)
159158
formtastic_i18n (0.6.0)
@@ -288,6 +287,7 @@ GEM
288287
polyamorous (~> 1.3.2)
289288
rdiscount (2.1.7.1)
290289
redis (4.0.1)
290+
regexp_parser (1.3.0)
291291
responders (2.4.0)
292292
actionpack (>= 4.2.0, < 5.3)
293293
railties (>= 4.2.0, < 5.3)
@@ -297,23 +297,23 @@ GEM
297297
netrc (~> 0.8)
298298
rollbar (2.8.3)
299299
multi_json
300-
rspec-core (3.7.1)
301-
rspec-support (~> 3.7.0)
302-
rspec-expectations (3.7.0)
300+
rspec-core (3.8.0)
301+
rspec-support (~> 3.8.0)
302+
rspec-expectations (3.8.2)
303303
diff-lcs (>= 1.2.0, < 2.0)
304-
rspec-support (~> 3.7.0)
305-
rspec-mocks (3.7.0)
304+
rspec-support (~> 3.8.0)
305+
rspec-mocks (3.8.0)
306306
diff-lcs (>= 1.2.0, < 2.0)
307-
rspec-support (~> 3.7.0)
308-
rspec-rails (3.7.2)
307+
rspec-support (~> 3.8.0)
308+
rspec-rails (3.8.2)
309309
actionpack (>= 3.0)
310310
activesupport (>= 3.0)
311311
railties (>= 3.0)
312-
rspec-core (~> 3.7.0)
313-
rspec-expectations (~> 3.7.0)
314-
rspec-mocks (~> 3.7.0)
315-
rspec-support (~> 3.7.0)
316-
rspec-support (3.7.0)
312+
rspec-core (~> 3.8.0)
313+
rspec-expectations (~> 3.8.0)
314+
rspec-mocks (~> 3.8.0)
315+
rspec-support (~> 3.8.0)
316+
rspec-support (3.8.0)
317317
rubocop (0.52.1)
318318
parallel (~> 1.10)
319319
parser (>= 2.4.0.2, < 3.0)
@@ -334,9 +334,9 @@ GEM
334334
tilt (>= 1.1, < 3)
335335
select2-rails (4.0.1)
336336
thor (~> 0.14)
337-
selenium-webdriver (3.11.0)
337+
selenium-webdriver (3.141.0)
338338
childprocess (~> 0.5)
339-
rubyzip (~> 1.2)
339+
rubyzip (~> 1.2, >= 1.2.2)
340340
shoulda-matchers (3.1.2)
341341
activesupport (>= 4.0.0)
342342
sidekiq (5.1.3)
@@ -350,6 +350,11 @@ GEM
350350
simple_form (3.1.0)
351351
actionpack (~> 4.0)
352352
activemodel (~> 4.0)
353+
simplecov (0.16.1)
354+
docile (~> 1.1)
355+
json (>= 1.8, < 3)
356+
simplecov-html (~> 0.10.0)
357+
simplecov-html (0.10.2)
353358
skylight (2.0.1)
354359
skylight-core (= 2.0.1)
355360
skylight-core (2.0.1)
@@ -390,7 +395,7 @@ GEM
390395
sprockets-rails (>= 2.0, < 4.0)
391396
whenever (0.9.4)
392397
chronic (>= 0.6.3)
393-
xpath (3.0.0)
398+
xpath (3.2.0)
394399
nokogiri (~> 1.8)
395400

396401
PLATFORMS
@@ -406,18 +411,17 @@ DEPENDENCIES
406411
capistrano (~> 3.1)
407412
capistrano-rails (~> 1.1)
408413
capistrano-rbenv (~> 2.1)
409-
capybara (~> 2.7)
410-
capybara-selenium (~> 0.0.6)
411-
chromedriver-helper (~> 1.0)
414+
capybara (~> 3.13)
415+
chromedriver-helper (~> 2.1)
412416
coffee-rails
413417
dalli
414418
database_cleaner (= 1.6.2)
415419
devise (~> 4.5.0)
416-
dotenv-rails (= 2.5.0)
420+
dotenv-rails (~> 2.7.1)
417421
elasticsearch-model
418422
elasticsearch-rails
419423
fabrication
420-
faker
424+
faker (~> 1.9)
421425
has_scope
422426
hstore_translate
423427
http_accept_language (~> 2.1.1)
@@ -434,15 +438,17 @@ DEPENDENCIES
434438
rails_12factor (= 0.0.3)
435439
rdiscount
436440
rollbar (= 2.8.3)
437-
rspec-rails (~> 3.7.2)
441+
rspec-rails (~> 3.8.2)
438442
rubocop (~> 0.52.1)
439443
rufus-scheduler (~> 3.4.2)
440444
sass-rails (~> 5.0.7)
441445
select2-rails
446+
selenium-webdriver (~> 3.141)
442447
shoulda-matchers (~> 3.1.2)
443448
sidekiq (= 5.1.3)
444449
sidekiq-cron (= 0.6.3)
445450
simple_form (>= 3.0.0)
451+
simplecov (~> 0.16.1)
446452
skylight
447453
uglifier (= 2.7.2)
448454
unicorn

app/assets/images/redeira.png

24.1 KB
Loading

app/controllers/application_controller.rb

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ class ApplicationController < ActionController::Base
1010
before_filter :configure_permitted_parameters, if: :devise_controller?
1111
before_filter :set_locale
1212
before_filter :set_current_organization
13-
after_filter :store_location
1413

1514
rescue_from MissingTOSAcceptance, OutadedTOSAcceptance do
1615
redirect_to terms_path
@@ -21,7 +20,11 @@ class ApplicationController < ActionController::Base
2120

2221
helper_method :current_organization, :admin?, :superadmin?
2322

24-
protected
23+
def switch_lang
24+
redirect_to :back
25+
end
26+
27+
private
2528

2629
def configure_permitted_parameters
2730
devise_parameter_sanitizer.permit(:sign_up, keys: [:username])
@@ -35,17 +38,6 @@ def set_current_organization
3538
end
3639
end
3740

38-
def store_location
39-
# store last url - this is needed for post-login redirect to whatever the
40-
# user last visited.
41-
return unless request.get?
42-
paths = ["/", "/users/sign_in", "/users/sign_up", "/users/password/new",
43-
"/users/password/edit", "/users/confirmation", "/users/sign_out"]
44-
if !paths.include?(request.path) && !request.xhr?
45-
session[:previous_url] = request.fullpath
46-
end
47-
end
48-
4941
def after_sign_in_path_for(user)
5042
if user.members.present?
5143
users_path
@@ -54,8 +46,6 @@ def after_sign_in_path_for(user)
5446
end
5547
end
5648

57-
private
58-
5949
def check_for_terms_acceptance!
6050
if user_signed_in?
6151
accepted = current_user.terms_accepted_at

app/controllers/global_controller.rb

Lines changed: 0 additions & 5 deletions
This file was deleted.

app/helpers/brand_logo_helper.rb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
module BrandLogoHelper
2+
def render_brand_logo
3+
return unless should_render_logo?
4+
render 'application/brand_logo'
5+
end
6+
7+
private
8+
9+
def should_render_logo?
10+
return false unless current_user
11+
current_organization&.id == branded_organization_id
12+
end
13+
14+
def branded_organization_id
15+
Rails.application.config.branded_organization_id
16+
end
17+
end
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<div class="container" style="margin-bottom: 30px">
2+
<%= image_tag("redeira.png", class: 'organization-brand-logo img-responsive center-block') %>
3+
</div>

app/views/layouts/application.html.erb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
</div>
2727
</div>
2828

29+
<%= render_brand_logo %>
2930
<%= render 'application/footer' %>
3031

3132
<div class="back-overlay"></div>

config/application.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class Application < Rails::Application
2020
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
2121
# config.i18n.default_locale = :de
2222
config.i18n.default_locale = :es
23-
config.i18n.available_locales = [:es, :ca, :eu, :en, :'pt-BR']
23+
config.i18n.available_locales = [:es, :ca, :eu, :gl, :en, :'pt-BR']
2424
config.i18n.fallbacks = true
2525

2626
# Do not swallow errors in after_commit/after_rollback callbacks.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
DEFAULT_BRANDED_ORG_ID = 246
2+
3+
Rails.application.config.branded_organization_id = nil
4+
5+
unless Rails.env.test?
6+
Rails.application.config.branded_organization_id = (Redis.current.get('branded_organization_id') || DEFAULT_BRANDED_ORG_ID).to_i
7+
end

0 commit comments

Comments
 (0)