Browse Source

Properly style flashes; add sections.

old-ruby
Ben Kurtovic 9 years ago
parent
commit
9e8fd6ba08
4 changed files with 41 additions and 15 deletions
  1. +16
    -1
      app/assets/stylesheets/_header.css
  2. +22
    -11
      app/views/admin/index.html.erb
  3. +1
    -1
      app/views/layouts/application.html.erb
  4. +2
    -2
      app/views/shared/_header.html.erb

+ 16
- 1
app/assets/stylesheets/_header.css View File

@@ -1,3 +1,5 @@
/* -------------------------------- Header --------------------------------- */

header { header {
display: table; display: table;
width: 100%; width: 100%;
@@ -46,6 +48,19 @@ header nav li:not(:first-child) {
padding-left: 1em; padding-left: 1em;
} }


/* --------------------------------- Flash --------------------------------- */

div.flash { div.flash {
/**/
margin: 1em 0;
padding: 0.5em;
}

div.flash.alert {
background-color: #FFEEEE;
border: 1px solid #FFCCCC;
}

div.flash.notice {
background-color: #FFFDDD;
border: 1px solid #EEEE00;
} }

+ 22
- 11
app/views/admin/index.html.erb View File

@@ -2,16 +2,27 @@


<h1>Admin Settings</h1> <h1>Admin Settings</h1>


<%= form_tag do %>
<table>
<% Calefaction::Settings::SETTINGS.each do |s| %>
<section id="general">
<h2>General</h2>
<%= form_tag do %>
<table>
<% Calefaction::Settings::SETTINGS.each do |s| %>
<tr>
<td><%= label_tag("settings[#{s[:key]}]", s[:label]) %></td>
<td><%= setting_tag s %></td>
</tr>
<% end %>
<tr> <tr>
<td><%= label_tag("settings[#{s[:key]}]", s[:label]) %></td>
<td><%= setting_tag s %></td>
<td colspan="2"><%= submit_tag('Update') %></td>
</tr> </tr>
<% end %>
<tr>
<td colspan="2"><%= submit_tag('Update') %></td>
</tr>
</table>
<% end %>
</table>
<% end %>
</section>

<section id="tools">
<h2>Tools</h2>
</section>

<section id="users">
<h2>Users</h2>
</section>

+ 1
- 1
app/views/layouts/application.html.erb View File

@@ -1,5 +1,5 @@
<!DOCTYPE html> <!DOCTYPE html>
<html>
<html lang="en">
<head> <head>
<title><%= get_title(yield(:title)) %></title> <title><%= get_title(yield(:title)) %></title>
<%= stylesheet_link_tag 'application', media: 'all' %> <%= stylesheet_link_tag 'application', media: 'all' %>


+ 2
- 2
app/views/shared/_header.html.erb View File

@@ -13,6 +13,6 @@
</ul> </ul>
</nav> </nav>
</header> </header>
<% flash.each do |name, msg| %>
<div class="flash"><%= name %>: <%= msg %></div>
<% flash.each do |type, message| %>
<div class="flash <%= type %>"><%= message %></div>
<% end %> <% end %>

Loading…
Cancel
Save