Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ GEM
autoprefixer-rails (6.3.1)
execjs
json
bcrypt (3.1.11)
bcrypt (3.1.12)
better_errors (2.4.0)
coderay (>= 1.0.0)
erubi (>= 1.0.0)
Expand Down Expand Up @@ -113,14 +113,14 @@ GEM
columnize (0.9.0)
concurrent-ruby (1.0.5)
connection_pool (2.2.1)
crass (1.0.3)
crass (1.0.4)
dalli (2.7.2)
database_cleaner (1.6.2)
debug_inspector (0.0.3)
devise (4.4.1)
devise (4.4.3)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
railties (>= 4.1.0, < 5.2)
railties (>= 4.1.0, < 6.0)
responders
warden (~> 1.2.3)
diff-lcs (1.3)
Expand Down Expand Up @@ -241,7 +241,7 @@ GEM
public_suffix (2.0.5)
pundit (0.3.0)
activesupport (>= 3.0.0)
rack (1.6.9)
rack (1.6.10)
rack-protection (2.0.1)
rack
rack-test (0.6.3)
Expand Down Expand Up @@ -280,7 +280,7 @@ GEM
thor (>= 0.18.1, < 2.0)
rainbow (3.0.0)
raindrops (0.16.0)
rake (12.3.0)
rake (12.3.1)
ransack (1.8.6)
actionpack (>= 3.0)
activerecord (>= 3.0)
Expand All @@ -289,8 +289,9 @@ GEM
polyamorous (~> 1.3.2)
rdiscount (2.1.7.1)
redis (4.0.1)
responders (2.0.2)
railties (>= 4.2.0.alpha, < 5)
responders (2.4.0)
actionpack (>= 4.2.0, < 5.3)
railties (>= 4.2.0, < 5.3)
rest-client (2.0.1)
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 4.0)
Expand Down Expand Up @@ -364,7 +365,7 @@ GEM
sshkit (1.8.1)
net-scp (>= 1.1.2)
net-ssh (>= 2.8.0)
thor (0.19.4)
thor (0.20.0)
thread_safe (0.3.6)
tilt (2.0.8)
ttfunk (1.5.1)
Expand Down
31 changes: 2 additions & 29 deletions app/assets/stylesheets/application.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -294,38 +294,11 @@ ul.statistics li{
}

/*flash*/
.alert > p, .alert > ul {
.alert > ul {
list-style: none;
padding-left: 1.5rem;
}

.alert-error {
background-color: #f2dede;
border-color: #eed3d7;
color: #b94a48;
text-align: left;
}

.alert-alert {
background-color: #f2dede;
border-color: #eed3d7;
color: #b94a48;
text-align: left;
}

.alert-success {
background-color: #dff0d8;
border-color: #d6e9c6;
color: #468847;
text-align: left;
}

.alert-notice {
background-color: #dff0d8;
border-color: #d6e9c6;
color: #468847;
text-align: left;
}

// if not navbar hidden datepicker in small windows
.ui-datepicker{
z-index: 1000 !important;
Expand Down
13 changes: 13 additions & 0 deletions app/helpers/messages_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module MessagesHelper
def alert_class(alert)
if alert == 'error' || alert == 'alert'
'alert-danger'
elsif alert == 'success'
'alert-success'
elsif alert == 'notice'
'alert-info'
else
'alert-info'
end
end
end
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mllocs maybe we can move this to ApplicationHelper, I think we don't need an extra module only for this helper method (I'm also removing "blank" helpers in #361).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll create an issue where we can discuss this, I prefer to tackle it in a different PR since we already tested it 😄

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no prob @mllocs, I'll do it in #361 while rebasing develop

3 changes: 2 additions & 1 deletion app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ class User < ActiveRecord::Base
:rememberable,
:confirmable,
:lockable,
:trackable
:trackable,
:timeoutable
]

GENDERS = %w[male female]
Expand Down
4 changes: 3 additions & 1 deletion app/views/layouts/_messages.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<% flash.each do |key, value| %>
<div class="alert alert-<%= key %>">
<% next if key == 'timedout' %>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


<div class="alert <%= alert_class(key) %>">
<button type="button" class="close" data-dismiss="alert">x</button>
<ul>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we fix indentation here 🙏 ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll do it in the next PR 💪

<li>
Expand Down
4 changes: 2 additions & 2 deletions config/initializers/devise.rb
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@

# ==> Configuration for :rememberable
# The time the user will be remembered without asking for credentials again.
config.remember_for = 2.weeks
config.remember_for = 4.weeks

# If true, extends the user's remember period when remembered via cookie.
config.extend_remember_period = false
Expand All @@ -148,7 +148,7 @@
# ==> Configuration for :timeoutable
# The time you want to timeout the user session without activity. After this
# time the user will be asked for credentials again. Default is 30 minutes.
# config.timeout_in = 30.minutes
config.timeout_in = 1.hour

# If true, expires auth token on session timeout.
# config.expire_auth_token_on_timeout = false
Expand Down
2 changes: 1 addition & 1 deletion config/initializers/session_store.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Be sure to restart your server when you modify this file.

Rails.application.config.session_store :cookie_store, key: '_timeoverflow_session', expire_after: 1.hour
Rails.application.config.session_store :cookie_store, key: '_timeoverflow_session'