changeset 681:6bbcfcb85e50 feature_36

Transplant rev 65abc6b39292 from live branch
author Chris Cannam <chris.cannam@soundsoftware.ac.uk>
date Thu, 15 Sep 2011 15:36:38 +0100
parents ec6c2f6a33c4
children 7e887544be06
files app/models/project.rb vendor/plugins/redmine_bibliography/app/views/projects/show.rhtml
diffstat 2 files changed, 32 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/app/models/project.rb	Tue Sep 13 17:18:00 2011 +0100
+++ b/app/models/project.rb	Thu Sep 15 15:36:38 2011 +0100
@@ -597,7 +597,8 @@
     'custom_field_values',
     'custom_fields',
     'tracker_ids',
-    'issue_custom_field_ids'
+    'issue_custom_field_ids',
+    'has_welcome_page'
 
   safe_attributes 'enabled_module_names',
     :if => lambda {|project, user| project.new_record? || user.allowed_to?(:select_project_modules, project) }
--- a/vendor/plugins/redmine_bibliography/app/views/projects/show.rhtml	Tue Sep 13 17:18:00 2011 +0100
+++ b/vendor/plugins/redmine_bibliography/app/views/projects/show.rhtml	Thu Sep 15 15:36:38 2011 +0100
@@ -10,6 +10,34 @@
 	<% end %>
 </div>
 
+<% if @project.has_welcome_page %>
+<% page = @project.wiki.find_page("Overview") %>
+<% end %>
+
+<% if page %>
+
+<% if @project.module_enabled? :wiki %>
+<% if User.current.allowed_to?(:edit_wiki_pages, @project) %>
+<div class="contextual">
+<%= link_to(l(:button_welcome_page_edit_this), {:controller => 'wiki', :action => 'edit', :project_id => @project, :id => Wiki.titleize("Overview")}, :class => 'icon icon-edit') %>
+</div>
+<% end %>
+<% end %>
+
+<div class="contextual" style="clear: right">
+<ul>
+<% 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">
@@ -82,6 +110,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 %>