@@ -13,3 +13,8 @@ | |||||
*= require_tree . | *= require_tree . | ||||
*= require_self | *= require_self | ||||
*/ | */ | ||||
img#corp_logo { | |||||
width: 64px; | |||||
height: 64px; | |||||
} |
@@ -1,8 +1,9 @@ | |||||
module AdminHelper | module AdminHelper | ||||
SETTINGS = [ | SETTINGS = [ | ||||
{:key => 'site_name', :label => 'Site name'}, | {:key => 'site_name', :label => 'Site name'}, | ||||
{:key => 'corporation', :label => 'Corporation'}, | |||||
{:key => 'description', :label => 'Home page description', :textarea => true}, | |||||
{:key => 'corp_name', :label => 'Corporation name'}, | |||||
{:key => 'corp_id', :label => 'Corporation ID', :size => 10}, | |||||
{:key => 'description', :label => 'Welcome message', :textarea => true}, | |||||
{:key => 'copyright', :label => 'Copyright'}, | {:key => 'copyright', :label => 'Copyright'}, | ||||
] | ] | ||||
end | end |
@@ -7,13 +7,16 @@ module ApplicationHelper | |||||
title.empty? ? base : "#{title} : #{base}" | title.empty? ? base : "#{title} : #{base}" | ||||
end | end | ||||
def get_copyright_year | |||||
def corp_logo_tag | |||||
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") | |||||
end | |||||
def copyright_year | |||||
start = 2015 | start = 2015 | ||||
year = Time.now.year | year = Time.now.year | ||||
year > start ? "#{start}–#{year}" : start | year > start ? "#{start}–#{year}" : start | ||||
end | end | ||||
def get_copyright_holders | |||||
AdminSetting.get('copyright') | |||||
end | |||||
end | end |
@@ -1,6 +1,2 @@ | |||||
module ToolsHelper | module ToolsHelper | ||||
def get_description | |||||
AdminSetting.get('description') | |||||
end | |||||
end | end |
@@ -10,7 +10,7 @@ | |||||
<% if s[:textarea] %> | <% if s[:textarea] %> | ||||
<td><%= text_area_tag("settings[#{s[:key]}]", AdminSetting.get(s[:key]), size: "60x5") %></td> | <td><%= text_area_tag("settings[#{s[:key]}]", AdminSetting.get(s[:key]), size: "60x5") %></td> | ||||
<% else %> | <% else %> | ||||
<td><%= text_field_tag("settings[#{s[:key]}]", AdminSetting.get(s[:key]), size: 40) %></td> | |||||
<td><%= text_field_tag("settings[#{s[:key]}]", AdminSetting.get(s[:key]), size: s[:size] || 40) %></td> | |||||
<% end %> | <% end %> | ||||
</tr> | </tr> | ||||
<% end %> | <% end %> | ||||
@@ -1,6 +1,6 @@ | |||||
<div id="footer"> | <div id="footer"> | ||||
<p> | <p> | ||||
Copyright © <%= get_copyright_year %> <%= get_copyright_holders %> | |||||
Copyright © <%= copyright_year %> <%= AdminSetting.get('copyright') %> | |||||
• | • | ||||
Running <a href="//github.com/earwig/calefaction">Calefaction</a> <%= Calefaction::Version::VERSION_STRING %> | Running <a href="//github.com/earwig/calefaction">Calefaction</a> <%= Calefaction::Version::VERSION_STRING %> | ||||
• | • | ||||
@@ -1,4 +1,8 @@ | |||||
<div id="header"> | <div id="header"> | ||||
<h1> | |||||
<%= corp_logo_tag %> | |||||
<%= AdminSetting.get('corp_name') %> | |||||
</h1> | |||||
<p> | <p> | ||||
<%= link_to 'Home', controller: 'tools', action: 'index' %> | <%= link_to 'Home', controller: 'tools', action: 'index' %> | ||||
</p> | </p> | ||||
@@ -2,4 +2,4 @@ | |||||
<p>Tools: ...</p> | <p>Tools: ...</p> | ||||
<p><%= get_description %></p> | |||||
<p><%= AdminSetting.get('description') %></p> |
@@ -6,7 +6,9 @@ | |||||
# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }]) | # cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }]) | ||||
# Mayor.create(name: 'Emanuel', city: cities.first) | # Mayor.create(name: 'Emanuel', city: cities.first) | ||||
AdminSetting.add('site_name', 'Your Corporation Site') | |||||
AdminSetting.add('corporation', 'Your Corporation') | |||||
AdminSetting.add('description', 'Your corporation\'s description goes here!') | |||||
AdminSetting.add('site_name', 'Your Corporation\'s Site') | |||||
AdminSetting.add('corp_name', 'Your Corporation') | |||||
AdminSetting.add('corp_id', '1') | |||||
AdminSetting.add('copyright', 'Your Corporation/Your Name') | AdminSetting.add('copyright', 'Your Corporation/Your Name') | ||||
AdminSetting.add('description', | |||||
'Welcome to your corporation\'s website! This message can be changed in the admin settings panel.') |