comparison app/views/projects/show.rhtml @ 350:a1e6dc0e204b feature_123

Show Overview wiki page, if it exists, instead of (almost) entire overview page
author Chris Cannam <chris.cannam@soundsoftware.ac.uk>
date Thu, 31 Mar 2011 16:14:38 +0100
parents f039bb649d0c
children ebf53b46f3f3
comparison
equal deleted inserted replaced
347:f039bb649d0c 350:a1e6dc0e204b
1 <div class="contextual"> 1 <div class="contextual">
2 <% if User.current.allowed_to?(:add_subprojects, @project) %> 2 <% if User.current.allowed_to?(:add_subprojects, @project) %>
3 <%= link_to l(:label_subproject_new), {:controller => 'projects', :action => 'new', :parent_id => @project}, :class => 'icon icon-add' %> 3 <%= link_to l(:label_subproject_new), {:controller => 'projects', :action => 'new', :parent_id => @project}, :class => 'icon icon-add' %>
4 <% end %> 4 <% end %>
5 </div> 5 </div>
6
7 <% page = @project.wiki.find_page("Overview") %>
8
9 <% if page %>
10
11 <div class="contextual" style="clear: right">
12 <ul>
13 <% @users_by_role.keys.sort.each do |role| %>
14 <li><%=h role %>: <%= @users_by_role[role].sort.collect{|u| link_to_user u}.join(", ") %></li>
15 <% end %>
16 <% unless @project.homepage.blank? %><li><%=l(:field_homepage)%>: <%= auto_link(h(@project.homepage)) %></li><% end %>
17 <% if @subprojects.any? %>
18 <li><%=l(:label_subproject_plural)%>:
19 <%= @subprojects.collect{|p| link_to(h(p), :action => 'show', :id => p)}.join(", ") %></li>
20 <% end %>
21 </ul>
22 </div>
23
24 <%= render(:partial => "wiki/content", :locals => {:content => page.content_for_version()}) %>
25
26 <% else %>
6 27
7 <h2><%=l(:label_overview)%></h2> 28 <h2><%=l(:label_overview)%></h2>
8 29
9 <div class="splitcontentleft"> 30 <div class="splitcontentleft">
10 <div class="wiki"> 31 <div class="wiki">
77 <%= link_to(l(:label_report), {:controller => 'time_entry_reports', :action => 'report', :project_id => @project}) %></p> 98 <%= link_to(l(:label_report), {:controller => 'time_entry_reports', :action => 'report', :project_id => @project}) %></p>
78 <% end %> 99 <% end %>
79 <%= call_hook(:view_projects_show_sidebar_bottom, :project => @project) %> 100 <%= call_hook(:view_projects_show_sidebar_bottom, :project => @project) %>
80 <% end %> 101 <% end %>
81 102
103 <% end %>
104
82 <% content_for :header_tags do %> 105 <% content_for :header_tags do %>
83 <%= auto_discovery_link_tag(:atom, {:controller => 'activities', :action => 'index', :id => @project, :format => 'atom', :key => User.current.rss_key}) %> 106 <%= auto_discovery_link_tag(:atom, {:controller => 'activities', :action => 'index', :id => @project, :format => 'atom', :key => User.current.rss_key}) %>
84 <% end %> 107 <% end %>
85 108
86 <% html_title(l(:label_overview)) -%> 109 <% html_title(l(:label_overview)) -%>