Skip to content

Commit

Permalink
Add notifications styling
Browse files Browse the repository at this point in the history
  • Loading branch information
hmlON committed Jan 31, 2017
1 parent e6dc8f6 commit 419de41
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .config.reek
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ UncommunicativeModuleName:
IrresponsibleModule:
enabled: false
UtilityFunction:
enabled: fals
enabled: false

"db/migrate":
IrresponsibleModule:
Expand Down
1 change: 1 addition & 0 deletions app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
@import "bootstrap";
@import "notifications"
4 changes: 4 additions & 0 deletions app/assets/stylesheets/notifications.sass
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.notifications
position: fixed
bottom: 0px
left: 10px
7 changes: 7 additions & 0 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
module ApplicationHelper
def flash_key_alert_class(key)
flash_to_alert = {
'notice' => 'info',
'alert' => 'danger'
}
flash_to_alert[key]
end
end
2 changes: 1 addition & 1 deletion app/views/layouts/_notifications.html.slim
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.notifications
- flash.each do |key, value|
div class="alert alert-#{key}"
div class="alert alert-#{flash_key_alert_class(key)}"
= value
a.close[href="#" data-dismiss="alert"] ×

0 comments on commit 419de41

Please sign in to comment.