diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-03-10 15:09:49 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-03-10 15:09:49 +0000 |
commit | c514316a2efcf4e8df4bc2f2681548ebffa30adf (patch) | |
tree | b9b7bc9ccbbbad1cce2701430788f4dfbf872610 /app/views | |
parent | 8b98ceb92c8fba72315d28c3b7664f481547bf24 (diff) | |
download | redmine-c514316a2efcf4e8df4bc2f2681548ebffa30adf.tar.gz redmine-c514316a2efcf4e8df4bc2f2681548ebffa30adf.zip |
wiki branch merged into trunk
git-svn-id: http://redmine.rubyforge.org/svn/trunk@323 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/layouts/base.rhtml | 2 | ||||
-rw-r--r-- | app/views/projects/_form.rhtml | 14 | ||||
-rw-r--r-- | app/views/settings/edit.rhtml | 3 | ||||
-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 |
10 files changed, 172 insertions, 0 deletions
diff --git a/app/views/layouts/base.rhtml b/app/views/layouts/base.rhtml index 42275b11f..7665632ef 100644 --- a/app/views/layouts/base.rhtml +++ b/app/views/layouts/base.rhtml @@ -91,6 +91,7 @@ <%= link_to l(:label_change_log), {:controller => 'projects', :action => 'changelog', :id => @project }, :class => "menuItem" %>
<%= link_to l(:label_roadmap), {:controller => 'projects', :action => 'roadmap', :id => @project }, :class => "menuItem" %>
<%= link_to l(:label_document_plural), {:controller => 'projects', :action => 'list_documents', :id => @project }, :class => "menuItem" %>
+ <%= link_to l(:label_wiki), {:controller => 'wiki', :id => @project, :page => nil }, :class => "menuItem" if @project.wiki and !@project.wiki.new_record? %>
<%= link_to l(:label_member_plural), {:controller => 'projects', :action => 'list_members', :id => @project }, :class => "menuItem" %>
<%= link_to l(:label_attachment_plural), {:controller => 'projects', :action => 'list_files', :id => @project }, :class => "menuItem" %>
<%= link_to l(:label_search), {:controller => 'projects', :action => 'search', :id => @project }, :class => "menuItem" %>
@@ -115,6 +116,7 @@ <li><%= link_to l(:label_change_log), :controller => 'projects', :action => 'changelog', :id => @project %></li>
<li><%= link_to l(:label_roadmap), :controller => 'projects', :action => 'roadmap', :id => @project %></li>
<li><%= link_to l(:label_document_plural), :controller => 'projects', :action => 'list_documents', :id => @project %></li>
+ <li><%= link_to l(:label_wiki), :controller => 'wiki', :id => @project, :page => nil if @project.wiki and !@project.wiki.new_record? %></li>
<li><%= link_to l(:label_member_plural), :controller => 'projects', :action => 'list_members', :id => @project %></li>
<li><%= link_to l(:label_attachment_plural), :controller => 'projects', :action => 'list_files', :id => @project %></li>
<li><%= link_to l(:label_search), :controller => 'projects', :action => 'search', :id => @project %></li>
diff --git a/app/views/projects/_form.rhtml b/app/views/projects/_form.rhtml index 2191e9fa3..0bb7ebfb5 100644 --- a/app/views/projects/_form.rhtml +++ b/app/views/projects/_form.rhtml @@ -38,6 +38,20 @@ <%= javascript_tag "Element.hide('repository');" if @project.repository.nil? %> </div> +<div class="box"> +<h3><%= check_box_tag "wiki_enabled", 1, !@project.wiki.nil?, :onclick => "Element.toggle('wiki');" %> <%= l(:label_wiki) %></h3> +<%= hidden_field_tag "wiki_enabled", 0 %> +<div id="wiki"> +<% fields_for :wiki, @project.wiki, { :builder => TabularFormBuilder, :lang => current_language} do |wiki| %> +<p><%= wiki.text_field :start_page, :size => 60, :required => true %></p> +<% # content_tag("div", "", :id => "wiki_start_page_auto_complete", :class => "auto_complete") + + # auto_complete_field("wiki_start_page", { :url => { :controller => 'wiki', :action => 'auto_complete_for_wiki_page', :id => @project } }) +%> +<% end %> +</div> +<%= javascript_tag "Element.hide('wiki');" if @project.wiki.nil? %> +</div> + <% content_for :header_tags do %> <%= javascript_include_tag 'calendar/calendar' %> <%= javascript_include_tag "calendar/lang/calendar-#{current_language}.js" %> diff --git a/app/views/settings/edit.rhtml b/app/views/settings/edit.rhtml index ed42d3478..aac4ab686 100644 --- a/app/views/settings/edit.rhtml +++ b/app/views/settings/edit.rhtml @@ -38,6 +38,9 @@ <p><label><%= l(:setting_text_formatting) %></label> <%= select_tag 'settings[text_formatting]', options_for_select( [[l(:label_none), 0], ["textile", "textile"]], Setting.text_formatting) %></p> +<p><label><%= l(:setting_wiki_compression) %></label> +<%= select_tag 'settings[wiki_compression]', options_for_select( [[l(:label_none), 0], ["gzip", "gzip"]], Setting.wiki_compression) %></p> + </div> <%= submit_tag l(:button_save) %> <% end %>
\ No newline at end of file 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 |