diff options
| author | hukl <contact@smyck.org> | 2009-02-22 13:23:38 +0100 |
|---|---|---|
| committer | hukl <contact@smyck.org> | 2009-02-22 13:23:38 +0100 |
| commit | 51e91975cbfb81de40f2b8dd0ddada84b0c93ae6 (patch) | |
| tree | 9c88fbcc1408814a4470590c4adc15feba487227 | |
| parent | c39eb1e9839664deb68b50b2a9db16770d42852c (diff) | |
created route for home page, removed rails index.html
| -rw-r--r-- | app/models/node.rb | 2 | ||||
| -rw-r--r-- | app/views/content/render_page.html.erb | 10 | ||||
| -rw-r--r-- | app/views/layouts/application.html.erb | 26 | ||||
| -rw-r--r-- | config/routes.rb | 7 | ||||
| -rw-r--r-- | lib/tasks/development_init.rake | 14 | ||||
| -rw-r--r-- | public/index.html | 274 |
6 files changed, 24 insertions, 309 deletions
diff --git a/app/models/node.rb b/app/models/node.rb index a6e3867..c99143f 100644 --- a/app/models/node.rb +++ b/app/models/node.rb | |||
| @@ -24,7 +24,7 @@ class Node < ActiveRecord::Base | |||
| 24 | unless revision.class == Fixnum | 24 | unless revision.class == Fixnum |
| 25 | raise ArgumentError, "revision must be a Fixnum" | 25 | raise ArgumentError, "revision must be a Fixnum" |
| 26 | end | 26 | end |
| 27 | 27 | ||
| 28 | node = Node.find_by_unique_name(path) | 28 | node = Node.find_by_unique_name(path) |
| 29 | 29 | ||
| 30 | if node | 30 | if node |
diff --git a/app/views/content/render_page.html.erb b/app/views/content/render_page.html.erb index f499c9c..ca35403 100644 --- a/app/views/content/render_page.html.erb +++ b/app/views/content/render_page.html.erb | |||
| @@ -1,14 +1,4 @@ | |||
| 1 | <div id="precontent"> | ||
| 2 | <h2 class="first">Precontent</h2> | ||
| 3 | <p> | ||
| 4 | Rhabarber, brable, bra..., bla, bla... (fasel) | ||
| 5 | </p> | ||
| 6 | </div> | ||
| 7 | |||
| 8 | <div class="article"> | 1 | <div class="article"> |
| 9 | <div class="teaserruler"> | ||
| 10 | <hr/> | ||
| 11 | </div> | ||
| 12 | <h2><a href="a_barriere.html"><%= @page.title %></a></h2> | 2 | <h2><a href="a_barriere.html"><%= @page.title %></a></h2> |
| 13 | <h3><%= date_for_page @page %>, <%= @page.user.try(:login) %></h3> | 3 | <h3><%= date_for_page @page %>, <%= @page.user.try(:login) %></h3> |
| 14 | <hr class="subtitle" /> | 4 | <hr class="subtitle" /> |
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 6886a5f..828f5b2 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb | |||
| @@ -25,12 +25,6 @@ | |||
| 25 | <div id="topnav"> | 25 | <div id="topnav"> |
| 26 | <ul id="navlist"> | 26 | <ul id="navlist"> |
| 27 | <li> | 27 | <li> |
| 28 | <a href="#">Startseite</a> | ||
| 29 | </li> | ||
| 30 | <li> | ||
| 31 | • | ||
| 32 | </li> | ||
| 33 | <li> | ||
| 34 | <a href="#">CCC</a> | 28 | <a href="#">CCC</a> |
| 35 | </li> | 29 | </li> |
| 36 | <li> | 30 | <li> |
| @@ -43,7 +37,7 @@ | |||
| 43 | • | 37 | • |
| 44 | </li> | 38 | </li> |
| 45 | <li> | 39 | <li> |
| 46 | <a href="#">Kampagne</a> | 40 | <a href="#">Termine</a> |
| 47 | </li> | 41 | </li> |
| 48 | <li> | 42 | <li> |
| 49 | • | 43 | • |
| @@ -123,23 +117,7 @@ | |||
| 123 | <hr/> | 117 | <hr/> |
| 124 | </div> | 118 | </div> |
| 125 | <div class="firstnavbar"> | 119 | <div class="firstnavbar"> |
| 126 | <ul class="firstnavbar"> | 120 | |
| 127 | <li> | ||
| 128 | <a href="#">Anmelden</a> | ||
| 129 | </li> | ||
| 130 | <li> | ||
| 131 | <a href="#">Registrieren</a> | ||
| 132 | </li> | ||
| 133 | <li> | ||
| 134 | <a href="#">Barrierefreiheit</a> | ||
| 135 | </li> | ||
| 136 | <li> | ||
| 137 | <a href="page.zip" title="Current page">Download</a> | ||
| 138 | </li> | ||
| 139 | </ul> | ||
| 140 | </div> | ||
| 141 | <div class="navbarruler"> | ||
| 142 | <hr/> | ||
| 143 | </div> | 121 | </div> |
| 144 | <div id="secondnavbar"> | 122 | <div id="secondnavbar"> |
| 145 | <h2>Topics</h2> | 123 | <h2>Topics</h2> |
diff --git a/config/routes.rb b/config/routes.rb index ff9a13b..2fd3705 100644 --- a/config/routes.rb +++ b/config/routes.rb | |||
| @@ -1,4 +1,11 @@ | |||
| 1 | ActionController::Routing::Routes.draw do |map| | 1 | ActionController::Routing::Routes.draw do |map| |
| 2 | map.root( | ||
| 3 | :locale => 'de', | ||
| 4 | :controller => 'content', | ||
| 5 | :action => 'render_page', | ||
| 6 | :page_path => ['home'] | ||
| 7 | ) | ||
| 8 | |||
| 2 | map.filter :locale | 9 | map.filter :locale |
| 3 | 10 | ||
| 4 | map.resources :pages | 11 | map.resources :pages |
diff --git a/lib/tasks/development_init.rake b/lib/tasks/development_init.rake index 886474b..cdfe9e9 100644 --- a/lib/tasks/development_init.rake +++ b/lib/tasks/development_init.rake | |||
| @@ -39,4 +39,18 @@ namespace :cccms do | |||
| 39 | i = UpdateImporter.new("#{RAILS_ROOT}/db/updates") | 39 | i = UpdateImporter.new("#{RAILS_ROOT}/db/updates") |
| 40 | i.import_xml | 40 | i.import_xml |
| 41 | end | 41 | end |
| 42 | |||
| 43 | desc "Create Home Page" | ||
| 44 | task :create_home_page => :environment do |t| | ||
| 45 | n = Node.create :slug => 'home' | ||
| 46 | n.move_to_child_of Node.root | ||
| 47 | |||
| 48 | d = n.draft | ||
| 49 | d.title = "Startseite" | ||
| 50 | d.abstract = "Wilkommen auf der Seite des CCC" | ||
| 51 | d.body = "Hier gibts content" | ||
| 52 | d.save | ||
| 53 | |||
| 54 | n.publish_draft! | ||
| 55 | end | ||
| 42 | end \ No newline at end of file | 56 | end \ No newline at end of file |
diff --git a/public/index.html b/public/index.html deleted file mode 100644 index e84c359..0000000 --- a/public/index.html +++ /dev/null | |||
| @@ -1,274 +0,0 @@ | |||
| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | ||
| 2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | ||
| 3 | <html> | ||
| 4 | <head> | ||
| 5 | <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> | ||
| 6 | <title>Ruby on Rails: Welcome aboard</title> | ||
| 7 | <style type="text/css" media="screen"> | ||
| 8 | body { | ||
| 9 | margin: 0; | ||
| 10 | margin-bottom: 25px; | ||
| 11 | padding: 0; | ||
| 12 | background-color: #f0f0f0; | ||
| 13 | font-family: "Lucida Grande", "Bitstream Vera Sans", "Verdana"; | ||
| 14 | font-size: 13px; | ||
| 15 | color: #333; | ||
| 16 | } | ||
| 17 | |||
| 18 | h1 { | ||
| 19 | font-size: 28px; | ||
| 20 | color: #000; | ||
| 21 | } | ||
| 22 | |||
| 23 | a {color: #03c} | ||
| 24 | a:hover { | ||
| 25 | background-color: #03c; | ||
| 26 | color: white; | ||
| 27 | text-decoration: none; | ||
| 28 | } | ||
| 29 | |||
| 30 | |||
| 31 | #page { | ||
| 32 | background-color: #f0f0f0; | ||
| 33 | width: 750px; | ||
| 34 | margin: 0; | ||
| 35 | margin-left: auto; | ||
| 36 | margin-right: auto; | ||
| 37 | } | ||
| 38 | |||
| 39 | #content { | ||
| 40 | float: left; | ||
| 41 | background-color: white; | ||
| 42 | border: 3px solid #aaa; | ||
| 43 | border-top: none; | ||
| 44 | padding: 25px; | ||
| 45 | width: 500px; | ||
| 46 | } | ||
| 47 | |||
| 48 | #sidebar { | ||
| 49 | float: right; | ||
| 50 | width: 175px; | ||
| 51 | } | ||
| 52 | |||
| 53 | #footer { | ||
| 54 | clear: both; | ||
| 55 | } | ||
| 56 | |||
| 57 | |||
| 58 | #header, #about, #getting-started { | ||
| 59 | padding-left: 75px; | ||
| 60 | padding-right: 30px; | ||
| 61 | } | ||
| 62 | |||
| 63 | |||
| 64 | #header { | ||
| 65 | background-image: url("images/rails.png"); | ||
| 66 | background-repeat: no-repeat; | ||
| 67 | background-position: top left; | ||
| 68 | height: 64px; | ||
| 69 | } | ||
| 70 | #header h1, #header h2 {margin: 0} | ||
| 71 | #header h2 { | ||
| 72 | color: #888; | ||
| 73 | font-weight: normal; | ||
| 74 | font-size: 16px; | ||
| 75 | } | ||
| 76 | |||
| 77 | |||
| 78 | #about h3 { | ||
| 79 | margin: 0; | ||
| 80 | margin-bottom: 10px; | ||
| 81 | font-size: 14px; | ||
| 82 | } | ||
| 83 | |||
| 84 | #about-content { | ||
| 85 | background-color: #ffd; | ||
| 86 | border: 1px solid #fc0; | ||
| 87 | margin-left: -11px; | ||
| 88 | } | ||
| 89 | #about-content table { | ||
| 90 | margin-top: 10px; | ||
| 91 | margin-bottom: 10px; | ||
| 92 | font-size: 11px; | ||
| 93 | border-collapse: collapse; | ||
| 94 | } | ||
| 95 | #about-content td { | ||
| 96 | padding: 10px; | ||
| 97 | padding-top: 3px; | ||
| 98 | padding-bottom: 3px; | ||
| 99 | } | ||
| 100 | #about-content td.name {color: #555} | ||
| 101 | #about-content td.value {color: #000} | ||
| 102 | |||
| 103 | #about-content.failure { | ||
| 104 | background-color: #fcc; | ||
| 105 | border: 1px solid #f00; | ||
| 106 | } | ||
| 107 | #about-content.failure p { | ||
| 108 | margin: 0; | ||
| 109 | padding: 10px; | ||
| 110 | } | ||
| 111 | |||
| 112 | |||
| 113 | #getting-started { | ||
| 114 | border-top: 1px solid #ccc; | ||
| 115 | margin-top: 25px; | ||
| 116 | padding-top: 15px; | ||
| 117 | } | ||
| 118 | #getting-started h1 { | ||
| 119 | margin: 0; | ||
| 120 | font-size: 20px; | ||
| 121 | } | ||
| 122 | #getting-started h2 { | ||
| 123 | margin: 0; | ||
| 124 | font-size: 14px; | ||
| 125 | font-weight: normal; | ||
| 126 | color: #333; | ||
| 127 | margin-bottom: 25px; | ||
| 128 | } | ||
| 129 | #getting-started ol { | ||
| 130 | margin-left: 0; | ||
| 131 | padding-left: 0; | ||
| 132 | } | ||
| 133 | #getting-started li { | ||
| 134 | font-size: 18px; | ||
| 135 | color: #888; | ||
| 136 | margin-bottom: 25px; | ||
| 137 | } | ||
| 138 | #getting-started li h2 { | ||
| 139 | margin: 0; | ||
| 140 | font-weight: normal; | ||
| 141 | font-size: 18px; | ||
| 142 | color: #333; | ||
| 143 | } | ||
| 144 | #getting-started li p { | ||
| 145 | color: #555; | ||
| 146 | font-size: 13px; | ||
| 147 | } | ||
| 148 | |||
| 149 | |||
| 150 | #search { | ||
| 151 | margin: 0; | ||
| 152 | padding-top: 10px; | ||
| 153 | padding-bottom: 10px; | ||
| 154 | font-size: 11px; | ||
| 155 | } | ||
| 156 | #search input { | ||
| 157 | font-size: 11px; | ||
| 158 | margin: 2px; | ||
| 159 | } | ||
| 160 | #search-text {width: 170px} | ||
| 161 | |||
| 162 | |||
| 163 | #sidebar ul { | ||
| 164 | margin-left: 0; | ||
| 165 | padding-left: 0; | ||
| 166 | } | ||
| 167 | #sidebar ul h3 { | ||
| 168 | margin-top: 25px; | ||
| 169 | font-size: 16px; | ||
| 170 | padding-bottom: 10px; | ||
| 171 | border-bottom: 1px solid #ccc; | ||
| 172 | } | ||
| 173 | #sidebar li { | ||
| 174 | list-style-type: none; | ||
| 175 | } | ||
| 176 | #sidebar ul.links li { | ||
| 177 | margin-bottom: 5px; | ||
| 178 | } | ||
| 179 | |||
| 180 | </style> | ||
| 181 | <script type="text/javascript" src="javascripts/prototype.js"></script> | ||
| 182 | <script type="text/javascript" src="javascripts/effects.js"></script> | ||
| 183 | <script type="text/javascript"> | ||
| 184 | function about() { | ||
| 185 | if (Element.empty('about-content')) { | ||
| 186 | new Ajax.Updater('about-content', 'rails/info/properties', { | ||
| 187 | method: 'get', | ||
| 188 | onFailure: function() {Element.classNames('about-content').add('failure')}, | ||
| 189 | onComplete: function() {new Effect.BlindDown('about-content', {duration: 0.25})} | ||
| 190 | }); | ||
| 191 | } else { | ||
| 192 | new Effect[Element.visible('about-content') ? | ||
| 193 | 'BlindUp' : 'BlindDown']('about-content', {duration: 0.25}); | ||
| 194 | } | ||
| 195 | } | ||
| 196 | |||
| 197 | window.onload = function() { | ||
| 198 | $('search-text').value = ''; | ||
| 199 | $('search').onsubmit = function() { | ||
| 200 | $('search-text').value = 'site:rubyonrails.org ' + $F('search-text'); | ||
| 201 | } | ||
| 202 | } | ||
| 203 | </script> | ||
| 204 | </head> | ||
| 205 | <body> | ||
| 206 | <div id="page"> | ||
| 207 | <div id="sidebar"> | ||
| 208 | <ul id="sidebar-items"> | ||
| 209 | <li> | ||
| 210 | <form id="search" action="http://www.google.com/search" method="get"> | ||
| 211 | <input type="hidden" name="hl" value="en" /> | ||
| 212 | <input type="text" id="search-text" name="q" value="site:rubyonrails.org " /> | ||
| 213 | <input type="submit" value="Search" /> the Rails site | ||
| 214 | </form> | ||
| 215 | </li> | ||
| 216 | |||
| 217 | <li> | ||
| 218 | <h3>Join the community</h3> | ||
| 219 | <ul class="links"> | ||
| 220 | <li><a href="http://www.rubyonrails.org/">Ruby on Rails</a></li> | ||
| 221 | <li><a href="http://weblog.rubyonrails.org/">Official weblog</a></li> | ||
| 222 | <li><a href="http://wiki.rubyonrails.org/">Wiki</a></li> | ||
| 223 | </ul> | ||
| 224 | </li> | ||
| 225 | |||
| 226 | <li> | ||
| 227 | <h3>Browse the documentation</h3> | ||
| 228 | <ul class="links"> | ||
| 229 | <li><a href="http://api.rubyonrails.org/">Rails API</a></li> | ||
| 230 | <li><a href="http://stdlib.rubyonrails.org/">Ruby standard library</a></li> | ||
| 231 | <li><a href="http://corelib.rubyonrails.org/">Ruby core</a></li> | ||
| 232 | </ul> | ||
| 233 | </li> | ||
| 234 | </ul> | ||
| 235 | </div> | ||
| 236 | |||
| 237 | <div id="content"> | ||
| 238 | <div id="header"> | ||
| 239 | <h1>Welcome aboard</h1> | ||
| 240 | <h2>You’re riding Ruby on Rails!</h2> | ||
| 241 | </div> | ||
| 242 | |||
| 243 | <div id="about"> | ||
| 244 | <h3><a href="rails/info/properties" onclick="about(); return false">About your application’s environment</a></h3> | ||
| 245 | <div id="about-content" style="display: none"></div> | ||
| 246 | </div> | ||
| 247 | |||
| 248 | <div id="getting-started"> | ||
| 249 | <h1>Getting started</h1> | ||
| 250 | <h2>Here’s how to get rolling:</h2> | ||
| 251 | |||
| 252 | <ol> | ||
| 253 | <li> | ||
| 254 | <h2>Use <tt>script/generate</tt> to create your models and controllers</h2> | ||
| 255 | <p>To see all available options, run it without parameters.</p> | ||
| 256 | </li> | ||
| 257 | |||
| 258 | <li> | ||
| 259 | <h2>Set up a default route and remove or rename this file</h2> | ||
| 260 | <p>Routes are set up in config/routes.rb.</p> | ||
| 261 | </li> | ||
| 262 | |||
| 263 | <li> | ||
| 264 | <h2>Create your database</h2> | ||
| 265 | <p>Run <tt>rake db:migrate</tt> to create your database. If you're not using SQLite (the default), edit <tt>config/database.yml</tt> with your username and password.</p> | ||
| 266 | </li> | ||
| 267 | </ol> | ||
| 268 | </div> | ||
| 269 | </div> | ||
| 270 | |||
| 271 | <div id="footer"> </div> | ||
| 272 | </div> | ||
| 273 | </body> | ||
| 274 | </html> \ No newline at end of file | ||
