Skip to content

Commit

Permalink
Add styling to flash
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordan Byron committed Jan 12, 2012
1 parent 53ce976 commit f526776
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 23 deletions.
3 changes: 3 additions & 0 deletions app/assets/stylesheets/application.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@

@import "blueprint/reset";
@import "blueprint";

@import "lib/base";
@import "partials/flash";
12 changes: 0 additions & 12 deletions app/assets/stylesheets/layout.scss.erb
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,6 @@ body {
}
}

/* *******************************/
/* Flashes */
/* *******************************/
#error {
padding: 0 1em 1em;
color: red;

ul {
padding-left: 2em;
}
}

/* *******************************/
/* Main Content */
/* *******************************/
Expand Down
20 changes: 20 additions & 0 deletions app/assets/stylesheets/partials/_flash.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
div#flash div.flash {
padding: 0.5em 1em;
@include rounded(4px);
background-color: #FDFAF2;
color: #555;

&.notice {
background-color: #8c8;
color: #252;
}

&.error, &.alert, &.warning {
background-color: #c88;
color: #522;
}

ul {
padding-left: 2em;
}
}
12 changes: 7 additions & 5 deletions app/views/login/_username_error.haml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#error
%p Warning: your username is currently empty or invalid.
%p
Please
%a{:href=>"/reset-username", :id=>"reset_username"}click here to reset your username.
#flash
.flash.error
%p Warning: your username is currently empty or invalid.
%p
Please
%a{:href=>"/reset-username", :id=>"reset_username"}
click here to reset your username.
10 changes: 4 additions & 6 deletions app/views/shared/_flash.haml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
- if flash[:notice]
#flash
= flash[:notice]
- if flash[:error]
#error
= flash[:error]
#flash
- flash.each do |flashtype, message|
%div{:class => "flash #{flashtype}"}
= message

0 comments on commit f526776

Please sign in to comment.