suitepro/plugins/redmine_private_wiki/app/views/wiki/date_index.html.erb

60 lines
2.3 KiB
Text
Executable file

<div class="contextual">
<% if User.current.allowed_to?(:edit_wiki_pages, @project) %>
<%= link_to l(:label_wiki_page_new), new_project_wiki_page_path(@project), :remote => true, :class => 'icon icon-add' %>
<% end %>
<%= watcher_link(@wiki, User.current) %>
</div>
<h2><%= l(:label_index_by_date) %></h2>
<% if @pages.empty? %>
<p class="nodata"><%= l(:label_no_data) %></p>
<% end %>
<% @pages_by_date.keys.sort.reverse.each do |date| %>
<% all_private = true %>
<% @pages_by_date[date].each do |page| %>
<% if !page.private? %>
<% all_private = false %>
<% end %>
<% end %>
<% if !all_private %>
<h3><%= format_date(date) %></h3>
<ul>
<% @pages_by_date[date].each do |page| %>
<% if !page.private? %>
<li><%= link_to page.pretty_title, :action => 'show', :id => page.title, :project_id => page.project %></li>
<% elsif User.current.allowed_to?(:view_privates_wiki, @project) %>
<li><%= link_to page.pretty_title, :action => 'show', :id => page.title, :project_id => page.project %>&nbsp;&nbsp;&nbsp;&nbsp;<span class="private_wiki_flag" style="display:inline-block;"><%= l(:private_flag) %></span></li>
<% end %>
<% end %>
</ul>
<% elsif User.current.allowed_to?(:view_privates_wiki, @project) %>
<h3><%= format_date(date) %></h3>
<ul>
<% @pages_by_date[date].each do |page| %>
<li><%= link_to page.pretty_title, :action => 'show', :id => page.title, :project_id => page.project %>&nbsp;&nbsp;&nbsp;&nbsp;<span class="private_wiki_flag" style="display:inline-block;"><%= l(:private_flag) %></span></li>
<% end %>
</ul>
<% end %>
<% end %>
<% content_for :sidebar do %>
<%= render :partial => 'sidebar' %>
<% end %>
<% unless @pages.empty? %>
<% other_formats_links do |f| %>
<%= f.link_to 'Atom', :url => {:controller => 'activities', :action => 'index', :id => @project, :show_wiki_edits => 1, :key => User.current.rss_key} %>
<% if User.current.allowed_to?(:export_wiki_pages, @project) %>
<%= f.link_to('PDF', :url => {:action => 'export', :format => 'pdf'}) %>
<%= f.link_to('HTML', :url => {:action => 'export'}) %>
<% end %>
<% end %>
<% end %>
<% content_for :header_tags do %>
<%= auto_discovery_link_tag(:atom, :controller => 'activities', :action => 'index', :id => @project, :show_wiki_edits => 1, :format => 'atom', :key => User.current.rss_key) %>
<% end %>