diff options
Diffstat (limited to 'app/views/wiki')
-rw-r--r-- | app/views/wiki/_preview.rhtml | 3 | ||||
-rw-r--r-- | app/views/wiki/edit.rhtml | 39 | ||||
-rw-r--r-- | app/views/wiki/export.rhtml | 14 | ||||
-rw-r--r-- | app/views/wiki/export_multiple.rhtml | 26 | ||||
-rw-r--r-- | app/views/wiki/history.rhtml | 28 | ||||
-rw-r--r-- | app/views/wiki/show.rhtml | 30 | ||||
-rw-r--r-- | app/views/wiki/special_page_index.rhtml | 13 |
7 files changed, 153 insertions, 0 deletions
diff --git a/app/views/wiki/_preview.rhtml b/app/views/wiki/_preview.rhtml new file mode 100644 index 000000000..c17200ab1 --- /dev/null +++ b/app/views/wiki/_preview.rhtml @@ -0,0 +1,3 @@ +<fieldset class="preview"><legend><%= l(:label_preview) %></legend>
+<%= textilizable @text %>
+</fieldset>
diff --git a/app/views/wiki/edit.rhtml b/app/views/wiki/edit.rhtml new file mode 100644 index 000000000..ca29aa1e6 --- /dev/null +++ b/app/views/wiki/edit.rhtml @@ -0,0 +1,39 @@ +<div class="contextual">
+<%= link_to(l(:label_page_index), {:action => 'special', :page => 'Page_index'}, :class => 'icon icon-index') %>
+</div>
+
+<h2><%= @page.pretty_title %></h2>
+
+<% form_for :content, @content, :url => {:action => 'edit', :page => @page.title}, :html => {:id => 'wiki_form'} do |f| %>
+<%= error_messages_for 'content' %>
+<p><%= f.text_area :text, :cols => 100, :rows => 25, :style => "width:99%;" %></p>
+<p><label><%= l(:field_comment) %></label><br /><%= f.text_field :comment, :size => 120 %></p>
+<p><%= submit_tag l(:button_save) %>
+ <%= link_to_remote l(:label_preview),
+ { :url => { :controller => 'wiki', :action => 'preview' },
+ :method => 'get',
+ :update => 'preview',
+ :with => "Form.serialize('wiki_form')",
+ :loading => "Element.show('indicator')",
+ :loaded => "Element.hide('indicator')"
+ } %>
+ <span id="indicator" style="display:none"><%= image_tag "loading.gif", :align => "absmiddle" %></span>
+</p>
+
+<% end %>
+
+<% if Setting.text_formatting == 'textile' %>
+<%= javascript_include_tag 'jstoolbar' %>
+<script type="text/javascript">
+//<![CDATA[
+if (document.getElementById) {
+ if (document.getElementById('content_text')) {
+ var commentTb = new jsToolBar(document.getElementById('content_text'));
+ commentTb.draw();
+ }
+}
+//]]>
+</script>
+<% end %>
+
+<div id="preview" class="wiki"></div>
\ No newline at end of file diff --git a/app/views/wiki/export.rhtml b/app/views/wiki/export.rhtml new file mode 100644 index 000000000..c31568246 --- /dev/null +++ b/app/views/wiki/export.rhtml @@ -0,0 +1,14 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+<head>
+<title><%=h @page.pretty_title %></title>
+<meta http-equiv="content-type" content="text/html; charset=utf-8" />
+<style>
+body { font:80% Verdana,Tahoma,Arial,sans-serif; }
+h1, h2, h3, h4 { font-family: Trebuchet MS,Georgia,"Times New Roman",serif; }
+</style>
+</head>
+<body>
+<%= textilizable @content.text, :wiki_links => :local %>
+</body>
+</html>
diff --git a/app/views/wiki/export_multiple.rhtml b/app/views/wiki/export_multiple.rhtml new file mode 100644 index 000000000..cecb40b42 --- /dev/null +++ b/app/views/wiki/export_multiple.rhtml @@ -0,0 +1,26 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+<head>
+<title><%=h @wiki.project.name %></title>
+<meta http-equiv="content-type" content="text/html; charset=utf-8" />
+<style>
+body { font:80% Verdana,Tahoma,Arial,sans-serif; }
+h1, h2, h3, h4 { font-family: Trebuchet MS,Georgia,"Times New Roman",serif; }
+</style>
+</head>
+<body>
+
+<strong><%= l(:label_page_index) %></strong>
+<ul>
+<% @pages.each do |page| %>
+ <li><a href="#<%= page.title %>"><%= page.pretty_title %></a></li>
+<% end %>
+</ul>
+
+<% @pages.each do |page| %>
+<hr />
+<%= textilizable page.content.text, :wiki_links => :anchor %>
+<% end %>
+
+</body>
+</html>
diff --git a/app/views/wiki/history.rhtml b/app/views/wiki/history.rhtml new file mode 100644 index 000000000..e44a08168 --- /dev/null +++ b/app/views/wiki/history.rhtml @@ -0,0 +1,28 @@ +<div class="contextual">
+<%= link_to(l(:label_page_index), {:action => 'special', :page => 'Page_index'}, :class => 'icon icon-index') %>
+</div>
+
+<h2><%= @page.pretty_title %></h2>
+
+<h3><%= l(:label_history) %></h3>
+
+<table class="list">
+<thead><tr>
+ <th>#</th>
+ <th><%= l(:field_updated_on) %></th>
+ <th><%= l(:field_author) %></th>
+ <th><%= l(:field_comment) %></th>
+</tr></thead>
+<tbody>
+<% @versions.each do |ver| %>
+<tr class="<%= cycle("odd", "even") %>">
+ <th align="center"><%= link_to ver.version, :action => 'index', :page => @page.title, :version => ver.version %></th>
+ <td align="center"><%= format_time(ver.updated_on) %></td>
+ <td><em><%= ver.author ? ver.author.name : "anonyme" %></em></td>
+ <td><%=h ver.comment %></td>
+</tr>
+<% end %>
+</tbody>
+</table>
+
+<p><%= link_to l(:button_back), :action => 'index', :page => @page.title %></p>
\ No newline at end of file diff --git a/app/views/wiki/show.rhtml b/app/views/wiki/show.rhtml new file mode 100644 index 000000000..e0369ed30 --- /dev/null +++ b/app/views/wiki/show.rhtml @@ -0,0 +1,30 @@ +<div class="contextual">
+<%= link_to(l(:button_edit), {:action => 'edit', :page => @page.title}, :class => 'icon icon-edit') if @content.version == @page.content.version %>
+<%= link_to(l(:label_history), {:action => 'history', :page => @page.title}, :class => 'icon icon-history') %>
+<%= link_to(l(:label_page_index), {:action => 'special', :page => 'Page_index'}, :class => 'icon icon-index') %>
+</div>
+
+<% if @content.version != @page.content.version %>
+ <p>
+ <%= link_to(('« ' + l(:label_previous)), :action => 'index', :page => @page.title, :version => (@content.version - 1)) + " - " if @content.version > 1 %>
+ <%= "#{l(:label_version)} #{@content.version}/#{@page.content.version}" %> -
+ <%= link_to((l(:label_next) + ' »'), :action => 'index', :page => @page.title, :version => (@content.version + 1)) + " - " if @content.version < @page.content.version %>
+ <%= link_to(l(:label_current_version), :action => 'index', :page => @page.title) %>
+ <br />
+ <em><%= @content.author ? @content.author.name : "anonyme" %>, <%= format_time(@content.updated_on) %> </em><br />
+ <%=h @content.comment %>
+ </p>
+ <hr />
+<% end %>
+
+<div class="wiki">
+<% cache "wiki/show/#{@page.id}/#{@content.version}" do %>
+<%= textilizable @content.text %>
+<% end %>
+</div>
+
+<div class="contextual">
+<%= l(:label_export_to) %>
+<%= link_to 'HTML', {:export => 'html', :version => @content.version}, :class => 'icon icon-html' %>,
+<%= link_to 'TXT', {:export => 'txt', :version => @content.version}, :class => 'icon icon-txt' %>
+</div>
\ No newline at end of file diff --git a/app/views/wiki/special_page_index.rhtml b/app/views/wiki/special_page_index.rhtml new file mode 100644 index 000000000..e6e3e7020 --- /dev/null +++ b/app/views/wiki/special_page_index.rhtml @@ -0,0 +1,13 @@ +<div class="contextual">
+<% unless @pages.empty? %>
+<%= l(:label_export_to) %> <%= link_to 'HTML', {:action => 'special', :page => 'export'}, :class => 'icon icon-html' %>
+<% end %>
+</div>
+
+<h2><%= l(:label_page_index) %></h2>
+
+<% if @pages.empty? %><p><i><%= l(:label_no_data) %></i></p><% end %>
+<ul><% @pages.each do |page| %>
+ <li><%= link_to page.pretty_title, :action => 'index', :page => page.title %> -
+ <%= l(:label_last_updates) %>: <%= format_time(page.updated_on) %></li>
+<% end %></ul>
\ No newline at end of file |