Browse Source

Reorganize CSS, cleanup.

old-ruby
Ben Kurtovic 9 years ago
parent
commit
04523f51b7
5 changed files with 79 additions and 52 deletions
  1. +51
    -0
      app/assets/stylesheets/_header.css
  2. +0
    -23
      app/assets/stylesheets/application.css
  3. +1
    -1
      app/helpers/application_helper.rb
  4. +13
    -14
      app/views/layouts/application.html.erb
  5. +14
    -14
      app/views/shared/_header.html.erb

+ 51
- 0
app/assets/stylesheets/_header.css View File

@@ -0,0 +1,51 @@
header {
display: table;
width: 100%;
background-color: #EEE;
}

header #corp-banner {
display: table-cell;
}

header #corp-banner a {
text-decoration: none;
color: black;
font-family: sans-serif;
}

header #corp-banner img {
width: 64px;
height: 64px;
vertical-align: middle;
margin-right: 0.5em;
}

header #corp-banner span {
font-size: 250%;
vertical-align: middle;
}

header nav {
display: table-cell;
text-align: right;
vertical-align: middle;
}

header nav ul {
padding-left: 0;
margin-right: 1.5em;
}

header nav li {
display: inline;
list-style-type: none;
}

header nav li:not(:first-child) {
padding-left: 1em;
}

div.flash {
/**/
}

+ 0
- 23
app/assets/stylesheets/application.css View File

@@ -13,26 +13,3 @@
*= require_tree .
*= require_self
*/

header #home-link {
text-decoration: none;
color: black;
font-family: sans-serif;
}

header #corp-logo {
width: 64px;
height: 64px;
vertical-align: middle;
margin-right: 0.5em;
}

header #corp-name {
font-size: 250%;
vertical-align: middle;
}

header #user-links {
float: right;
margin: 0.5em;
}

+ 1
- 1
app/helpers/application_helper.rb View File

@@ -11,7 +11,7 @@ module ApplicationHelper
corp_id = AdminSetting.get(:corp_id)
corp_name = AdminSetting.get(:corp_name)
image_tag("https://image.eveonline.com/Corporation/#{corp_id}_256.png",
id: 'corp-logo', title: corp_name, alt: "#{corp_name} Logo")
title: corp_name, alt: "#{corp_name} Logo")
end

def copyright_year


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

@@ -1,17 +1,16 @@
<!DOCTYPE html>
<html>
<head>
<title><%= get_title(yield(:title)) %></title>
<%= stylesheet_link_tag 'application', media: 'all' %>
<%= javascript_include_tag 'application' %>
<%= csrf_meta_tags %>
</head>
<body>
<%= render "shared/header" %>
</div>
<main>
<%= yield %>
</main>
<%= render "shared/footer" %>
</body>
<head>
<title><%= get_title(yield(:title)) %></title>
<%= stylesheet_link_tag 'application', media: 'all' %>
<%= javascript_include_tag 'application' %>
<%= csrf_meta_tags %>
</head>
<body>
<%= render "shared/header" %>
<main>
<%= yield %>
</main>
<%= render "shared/footer" %>
</body>
</html>

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

@@ -1,18 +1,18 @@
<header>
<%= link_to(root_url, id: 'home-link') do %>
<%= corp_logo_tag %>
<span id="corp-name">
<%= AdminSetting.get(:corp_name) %>
</span>
<% end %>
<span id="user-links">
<%= link_to 'Signup', controller: 'users', action: 'signup' %>
&bull;
<%= link_to 'Login', controller: 'users', action: 'login' %>
&bull;
<%= link_to 'Admin', controller: 'admin', action: 'index' %>
</span>
<div id="corp-banner">
<%= link_to(root_url) do %>
<%= corp_logo_tag %>
<span><%= AdminSetting.get(:corp_name) %></span>
<% end %>
</div>
<nav>
<ul>
<li><%= link_to 'Signup', controller: 'users', action: 'signup' %></li>
<li><%= link_to 'Login', controller: 'users', action: 'login' %></li>
<li><%= link_to 'Admin', controller: 'admin', action: 'index' %></li>
</ul>
</nav>
</header>
<% flash.each do |name, msg| %>
<div class="flash">FLASH: <%= name %>: <%= msg %></div>
<div class="flash"><%= name %>: <%= msg %></div>
<% end %>

Loading…
Cancel
Save