summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhukl <hukl@eight.local>2009-01-31 23:14:54 +0100
committerhukl <hukl@eight.local>2009-01-31 23:14:54 +0100
commit5ccb76770646d8eb13ea379f5042670a8376d21e (patch)
tree0efb195af04acf4b8bb7ce9de9f7978661bd552d
parent8de27a58b5c401ecb324014bf9827b28f30d6044 (diff)
added everything needed to render a page
-rw-r--r--app/controllers/content_controller.rb6
-rw-r--r--app/models/node.rb21
-rw-r--r--app/views/content/render_page.html.erb3
-rw-r--r--app/views/layouts/application.html.erb199
-rwxr-xr-xpublic/images/bg.gifbin0 -> 1091 bytes
-rwxr-xr-xpublic/images/bg.pngbin0 -> 171 bytes
-rwxr-xr-xpublic/images/bg_teaser.gifbin0 -> 853 bytes
-rwxr-xr-xpublic/images/chaosknot.gifbin0 -> 3535 bytes
-rwxr-xr-xpublic/images/chaosknot.icobin0 -> 3382 bytes
-rwxr-xr-xpublic/images/hr.pngbin0 -> 150 bytes
-rwxr-xr-xpublic/images/ohne_styles.gifbin0 -> 6842 bytes
-rwxr-xr-xpublic/images/ohne_styles.pngbin0 -> 150703 bytes
-rwxr-xr-xpublic/images/ohne_styles_big.gifbin0 -> 81119 bytes
-rwxr-xr-xpublic/images/snafu_sm.pngbin0 -> 3134 bytes
-rwxr-xr-xpublic/images/t_chinese_wall.pngbin0 -> 2531 bytes
-rwxr-xr-xpublic/images/t_congress.pngbin0 -> 2729 bytes
-rwxr-xr-xpublic/images/t_fingers.pngbin0 -> 5538 bytes
-rwxr-xr-xpublic/stylesheets/ie.css16
-rwxr-xr-xpublic/stylesheets/safari.css3
-rwxr-xr-xpublic/stylesheets/styled.css486
20 files changed, 729 insertions, 5 deletions
diff --git a/app/controllers/content_controller.rb b/app/controllers/content_controller.rb
index 8059fab..a78b8b5 100644
--- a/app/controllers/content_controller.rb
+++ b/app/controllers/content_controller.rb
@@ -1,12 +1,12 @@
1class ContentController < ApplicationController 1class ContentController < ApplicationController
2 2
3 def render_page 3 def render_page
4 path = params[:page_path].join('/') 4 path = params[:pagepath].join('/')
5 5
6 @node = Node.find_by_unique_name(path) 6 @page = Node.find_page(path)
7 7
8 # Replace with real 404 8 # Replace with real 404
9 render :status => 404 unless @node 9 render :status => 404 unless @page
10 end 10 end
11 11
12end 12end
diff --git a/app/models/node.rb b/app/models/node.rb
index 6e54004..5acf563 100644
--- a/app/models/node.rb
+++ b/app/models/node.rb
@@ -3,6 +3,27 @@ class Node < ActiveRecord::Base
3 3
4 has_many :pages, :order => "revision ASC" 4 has_many :pages, :order => "revision ASC"
5 5
6 # Class methods
7
8 def self.find_page path, revision = :current
9
10 node = Node.find_by_unique_name(path)
11
12 if node
13
14 case revision
15 when :current
16 return node.pages.last
17 when /\d+/
18 return node.pages.find_by_revision revision
19 end
20 end
21
22 nil
23 end
24
25 # Instance Methods
26
6 # returns array with pages up to root excluding root 27 # returns array with pages up to root excluding root
7 def path_to_root 28 def path_to_root
8 parent.nil? && [slug] || parent.path_to_root.push(slug) 29 parent.nil? && [slug] || parent.path_to_root.push(slug)
diff --git a/app/views/content/render_page.html.erb b/app/views/content/render_page.html.erb
index af7ef88..2c65a6c 100644
--- a/app/views/content/render_page.html.erb
+++ b/app/views/content/render_page.html.erb
@@ -1,2 +1 @@
1<h1>Content#render_page</h1> <%= @page.body %> \ No newline at end of file
2<p>Find me in app/views/content/render_page.html.erb</p>
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb
index e69de29..f9f7faa 100644
--- a/app/views/layouts/application.html.erb
+++ b/app/views/layouts/application.html.erb
@@ -0,0 +1,199 @@
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml">
3 <head>
4 <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type" />
5 <title>CCC Template</title>
6 <link rel="shortcut icon" href="/images/chaosknot.ico" type="image/ico" />
7 <%= stylesheet_link_tag 'styled' %>
8 <%= stylesheet_link_tag 'safari' %>
9 <%= stylesheet_link_tag 'ie' %>
10 <!--[if lt IE 7]>
11 <style type="text/css">@import url(css/ie.css);</style>
12 <![endif]-->
13 </head>
14 <body>
15 <div id="logo">
16 <a href="index.html" title="Startseite"><img src="/images/chaosknot.gif" alt="Chaosknoten" /></a>
17 </div>
18 <!-- HEAD -->
19 <div id="header">
20 <div id="yellow">
21 </div>
22 <div id="title">
23 <h1>Chaos Computer Club</h1>
24 </div>
25 <div id="topnav">
26 <ul id="navlist">
27 <li>
28 <a href="#">Startseite</a>
29 </li>
30 <li>
31 &bull;
32 </li>
33 <li>
34 <a href="#">CCC</a>
35 </li>
36 <li>
37 &bull;
38 </li>
39 <li>
40 <a href="#">Themen</a>
41 </li>
42 <li>
43 &bull;
44 </li>
45 <li>
46 <a href="#">Kampagne</a>
47 </li>
48 <li>
49 &bull;
50 </li>
51 <li>
52 <a href="#">Projekte</a>
53 </li>
54 </ul>
55 </div>
56 </div>
57 <!-- HEAD END -->
58 <!-- CONTENT -->
59 <div id="main">
60 <div id="content">
61 <div id="precontent">
62 <h2 class="first">Precontent</h2>
63 <p>
64 Rhabarber, brable, bra..., bla, bla... (fasel)
65 </p>
66 </div>
67
68 <div class="article">
69 <div class="teaserruler">
70 <hr/>
71 </div>
72 <h2><a href="a_barriere.html"><%= @page.title %></a></h2>
73 <h3><%= @page.published_at.to_s(:db) %>, gregoa</h3>
74 <hr class="subtitle" />
75 <%= @page.body %>
76 </div>
77 </div>
78
79 <!-- CONTENT END -->
80 <!-- TEASERBAR -->
81 <div id="teaserbar">
82 <div class="teaserimg">
83 <ul class="teaserimg">
84 <li>
85 <a href="#" title="ChaosCommunicationsCongress"><img src="/images/t_congress.png" alt="Congress" /></a>
86 </li>
87 <li>
88 <a href="#" title="Chinesewall.ccc.de"><img src="/images/t_chinese_wall.png" alt="www.chinesewall.ccc.de" /></a>
89 </li>
90 <li>
91 <a href="#" title="Fingerabdr&uuml;cke"><img src="/images/t_fingers.png" alt="Fingerabrdr&uuml;cke" /></a>
92 </li>
93 </ul>
94 </div><hr/>
95 <div class="teasertext">
96 <h2>Termine / News</h2>
97 <ul class="teasertext">
98 <li>
99 <a href="#">Chaosdock 2008</a>
100 </li>
101 <li>
102 <a href="#">Metarheinmain Chaosdays
103 <br/>
104 <span class="black">mrmcd111b</span>
105 </a>
106 </li>
107 <li>
108 <a href="#"><span class="black">Kˆln: <span class="orange">OpenChaos</span> zu Dynamisches Routing</span></a>
109 </li>
110 <li>
111 <a href="#">CCCS <span class="black">- Braucht Freiheit (‹berwachungs-) Sicherheit?</span></a>
112 </li>
113 </ul>
114 </div>
115 <hr/>
116 <div id="foerderer">
117 <h2>Sponsoren</h2>
118 <ul id="sponsorlist">
119 <li>
120 <a href="http://www.snafu.de/"><img src="/images/snafu_sm.png" alt="snafu: So geht man ins Netz" /></a>
121 </li>
122 </ul>
123 </div>
124 </div>
125 <!-- TEASERBAR END -->
126 <!-- NAVBAR -->
127 <div id="navbar">
128 <form method="get" action="/cgi-bin/search.pl">
129 <p>
130 <label>
131 Finden
132 </label>
133 <br/>
134 <input type="text" name="query" />
135 </p>
136 </form>
137 <div class="navbarruler">
138 <hr/>
139 </div>
140 <div class="firstnavbar">
141 <ul class="firstnavbar">
142 <li>
143 <a href="#">Anmelden</a>
144 </li>
145 <li>
146 <a href="#">Registrieren</a>
147 </li>
148 <li>
149 <a href="#">Barrierefreiheit</a>
150 </li>
151 <li>
152 <a href="page.zip" title="Current page">Download</a>
153 </li>
154 </ul>
155 </div>
156 <div class="navbarruler">
157 <hr/>
158 </div>
159 <div id="secondnavbar">
160 <h2>Topics</h2>
161 <ul id="secnavbar">
162 <li>
163 <a href="#">Wahlcomputer</a>
164 </li>
165 <li>
166 <a href="#">ePass</a>
167 </li>
168 <li>
169 <a href="#">Rechtekontrolle</a>
170 </li>
171 <li>
172 <a href="#">Plastikgeld</a>
173 </li>
174 <li>
175 <a href="#">Hackerethik</a>
176 </li>
177 <li>
178 <a href="#">Netzzensur</a>
179 </li>
180 </ul>
181 </div>
182 </div>
183 <!-- NAVBAR END -->
184 </div>
185 <!-- MAIN END -->
186 <!-- FOOTER -->
187 <div id="footer">
188 <div id="footer_left">
189 Kabelsalat ist gesund
190 </div>
191 <div id="footer_rest">
192 <a href="#">Impressum</a>
193 </div>
194 </div>
195 <div id="fnord">
196 </div>
197 <!-- FOOTER -->
198 </body>
199</html> \ No newline at end of file
diff --git a/public/images/bg.gif b/public/images/bg.gif
new file mode 100755
index 0000000..c2e3805
--- /dev/null
+++ b/public/images/bg.gif
Binary files differ
diff --git a/public/images/bg.png b/public/images/bg.png
new file mode 100755
index 0000000..ac55f29
--- /dev/null
+++ b/public/images/bg.png
Binary files differ
diff --git a/public/images/bg_teaser.gif b/public/images/bg_teaser.gif
new file mode 100755
index 0000000..c84c0d7
--- /dev/null
+++ b/public/images/bg_teaser.gif
Binary files differ
diff --git a/public/images/chaosknot.gif b/public/images/chaosknot.gif
new file mode 100755
index 0000000..f6b5c3a
--- /dev/null
+++ b/public/images/chaosknot.gif
Binary files differ
diff --git a/public/images/chaosknot.ico b/public/images/chaosknot.ico
new file mode 100755
index 0000000..cd6afd2
--- /dev/null
+++ b/public/images/chaosknot.ico
Binary files differ
diff --git a/public/images/hr.png b/public/images/hr.png
new file mode 100755
index 0000000..024b190
--- /dev/null
+++ b/public/images/hr.png
Binary files differ
diff --git a/public/images/ohne_styles.gif b/public/images/ohne_styles.gif
new file mode 100755
index 0000000..4c1560e
--- /dev/null
+++ b/public/images/ohne_styles.gif
Binary files differ
diff --git a/public/images/ohne_styles.png b/public/images/ohne_styles.png
new file mode 100755
index 0000000..262174d
--- /dev/null
+++ b/public/images/ohne_styles.png
Binary files differ
diff --git a/public/images/ohne_styles_big.gif b/public/images/ohne_styles_big.gif
new file mode 100755
index 0000000..a59ebf0
--- /dev/null
+++ b/public/images/ohne_styles_big.gif
Binary files differ
diff --git a/public/images/snafu_sm.png b/public/images/snafu_sm.png
new file mode 100755
index 0000000..3b19d9c
--- /dev/null
+++ b/public/images/snafu_sm.png
Binary files differ
diff --git a/public/images/t_chinese_wall.png b/public/images/t_chinese_wall.png
new file mode 100755
index 0000000..b76a8f0
--- /dev/null
+++ b/public/images/t_chinese_wall.png
Binary files differ
diff --git a/public/images/t_congress.png b/public/images/t_congress.png
new file mode 100755
index 0000000..58b8178
--- /dev/null
+++ b/public/images/t_congress.png
Binary files differ
diff --git a/public/images/t_fingers.png b/public/images/t_fingers.png
new file mode 100755
index 0000000..d692b1e
--- /dev/null
+++ b/public/images/t_fingers.png
Binary files differ
diff --git a/public/stylesheets/ie.css b/public/stylesheets/ie.css
new file mode 100755
index 0000000..05ec223
--- /dev/null
+++ b/public/stylesheets/ie.css
@@ -0,0 +1,16 @@
1* html #topnav {
2 margin: 0.9em 0 0 3.48em;
3}
4
5* html #main {
6 background: url(../images/bg_teaser.gif)
7}
8
9* html #teaserbar {
10 border: 0;
11}
12
13/*
14div {
15 border: solid 1px red;
16} */
diff --git a/public/stylesheets/safari.css b/public/stylesheets/safari.css
new file mode 100755
index 0000000..5a5c824
--- /dev/null
+++ b/public/stylesheets/safari.css
@@ -0,0 +1,3 @@
1.quell {
2 font-size: 1.2em;
3}
diff --git a/public/stylesheets/styled.css b/public/stylesheets/styled.css
new file mode 100755
index 0000000..8af3299
--- /dev/null
+++ b/public/stylesheets/styled.css
@@ -0,0 +1,486 @@
1/* CCC CSS:
2 * Start: 29. Oct. 2008
3 * Url: http://ccc.de//css/style.css
4 *
5 * Body fontsize: 11px = 0.69em
6 * em calc: http://riddle.pl/emcalc/
7 *
8 * Colors:
9 * #EEE = Header BG
10 * #FFCA08 = Yellow
11 * #999 = h2 Precontent
12 * #4d4d4d = Navigation
13 * #eab407 = Content Headers
14 * #fbb03b = Orange, Teaserbar Subheaders
15 */
16
17#wrapper {
18 margin:0;
19 padding: 0;
20 top: 0;
21 bottom: 0;
22}
23
24/* HEADER */
25#header {
26 background: #EEE;
27 height: 7.08em;
28 border: solid silver;
29 border-width: 0 0 .09em .09em;
30}
31
32#yellow {
33 background: #FFCA08;
34 height: 1.27em;
35}
36
37#title {
38 width: 68em;
39 margin: .68em 0 0 7em;
40}
41
42#title h1 {
43 float: left;
44 padding: 0;
45 margin: 0;
46 font-size: 1.91em;
47 font-weight: normal;
48 color: #000;
49}
50
51#topnav {
52 clear: left;
53 width: 68em;
54 padding: 0;
55 margin: 0.9em 0 0 7em;
56 float: left;
57 text-transform: uppercase;
58}
59
60#topnav ul {
61 margin: 0;
62 padding: 0;
63}
64
65#navlist li {
66 display: inline;
67 list-style-type: none;
68 padding-right: .7em;
69 color: #4d4d4d;
70}
71
72#navlist a {
73 text-decoration: none;
74 color: #4d4d4d;
75}
76
77#navlist a:hover {
78 text-decoration: underline;
79 color: #4d4d4d;
80}
81
82#logo {
83 position: absolute;
84 top: 2em;
85 left: 79.2em;
86 width: 12.27em;
87 height: 8.73em;
88}
89
90#logo img {
91 width: 12.27em;
92 height: 8.73em;
93}
94/* HEADER END */
95
96/* CONTENT */
97#main {
98 position: relative;
99 bottom: 3.5em;
100 width: 91.3em;
101 top: 0;
102}
103
104#content {
105 position: relative;
106 padding: .9em 6em 2em 8em;
107 width: 41.75em;
108 border-right: solid .09em silver;
109}
110
111#content .article {
112 position: relative;
113 padding-top: 1em;
114 clear: both;
115}
116
117#content .article img {
118 float:left;
119 margin: .5em 1em 1em;
120 border: .09em solid silver;
121}
122
123#content h2.first {
124 padding: .28em 0 .45em 0;
125 margin: 0;
126 /* text-align: center;
127 /* color: #eab407; */
128}
129
130#content h2 {
131 padding: 1.2em 0 .45em 0;
132 margin: 0;
133 text-align: center;
134 color: #eab407;
135}
136
137#precontent h2 {
138 color: #999;
139 text-align: left;
140}
141
142#content h2 a {
143 margin: 0;
144 padding: 0;
145 text-align: center;
146 color: #eab407;
147 font-family: Georgia;
148 font-weight: normal;
149}
150
151#content h2 a:hover {
152 padding: 0;
153 text-decoration: underline;
154}
155
156#content h3 {
157 padding: 0 0 .45em 0;
158 margin: 0;
159 text-align: center;
160 color: #666;
161 font-family: Times;
162 font-size: 1.18em;
163 font-style: italic;
164 font-weight: normal;
165}
166
167hr.subtitle {
168 background: silver;
169 height: .09em;
170 width: 10.91em;
171}
172
173.quell {
174 color: #0000C0;
175 font-size: 1em;
176 line-height: 1.3em;
177 font-family: "Courier New",Courier,monospace;
178
179}
180
181#content p {
182 color: #4d4d4d;
183 font-family: Verdana;
184 line-height: 1.8em;
185 margin: 0;
186 padding: 0;
187}
188
189#precontent p {
190 margin-top: 0;
191 line-height: 1.8em;
192}
193
194#content a {
195 padding: 1em;
196 margin: -1em;
197 color: #4d4d4d;
198 font-family: Verdana;
199 text-decoration: none;
200}
201
202#content a:hover {
203 padding: 1em;
204 text-decoration: underline;
205}
206
207div.teaserruler {
208 background: url(../images/hr.png);
209 border: 0 none;
210 height: .09em;
211}
212
213div.teaserruler hr {
214 display: none;
215}
216/* CONTENT END */
217
218/* TEASERBAR */
219#teaserbar {
220 position: absolute;
221 top: 0;
222 left: 55.88em;
223 bottom: 0;
224 float: left;
225 padding-top: 1.8em;
226 width: 19.9em;
227 border-right: solid .09em silver;
228}
229
230.teaserimg ul {
231 list-style-type: none;
232 padding: 0;
233 margin: 0;
234 text-align: center;
235}
236
237.teaserimg img {
238 /* Size: 170px x 58px */
239 width: 15.45em;
240 height: 5.27em;
241}
242
243.teaserimg li {
244 padding-bottom: 1.1em;
245}
246
247.teasertext ul {
248 list-style-type: none;
249 padding: 0 1em;
250 margin: 0;
251}
252
253.teasertext li {
254 padding-bottom: 1.2em;
255}
256
257.teasertext a {
258 color: #fbb03b;
259 text-decoration: none;
260}
261
262.teasertext a:hover {
263 text-decoration: underline;
264}
265
266#foerderer {
267}
268
269#foerderer h2 {
270 padding: 0.686em 0pt 0.8em 0.7em;
271 margin: 0;
272}
273
274#foerderer ul {
275 list-style-type: none;
276 padding: 0;
277 margin: 0;
278 text-align: center;
279}
280
281#sponsorlist img {
282 /* Size: 160px x 49px */
283 width: 14.55em;
284 height: 4.45em;
285}
286
287#sponsorlist li {
288 padding-bottom: 1.1em;
289}
290/* TEASERBAR END */
291
292/* NAVBAR */
293#navbar {
294 position: absolute;
295 top: 0;
296 bottom: 0;
297 left: 75.9em;
298 padding: 0.9em 1.5em;
299 width: 12.3em;
300}
301
302#navbar h2 {
303 padding: .28em 0 .45em 0;
304 margin: 0;
305 color: #999;
306}
307
308/* SEARCHFORM */
309form {
310 padding: 0 0 .3em .24em;
311 margin-top: -.23em;
312}
313
314form p {
315 margin: 0;
316}
317
318label {
319 color: #999;
320 font-family: Georgia;
321 font-size: 1.64em;
322 font-weight: normal;
323 margin-left: -.2em;
324 line-height: 2em;
325}
326
327input {
328 font-size: 1em;
329 width: 9em;
330 border:.09em solid #000;
331}
332
333input.check {
334 float:left;
335 width: 1em;
336 height: 1em;
337 margin: 0.3em 0;
338 color: #000;
339 background: #fff;
340 border: solid .09em #000;
341}
342
343label.foren {
344 padding-left: .4em;
345 color: #4d4d4d;
346 font-family: Verdana;
347 font-size: 1em;
348 line-height: 1.7em;
349}
350
351div.navbarruler {
352 margin: 1.3em -.2em .8em;
353 background: url(../images/hr.png);
354 border: 0 none;
355 height: .09em;
356}
357div.navbarruler hr {
358 display: none;
359}
360
361/* 1ST NAV RIGHT */
362.firstnavbar ul {
363 padding:0;
364 margin:0;
365 list-style: none
366}
367
368.firstnavbar li {
369 padding-bottom: 1em;
370 margin:0;
371 list-style: none
372}
373
374.firstnavbar li a {
375 color: #6f8745;
376 text-decoration: none;
377}
378
379.firstnavbar li a:hover {
380 color: #6f8745;
381 text-decoration: underline;
382}
383
384#secondnavbar ul {
385 padding-left: 1.1em;
386 margin: 0;
387}
388
389/* 2ND NAV RIGHT */
390#secnavbar li {
391 padding-bottom: 1em;
392 margin:0;
393 color: #6f8745;
394}
395
396#secnavbar a {
397 color: #6f8745;
398 text-decoration: none;
399}
400
401#secnavbar a:hover {
402 color: #6f8745;
403 text-decoration: underline;
404}
405/* NAVBAR END */
406
407/* FOOTER */
408#footer {
409 clear: both;
410 border: solid silver;
411 border-width: .09em 0 .09em 0;
412 height: 2.5em;
413 background: #fff;
414 width: 100%;
415}
416
417#footer_left {
418 float: left;
419 width: 16.7em;
420 height: 2.5em;
421 background: #FFCA08;
422 text-transform: uppercase;
423 text-align: center;
424 line-height: 2.3em;
425 border-right: solid .09em silver;
426}
427
428#footer_rest {
429 float: left;
430 padding-left: 1.9em;
431 line-height: 2.3em;
432}
433
434#fnord {
435 height: 1em;
436}
437/* FOOTER END */
438
439/* SYSTEMWEITE DEFS */
440.black {
441 color: #4d4d4d;
442}
443
444.orange {
445 color: #fbb03b;
446}
447
448h2 {
449 padding: .686em 0 .8em .7em;
450 margin: 0;
451 text-align: left;
452 color: #999;
453}
454
455a {
456 color: #999;
457 text-decoration: none;
458}
459
460a:hover {
461 text-decoration: underline;
462}
463
464hr {
465 border: 0;
466 background: silver;
467 height: .09em;
468}
469
470img {
471 border: 0;
472}
473
474h2 {
475 font-family: Georgia;
476 font-size: 1.64em;
477 font-weight: normal;
478}
479
480body {
481 margin: 0;
482 padding: 0;
483 background: #fff url(../images/bg.png) repeat-x;
484 font-family: Verdana;
485 font-size: 0.69em;
486} \ No newline at end of file