From 21ef68515570db14af74505b61349c5136eb9198 Mon Sep 17 00:00:00 2001 From: andrew Date: Thu, 15 Nov 2007 06:49:33 +0000 Subject: [PATCH] base layout git-svn-id: http://svn.barleysodas.com/barleysodas/trunk@24 0f7b21a7-9e3a-4941-bbeb-ce5c7c368fa7 --- app/helpers/application_helper.rb | 12 + app/views/layouts/application.rhtml | 48 ++++ public/images/background.gif | Bin 0 -> 2740 bytes public/images/gravatar.gif | Bin 0 -> 138 bytes public/images/header_shadow.gif | Bin 0 -> 87 bytes public/images/spinner.gif | Bin 0 -> 1553 bytes public/stylesheets/application.css | 37 +++ public/stylesheets/content.css | 405 ++++++++++++++++++++++++++++ public/stylesheets/layout.css | 47 ++++ public/stylesheets/syntax.css | 50 ++++ 10 files changed, 599 insertions(+) create mode 100644 app/views/layouts/application.rhtml create mode 100644 public/images/background.gif create mode 100644 public/images/gravatar.gif create mode 100644 public/images/header_shadow.gif create mode 100644 public/images/spinner.gif create mode 100644 public/stylesheets/application.css create mode 100644 public/stylesheets/content.css create mode 100644 public/stylesheets/layout.css create mode 100644 public/stylesheets/syntax.css diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index cb3ce3e..648933c 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -3,10 +3,22 @@ module ApplicationHelper # Returns the title for a page. This could be a Page title or something else. # def page_title + return @page_title if @page_title return @page.title if @page "BarleySodas :: #{controller_class_name.gsub(/Controller/, '')}" 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. # diff --git a/app/views/layouts/application.rhtml b/app/views/layouts/application.rhtml new file mode 100644 index 0000000..789786e --- /dev/null +++ b/app/views/layouts/application.rhtml @@ -0,0 +1,48 @@ + + + + + <%= page_title -%> + + + + <%= stylesheet_link_tag 'application', :media => 'all' %> + <%= javascript_include_tag :defaults %> + + + + + + +
+<% flash.keys.each do |key| -%> +
+ <%= flash[key] %> +
+<% end -%> + + + +
+
+ <%= yield %> +
+ +
+
+ + + +
+ + \ No newline at end of file diff --git a/public/images/background.gif b/public/images/background.gif new file mode 100644 index 0000000000000000000000000000000000000000..003fb997b0419124f848d46befa9484e5ca340fe GIT binary patch literal 2740 zcmds$i$B!)9>(X&m>F|rNFyW4G^C-aFw&SAky|6SCM&nJRO)Ek#X230xiIJ=v1_}I zsdka<~uL@RWoWcxrHR8>3n~`KjVC!*ZXg~`F01i+vpc)z;2EYLd z22{f%BLFx+!GLOHbQAywC>T(Uj*S7}00jf8v3KtPaDajV)w}U=034uTKs7!w0e}M( z45%h1CjoGPf&ta!`}Y7iK*50O{nQiy4p1ho00$@-P<@!52EYLd22|4@KLX$Y z1p}&&Gcy1o-sU_dqh`7;0x zP%xnSY_R~~00jdo%a<i_q=5a6I+K;SG0ER)S*waZXw3?&SwK_JjpRzfdb zmJBI(a3SFYT$!vCi4sIQ8fD#RD!C@1xADTwpO!ncfA=IAiMA%jtroNkI^wHL@SB(1l^z#5FUvSF|gt*p8&zb18+eBh*HK4>Jd0<*>uqw!5NcA$*w zx=U$8=Lj@LLFaQEX=syL@F-Y?vuB$t%eMGn+w9neO3gHP0AICo_lrZbsPx+lxVw9p zP9iMf^r|EsB~S5|$XuP-B6DrRl3KR!HcF7$h0mE@8SU*zw3VqbWq0zZlcI1?zyF^` z?%JF&(tW=4CmwY2#5>hAI{|2`}+}>5?1jffC^L+A1Ho~JuK zPJjQ56eR%;2;xWc95wY@x#%z1&p`go_r%y(c{Q41f#IyHg3R|8g zk6mlgHq5=f;8zo0cd6nbS7BS9&q0&V50s%vfo4G+`A^hM5vgm4o2k3)%daQ@2fy2^ zsbjz>y4*9ZLpKJ^k9U#uW123~y4P8INdt4TF%mzwbT4_bFJCQ>mJA%&{%K$d!9C+^3Eb?2L==iB7>IS!J@x5^Nwp9;8 z-Gis7pi_Rh`V}vd8kQA-xz6{rAG^>-Sikqu*$A3 z!Ut;~s~l?`meeeo9ctLj3wia`w*LqdEp%Vd8y4+bzAHBTp<4U`|d zSfOAJXu<<<$4NOd5pzgT6yP39%9eb?G$XA2d2~{?TH$Qw7Wws5lV0>M^%+J)^KW&K za{LCJPyJAo-TMCYTct{?$OWmSPrBwn$%dY9Wjyed(exX78ezab&zw6BL1wV zi2u5SoM#rf%=}!$pF&pSme;sU8w^2qJo16Zzq+{hS+6_v;5<93cEf@`NoA|ug}ktx z8~?nSbbuES69GR zZocaDKsaAb+4^_g=CiF|3DqC!GeU+J)Ar#+OgU8*CU&J9Q;QuJQ`O0OSIRzht9R$6 zoadg2gv+?~{gszgTz$f$cwC6PoO(#-ndb3HDrToPR_)O5Sb1^loxIimK5VRa6FyUi z@=&y+SxPs@yXy6RC|bSBa>;FJhdS)~G__2vcUwfYc`DRixv&G{?tb}MC^wbXGCJ!1 z~4Q#28w>`w%*;d)-SojU@w(jc%E56*P2;2#k#9_@jK^~zJ>61yZcC=M0 s?F$Zz$K-YS={|^`_I7nD%2vGn4JBd<4X8-^I literal 0 HcmV?d00001 diff --git a/public/images/header_shadow.gif b/public/images/header_shadow.gif new file mode 100644 index 0000000000000000000000000000000000000000..9de7956bdb519a2992f5268d232ea6bafb2f6411 GIT binary patch literal 87 zcmZ?wbh9u|lw{yyIK;}Zef#!Hmo7bf_U!A|umAr2`ws&;3_t)nb99Af5rT)t{mCEg5urg=A(g z{C|6SPb~9Xage|wB`SrZk2FOMYM!buln2sX?5Y+T78iB(Zu9cS7|LZyZ++}u$^oi1 z_j@S}bW9OzU2R+RMy&~OT>X-oZ98$jq#ogNfJ!BM-42wHGZk*6s2KD}U*IA%epmxb zm}|6BK9YoIF;*xSL!+z@<64lB7->LTW2Vi4ostCA(z&2XniwNIv}fFo-`MbG;)u4G z^p@F!)|9HhZprHd_vXjDoxs6WkK-6P0@lfxnGT>*p(QHoUV=u1FAqb@b%*W=a3{`LsH5k^AvQNL>6fPpy#oU(&MuH(*aEX4b35*} zn4n7)`I2U%=+Z=?BVZQ?vjQFW4gD@~XSOO6b{qu81`4&LFuU2(ilxW+1|ZkNMnWe79C$gs zWT?Ele|HR{JGPe)5BTW>0Ey?-Ls6S#GoV0tbt6ku7B&*0 z;i9QM$W1Rj*rRIdceL)rAOSl+sDe3LkB87<%){;ZdHp6|SNlopDXRx< zxBDF9-lTo&v`8$humFygUij@qgT=Qzhj8{ym2-{Xciwqq_Xwk%=O3B-MNAL_6e`3U zyxwmXex4`g0^1RYw~Dth3av3Dl^AAlpO3mG!nLr#&ZZ7c_wUboI+deC+&%TFjK2Lm z!Y&f1h|T_On%RCV&=4bx`!>(YezqGVhl&QpED?N6GV)HmzJ9&rh$x*i?*@o9#6QI< z5ZI_MRX;0+pY8$`j)eF#TlUyG(eE%E7S!rj;mj^M5vhUicPm zVWQ2z+imFyg}SRABmOBY_@osR!>7Ov!ioK`NB6_Rv}7Ud?35ed5Sb@?yND?kv~RCa wqs^a3Sh>&&L4)!LKI?D2&k@))k(LESaga|C278ChSzn3NWVkcuNoY&{0f?~U_5c6? literal 0 HcmV?d00001 diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css new file mode 100644 index 0000000..de585e8 --- /dev/null +++ b/public/stylesheets/application.css @@ -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; +} \ No newline at end of file diff --git a/public/stylesheets/content.css b/public/stylesheets/content.css new file mode 100644 index 0000000..62fb329 --- /dev/null +++ b/public/stylesheets/content.css @@ -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; +} diff --git a/public/stylesheets/layout.css b/public/stylesheets/layout.css new file mode 100644 index 0000000..6991214 --- /dev/null +++ b/public/stylesheets/layout.css @@ -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; +} diff --git a/public/stylesheets/syntax.css b/public/stylesheets/syntax.css new file mode 100644 index 0000000..36c6f4f --- /dev/null +++ b/public/stylesheets/syntax.css @@ -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; }