Project

General

Profile

Patch #16042 » nicer_overview_boxes.patch

Massimo Rossello, 2014-02-06 16:19

View differences:

app/controllers/projects_controller.rb
44 44
  include RepositoriesHelper
45 45
  include ProjectsHelper
46 46
  helper :members
47
  helper :reports
47 48

  
48 49
  # Lists visible projects
49 50
  def index
app/views/projects/show.html.erb
19 19

  
20 20
<div class="splitcontentleft">
21 21
  <% if @project.description.present? %>
22
  <div class="wiki">
22
  <div class="wiki box">
23 23
    <%= textilizable @project.description %>
24 24
  </div>
25 25
  <% end %>
26
  <ul>
27 26
  <% unless @project.homepage.blank? %>
28
    <li><%=l(:field_homepage)%>: <%= link_to h(@project.homepage), @project.homepage %></li>
27
    <div class="homepage box">
28
      <h3><%=l(:field_homepage)%></h3>
29
      <%= link_to h(@project.homepage), @project.homepage %>
30
    </div>
29 31
  <% end %>
30 32
  <% if @subprojects.any? %>
31
    <li><%=l(:label_subproject_plural)%>:
32
      <%= @subprojects.collect{|p| link_to p, project_path(p)}.join(", ").html_safe %></li>
33
    <% issues_by_subproject = Issue.by_subproject(@project) || [] %>
34
    <div class="subprojects box">
35
      <h3><%=l(:label_subproject_plural)%></h3>
36
      <table class="list">
37
        <thead><tr>
38
          <th style="width:25%"></th>
39
          <th align="center" style="width:25%"><%=l(:label_open_issues_plural)%></th>
40
          <th align="center" style="width:25%"><%=l(:label_closed_issues_plural)%></th>
41
          <th align="center" style="width:25%"><%=l(:label_total)%></th>
42
        </tr></thead>
43
      <tbody>
44
        <% for row in @subprojects %>
45
          <tr class="<%= cycle("odd", "even") %>">
46
            <td><%= link_to h(row.name), aggregate_path(@project, row.name, row) %></td>
47
            <td align="center"><%= aggregate_link issues_by_subproject, { "project_id" => row.id, "closed" => 0 }, aggregate_path(@project, row.id, row, :status_id => "o") %></td>
48
            <td align="center"><%= aggregate_link issues_by_subproject, { "project_id" => row.id, "closed" => 1 }, aggregate_path(@project, row.name, row, :status_id => "c") %></td>
49
            <td align="center"><%= aggregate_link issues_by_subproject, { "project_id" => row.id }, aggregate_path(@project, row.name, row, :status_id => "*") %></td>
50
          </tr>
51
        <% end %>
52
      </tbody>
53
      </table>
54
    </div>
33 55
  <% end %>
34 56
  <% @project.visible_custom_field_values.each do |custom_value| %>
35
  <% if !custom_value.value.blank? %>
36
     <li><%=h custom_value.custom_field.name %>: <%=h show_value(custom_value) %></li>
37
  <% end %>
57
    <% if !custom_value.value.blank? %>
58
      <div class="custom box">
59
        <h3><%=h custom_value.custom_field.name %></h3>
60
        <%=h show_value(custom_value) %>
61
      </div>
62
    <% end %>
38 63
  <% end %>
39
  </ul>
40 64

  
41 65
  <% if User.current.allowed_to?(:view_issues, @project) %>
42 66
  <div class="issues box">
(1-1/2)