Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Switch from Haml to ERB

  • Loading branch information...
commit c87a0f01f1b1d64996f2ab9f96eeda5e53b7024c 1 parent 19c8a52
Michael Fellinger authored
49 layout/default.erb
... ... @@ -0,0 +1,49 @@
  1 +<html>
  2 + <head>
  3 + <title>Ramaze Wiki</title>
  4 + <link rel="stylesheet" type="text/css" href="/css/screen.css" />
  5 + <link rel="stylesheet" type="text/css" href="/css/coderay.css" />
  6 + <% if uv_style = session[:uv_style] %>
  7 + <link rel="stylesheet" type="text/css" href="/css/<%= uv_style %>.css" />
  8 + <% end %>
  9 + </head>
  10 + <body>
  11 + <div class="head">
  12 + <div class="title">
  13 + <a href="/Home" alt="Home"><img src="/logo.png" alt="Ramaze Wiki" /></a>
  14 + </div>
  15 + <div class="menu">
  16 + <div class="locale">
  17 + <a href="<%= r(:language, 'en') %>">English</a>
  18 + <a href="<%= r(:language, 'de') %>">Deutsch</a>
  19 + <a href="<%= r(:language, 'ja') %>">日本語</a>
  20 + </div>
  21 + <a href="http://ramaze.net">Ramaze</a>
  22 + <a href="/list">List Pages</a>
  23 + <a href="<%= r(:random) %>">Random Page</a>
  24 + <% if logged_in? %>
  25 + <a href="<%= Auth.r(:logout) %>">Log out</a>
  26 + <% else %>
  27 + <a href="<%= Auth.r(:login) %>">Log in</a>
  28 + <% end %>
  29 + </div>
  30 + </div>
  31 + <div class="content">
  32 + <%= @content %>
  33 + </div>
  34 + <div class="footer">
  35 + <div class="copy">
  36 + <a rel="license" href="http://creativecommons.org/licenses/by-sa/2.1/jp/">
  37 + <img alt="Creative Commons License" src="http://i.creativecommons.org/l/by-sa/2.1/jp/88x31.png" />
  38 + </a>
  39 + <br />
  40 + <span href="http://purl.org/dc/dcmitype/Text" xmlns:dc="http://purl.org/dc/elements/1.1" property="dc:title" rel="dc:type">Ramaze Wiki</span>
  41 + by
  42 + <a href="http://wiki.ramaze.net" xmlns:cc="http://creativecommons.org/ns#" property="cc:attributionName" rel="cc:attributionURL">Michael Fellinger</a>
  43 + is licensed under a
  44 + <a href="http://creativecommons.org/licenses/by-sa/2.1/jp/" rel="license">Creative Commons Attributions-Share Alike 2.1 Japan License</a>
  45 + .
  46 + </div>
  47 + </div>
  48 + </body>
  49 +</html>
43 layout/default.haml
... ... @@ -1,43 +0,0 @@
1   -!!! XML
2   -!!!
3   -
4   -%html
5   - %head
6   - %title= l('Ramaze Wiki')
7   - %link{:rel => 'stylesheet', :href => '/css/screen.css', :type => 'text/css'}
8   - %link{:rel => 'stylesheet', :href => '/css/coderay.css', :type => 'text/css'}
9   - - if uv_style = session[:uv_style]
10   - %link{:rel => 'stylesheet', :href => "/css/#{uv_style}.css", :type => 'text/css'}
11   - %body
12   - .head
13   - .title
14   - %a{:href => '/Home', :alt => 'Home'}
15   - %h1= l('Ramaze Wiki')
16   - %h2= l('A minimal git based wiki')
17   - .menu
18   - .locale
19   - %a{:href => r(:language, 'en')} English
20   - %a{:href => r(:language, 'de')} Deutsch
21   - %a{:href => r(:language, 'ja')} 日本語
22   - %a{:href => 'http://ramaze.net'}= l('Ramaze')
23   - %a{:href => '/list'}= l('List Pages')
24   - %a{:href => r(:random)}= l('Random Page')
25   - - if logged_in?
26   - %a{:href => Auth.r(:logout)}= l('Log out')
27   - - else
28   - %a{:href => Auth.r(:login)}= l('Log in')
29   - .content= content
30   - .footer
31   - .copy
32   - %a{:rel => :license, :href => 'http://creativecommons.org/licenses/by-sa/2.1/jp/'}
33   - %img{:alt => 'Creative Commons License', :style => 'border-width: 0', :src => 'http://i.creativecommons.org/l/by-sa/2.1/jp/88x31.png'}
34   - %br/
35   - %span{'xmlns:dc' => 'http://purl.org/dc/elements/1.1', :href => 'http://purl.org/dc/dcmitype/Text', :property => 'dc:title', :rel => 'dc:type'}
36   - Ramaze Wiki
37   - by
38   - %a{'xmlns:cc' => 'http://creativecommons.org/ns#', :href => 'http://wiki.ramaze.net', :property => 'cc:attributionName', :rel => 'cc:attributionURL'}
39   - Michael Fellinger
40   - is licensed under a
41   - %a{:rel => :license, :href => 'http://creativecommons.org/licenses/by-sa/2.1/jp/'}
42   - Creative Commons Attributions-Share Alike 2.1 Japan License
43   - \.
7 node/css.rb
... ... @@ -1,7 +0,0 @@
1   -class CSSNode
2   - include Innate::Node
3   - map '/css'
4   -
5   - provide :css => :none # serve .css plain
6   - provide :sass => :sass # serve .css.sass through Sass
7   -end
3  node/init.rb
... ... @@ -1,3 +0,0 @@
1   -require 'node/css'
2   -require 'node/page'
3   -require 'node/auth'
2  node/page.rb
@@ -4,7 +4,7 @@ class PageNode
4 4 layout 'default'
5 5 helper :user, :localize
6 6
7   - provide :html => :haml
  7 + provide :html => :erb
8 8
9 9 def index(*name)
10 10 redirect r(:/, 'Home') if name.empty?
147 public/css/screen.css
... ... @@ -0,0 +1,147 @@
  1 +* {
  2 + margin: 0;
  3 + padding: 0;
  4 +}
  5 +body {
  6 + background: #fff;
  7 + margin: 0;
  8 + padding: 0;
  9 +}
  10 +textarea {
  11 + width: 95%;
  12 + height: 20em;
  13 + display: block;
  14 + padding: 1em;
  15 +}
  16 +input.submit {
  17 + width: 95%;
  18 +}
  19 +img {
  20 + border: 0;
  21 +}
  22 +.content {
  23 + clear: both;
  24 + padding: 1em;
  25 +}
  26 +.content table {
  27 + width: 70%;
  28 + margin: 2em;
  29 + text-align: center;
  30 + border-spacing: 0;
  31 + border-collapse: collapse;
  32 +}
  33 +.content table tr td {
  34 + padding: 0.2em;
  35 + width: 25%;
  36 +}
  37 +.content .list {
  38 + margin-top: 0em;
  39 +}
  40 +.content .list ul {
  41 + margin-left: 1em;
  42 +}
  43 +.content .list ul li {
  44 + margin: 0.2em;
  45 +}
  46 +h1, h2, h3, h4, h5, h6 {
  47 + margin: 0;
  48 + margin-top: 1em;
  49 +}
  50 +.content .text a.missing-wiki-link, .content .list a.missing-wiki-link {
  51 + color: #f00;
  52 +}
  53 +.content .text a.existing-wiki-link, .content .list a.existing-wiki-link {
  54 + color: #00f;
  55 +}
  56 +.content .text p, .content .list p {
  57 + padding: 0.5em;
  58 +}
  59 +.content .text ul {
  60 + padding-left: 2em;
  61 + margin-top: 1em;
  62 +}
  63 +.content .text code, .content .list code {
  64 + background: #eee;
  65 +}
  66 +.content .text div.CodeRay, .content .list div.CodeRay {
  67 + margin: 0.5em;
  68 + padding: 0.5em;
  69 +}
  70 +.content .toc {
  71 + clear: right;
  72 + font-size: 0.8em;
  73 + float: right;
  74 + padding: 0.5em;
  75 + border: 1px solid #ddd;
  76 + background: #eee;
  77 +}
  78 +.content .toc ol {
  79 + list-style-type: none;
  80 + margin-left: 0.5em;
  81 +}
  82 +.content .toc ol li {
  83 + list-style-type: none;
  84 + margin-left: 0.5em;
  85 +}
  86 +.mod, .uv_select {
  87 + margin: 0.5em;
  88 + font-size: 0.8em;
  89 + float: right;
  90 + padding: 0.5em;
  91 + border: 1px solid #ddd;
  92 + background: #eee;
  93 +}
  94 +.history {
  95 + padding: 1em;
  96 +}
  97 +.history table {
  98 + border-collapse: collapse;
  99 +}
  100 +.history table tr.current {
  101 + background: #efe;
  102 +}
  103 +.history table tr.old {
  104 + background: #ddd;
  105 +}
  106 +.history table td {
  107 + border: 1px solid #ddd;
  108 + padding: 0.2em;
  109 +}
  110 +.diff {
  111 + margin-top: 1em;
  112 + overflow: auto;
  113 +}
  114 +.head {
  115 + background: #38f;
  116 + color: #fff;
  117 + height: 4em;
  118 +}
  119 +.head a {
  120 + color: #fff;
  121 +}
  122 +.head .title {
  123 + color: #fff;
  124 + padding: 0.5em;
  125 +}
  126 +.head .menu {
  127 + background: #38f;
  128 + position: absolute;
  129 + right: 0.5em;
  130 + top: 0.5em;
  131 + line-height: 1.5em;
  132 + text-align: right;
  133 +}
  134 +.head .menu a {
  135 + color: #fff;
  136 + padding: 0.2em;
  137 + text-decoration: none;
  138 +}
  139 +.head .menu a:hover {
  140 + background: #669;
  141 +}
  142 +.footer {
  143 + clear: both;
  144 + padding-top: 3em;
  145 + text-align: center;
  146 + font-size: 0.8em;
  147 +}
0  view/css/uv.css → public/css/uv.css
File renamed without changes
BIN  public/logo.png
2  start.rb
@@ -30,7 +30,7 @@
30 30 # gem :uv
31 31 # gem :git
32 32
33   - require 'env', 'model/page', 'node/init'
  33 + require 'env', 'model/page', 'node/page', 'node/auth'
34 34
35 35 start :adapter => :mongrel
36 36 end
19 view/auth/login.erb
... ... @@ -0,0 +1,19 @@
  1 +<div id="login">
  2 + <form method="post">
  3 + <fieldset>
  4 + <legend>Log in</legend>
  5 +
  6 + <div class="pair">
  7 + <label for="form_user">Username</label>
  8 + <input id="form_user" type="text" name="user" />
  9 + </div>
  10 +
  11 + <div class="pair">
  12 + <label for="form_pass">Password</label>
  13 + <input id="form_pass" type="password" name="pass" />
  14 + </div>
  15 +
  16 + <input type="submit" value="Log in" />
  17 + </fieldset>
  18 + </form>
  19 +</div>
11 view/auth/login.haml
... ... @@ -1,11 +0,0 @@
1   -#login
2   - %form{:method => :post}
3   - %fieldset
4   - %legend= l('Log in')
5   - .pair
6   - %label{:for => :form_user}= l('Username')
7   - %input#form_user{:type => :text, :name => :user}
8   - .pair
9   - %label{:for => :form_pass}= l('Password')
10   - %input#form_pass{:type => :password, :name => :pass}
11   - %input{:type => :submit, :value => l('Log in')}
104 view/css/coderay.css
... ... @@ -1,104 +0,0 @@
1   -.CodeRay {
2   - background-color: #f8f8f8;
3   - border: 1px solid silver;
4   - font-family: 'Courier New', 'Terminal', monospace;
5   - color: #100;
6   -}
7   -.CodeRay pre { margin: 0px }
8   -
9   -div.CodeRay { width: 70%; }
10   -
11   -span.CodeRay { white-space: pre; border: 0px; padding: 2px }
12   -
13   -table.CodeRay { border-collapse: collapse; width: 100%; padding: 2px }
14   -table.CodeRay td { padding: 2px 4px; vertical-align: top }
15   -
16   -.CodeRay .line_numbers, .CodeRay .no {
17   - background-color: #def;
18   - color: gray;
19   - text-align: right;
20   -}
21   -.CodeRay .line_numbers tt { font-weight: bold }
22   -.CodeRay .no { padding: 0px 4px }
23   -.CodeRay .code { width: 100% }
24   -
25   -ol.CodeRay { font-size: 10pt }
26   -ol.CodeRay li { white-space: pre }
27   -
28   -.CodeRay .code pre { overflow: auto }
29   -
30   -.CodeRay .af { color:#00C }
31   -.CodeRay .an { color:#007 }
32   -.CodeRay .av { color:#700 }
33   -.CodeRay .aw { color:#C00 }
34   -.CodeRay .bi { color:#509; font-weight:bold }
35   -.CodeRay .c { color:#888 }
36   -
37   -.CodeRay .ch { color:#04D }
38   -.CodeRay .ch .k { color:#04D }
39   -.CodeRay .ch .dl { color:#039 }
40   -
41   -.CodeRay .cl { color:#B06; font-weight:bold }
42   -.CodeRay .co { color:#036; font-weight:bold }
43   -.CodeRay .cr { color:#0A0 }
44   -.CodeRay .cv { color:#369 }
45   -.CodeRay .df { color:#099; font-weight:bold }
46   -.CodeRay .di { color:#088; font-weight:bold }
47   -.CodeRay .dl { color:black }
48   -.CodeRay .do { color:#970 }
49   -.CodeRay .ds { color:#D42; font-weight:bold }
50   -.CodeRay .e { color:#666; font-weight:bold }
51   -.CodeRay .en { color:#800; font-weight:bold }
52   -.CodeRay .er { color:#F00; background-color:#FAA }
53   -.CodeRay .ex { color:#F00; font-weight:bold }
54   -.CodeRay .fl { color:#60E; font-weight:bold }
55   -.CodeRay .fu { color:#06B; font-weight:bold }
56   -.CodeRay .gv { color:#d70; font-weight:bold }
57   -.CodeRay .hx { color:#058; font-weight:bold }
58   -.CodeRay .i { color:#00D; font-weight:bold }
59   -.CodeRay .ic { color:#B44; font-weight:bold }
60   -
61   -.CodeRay .il { background: #eee }
62   -.CodeRay .il .il { background: #ddd }
63   -.CodeRay .il .il .il { background: #ccc }
64   -.CodeRay .il .idl { font-weight: bold; color: #888 }
65   -
66   -.CodeRay .in { color:#B2B; font-weight:bold }
67   -.CodeRay .iv { color:#33B }
68   -.CodeRay .la { color:#970; font-weight:bold }
69   -.CodeRay .lv { color:#963 }
70   -.CodeRay .oc { color:#40E; font-weight:bold }
71   -.CodeRay .on { color:#000; font-weight:bold }
72   -.CodeRay .op { }
73   -.CodeRay .pc { color:#038; font-weight:bold }
74   -.CodeRay .pd { color:#369; font-weight:bold }
75   -.CodeRay .pp { color:#579 }
76   -.CodeRay .pt { color:#339; font-weight:bold }
77   -.CodeRay .r { color:#080; font-weight:bold }
78   -
79   -.CodeRay .rx { background-color:#fff0ff }
80   -.CodeRay .rx .k { color:#808 }
81   -.CodeRay .rx .dl { color:#404 }
82   -.CodeRay .rx .mod { color:#C2C }
83   -.CodeRay .rx .fu { color:#404; font-weight: bold }
84   -
85   -.CodeRay .s { background-color:#fff0f0 }
86   -.CodeRay .s .s { background-color:#ffe0e0 }
87   -.CodeRay .s .s .s { background-color:#ffd0d0 }
88   -.CodeRay .s .k { color:#D20 }
89   -.CodeRay .s .dl { color:#710 }
90   -
91   -.CodeRay .sh { background-color:#f0fff0 }
92   -.CodeRay .sh .k { color:#2B2 }
93   -.CodeRay .sh .dl { color:#161 }
94   -
95   -.CodeRay .sy { color:#A60 }
96   -.CodeRay .sy .k { color:#A60 }
97   -.CodeRay .sy .dl { color:#630 }
98   -
99   -.CodeRay .ta { color:#070 }
100   -.CodeRay .tf { color:#070; font-weight:bold }
101   -.CodeRay .ts { color:#D70; font-weight:bold }
102   -.CodeRay .ty { color:#339; font-weight:bold }
103   -.CodeRay .v { color:#036 }
104   -.CodeRay .xt { color:#444 }
131 view/css/screen.css.sass
... ... @@ -1,131 +0,0 @@
1   -*
2   - :margin 0
3   - :padding 0
4   -
5   -body
6   - :background #fff
7   - :margin 0
8   - :padding 0
9   -
10   -textarea
11   - :width 95%
12   - :height 20em
13   - :display block
14   - :padding 1em
15   -
16   -input.submit
17   - :width 95%
18   -
19   -.content
20   - :clear both
21   - :padding 1em
22   -
23   - table
24   - :width 70%
25   - :margin 2em
26   - :text-align center
27   - :border-spacing 0
28   - :border-collapse collapse
29   - tr
30   - td
31   - :padding 0.2em
32   - :width 25%
33   -
34   -
35   - .list
36   - ul
37   - :padding 0.5em
38   - li
39   - :margin-bottom 0.5em
40   -
41   - .text, .list
42   - h1, h2, h3
43   - :margin 0
44   - h2, h3, h4, h5, h6
45   - :margin-top 1em
46   - a.missing-wiki-link
47   - :color #f00
48   - a.existing-wiki-link
49   - :color #00f
50   - p
51   - :padding 0.5em
52   - ul
53   - :padding-left 2em
54   - :margin-top 1em
55   - code
56   - :background #eee
57   - div.CodeRay
58   - :margin 0.5em
59   - :padding 0.5em
60   - .toc
61   - :clear right
62   - :font-size 0.8em
63   - :float right
64   - :padding 0.5em
65   - :border 1px solid #ddd
66   - :background #eee
67   - ol
68   - :list-style-type none
69   - :margin-left 0.5em
70   - li
71   - :list-style-type none
72   - :margin-left 0.5em
73   -
74   -.mod, .uv_select
75   - :margin 0.5em
76   - :font-size 0.8em
77   - :float right
78   - :padding 0.5em
79   - :border 1px solid #ddd
80   - :background #eee
81   -
82   -.history
83   - :padding 1em
84   - table
85   - :border-collapse collapse
86   - tr.current
87   - :background #efe
88   - tr.old
89   - :background #ddd
90   - td
91   - :border 1px solid #ddd
92   - :padding 0.2em
93   -
94   -.diff
95   - :margin-top 1em
96   - :overflow auto
97   -
98   -.head
99   - :background #38f
100   - :color #fff
101   - :height 6em
102   - a
103   - :color #fff
104   - .title
105   - :float left
106   - :color #fff
107   - h1
108   - :margin 0
109   - :padding 0.2em
110   - h2
111   - :margin 0
112   - :padding-left 0.5em
113   - :font-size 1em
114   - .menu
115   - :float right
116   - :line-height 1.7em
117   - :margin 0.5em
118   - :text-align right
119   - .locale
120   - a
121   - :color #fff
122   - :padding 0.2em
123   - :text-decoration none
124   - &:hover
125   - :background #aaf
126   -
127   -.footer
128   - :clear both
129   - :padding-top 3em
130   - :text-align center
131   - :font-size 0.8em
9 view/delete.erb
... ... @@ -0,0 +1,9 @@
  1 +<p>Yes, i know this page sucks, but until we can afford an undo function please
  2 +bear with it as a way to prevent unsuspecting clients from wildly clicking all
  3 +GET links.<br />
  4 +Are you sure you want to delete <%= h(@name) %>?
  5 +
  6 + <form method="post" action="<%= @action %>">
  7 + <input type="submit" class="submit" value="Yes" />
  8 + </form>
  9 +</p>
11 view/delete.haml
... ... @@ -1,11 +0,0 @@
1   -%p
2   - Yes, i know this page sucks, but until we can afford an undo function please
3   - bear with it as a way to prevent unsuspecting clients from wildly clicking
4   - all GET links.
5   - %br/
6   - Are you sure you want to delete
7   - = @name
8   - ?
9   -
10   -%form{:method => :POST, :action => @action}
11   -%input{:type => :submit, :value => 'Yes'}
18 view/diff.erb
... ... @@ -0,0 +1,18 @@
  1 +<h1>Diff <a href="<%= r(:show, @sha, @name) %>"><%= h(@sha) %></a> to <a href="<%= r(@name) %>"><%= h(@name) %></a></h1>
  2 +
  3 +<div class="uv_select">
  4 + <b>Style select</b>
  5 + <% current = session[:uv_style]
  6 + @styles.each do |style| %>
  7 + <br />
  8 + <% if current == style %>
  9 + <%= h(style) %>
  10 + <% else %>
  11 + <a href="?uv_style=<%= h(style) %>"><%= h(style) %></a>
  12 + <% end %>
  13 + <% end %>
  14 +</div>
  15 +
  16 +<div class="diff">
  17 + <%= @text %>
  18 +</div>
17 view/diff.haml
... ... @@ -1,17 +0,0 @@
1   -%h1
2   - = l("Diff")
3   - %a{:href => r(:show, @sha, @name)}= h(@sha)
4   - = l("to")
5   - %a{:href => r(@name)}= h(@name)
6   -
7   -.uv_select
8   - %b= l("Select your style")
9   - - current = session[:uv_style]
10   - - @styles.each do |style|
11   - %br/
12   - - if current == style
13   - = h(style)
14   - - else
15   - %a{:href => "?uv_style=#{style}"}= h(style)
16   -
17   -.diff~ @text
16 view/edit.erb
... ... @@ -0,0 +1,16 @@
  1 +<h1>Edit <%= h(@title.dump) %></h1>
  2 +
  3 +<form action="<%= r(:save) %>" method="post">
  4 + <input type="hidden" name="name" value="<%= h(@name) %>" />
  5 + <fieldset>
  6 + <legend>Edit</legend>
  7 +
  8 + <label for="form_text"> Text:</label>
  9 + <textarea id="form_text" name="text"><%= @text %></textarea>
  10 +
  11 + <label for="form_comment"> Text:</label>
  12 + <input id="form_comment" type="text" name="comment" value="Update <%= h(@name) %>" />
  13 +
  14 + <input type="submit" class="submit" value="Save" />
  15 + </fieldset>
  16 +</form>
19 view/edit.haml
... ... @@ -1,19 +0,0 @@
1   -%h1
2   - = l('Edit', @title.dump)
3   -
4   -%form{:action => r(:save), :method => :post}
5   - %input{:type => :hidden, :name => :name, :value => @name}
6   - %fieldset
7   - %legend= l 'Edit'
8   - %label{:for => :form_text}= l('Text') + ':'
9   - %textarea{:name => :text, :id => :form_text}~ @text
10   - %label{:for => :form_comment}= l('Comment') + ':'
11   - %input{:type => :text, :name => :comment, :value => l('Update', @name), :id => :form_comment}
12   - %input{:type => :submit, :class => :submit, :value => l('Save')}
13   -
14   -%form{:action => r(:move, @name), :method => :post}
15   - %fieldset
16   - %legend= l('Move')
17   - %label{:for => :form_move}= l('Move to different page') + ':'
18   - %input{:type => :input, :name => :move, :id => :form_move, :value => @name}
19   - %input{:type => :submit, :class => :submit, :value => l('Move')}
23 view/history.erb
... ... @@ -0,0 +1,23 @@
  1 +<h1>History of <a href="<%= r(@name) %>"><%= h(@name) %></a></h1>
  2 +
  3 +<div class="history">
  4 + <table>
  5 + <tr>
  6 + <td>Message</td><td>Author</td><td>Date</td><td>Action</td>
  7 + </tr>
  8 + <% @history.each_with_index do |log, idx|
  9 + current = idx == 0 %>
  10 + <tr class="<%= current ? 'current' : 'old' %>">
  11 + <td><%= h(log.message) %></td>
  12 + <td><%= h(log.author.name) %></td>
  13 + <td><%= h(log.date) %></td>
  14 + <td>
  15 + <% unless current %>
  16 + <a href="<%= r(:diff, log.objectish, @name) %>">Diff</a>
  17 + <% end %>
  18 + <a href="<%= r(:show, log.objectish, @name) %>">Show</a>
  19 + </td>
  20 + </tr>
  21 + <% end %>
  22 + </table>
  23 +</div>
31 view/history.haml
... ... @@ -1,31 +0,0 @@
1   -.mod
2   - %b= l('Control') + ':'
3   - - if @page and @page.exists?
4   - %a{:href => r(:edit, @name)}= l('Edit')
5   - %a{:href => r(:delete, @name)}= l('Delete')
6   - %a{:href => r(:history, @name)}= l('History')
7   - - elsif @name
8   - %a{:href => r(:edit, @name)}= l('Create')
9   -
10   -%h1
11   - = l('History of')
12   - %a{:href => r(@name)}= h(@name)
13   -
14   -.history
15   - %table
16   - %tr
17   - %td= l('Message')
18   - %td= l('Author')
19   - %td= l('Date')
20   - %td= l('Action')
21   - - @history.each_with_index do |log, idx|
22   - - current = idx == 0
23   - - style = current ? 'current' : 'old'
24   - %tr{:class => style}
25   - %td= h log.message
26   - %td= h log.author.name
27   - %td= h log.date
28   - %td
29   - - unless current
30   - %a{:href => r(:diff, log.objectish, @name)}= l('Diff')
31   - %a{:href => r(:show, log.objectish, @name)}= l('Show')
20 view/index.erb
... ... @@ -0,0 +1,20 @@
  1 +<div class="mod">
  2 + <% if @page and @page.exists? %>
  3 + <a href="<%= r(:history, @name) %>">History</a>
  4 + <% if logged_in? %>
  5 + <a href="<%= r(:edit, @name) %>">Edit</a>
  6 + <a href="<%= r(:move, @name) %>">Move</a>
  7 + <a href="<%= r(:delete, @name) %>">Delete</a>
  8 + <% end %>
  9 + <% elsif @name and logged_in? %>
  10 + <a href="<%= r(:edit, @name) %>">Create</a>
  11 + <% end %>
  12 +</div>
  13 +
  14 +<div class="toc">
  15 + <b>Table of Contents</b>
  16 + <%= @toc %>
  17 +</div>
  18 +<div class="text">
  19 + <%= @html %>
  20 +</div>
15 view/index.haml
... ... @@ -1,15 +0,0 @@
1   -.mod
2   - %b= l('Control') + ':'
3   - - if @page and @page.exists?
4   - %a{:href => r(:history, @name)}= l('History')
5   - - if logged_in?
6   - %a{:href => r(:edit, @name)}= l('Edit')
7   - %a{:href => r(:delete, @name)}= l('Delete')
8   - - elsif @name
9   - - if logged_in?
10   - %a{:href => r(:edit, @name)}= l('Create')
11   -
12   -.toc
13   - %b= l('Table of Contents')
14   - ~ @toc
15   -.text~ @html
8 view/list.erb
... ... @@ -0,0 +1,8 @@
  1 +<div class="list">
  2 + <h1>Wiki index</h1>
  3 + <ul>
  4 + <% @list.each do |page| %>
  5 + <%= page %>
  6 + <% end %>
  7 + </ul>
  8 +</div>
5 view/list.haml
... ... @@ -1,5 +0,0 @@
1   -.list
2   - %h1= l('Wiki index')
3   - %ul
4   - - @list.each do |page|
5   - = page
12 view/move.erb
... ... @@ -0,0 +1,12 @@
  1 +<h1>Move <%= h(@title.dump) %></h1>
  2 +
  3 +<form action="<%= r(:move, @name) %>" method="post">
  4 + <fieldset>
  5 + <legend>Move</legend>
  6 +
  7 + <label for="form_move">Move to different page:</label>
  8 + <input id="form_move" type="text" name="move" value="<%= h(@name) %>" />
  9 +
  10 + <input type="submit" class="submit" value="Move" />
  11 + </fieldset>
  12 +</form>
20 view/show.erb
... ... @@ -0,0 +1,20 @@
  1 +<div class="mod">
  2 + <% if @page and @page.exists? %>
  3 + <a href="<%= r(:history, @name) %>">History</a>
  4 + <% if logged_in? %>
  5 + <a href="<%= r(:edit, @name) %>">Edit</a>
  6 + <a href="<%= r(:move, @name) %>">Move</a>
  7 + <a href="<%= r(:delete, @name) %>">Delete</a>
  8 + <% end %>
  9 + <% elsif @name and logged_in? %>
  10 + <a href="<%= r(:edit, @name) %>">Create</a>
  11 + <% end %>
  12 +</div>
  13 +
  14 +<div class="toc">
  15 + <b>Table of Contents</b>
  16 + <%= @toc %>
  17 +</div>
  18 +<div class="text">
  19 + <%= @html %>
  20 +</div>
15 view/show.haml
... ... @@ -1,15 +0,0 @@
1   -.mod
2   - %b= l('Control') + ':'
3   - - if @page and @page.exists?
4   - %a{:href => r(:history, @name)}= l('History')
5   - - if logged_in?
6   - %a{:href => r(:edit, @name)}= l('Edit')
7   - %a{:href => r(:delete, @name)}= l('Delete')
8   - - elsif @name
9   - - if logged_in?
10   - %a{:href => r(:edit, @name)}= l('Create')
11   -
12   -.toc
13   - %b= l('Table of Contents')
14   - ~ @toc
15   -.text~ @html

0 comments on commit c87a0f0

Please sign in to comment.
Something went wrong with that request. Please try again.