changeset 1232:345e08eee166 redmine-2.2-integration

Some fixes from comparing plugin views to core app views
author Chris Cannam
date Wed, 13 Mar 2013 13:06:31 +0000
parents c2e85aec91b2
children ed0d04113c93
files app/views/projects/index.html.erb plugins/redmine_bibliography/app/views/projects/show.html.erb
diffstat 2 files changed, 32 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/app/views/projects/index.html.erb	Wed Mar 13 11:11:16 2013 +0000
+++ b/app/views/projects/index.html.erb	Wed Mar 13 13:06:31 2013 +0000
@@ -4,7 +4,6 @@
 
 <div class="contextual">
     <%= link_to l(:label_overall_activity), { :controller => 'activities', :action => 'index' }%>
-    <%= ('| ' + link_to(l(:label_issue_view_all), issues_path)).html_safe if User.current.allowed_to?(:view_issues, nil, :global => true) %>
     <%= ('| ' + link_to(l(:label_project_new), {:controller => 'projects', :action => 'new'}, :class => 'icon icon-add')).html_safe if User.current.allowed_to?(:add_project, nil, :global => true) %>
 </div>
 
--- a/plugins/redmine_bibliography/app/views/projects/show.html.erb	Wed Mar 13 11:11:16 2013 +0000
+++ b/plugins/redmine_bibliography/app/views/projects/show.html.erb	Wed Mar 13 13:06:31 2013 +0000
@@ -3,6 +3,13 @@
 		<%= link_to l(:label_subproject_new), {:controller => 'projects', :action => 'new', :parent_id => @project}, :class => 'icon icon-add' %>
 	<% end %>
 	
+  <% if User.current.allowed_to?(:close_project, @project) %>
+    <% if @project.active? %>
+      <%= link_to l(:button_close), close_project_path(@project), :data => {:confirm => l(:text_are_you_sure)}, :method => :post, :class => 'icon icon-lock' %>
+    <% else %>
+      <%= link_to l(:button_reopen), reopen_project_path(@project), :data => {:confirm => l(:text_are_you_sure)}, :method => :post, :class => 'icon icon-unlock' %>
+    <% end %>
+
 	<% if @project.module_enabled? :redmine_bibliography %>
 	  <% if User.current.allowed_to?(:add_publication, @project) %>	
 		  <%= link_to l(:label_add_publication_to_project), {:controller => 'publications', :action => 'new', :project_id => @project}, :class => 'icon icon-add' %>		
@@ -26,10 +33,10 @@
 
 <div class="contextual" style="clear: right">
 <ul>
-<% unless @project.homepage.blank? %><li><%=l(:field_homepage)%>: <%= auto_link(h(@project.homepage)) %></li><% end %>
+<% unless @project.homepage.blank? %><li><%=l(:field_homepage)%>: <%= link_to h(@project.homepage), @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>
+	    <%= @subprojects.collect{|p| link_to(h(p), :action => 'show', :id => p)}.join(", ").html_safe %></li>
 <% end %>
 </ul>
 </div>
@@ -40,15 +47,21 @@
 
 <h2><%=l(:label_overview)%></h2> 
 	
+<% unless @project.active? %>
+  <p class="warning"><span class="icon icon-lock"><%= l(:text_project_closed) %></span></p>
+<% end %>
+
 <div class="splitcontentleft">
+  <% if @project.description.present? %>
 	<div class="wiki">
 		<%= textilizable @project.description %>
 	</div>	
+  <% end %>
 	<ul>
-	<% unless @project.homepage.blank? %><li><%=l(:field_homepage)%>: <%= auto_link(h(@project.homepage)) %></li><% end %>
+	<% unless @project.homepage.blank? %><li><%=l(:field_homepage)%>: <%= link_to h(@project.homepage), @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>
+	    <%= @subprojects.collect{|p| link_to(h(p), :action => 'show', :id => p)}.join(", ").html_safe %></li>
   <% end %>
 	<% @project.visible_custom_field_values.each do |custom_value| %>
 	<% if !custom_value.value.blank? %>
@@ -57,17 +70,17 @@
 	<% end %>
 	</ul>	
 
-  <% if User.current.allowed_to?(:view_issues, @project) %>
+  <% if User.current.allowed_to?(:view_issues, @project) and @open_issues_by_tracker.values.any? %>
   <div class="issues box">    
     <h3><%=l(:label_issue_tracking)%></h3>
     <ul>
     <% for tracker in @trackers %>    
-      <li><%= link_to tracker.name, :controller => 'issues', :action => 'index', :project_id => @project, 
+      <li><%= link_to h(tracker.name), :controller => 'issues', :action => 'index', :project_id => @project, 
                                                 :set_filter => 1, 
                                                 "tracker_id" => tracker.id %>:
-					<%= l(:label_x_open_issues_abbr_on_total, :count => @open_issues_by_tracker[tracker].to_i,
-																										:total => @total_issues_by_tracker[tracker].to_i) %>
-			</li>
+	<%= l(:label_x_open_issues_abbr_on_total, :count => @open_issues_by_tracker[tracker].to_i,
+	:total => @total_issues_by_tracker[tracker].to_i) %>
+      </li>
     <% end %>
     </ul>
     <p>
@@ -97,16 +110,23 @@
     <p><%= link_to l(:label_news_view_all), :controller => 'news', :action => 'index', :project_id => @project %></p>
   </div>  
   <% end %>
+
+  <%= render :partial => 'activities/recent' %>
+
   <%= call_hook(:view_projects_show_right, :project => @project) %>
 </div>
 
 <% content_for :sidebar do %>
     <%= call_hook(:view_projects_show_sidebar_top, :project => @project) %>
-    <% if @total_hours && User.current.allowed_to?(:view_time_entries, @project) %>
+    <% if @total_hours.present? && User.current.allowed_to?(:view_time_entries, @project) %>
     <h3><%= l(:label_spent_time) %></h3>
     <p><span class="icon icon-time"><%= l_hours(@total_hours) %></span></p>
-    <p><%= link_to(l(:label_details), {:controller => 'timelog', :action => 'index', :project_id => @project}) %> |
-    <%= link_to(l(:label_report), {:controller => 'time_entry_reports', :action => 'report', :project_id => @project}) %></p>
+    <p>
+    <% if User.current.allowed_to?(:log_time, @project) %>
+      <%= link_to l(:button_log_time), new_project_time_entry_path(@project) %> |
+    <% end %>
+    <%= link_to(l(:label_details), project_time_entries_path(@project)) %> |
+    <%= link_to(l(:label_report), report_project_time_entries_path(@project)) %></p>
     <% end %>
     <%= call_hook(:view_projects_show_sidebar_bottom, :project => @project) %>
 <% end %>