read-only-gollum 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +4 -0
- data/HISTORY.md +102 -0
- data/Home.md +3 -0
- data/LICENSE +21 -0
- data/README.md +477 -0
- data/Rakefile +142 -0
- data/bin/read-only-gollum +126 -0
- data/docs/sanitization.md +32 -0
- data/lib/gollum.rb +41 -0
- data/lib/gollum/blob_entry.rb +78 -0
- data/lib/gollum/committer.rb +218 -0
- data/lib/gollum/file.rb +64 -0
- data/lib/gollum/frontend/app.rb +225 -0
- data/lib/gollum/frontend/public/css/dialog.css +141 -0
- data/lib/gollum/frontend/public/css/editor.css +537 -0
- data/lib/gollum/frontend/public/css/gollum.css +660 -0
- data/lib/gollum/frontend/public/css/ie7.css +69 -0
- data/lib/gollum/frontend/public/css/template.css +381 -0
- data/lib/gollum/frontend/public/images/icon-sprite.png +0 -0
- data/lib/gollum/frontend/public/javascript/editor/gollum.editor.js +1096 -0
- data/lib/gollum/frontend/public/javascript/editor/langs/asciidoc.js +167 -0
- data/lib/gollum/frontend/public/javascript/editor/langs/creole.js +104 -0
- data/lib/gollum/frontend/public/javascript/editor/langs/markdown.js +211 -0
- data/lib/gollum/frontend/public/javascript/editor/langs/org.js +173 -0
- data/lib/gollum/frontend/public/javascript/editor/langs/pod.js +111 -0
- data/lib/gollum/frontend/public/javascript/editor/langs/rdoc.js +74 -0
- data/lib/gollum/frontend/public/javascript/editor/langs/textile.js +175 -0
- data/lib/gollum/frontend/public/javascript/gollum.dialog.js +263 -0
- data/lib/gollum/frontend/public/javascript/gollum.js +161 -0
- data/lib/gollum/frontend/public/javascript/gollum.placeholder.js +54 -0
- data/lib/gollum/frontend/public/javascript/jquery.color.js +123 -0
- data/lib/gollum/frontend/public/javascript/jquery.js +7179 -0
- data/lib/gollum/frontend/templates/compare.mustache +38 -0
- data/lib/gollum/frontend/templates/create.mustache +17 -0
- data/lib/gollum/frontend/templates/edit.mustache +17 -0
- data/lib/gollum/frontend/templates/editor.mustache +116 -0
- data/lib/gollum/frontend/templates/error.mustache +8 -0
- data/lib/gollum/frontend/templates/history.mustache +58 -0
- data/lib/gollum/frontend/templates/layout.mustache +28 -0
- data/lib/gollum/frontend/templates/page.mustache +37 -0
- data/lib/gollum/frontend/templates/pages.mustache +35 -0
- data/lib/gollum/frontend/templates/search.mustache +36 -0
- data/lib/gollum/frontend/templates/searchbar.mustache +10 -0
- data/lib/gollum/frontend/views/compare.rb +94 -0
- data/lib/gollum/frontend/views/create.rb +48 -0
- data/lib/gollum/frontend/views/edit.rb +52 -0
- data/lib/gollum/frontend/views/editable.rb +13 -0
- data/lib/gollum/frontend/views/error.rb +7 -0
- data/lib/gollum/frontend/views/history.rb +44 -0
- data/lib/gollum/frontend/views/layout.rb +20 -0
- data/lib/gollum/frontend/views/page.rb +57 -0
- data/lib/gollum/frontend/views/pages.rb +19 -0
- data/lib/gollum/frontend/views/search.rb +20 -0
- data/lib/gollum/git_access.rb +248 -0
- data/lib/gollum/markup.rb +489 -0
- data/lib/gollum/page.rb +430 -0
- data/lib/gollum/pagination.rb +61 -0
- data/lib/gollum/sanitization.rb +174 -0
- data/lib/gollum/tex.rb +89 -0
- data/lib/gollum/web_sequence_diagram.rb +43 -0
- data/lib/gollum/wiki.rb +636 -0
- data/read-only-gollum.gemspec +224 -0
- data/templates/formatting.html +92 -0
- data/test/examples/empty.git/HEAD +1 -0
- data/test/examples/empty.git/config +5 -0
- data/test/examples/empty.git/description +1 -0
- data/test/examples/empty.git/hooks/applypatch-msg.sample +15 -0
- data/test/examples/empty.git/hooks/commit-msg.sample +24 -0
- data/test/examples/empty.git/hooks/post-commit.sample +8 -0
- data/test/examples/empty.git/hooks/post-receive.sample +15 -0
- data/test/examples/empty.git/hooks/post-update.sample +8 -0
- data/test/examples/empty.git/hooks/pre-applypatch.sample +14 -0
- data/test/examples/empty.git/hooks/pre-commit.sample +46 -0
- data/test/examples/empty.git/hooks/pre-rebase.sample +169 -0
- data/test/examples/empty.git/hooks/prepare-commit-msg.sample +36 -0
- data/test/examples/empty.git/hooks/update.sample +128 -0
- data/test/examples/empty.git/info/exclude +6 -0
- data/test/examples/empty.git/objects/info/.gitkeep +0 -0
- data/test/examples/empty.git/objects/pack/.gitkeep +0 -0
- data/test/examples/empty.git/refs/heads/.gitkeep +0 -0
- data/test/examples/lotr.git/COMMIT_EDITMSG +1 -0
- data/test/examples/lotr.git/HEAD +1 -0
- data/test/examples/lotr.git/ORIG_HEAD +1 -0
- data/test/examples/lotr.git/config +12 -0
- data/test/examples/lotr.git/description +1 -0
- data/test/examples/lotr.git/index +0 -0
- data/test/examples/lotr.git/info/exclude +6 -0
- data/test/examples/lotr.git/logs/HEAD +3 -0
- data/test/examples/lotr.git/logs/refs/heads/master +3 -0
- data/test/examples/lotr.git/objects/06/131480411710c92a82fe2d1e76932c70feb2e5 +0 -0
- data/test/examples/lotr.git/objects/0a/de1e2916346d4c1f2fb63b863fd3c16808fe44 +0 -0
- data/test/examples/lotr.git/objects/0e/d8cbe0a25235bd867e65193c7d837c66b328ef +3 -0
- data/test/examples/lotr.git/objects/12/629d666c5e3178f82f533f543d61b53dc78c0b +0 -0
- data/test/examples/lotr.git/objects/1d/b89ebba7e2c14d93b94ff98cfa3708a4f0d4e3 +2 -0
- data/test/examples/lotr.git/objects/24/49c2681badfd3c189e8ed658dacffe8ba48fe5 +0 -0
- data/test/examples/lotr.git/objects/25/4bdc1ba27d8b8a794538a8522d9a2b56ec2dd9 +0 -0
- data/test/examples/lotr.git/objects/2c/b9156ad383914561a8502fc70f5a1d887e48ad +4 -0
- data/test/examples/lotr.git/objects/5d/cac289a8603188d2c5caf481dcba2985126aaa +0 -0
- data/test/examples/lotr.git/objects/60/f12f4254f58801b9ee7db7bca5fa8aeefaa56b +0 -0
- data/test/examples/lotr.git/objects/71/4323c104239440a5c66ab12a67ed07a83c404f +0 -0
- data/test/examples/lotr.git/objects/84/0ec5b1ba1320e8ec443f28f99566f615d5af10 +0 -0
- data/test/examples/lotr.git/objects/93/6b83ee0dd8837adb82511e40d5e4ebe59bb675 +0 -0
- data/test/examples/lotr.git/objects/94/523d7ae48aeba575099dd12926420d8fd0425d +2 -0
- data/test/examples/lotr.git/objects/96/97dc65e095658bbd1b8e8678e08881e86d32f1 +0 -0
- data/test/examples/lotr.git/objects/a3/1ca2a7c352c92531a8b99815d15843b259e814 +0 -0
- data/test/examples/lotr.git/objects/a6/59b3763b822dd97544621fd0beef162ea37b14 +4 -0
- data/test/examples/lotr.git/objects/a8/ad3c09dd842a3517085bfadd37718856dee813 +0 -0
- data/test/examples/lotr.git/objects/aa/b61fe89d56f8614c0a8151da34f939dcedfa68 +0 -0
- data/test/examples/lotr.git/objects/bc/4b5fc0ce2c2ba3acef6647e4f67256ee45ab60 +0 -0
- data/test/examples/lotr.git/objects/c3/b43e9f08966b088e7a0192e436b7a884542e05 +0 -0
- data/test/examples/lotr.git/objects/dc/596d6b2dd89ab05c66f4abd7d5eb706bc17f19 +0 -0
- data/test/examples/lotr.git/objects/ec/da3205bee14520aab5a7bb307392064b938e83 +0 -0
- data/test/examples/lotr.git/objects/f4/84ebb1f40f8eb20d1bcd8d1d71934d2b8ae961 +0 -0
- data/test/examples/lotr.git/objects/fa/e7ef5344202bba4129abdc13060d9297d99465 +3 -0
- data/test/examples/lotr.git/objects/info/packs +2 -0
- data/test/examples/lotr.git/objects/pack/pack-dcbeaf3f6ff6c5eb08ea2b0a2d83626e8763546b.idx +0 -0
- data/test/examples/lotr.git/objects/pack/pack-dcbeaf3f6ff6c5eb08ea2b0a2d83626e8763546b.pack +0 -0
- data/test/examples/lotr.git/packed-refs +2 -0
- data/test/examples/lotr.git/refs/heads/master +1 -0
- data/test/examples/lotr.git/refs/remotes/origin/HEAD +1 -0
- data/test/examples/page_file_dir.git/COMMIT_EDITMSG +1 -0
- data/test/examples/page_file_dir.git/HEAD +1 -0
- data/test/examples/page_file_dir.git/config +6 -0
- data/test/examples/page_file_dir.git/description +1 -0
- data/test/examples/page_file_dir.git/index +0 -0
- data/test/examples/page_file_dir.git/info/exclude +6 -0
- data/test/examples/page_file_dir.git/logs/HEAD +1 -0
- data/test/examples/page_file_dir.git/logs/refs/heads/master +1 -0
- data/test/examples/page_file_dir.git/objects/0c/7d27db1f575263efdcab3dc650f4502a2dbcbf +0 -0
- data/test/examples/page_file_dir.git/objects/22/b404803c966dd92865614d86ff22ca12e50c1e +0 -0
- data/test/examples/page_file_dir.git/objects/25/7cc5642cb1a054f08cc83f2d943e56fd3ebe99 +0 -0
- data/test/examples/page_file_dir.git/objects/57/16ca5987cbf97d6bb54920bea6adde242d87e6 +0 -0
- data/test/examples/page_file_dir.git/objects/5b/43e14e0a15fb6f08feab1773d1c0991e9f71e2 +0 -0
- data/test/examples/page_file_dir.git/refs/heads/master +1 -0
- data/test/examples/revert.git/COMMIT_EDITMSG +1 -0
- data/test/examples/revert.git/HEAD +1 -0
- data/test/examples/revert.git/config +12 -0
- data/test/examples/revert.git/description +1 -0
- data/test/examples/revert.git/index +0 -0
- data/test/examples/revert.git/info/exclude +6 -0
- data/test/examples/revert.git/logs/HEAD +2 -0
- data/test/examples/revert.git/logs/refs/heads/master +2 -0
- data/test/examples/revert.git/objects/20/2ced67cea93c7b6bd2928aa1daef8d1d55a20d +0 -0
- data/test/examples/revert.git/objects/41/76394bfa11222363c66ce7e84b5f154095b6d9 +0 -0
- data/test/examples/revert.git/objects/6a/69f92020f5df77af6e8813ff1232493383b708 +0 -0
- data/test/examples/revert.git/objects/b4/785957bc986dc39c629de9fac9df46972c00fc +0 -0
- data/test/examples/revert.git/objects/f4/03b791119f8232b7cb0ba455c624ac6435f433 +0 -0
- data/test/examples/revert.git/objects/info/packs +2 -0
- data/test/examples/revert.git/objects/pack/pack-a561f8437234f74d0bacb9e0eebe52d207f5770d.idx +0 -0
- data/test/examples/revert.git/objects/pack/pack-a561f8437234f74d0bacb9e0eebe52d207f5770d.pack +0 -0
- data/test/examples/revert.git/packed-refs +2 -0
- data/test/examples/revert.git/refs/heads/master +1 -0
- data/test/examples/revert.git/refs/remotes/origin/HEAD +1 -0
- data/test/examples/yubiwa.git/HEAD +1 -0
- data/test/examples/yubiwa.git/config +5 -0
- data/test/examples/yubiwa.git/description +1 -0
- data/test/examples/yubiwa.git/info/exclude +6 -0
- data/test/examples/yubiwa.git/objects/10/fa2ddc4e3b4009d8a453aace10bd6148c1ad00 +0 -0
- data/test/examples/yubiwa.git/objects/52/4b82874327ea7cbf730389964ba7cb3de966de +0 -0
- data/test/examples/yubiwa.git/objects/58/3fc201cb457fb3f1480f3e1e5999b119633835 +0 -0
- data/test/examples/yubiwa.git/objects/87/bc1dd46ab3d3874d4e898d45dd512cc20a7cc8 +1 -0
- data/test/examples/yubiwa.git/objects/89/64ed1b4e21aa90e831763bbce9034bfda81b70 +0 -0
- data/test/examples/yubiwa.git/objects/9f/f6dd0660da5fba2d3374adb2b84fa653bb538b +0 -0
- data/test/examples/yubiwa.git/objects/ac/e97abf2b177815a1972d7db22f229f58c83309 +0 -0
- data/test/examples/yubiwa.git/objects/b1/f443863a4816628807fbf86141ebef055dda34 +0 -0
- data/test/examples/yubiwa.git/refs/heads/master +1 -0
- data/test/helper.rb +66 -0
- data/test/test_app.rb +169 -0
- data/test/test_committer.rb +64 -0
- data/test/test_file.rb +27 -0
- data/test/test_git_access.rb +52 -0
- data/test/test_markup.rb +628 -0
- data/test/test_page.rb +166 -0
- data/test/test_page_revert.rb +45 -0
- data/test/test_wiki.rb +462 -0
- metadata +470 -0
@@ -0,0 +1,38 @@
|
|
1
|
+
<div id="wiki-wrapper" class="compare">
|
2
|
+
<div id="head">
|
3
|
+
<h1>History for <strong>{{path}}</strong></h1>
|
4
|
+
|
5
|
+
<ul class="actions">
|
6
|
+
<li class="minibutton"><a href="/history/{{escaped_name}}"
|
7
|
+
class="action-page-history">Back to Page History</a></li>
|
8
|
+
</ul>
|
9
|
+
{{>searchbar}}
|
10
|
+
</div>
|
11
|
+
|
12
|
+
{{#message}}
|
13
|
+
<p>{{message}}</p>
|
14
|
+
{{/message}}
|
15
|
+
|
16
|
+
<div id="compare-content">
|
17
|
+
|
18
|
+
<div class="data highlight">
|
19
|
+
<table cellpadding="0" cellspacing="0">
|
20
|
+
{{#lines}}
|
21
|
+
<tr>
|
22
|
+
<td class="line_numbers">{{ldln}}</td>
|
23
|
+
<td class="line_numbers">{{rdln}}</td>
|
24
|
+
<td>
|
25
|
+
<pre><div class="{{class}}">{{line}}</div></pre>
|
26
|
+
</td>
|
27
|
+
</tr>
|
28
|
+
{{/lines}}
|
29
|
+
</table>
|
30
|
+
</div>
|
31
|
+
</div>
|
32
|
+
<div id="footer">
|
33
|
+
<ul class="actions">
|
34
|
+
<li class="minibutton"><a href="#">Back to Top</a></li>
|
35
|
+
</ul>
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
</div>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<div id="wiki-wrapper">
|
2
|
+
<div id="head">
|
3
|
+
<h1>Create New Page</h1>
|
4
|
+
</div>
|
5
|
+
<div id="wiki-content" class="create edit">
|
6
|
+
<div class="has-rightbar">
|
7
|
+
{{>editor}}
|
8
|
+
</div>
|
9
|
+
</div>
|
10
|
+
</div>
|
11
|
+
<script type="text/javascript">
|
12
|
+
jQuery(document).ready(function() {
|
13
|
+
$.GollumEditor({ NewFile: true, MarkupType: '{{default_markup}}' });
|
14
|
+
});
|
15
|
+
</script>
|
16
|
+
|
17
|
+
{{something}}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<div id="wiki-wrapper" class="edit">
|
2
|
+
<div id="head">
|
3
|
+
<h1>Editing <strong>{{title}}</strong></h1>
|
4
|
+
<ul class="actions">
|
5
|
+
<li class="minibutton"><a href="/{{escaped_name}}"
|
6
|
+
class="action-view-page">View Page</a></li>
|
7
|
+
<li class="minibutton"><a href="/history/{{escaped_name}}"
|
8
|
+
class="action-page-history">Page History</a></li>
|
9
|
+
</ul>
|
10
|
+
</div>
|
11
|
+
<div id="wiki-content">{{>editor}}</div>
|
12
|
+
</div>
|
13
|
+
<script type="text/javascript">
|
14
|
+
jQuery(document).ready(function() {
|
15
|
+
$.GollumEditor();
|
16
|
+
});
|
17
|
+
</script>
|
@@ -0,0 +1,116 @@
|
|
1
|
+
<div id="gollum-editor" data-escaped-name="{{escaped_name}}" class="{{#is_create_page}}create{{/is_create_page}}{{#is_edit_page}}edit{{/is_edit_page}}">
|
2
|
+
{{#is_create_page}}
|
3
|
+
<form name="gollum-editor" action="/create" method="post">
|
4
|
+
{{/is_create_page}}
|
5
|
+
{{#is_edit_page}}
|
6
|
+
<form name="gollum-editor" action="/edit/{{escaped_name}}" method="post">
|
7
|
+
{{/is_edit_page}}
|
8
|
+
<fieldset id="gollum-editor-fields">
|
9
|
+
{{#is_create_page}}
|
10
|
+
<div id="gollum-editor-title-field" class="singleline">
|
11
|
+
<label for="page" class="jaws">Page Title</label>
|
12
|
+
<input type="text" name="page" id="gollum-editor-page-title" value="{{page_name}}">
|
13
|
+
</div>
|
14
|
+
{{/is_create_page}}
|
15
|
+
{{#is_edit_page}}
|
16
|
+
<input type="hidden" name="page" id="gollum-editor-page-title" value="{{page_name}}">
|
17
|
+
{{/is_edit_page}}
|
18
|
+
<div id="gollum-editor-function-bar">
|
19
|
+
<div id="gollum-editor-function-buttons">
|
20
|
+
<a href="#" id="function-bold" class="function-button">
|
21
|
+
<span>Bold</span></a>
|
22
|
+
<a href="#" id="function-italic" class="function-button">
|
23
|
+
<span>Italic</span></a>
|
24
|
+
<a href="#" id="function-code" class="function-button">
|
25
|
+
<span>Code</span></a>
|
26
|
+
<span class="function-divider"> </span>
|
27
|
+
<a href="#" id="function-ul" class="function-button">
|
28
|
+
<span>Unordered List</span></a>
|
29
|
+
<a href="#" id="function-ol" class="function-button">
|
30
|
+
<span>Ordered List</span></a>
|
31
|
+
<a href="#" id="function-blockquote" class="function-button">
|
32
|
+
<span>Blockquote</span></a>
|
33
|
+
|
34
|
+
<a href="#" id="function-hr" class="function-button">
|
35
|
+
<span>Horizontal Rule</span></a>
|
36
|
+
<span class="function-divider"> </span>
|
37
|
+
<a href="#" id="function-h1" class="function-button">
|
38
|
+
<span>h1</span></a>
|
39
|
+
<a href="#" id="function-h2" class="function-button">
|
40
|
+
<span>h2</span></a>
|
41
|
+
<a href="#" id="function-h3" class="function-button">
|
42
|
+
<span>h3</span></a>
|
43
|
+
<span class="function-divider"> </span>
|
44
|
+
<a href="#" id="function-link" class="function-button">
|
45
|
+
<span>Link</span></a>
|
46
|
+
<a href="#" id="function-image" class="function-button">
|
47
|
+
<span>Image</span></a>
|
48
|
+
<span class="function-divider"> </span>
|
49
|
+
<a href="#" id="function-help" class="function-button">
|
50
|
+
<span>Help</span></a>
|
51
|
+
</div>
|
52
|
+
|
53
|
+
<div id="gollum-editor-format-selector">
|
54
|
+
<select id="wiki_format" name="format">
|
55
|
+
{{#formats}}
|
56
|
+
<option {{#selected}}selected="selected" {{/selected}}value="{{id}}">
|
57
|
+
{{name}}
|
58
|
+
</option>
|
59
|
+
{{/formats}}
|
60
|
+
</select>
|
61
|
+
<label for="format">Edit Mode</label>
|
62
|
+
</div>
|
63
|
+
</div>
|
64
|
+
<div id="gollum-editor-help" class="jaws">
|
65
|
+
<ul id="gollum-editor-help-parent">
|
66
|
+
<li><a href="javascript:void(0);" class="selected">Help 1</a></li>
|
67
|
+
<li><a href="javascript:void(0);">Help 1</a></li>
|
68
|
+
<li><a href="javascript:void(0);">Help 1</a></li>
|
69
|
+
</ul>
|
70
|
+
<ul id="gollum-editor-help-list">
|
71
|
+
<li><a href="javascript:void(0);">Help 2</a></li>
|
72
|
+
<li><a href="javascript:void(0);">Help 3</a></li>
|
73
|
+
<li><a href="javascript:void(0);">Help 4</a></li>
|
74
|
+
<li><a href="javascript:void(0);">Help 5</a></li>
|
75
|
+
<li><a href="javascript:void(0);">Help 6</a></li>
|
76
|
+
<li><a href="javascript:void(0);">Help 7</a></li>
|
77
|
+
<li><a href="javascript:void(0);">Help 8</a></li>
|
78
|
+
</ul>
|
79
|
+
<div id="gollum-editor-help-wrapper">
|
80
|
+
<div id="gollum-editor-help-content">
|
81
|
+
<p>
|
82
|
+
</p>
|
83
|
+
</div>
|
84
|
+
</div>
|
85
|
+
</div>
|
86
|
+
<textarea id="gollum-editor-body"
|
87
|
+
data-markup-lang="{{format}}" name="content">{{content}}</textarea>
|
88
|
+
|
89
|
+
{{#footer}}
|
90
|
+
<div id="gollum-editor-edit-footer" class="collapsed">
|
91
|
+
<a href="#" class="button"><span>Expand/Collapse</span></a>
|
92
|
+
<h4>Footer</h4>
|
93
|
+
<textarea id="gollum-editor-footer" name="footer">{{footer}}</textarea>
|
94
|
+
</div>
|
95
|
+
{{/footer}}
|
96
|
+
|
97
|
+
{{#sidebar}}
|
98
|
+
<div id="gollum-editor-edit-sidebar" class="collapsed">
|
99
|
+
<a href="#" class="button"><span>Expand/Collapse</span></a>
|
100
|
+
<h4>Sidebar</h4>
|
101
|
+
<textarea id="gollum-editor-sidebar" name="sidebar">{{sidebar}}</textarea>
|
102
|
+
</div>
|
103
|
+
{{/sidebar}}
|
104
|
+
|
105
|
+
<div id="gollum-editor-edit-summary" class="singleline">
|
106
|
+
<label for="message" class="jaws">Edit message:</label>
|
107
|
+
<input type="text" name="message" id="gollum-editor-message-field" value="Write a small message here explaining this change. (Optional)">
|
108
|
+
</div>
|
109
|
+
|
110
|
+
|
111
|
+
<span class="jaws"><br></span>
|
112
|
+
<input type="submit" id="gollum-editor-submit" value="Save" title="Save current changes">
|
113
|
+
<a href="/preview" id="gollum-editor-preview" class="minibutton" title="Preview this Page">Preview</a>
|
114
|
+
</fieldset>
|
115
|
+
</form>
|
116
|
+
</div>
|
@@ -0,0 +1,58 @@
|
|
1
|
+
<div id="wiki-wrapper" class="history">
|
2
|
+
<div id="head">
|
3
|
+
<h1>History for <strong>{{title}}</strong></h1>
|
4
|
+
<ul class="actions">
|
5
|
+
<li class="minibutton"><a href="/{{escaped_name}}"
|
6
|
+
class="action-view-page">View Page</a></li>
|
7
|
+
</ul>
|
8
|
+
{{>searchbar}}
|
9
|
+
</div>
|
10
|
+
<div id="wiki-history">
|
11
|
+
|
12
|
+
<ul class="actions">
|
13
|
+
<li class="minibutton"><a href="javascript:void(0);"
|
14
|
+
class="action-compare-revision">Compare Revisions</a></li>
|
15
|
+
</ul>
|
16
|
+
|
17
|
+
<form name="compare-versions" id="version-form" method="post"
|
18
|
+
action="/compare/{{escaped_name}}">
|
19
|
+
<fieldset>
|
20
|
+
<table>
|
21
|
+
<tbody>
|
22
|
+
|
23
|
+
{{#versions}}
|
24
|
+
<tr>
|
25
|
+
<td class="checkbox">
|
26
|
+
<input type="checkbox" name="versions[]" value="{{id}}">
|
27
|
+
</td>
|
28
|
+
<td class="author">
|
29
|
+
<a href="javascript:void(0)">
|
30
|
+
<img src="https://secure.gravatar.com/avatar/{{gravatar}}?s=16"
|
31
|
+
alt="avatar: {{author}}" class="mini-gravatar">
|
32
|
+
<span class="username">{{author}}</span>
|
33
|
+
</a>
|
34
|
+
</td>
|
35
|
+
<td class="commit-name">
|
36
|
+
<span class="time-elapsed">{{date}}:</span>
|
37
|
+
{{message}}
|
38
|
+
[<a href="/{{escaped_name}}/{{id}}" title="View commit">{{id7}}</a>]
|
39
|
+
</td>
|
40
|
+
</tr>
|
41
|
+
{{/versions}}
|
42
|
+
|
43
|
+
</tbody>
|
44
|
+
</table>
|
45
|
+
</fieldset>
|
46
|
+
</form>
|
47
|
+
</div>
|
48
|
+
<div id="footer">
|
49
|
+
<ul class="actions">
|
50
|
+
<li class="minibutton"><a href="javascript:void(0);"
|
51
|
+
class="action-compare-revision">Compare Revisions</a></li>
|
52
|
+
|
53
|
+
<!-- only show this button if we have more than 20 revisions -->
|
54
|
+
<li class="minibutton"><a href="#"
|
55
|
+
class="action-back-to-top">Back to Top</a></li>
|
56
|
+
</ul>
|
57
|
+
</div>
|
58
|
+
</div>
|
@@ -0,0 +1,28 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta http-equiv="Content-type" content="text/html;charset=utf-8">
|
5
|
+
<link rel="stylesheet" type="text/css" href="/css/gollum.css" media="all">
|
6
|
+
<link rel="stylesheet" type="text/css" href="/css/editor.css" media="all">
|
7
|
+
<link rel="stylesheet" type="text/css" href="/css/dialog.css" media="all">
|
8
|
+
<link rel="stylesheet" type="text/css" href="/css/template.css" media="all">
|
9
|
+
|
10
|
+
<!--[if IE 7]>
|
11
|
+
<link rel="stylesheet" type="text/css" href="/css/ie7.css" media="all">
|
12
|
+
<![endif]-->
|
13
|
+
|
14
|
+
<script type="text/javascript" src="/javascript/jquery.js"></script>
|
15
|
+
<script type="text/javascript" src="/javascript/gollum.js"></script>
|
16
|
+
<script type="text/javascript" src="/javascript/gollum.dialog.js"></script>
|
17
|
+
<script type="text/javascript" src="/javascript/gollum.placeholder.js"></script>
|
18
|
+
|
19
|
+
<script type="text/javascript"
|
20
|
+
src="/javascript/editor/gollum.editor.js"></script>
|
21
|
+
<title>{{title}}</title>
|
22
|
+
</head>
|
23
|
+
<body>
|
24
|
+
|
25
|
+
{{{yield}}}
|
26
|
+
|
27
|
+
</body>
|
28
|
+
</html>
|
@@ -0,0 +1,37 @@
|
|
1
|
+
<div id="wiki-wrapper" class="page">
|
2
|
+
<div id="head">
|
3
|
+
<h1>{{title}}</h1>
|
4
|
+
<ul class="actions">
|
5
|
+
<li class="minibutton"><a href="/pages"
|
6
|
+
class="action-all-pages">All Pages</a></li>
|
7
|
+
<li class="minibutton"><a href="/history/{{escaped_name}}"
|
8
|
+
class="action-page-history">Page History</a></li>
|
9
|
+
</ul>
|
10
|
+
{{>searchbar}}
|
11
|
+
</div>
|
12
|
+
<div id="wiki-content">
|
13
|
+
<div class="wrap {{#has_footer}} has-footer {{/has_footer}} {{#has_sidebar}} has-rightbar{{/has_sidebar}}">
|
14
|
+
<div id="wiki-body" class="gollum-{{format}}-content">
|
15
|
+
<div id="template">
|
16
|
+
{{{content}}}
|
17
|
+
</div>
|
18
|
+
</div>
|
19
|
+
{{#has_sidebar}}
|
20
|
+
<div id="wiki-rightbar" class="gollum-{{sidebar_format}}-content">
|
21
|
+
{{{sidebar_content}}}
|
22
|
+
</div>
|
23
|
+
{{/has_sidebar}}
|
24
|
+
{{#has_footer}}
|
25
|
+
<div id="wiki-footer" class="gollum-{{footer_format}}-content">
|
26
|
+
<div id="footer-content">
|
27
|
+
{{{footer_content}}}
|
28
|
+
</div>
|
29
|
+
</div>
|
30
|
+
{{/has_footer}}
|
31
|
+
</div>
|
32
|
+
|
33
|
+
</div>
|
34
|
+
<div id="footer">
|
35
|
+
<p id="last-edit">Last edited by <b>{{author}}</b>, {{date}}</p>
|
36
|
+
</div>
|
37
|
+
</div>
|
@@ -0,0 +1,35 @@
|
|
1
|
+
<div id="wiki-wrapper" class="results">
|
2
|
+
<div id="head">
|
3
|
+
<h1>{{title}}</h1>
|
4
|
+
<ul class="actions">
|
5
|
+
<li class="minibutton"><a href="/"
|
6
|
+
class="action-edit-page">Home</a></li>
|
7
|
+
</ul>
|
8
|
+
{{>searchbar}}
|
9
|
+
</div>
|
10
|
+
<div id="results">
|
11
|
+
|
12
|
+
{{#has_results}}
|
13
|
+
<ul>
|
14
|
+
{{#results}}
|
15
|
+
<li>
|
16
|
+
<a href="/{{name}}">{{name}}</a>
|
17
|
+
</li>
|
18
|
+
{{/results}}
|
19
|
+
</ul>
|
20
|
+
{{/has_results}}
|
21
|
+
|
22
|
+
{{#no_results}}
|
23
|
+
<p id="no-results">
|
24
|
+
There are no pages in <strong>{{ref}}</strong>.
|
25
|
+
</p>
|
26
|
+
{{/no_results}}
|
27
|
+
|
28
|
+
</div>
|
29
|
+
<div id="footer">
|
30
|
+
<ul class="actions">
|
31
|
+
<li class="minibutton"><a href="#">Back to Top</a></li>
|
32
|
+
</ul>
|
33
|
+
</div>
|
34
|
+
</div>
|
35
|
+
|
@@ -0,0 +1,36 @@
|
|
1
|
+
<div id="wiki-wrapper" class="results">
|
2
|
+
<div id="head">
|
3
|
+
<h1>Search Results for <strong>{{query}}</strong></h1>
|
4
|
+
<ul class="actions">
|
5
|
+
<li class="minibutton"><a href="/"
|
6
|
+
class="action-edit-page">Home</a></li>
|
7
|
+
</ul>
|
8
|
+
{{>searchbar}}
|
9
|
+
</div>
|
10
|
+
<div id="results">
|
11
|
+
|
12
|
+
{{#has_results}}
|
13
|
+
<ul>
|
14
|
+
{{#results}}
|
15
|
+
<li>
|
16
|
+
<a href="/{{name}}">{{name}}</a>
|
17
|
+
<span class="count">({{count}} matches)</span>
|
18
|
+
</li>
|
19
|
+
{{/results}}
|
20
|
+
</ul>
|
21
|
+
{{/has_results}}
|
22
|
+
|
23
|
+
{{#no_results}}
|
24
|
+
<p id="no-results">
|
25
|
+
There are no results for your search <strong>{{query}}</strong>.
|
26
|
+
</p>
|
27
|
+
{{/no_results}}
|
28
|
+
|
29
|
+
</div>
|
30
|
+
<div id="footer">
|
31
|
+
<ul class="actions">
|
32
|
+
<li class="minibutton"><a href="#">Back to Top</a></li>
|
33
|
+
</ul>
|
34
|
+
</div>
|
35
|
+
</div>
|
36
|
+
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<div id="searchbar">
|
2
|
+
<form action="/search" method="get" id="search-form">
|
3
|
+
<div id="searchbar-fauxtext">
|
4
|
+
<input type="text" name="q" id="search-query" value="Search…" autocomplete="off">
|
5
|
+
<a href="#" id="search-submit" title="Search this wiki">
|
6
|
+
<span>Search</span>
|
7
|
+
</a>
|
8
|
+
</div>
|
9
|
+
</form>
|
10
|
+
</div>
|
@@ -0,0 +1,94 @@
|
|
1
|
+
module Precious
|
2
|
+
module Views
|
3
|
+
class Compare < Layout
|
4
|
+
attr_reader :page, :diff, :versions, :message
|
5
|
+
|
6
|
+
def title
|
7
|
+
"Comparison of #{@page.title}"
|
8
|
+
end
|
9
|
+
|
10
|
+
def path
|
11
|
+
@page.path
|
12
|
+
end
|
13
|
+
|
14
|
+
def before
|
15
|
+
@versions[0][0..6]
|
16
|
+
end
|
17
|
+
|
18
|
+
def after
|
19
|
+
@versions[1][0..6]
|
20
|
+
end
|
21
|
+
|
22
|
+
def lines
|
23
|
+
lines = []
|
24
|
+
@diff.diff.split("\n")[2..-1].each_with_index do |line, line_index|
|
25
|
+
lines << { :line => line,
|
26
|
+
:class => line_class(line),
|
27
|
+
:ldln => left_diff_line_number(0, line),
|
28
|
+
:rdln => right_diff_line_number(0, line) }
|
29
|
+
end if @diff
|
30
|
+
lines
|
31
|
+
end
|
32
|
+
|
33
|
+
def show_revert
|
34
|
+
!@message
|
35
|
+
end
|
36
|
+
|
37
|
+
# private
|
38
|
+
|
39
|
+
def line_class(line)
|
40
|
+
if line =~ /^@@/
|
41
|
+
'gc'
|
42
|
+
elsif line =~ /^\+/
|
43
|
+
'gi'
|
44
|
+
elsif line =~ /^\-/
|
45
|
+
'gd'
|
46
|
+
else
|
47
|
+
''
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
@left_diff_line_number = nil
|
52
|
+
def left_diff_line_number(id, line)
|
53
|
+
if line =~ /^@@/
|
54
|
+
m, li = *line.match(/\-(\d+)/)
|
55
|
+
@left_diff_line_number = li.to_i
|
56
|
+
@current_line_number = @left_diff_line_number
|
57
|
+
ret = '...'
|
58
|
+
elsif line[0] == ?-
|
59
|
+
ret = @left_diff_line_number.to_s
|
60
|
+
@left_diff_line_number += 1
|
61
|
+
@current_line_number = @left_diff_line_number - 1
|
62
|
+
elsif line[0] == ?+
|
63
|
+
ret = ' '
|
64
|
+
else
|
65
|
+
ret = @left_diff_line_number.to_s
|
66
|
+
@left_diff_line_number += 1
|
67
|
+
@current_line_number = @left_diff_line_number - 1
|
68
|
+
end
|
69
|
+
ret
|
70
|
+
end
|
71
|
+
|
72
|
+
@right_diff_line_number = nil
|
73
|
+
def right_diff_line_number(id, line)
|
74
|
+
if line =~ /^@@/
|
75
|
+
m, ri = *line.match(/\+(\d+)/)
|
76
|
+
@right_diff_line_number = ri.to_i
|
77
|
+
@current_line_number = @right_diff_line_number
|
78
|
+
ret = '...'
|
79
|
+
elsif line[0] == ?-
|
80
|
+
ret = ' '
|
81
|
+
elsif line[0] == ?+
|
82
|
+
ret = @right_diff_line_number.to_s
|
83
|
+
@right_diff_line_number += 1
|
84
|
+
@current_line_number = @right_diff_line_number - 1
|
85
|
+
else
|
86
|
+
ret = @right_diff_line_number.to_s
|
87
|
+
@right_diff_line_number += 1
|
88
|
+
@current_line_number = @right_diff_line_number - 1
|
89
|
+
end
|
90
|
+
ret
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|