Skip to content

Commit

Permalink
major fixes for show 3x and some syntax
Browse files Browse the repository at this point in the history
fixed the formatting of 3x
  • Loading branch information
speedy32129 committed May 20, 2016
1 parent cbc892e commit 3889e30
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 57 deletions.
2 changes: 1 addition & 1 deletion README.rdoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
= Redmine Project Show plugin

Project Show is a Redmine plugin to show how simple it is to override default views. This partial one display the sub-projects in a more readable list instead of the comma separated one. Doing it within a plugin is better than changing the core as when you go thru updates to Redmine you won't have to go back and make the changes again. I got tired of having to do this for multiple installs and versions fso I think the plugin is a btter idea.
Project Show is a Redmine plugin to show how simple it is to override default views. This partial one displays the sub-projects in a more readable list instead of the comma separated one. Doing it within a plugin is better than changing the core as when you go thru updates to Redmine you won't have to go back and make the changes again. I got tired of having to do this for multiple installs and versions fso I think the plugin is a btter idea.

== Features

Expand Down
14 changes: 10 additions & 4 deletions app/views/projects/_show_0.0.0.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
<% end %>
<% end %>
</div>
<!-- Project overview - start!-->

<!-- Project Overview - start-->
<h2><%=l(:label_overview)%></h2>

<% unless @project.active? %>
Expand All @@ -35,14 +36,16 @@
<h3><%=l(:label_subproject_plural)%>:</h3>
<li><%= @subprojects.collect{|p| link_to(h(p), :action => 'show', :id => p)}.join("</li><li>") %>
<% end %>
<!-- Sub Project list - end -->
<% @project.custom_values.each do |custom_value| %>
<% if !custom_value.value.blank? %>
<li><%=h custom_value.custom_field.name %>: <%=h show_value(custom_value) %></li>
<% end %>
<% end %>
</ul>
</div>
<!-- Subproject list - end -->

<!-- Tracker List - start -->
<div class="splitcontentright">
<% if User.current.allowed_to?(:view_issues, @project) %>
<div class="issues box">
Expand All @@ -69,9 +72,9 @@
</div>
<% end %>
<%= call_hook(:view_projects_show_left, :project => @project) %>
<!--</div>-->
<!-- Tracker List - end -->

<!--<div class="splitcontentright">-->
<!-- Member List - start -->
<%= render :partial => 'members_box' %>

<% if @news.any? && authorize_for('news', 'index') %>
Expand All @@ -83,7 +86,9 @@
<% end %>
<%= call_hook(:view_projects_show_right, :project => @project) %>
</div>
<!-- Member List - end -->

<!-- Sidebar - start -->
<% content_for :sidebar do %>
<% if @total_hours.present? %>
<h3><%= l(:label_spent_time) %></h3>
Expand All @@ -97,6 +102,7 @@
<% end %>
<%= call_hook(:view_projects_show_sidebar_bottom, :project => @project) %>
<% end %>
<!-- Sidebar - end -->

<% content_for :header_tags do %>
<%= auto_discovery_link_tag(:atom, {:controller => 'activities', :action => 'index', :id => @project, :format => 'atom', :key => User.current.rss_key}) %>
Expand Down
22 changes: 10 additions & 12 deletions app/views/projects/_show_2.0.0.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<% end %>
<% end %>
</div>
<!-- Project overview - start!-->
<!-- Project Overview - start-->
<h2><%=l(:label_overview)%></h2>

<% unless @project.active? %>
Expand All @@ -28,9 +28,9 @@
<% unless @project.homepage.blank? %>
<li><%=l(:field_homepage)%>: <%= link_to h(@project.homepage), @project.homepage %></li>
<% end %>
<!-- Project overview - end -->
<!-- Project Overview - end -->

<!-- Sub Project list - start -->
<!-- Subproject List - start -->
<% if @subprojects.any? %>
<h3><%=l(:label_subproject_plural)%>:</h3>
<li><%= @subprojects.collect{|p| link_to(h(p), :action => 'show', :id => p)}.join("</li><li>").html_safe %>
Expand All @@ -42,9 +42,9 @@
<% end %>
</ul>
</div>
<!-- Sub Project list - end -->
<!-- Subproject List - end -->

<!-- Tracker List - Start -->
<!-- Tracker List - start -->
<div class="splitcontentright">
<% if User.current.allowed_to?(:view_issues, @project) %>
<div class="issues box">
Expand All @@ -71,11 +71,9 @@
</div>
<% end %>
<%= call_hook(:view_projects_show_left, :project => @project) %>
<!--</div>-->
<!-- Tracker List - End -->
<!-- Tracker List - end -->

<!-- Member List - Start -->
<!--<div class="splitcontentright">-->
<!-- Member List - start -->
<%= render :partial => 'members_box' %>

<% if @news.any? && authorize_for('news', 'index') %>
Expand All @@ -87,9 +85,9 @@
<% end %>
<%= call_hook(:view_projects_show_right, :project => @project) %>
</div>
<!-- Member List - End -->
<!-- Member List - end -->

<!-- Sidebar - Start -->
<!-- Sidebar - start -->
<% content_for :sidebar do %>
<% if @total_hours.present? %>
<h3><%= l(:label_spent_time) %></h3>
Expand All @@ -103,7 +101,7 @@
<% end %>
<%= call_hook(:view_projects_show_sidebar_bottom, :project => @project) %>
<% end %>
<!-- Sidebar - End -->
<!-- Sidebar - end -->

<% content_for :header_tags do %>
<%= auto_discovery_link_tag(:atom, {:controller => 'activities', :action => 'index', :id => @project, :format => 'atom', :key => User.current.rss_key}) %>
Expand Down
60 changes: 20 additions & 40 deletions app/views/projects/_show_3.x.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
<% end %>
<% end %>
</div>
<!-- Project overview - start!-->

<!-- Project Overview - start -->
<h2><%=l(:label_overview)%></h2>

<% unless @project.active? %>
Expand All @@ -26,46 +27,25 @@
<% end %>
<ul>
<% unless @project.homepage.blank? %>
<li><span class="label"><%=l(:field_homepage)%>:</span> <%= link_to h(@project.homepage), @project.homepage %></li>
<li><%=l(:field_homepage)%>: <%= link_to h(@project.homepage), @project.homepage %></li>
<% end %>
<!-- Project overview - end -->
<!-- Project Overview - end -->

<div class="splitcontentleft">
<% if @project.description.present? %>
<div class="wiki">
<%= textilizable @project.description %>
</div>
<% end %>
<ul>
<% unless @project.homepage.blank? %>
<li><span class="label"><%=l(:field_homepage)%>:</span> <%= link_to h(@project.homepage), @project.homepage %></li>
<!-- Subproject List - start -->
<% if @subprojects.any? %>
<h3><span class="label"><%=l(:label_subproject_plural)%>:</span></h3>
<li><%= @subprojects.collect{|p| link_to(h(p), :action => 'show', :id => p)}.join("</li><li>").html_safe %>
<% end %>
</div>
<!-- Project overview - end -->

<!-- Subproject List - Start -->
<div class="splitcontentleft">
<% if @subprojects.any? or render_custom_field_values(@project).any? %>
<% unless @project.homepage.blank? %>
<li><span class="label"><%=l(:field_homepage)%>:</span> <%= link_to h(@project.homepage), @project.homepage %></li>
<% end %>
<% if @subprojects.any? %>
<h3><%=l(:label_subproject_plural)%>:</h3>
<ul>
<li>
<%= @subprojects.collect{|p| link_to p, project_path(p)}.join("</li><li>").html_safe %>
<% end %>
<% render_custom_field_values(@project) do |custom_field, formatted| %>
<li><span class="label"><%= custom_field.name %>:</span> <%= formatted %></li>
<% end %>
</ul>
<% render_custom_field_values(@project) do |custom_field, formatted| %>
<li><span class="label"><%= custom_field.name %>:</span> <%= formatted %></li>
<% end %>
</ul>
</div>
<!-- Subproject List - End -->
<!-- Subproject List - end -->

<!-- Tracker List - Start -->
<!-- Tracker List - start -->
<div class="splitcontentright">
<% if User.current.allowed_to?(:view_issues, @project) %>
<% if User.current.allowed_to?(:view_issues, @project) %>
<div class="issues box">
<h3><%=l(:label_issue_tracking)%></h3>
<ul>
Expand All @@ -89,11 +69,11 @@
<% end %>
<%= call_hook(:view_projects_show_left, :project => @project) %>
<!--</div>-->
<!-- Tracker List - End -->
<!-- Tracker List - end -->

<!-- Member List - Start -->
<!-- Member List - start -->
<!--<div class="splitcontentright">-->
<%= render :partial => 'members_box' %>
<%= render :partial => 'members_box' %>

<% if @news.any? && authorize_for('news', 'index') %>
<div class="news box">
Expand All @@ -104,13 +84,13 @@
<% end %>
<%= call_hook(:view_projects_show_right, :project => @project) %>
</div>
<!-- Member List - End -->
<!-- Member List - end -->

<!-- Sidebar - Start -->
<!-- Sidebar - start -->
<% content_for :sidebar do %>
<%= render :partial => 'projects/sidebar' %>
<% end %>
<!-- Sidebar - End -->
<!-- Sidebar - end -->

<% content_for :header_tags do %>
<%= auto_discovery_link_tag(:atom, {:controller => 'activities', :action => 'index', :id => @project, :format => 'atom', :key => User.current.rss_key}) %>
Expand Down

0 comments on commit 3889e30

Please sign in to comment.