summaryrefslogtreecommitdiff
path: root/app/views/revisions
diff options
context:
space:
mode:
authorerdgeist <erdgeist@bauklotz.local>2009-03-18 11:36:10 +0100
committererdgeist <erdgeist@bauklotz.local>2009-03-18 11:36:10 +0100
commitd957a33a0d50f00c1968c5d12e728bd73ea186b3 (patch)
tree8d7ecce1fc6c82abea10b8b8be868a92746cbd89 /app/views/revisions
parentce55ed022fd373af58f7bd25cdd3f092f5698c54 (diff)
parentca08b36ca6bd874abbb7207495860eeeb53884e0 (diff)
Merge branch 'master' of ssh://git@svn.medienhaus.udk-berlin.de/usr/local/git/cccms
Diffstat (limited to 'app/views/revisions')
-rw-r--r--app/views/revisions/diff.html.erb59
-rw-r--r--app/views/revisions/index.html.erb1
-rw-r--r--app/views/revisions/show.html.erb18
3 files changed, 78 insertions, 0 deletions
diff --git a/app/views/revisions/diff.html.erb b/app/views/revisions/diff.html.erb
new file mode 100644
index 0000000..a8a0276
--- /dev/null
+++ b/app/views/revisions/diff.html.erb
@@ -0,0 +1,59 @@
1<h1>Revisions#diff</h1>
2
3<% form_tag url_for(:action => :diff), :method => :get do %>
4 <%= select_tag :start, options_for_select(@node.pages.map{|x| x.revision}, params[:start].to_i) %>
5 <%= select_tag :end, options_for_select(@node.pages.map{|x| x.revision}, params[:end].to_i) %>
6 <%= submit_tag 'Diff' %>
7<% end %>
8
9
10<div id="start_title" style="display: none;">
11 <%= (@start.title) %>
12</div>
13
14<div id="end_title" style="display: none;">
15 <%= (@end.title) %>
16</div>
17
18<div id="start_abstract" style="display: none;">
19 <%= (@start.abstract) %>
20</div>
21
22<div id="end_abstract" style="display: none;">
23 <%= (@end.abstract) %>
24</div>
25
26<div id="start_body" style="display: none;">
27 <%= (@start.body) %>
28</div>
29
30<div id="end_body" style="display: none;">
31 <%= (@end.body) %>
32</div>
33
34
35<%= javascript_include_tag 'cacycle_diff' %>
36<script type="text/javascript" charset="utf-8">
37 window.onload = function() {
38 title1 = document.getElementById('start_title').innerHTML;
39 title2 = document.getElementById('end_title').innerHTML;
40 abstract1 = document.getElementById('start_abstract').innerHTML;
41 abstract2 = document.getElementById('end_abstract').innerHTML;
42 body1 = document.getElementById('start_body').innerHTML;
43 body2 = document.getElementById('end_body').innerHTML;
44 document.getElementById('diffview_title').innerHTML = WDiffString(title1, title2);
45 document.getElementById('diffview_abstract').innerHTML = WDiffString(abstract1, abstract2);
46 document.getElementById('diffview_body').innerHTML = WDiffString(body1, body2);
47 }
48</script>
49
50<div id="diffview">
51 <h3>Title</h3>
52 <p id="diffview_title"></p>
53
54 <h3>Abstract</h3>
55 <p id="diffview_abstract"></p>
56
57 <h3>Body</h3>
58 <p id="diffview_body"></p>
59</div> \ No newline at end of file
diff --git a/app/views/revisions/index.html.erb b/app/views/revisions/index.html.erb
new file mode 100644
index 0000000..e3134d7
--- /dev/null
+++ b/app/views/revisions/index.html.erb
@@ -0,0 +1 @@
<h1>Revisions#index</h1>
diff --git a/app/views/revisions/show.html.erb b/app/views/revisions/show.html.erb
new file mode 100644
index 0000000..64979fc
--- /dev/null
+++ b/app/views/revisions/show.html.erb
@@ -0,0 +1,18 @@
1<div id="subnavigation">
2 <%= link_to 'Diff revisions', :action => :diff, :id => params[:id] %>
3 <%= link_to 'Edit', edit_node_path(@node) %>
4</div>
5
6<h2>Revisions for Node: <%= @node.unique_name %></h2>
7
8<h3>Current title: <%= @node.head.title %></h3>
9<table>
10<% @node.pages.reverse.each do |page| %>
11 <tr>
12 <td><%= page.revision %></td>
13 <td><%= page.title %></td>
14 <td><%= page.user.try(:login) %></td>
15 <td><%= page.updated_at %></td>
16 </tr>
17<% end %>
18</table> \ No newline at end of file