changeset 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
files app/views/projects/show.rhtml
diffstat 1 files changed, 23 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/app/views/projects/show.rhtml	Thu Mar 31 15:21:43 2011 +0100
+++ b/app/views/projects/show.rhtml	Thu Mar 31 16:14:38 2011 +0100
@@ -4,6 +4,27 @@
 	<% end %>
 </div>
 
+<% page = @project.wiki.find_page("Overview") %>
+
+<% if page %>
+
+<div class="contextual" style="clear: right">
+<ul>
+<% @users_by_role.keys.sort.each do |role| %>
+<li><%=h role %>: <%= @users_by_role[role].sort.collect{|u| link_to_user u}.join(", ") %></li>
+<% end %>
+<% unless @project.homepage.blank? %><li><%=l(:field_homepage)%>: <%= auto_link(h(@project.homepage)) %></li><% end %>
+<% if @subprojects.any? %>
+	<li><%=l(:label_subproject_plural)%>:
+	    <%= @subprojects.collect{|p| link_to(h(p), :action => 'show', :id => p)}.join(", ") %></li>
+<% end %>
+</ul>
+</div>
+
+<%= render(:partial => "wiki/content", :locals => {:content => page.content_for_version()}) %>
+
+<% else %>
+
 <h2><%=l(:label_overview)%></h2> 
 	
 <div class="splitcontentleft">
@@ -79,6 +100,8 @@
     <%= call_hook(:view_projects_show_sidebar_bottom, :project => @project) %>
 <% end %>
 
+<% end %>
+
 <% content_for :header_tags do %>
 <%= auto_discovery_link_tag(:atom, {:controller => 'activities', :action => 'index', :id => @project, :format => 'atom', :key => User.current.rss_key}) %>
 <% end %>