base layout

git-svn-id: http://svn.barleysodas.com/barleysodas/trunk@24 0f7b21a7-9e3a-4941-bbeb-ce5c7c368fa7
master
andrew 2007-11-15 06:49:33 +00:00
parent 290add240e
commit 21ef685155
10 changed files with 599 additions and 0 deletions

View File

@ -3,10 +3,22 @@ module ApplicationHelper
# Returns the title for a page. This could be a Page title or something else. # Returns the title for a page. This could be a Page title or something else.
# #
def page_title def page_title
return @page_title if @page_title
return @page.title if @page return @page.title if @page
"BarleySodas :: #{controller_class_name.gsub(/Controller/, '')}" "BarleySodas :: #{controller_class_name.gsub(/Controller/, '')}"
end end
##
# Returns a secondary title for a page. Returns @secondary_title or the
# action in the controller.
#
def secondary_title
return @secondary_title if @secondary_title
return params[:action].to_s.capitalize.gsub(/_/) do |x|
$1.capitalize
end
end
## ##
# Returns a link for a Page model. # Returns a link for a Page model.
# #

View File

@ -0,0 +1,48 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>
<%= page_title -%>
</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<%= stylesheet_link_tag 'application', :media => 'all' %>
<%= javascript_include_tag :defaults %>
<script type="text/javascript">
<%= @content_for_script %>
</script>
</head>
<body>
<div id="container">
<% flash.keys.each do |key| -%>
<div id="<%= key -%>">
<%= flash[key] %>
</div>
<% end -%>
<div id="header">
<h1><%= page_title -%></h1>
<h2><%= secondary_title -%></h2>
</div>
<div id="page">
<div id="content">
<%= yield %>
</div>
<div id="sidebar">
<p>todo</p>
</div>
<br style="clear:both;" />
</div>
<div id="footer">
<hr />
<p><a href="http://www.penguincoder.org">PenguinCoder</a></p>
</div>
</div>
</body>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
public/images/gravatar.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 B

BIN
public/images/spinner.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -0,0 +1,37 @@
/*--------------------------------------------------------------
Application.css
Imports all stylesheets; sets defaults for bare elements
--------------------------------------------------------------*/
@import 'layout.css';
@import 'content.css';
@import 'syntax.css';
@media print { #sidebar { display: none; }
#content { float: none; width: 90%; }
#content pre { color: #000; background: #eee; }
#content form.comments { display: none; } }
body {
background: url(/images/background.gif) repeat-x left top;
font: normal 12px "lucida grande", verdana, sans-serif;
}
input,
textarea { font: normal 12px "bitstream vera sans", verdana, sans-serif; }
abbr { border: none; }
cite { font-style: normal; }
a img { border: none; padding: 0; margin: 0; }
a:link, a:visited { color: #000; }
a:hover, a:active { color: #fff; background: #000; }
/* http://longren.org/2006/09/27/wrapping-text-inside-pre-tags */
pre {
white-space: pre-wrap;
white-space: -moz-pre-wrap !important;
white-space: -pre-wrap;
white-space: -o-pre-wrap;
word-wrap: break-word;
}

View File

@ -0,0 +1,405 @@
/*--------------------------------------------------------------
Header
--------------------------------------------------------------*/
#header {
background: url(/images/header_shadow.gif) repeat-x left bottom;
}
#header a:link,
#header a:visited {
color: #000;
text-decoration: none;
}
#header a:hover,
#header a:active {
color: #930; background: transparent;
text-decoration: none;
}
#header h1 {
font: bold 410% georgia, serif;
letter-spacing: -1px;
margin: 0;
float: left;
}
#header h2 {
font: normal 12px verdana, arial, sans-serif;
margin: 2.35em 0.2em 0 0;
float: right;
}
/*--------------------------------------------------------------
Content
--------------------------------------------------------------*/
#content {}
#content h1,
#content h2,
#content h3,
#content h4,
#content h5 {
font-family: georgia, times;
font-weight: normal;
letter-spacing: -1px;
}
#content h1 {
font-size: 28px;
margin: 0 0 0.3em;
}
#content h2 {
font-size: 24px;
margin: 0 0 0.3em;
}
#content h3 {
font-size: 22px;
margin: 1.2em 0 0.3em;
}
#content h4 {
font-size: 20px;
margin: 1.2em 0 0.3em;
border-bottom: 1px dotted #bbb;
}
#content h5 {
font-size: 20px;
background: #ffd;
margin: 1.2em 0 0.3em;
border-bottom: 1px dotted #aaa;
}
#content p {
line-height: 14px;
margin: 0 0 1.2em;
}
#content ul,
#content ol {
margin: 1em;
padding:0;
}
#content ul {
list-style-type: square;
}
#content li {
line-height: 15px;
margin: 0 0 0 1em; padding: 0;
}
#content blockquote {
color: #555;
border-left: 5px solid #ccc;
margin: 1.3em 1em; padding: 0 1em;
}
#content code {
font: normal 12px "bitstream vera sans mono", monaco "lucida console", "courier new", courier, serif;
}
#content pre {
color: #63FF00;
background: #000;
overflow: auto;
font: normal 12px "bitstream vera sans mono", monaco "lucida console", "courier new", courier, serif;
margin: 0.9em 0; padding: 8px;
}
/* Article Entries - class names based on http://microformats.org/wiki/hatom] */
#content .hentry {
margin: 0 0 3em 0;
}
#content .hentry .entry-title {
font-size: 30px;
line-height: 99%;
letter-spacing: -1.5px;
margin: 0;
}
#content .hentry .entry-title a:link,
#content .hentry .entry-title a:visited {
color: #111;
text-decoration: none;
}
#content .hentry .entry-title a:hover,
#content .hentry .entry-title a:active {
background: transparent;
text-decoration: underline;
}
#content .hentry .entry-title .comment_count { color: #eee; }
#content .hentry .vcard,
#content .hentry .published {
float: left;
color: #a9a9a9;
font: normal 16px/14px helvetica, arial, verdana, sans-serif;
letter-spacing: -1px;
margin: 1px 0 0.6em 2px;
}
#content .hentry .fn {
font-weight:bold;
margin-right: 5px;
}
#content .hentry .fn a,
#content .hentry .fn a:hover {
color: #aaa; background: transparent;
text-decoration: none;
}
#content .hentry .clear { clear: both; }
#content .hentry .entry-content { }
#content .hentry ul.meta {
font-size: 10px;
background: #eee;
margin: 0; padding: 5px;
border: 1px solid #ddd;
list-style-type: none;
}
#content .hentry ul.meta li {
line-height: 13px;
margin: 0; padding: 0;
}
#content .hentry .meta a:link,
#content .hentry .meta a:visited {
color: #555;
text-decoration: none;
border-bottom: 1px dotted #aaa;
}
#content .hentry .meta a:hover,
#content .hentry .meta a:active {
color: #fff;
}
/* Comments and Trackbacks */
#content ol.comments,
#content ol.trackbacks {
list-style-type: none;
margin: 0; padding: 0;
}
#content li.comment,
#content li.trackback {
border: 2px solid #ddd;
margin: 0 0 1.5em; padding: 1em;
}
#content li.comment.preview {
background: #ffc;
border: 3px solid #fab444;
margin: 0 0 1.5em; padding: 1em;
}
#content li.comment .author,
#content li.trackback .author {
font-weight: bold;
margin-bottom: 1em;
}
#content li.comment .author cite,
#content li.trackback .author cite {
font-size: 16px;
letter-spacing: -1px;
}
#content li.comment .author abbr,
#content li.trackback .author abbr { color: #999; }
#content li.comment .author .gravatar {
margin: 0 0 0.5em 0.5em;
float: right;
}
#content li.comment .author div {
margin: 0 0 0.5em 0.5em;
width: 60px; height: 60px;
background: url(/images/gravatar.gif) no-repeat left top;
float: right;
}
#content form.comments {
background: #f2f2f2;
border-top: 1px solid #ddd;
padding: 1em 0.5em;
}
#content form.comments fieldset {
border: none;
}
#content form.comments legend {
display: none;
}
#content form.comments label {
font-weight: bold;
}
#content form.comments textarea {
width: 90%; height: 150px;
padding: 3px;
}
/*--------------------------------------------------------------
Sidebar
--------------------------------------------------------------*/
#sidebar {
font-size: 11px;
}
#sidebar h3 {
font: bold 14px "lucidamac bold", "lucida grande", verdana, arial, helvetica, sans-serif;
margin: 0 0 0.5em;
}
#sidebar h3 a:link,
#sidebar h3 a:visited {
color: #000; text-decoration: none;
}
#sidebar h3 a:hover,
#sidebar h3 a:active {
background: transparent; text-decoration: underline;
}
#sidebar ul {
list-style-type: none;
margin: 0 0 2em; padding: 0;
}
#sidebar li {
margin: 0;
padding: 1px 0;
}
#sidebar em { font-style: normal; }
/* Live-search and results */
#sidebar .search p {
margin: 0;
}
#sidebar .search p input {
font-size: 11px; width: 92%;
}
#sidebar .search .loading {
background: url(/images/spinner.gif) no-repeat left 50%;
margin: 1em 0; padding: 0 0 0 20px;
height: 15px;
}
#sidebar .search .results {
margin: 0 0 1.25em;
}
#sidebar .search .results h3 {
margin-top: 1em;
}
#sidebar .search .results p {
font: bold 14px "lucidamac bold", "lucida grande", verdana, arial, helvetica, sans-serif;
margin: 0 0 0.5em;
}
#sidebar .search .results ul {
margin: 0; padding: 3px;
}
#sidebar .search .results li { background: #ffc; padding: 0.2em; }
#sidebar .search .results a:link,
#sidebar .search .results a:visited {
color: #222;
}
#sidebar .search .results a:hover,
#sidebar .search .results a:active {
color: #fff;
}
/* Flickr sidebar-node */
#sidebar #flickr {
margin: 0 0 2em;
clear: both;
}
#sidebar #flickr div {
}
#sidebar #flickr img {
margin: 0 0 5px;
padding: 5px;
border: 1px solid #ddd;
display: block;
}
#sidebar #flickr img:hover {
background: #ffc;
}
#sidebar #flickr a {
border: none;
}
/*--------------------------------------------------------------
Footer
--------------------------------------------------------------*/
#footer {
border-top: 1px solid #ccc;
font-size: 90%;
}
#footer a:link,
#footer a:visited {
color: #000;
}
#footer a:hover,
#footer a:active {
color: #fff;
background: #000;
}
#footer hr {
display: none;
}
#footer p {
width: 40%;
float: left;
margin: 0; padding: 0;
}
#footer ul {
width: 40%;
margin: 0; padding: 0;
list-style-type: none;
text-align: right;
float: right;
}
#footer li {
margin: 0; padding: 0 0 0 1em;
display: inline;
}

View File

@ -0,0 +1,47 @@
/**
* Controls the main layout (width, height, margin, padding)
*
* #container
* #header
* #page
* #content
* #sidebar
* #footer
*/
body {
text-align: center;
margin: 0; padding: 0.6em 1em 1em 1em;
}
#container {
width: 900px;
text-align: left;
margin: 0 auto; padding: 0;
}
#header {
height: 62px;
margin: 0 -0.5px 12px 0; padding: 0;
}
#page {}
#content {
float: left;
width: 662px;
padding: 0 0 0 5px;
}
#sidebar {
float: right;
text-align: left;
width: 200px;
padding-left: 15px;
border-left: 1px dotted #ddd;
}
#footer {
height: 40px;
margin: 10px 0 0; padding: 10px 0 0;
clear:both;
}

View File

@ -0,0 +1,50 @@
/*--------------------------------------------------------------
Syntax Highlighting - contributed by James Wilford
Closely matches TextMate's "All Hallow's Eve" theme
--------------------------------------------------------------*/
#content .typocode { margin: 0.9em 0; padding: 8px; background: #000; }
#content .typocode pre { margin: 0; padding: 0;}
#content .typocode_linenumber .lineno { text-align: right; }
#content .typocode_linenumber .lineno pre { width: 23px; padding-right: 3px; color: #777; background: #222; }
#content .typocode_ruby .normal {}
#content .typocode_ruby .comment { color: #9933cc; }
#content .typocode_ruby .keyword { color: #cc7833; }
#content .typocode_ruby .method { color: #fff; }
#content .typocode_ruby .class { color: #fff; text-decoration: underline; }
#content .typocode_ruby .module { color: #fff; text-decoration: underline; }
#content .typocode_ruby .punct { color: #fff; }
#content .typocode_ruby .symbol { color: #3387cc; }
#content .typocode_ruby .string { color: #66cc33; }
#content .typocode_ruby .char { color: #f07; }
#content .typocode_ruby .ident { color: #fff; }
#content .typocode_ruby .constant { color: #fff; }
#content .typocode_ruby .regex { color: #cccc33; }
#content .typocode_ruby .number { color: #3387cc; }
#content .typocode_ruby .attribute { color: #fff; }
#content .typocode_ruby .global { color: #7fb; }
#content .typocode_ruby .expr { color: #fff; }
#content .typocode_ruby .escape { color: #277; }
#content .typocode_xml .normal {}
#content .typocode_xml .namespace { color: #c60; font-weight: bold; }
#content .typocode_xml .tag { color: #9ff; }
#content .typocode_xml .comment { color: #ccc; font-style: italic; }
#content .typocode_xml .punct { color: #0d0; font-weight: bold; }
#content .typocode_xml .string { color: #c03; }
#content .typocode_xml .number { color: #ff0; }
#content .typocode_xml .attribute { color: #bb7; }
#content .typocode_yaml .normal {}
#content .typocode_yaml .document { color: #07f; font-weight: bold; }
#content .typocode_yaml .type { color: #c60; font-weight: bold; }
#content .typocode_yaml .key { color: #c60; }
#content .typocode_yaml .comment { color: #ccc; font-style: italic; }
#content .typocode_yaml .punct { color: #0d0; font-weight: bold; }
#content .typocode_yaml .string { color: #c03; }
#content .typocode_yaml .number { color: #ff0; }
#content .typocode_yaml .time { color: #ff0; }
#content .typocode_yaml .date { color: #ff0; }
#content .typocode_yaml .ref { color: #944; }
#content .typocode_yaml .anchor { color: #944; }