show.html.erb
2.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<% @project = locals[:current_project] %>
<% @total_metrics = @project.total_metrics if @project != nil %>
<% @statistical_metrics = @project.statistical_metrics if @project != nil %>
<% @svn_error = @project.svn_error if (@project != nil && @project.svn_error) %>
<h1> <%= @project.name %>'s Info</h1>
<table id="show_info">
<tr>
<td><%= _("Name") %></td>
<td><%= @project.name %></td>
</tr>
<% if (@project.description != nil && @project.description != "" ) %>
<tr>
<td><%= _("Description") %></td>
<td><%= @project.description %></td>
</tr>
<% end %>
<tr>
<td><%= _("Repository address") %></td>
<td><%= @project.repository_url %></td>
</tr>
</table>
<br />
<% if @svn_error %>
<h3>ERROR</h3>
<div id="svn_error">
<%= @svn_error %>
</div>
<br />
<br />
<p>
<%= _("Possible causes:") %>
<ul>
<li>
<%= _("Server is down") %>
</li>
<li>
<% _("URL invalid, in this case create another project with the correct URL
(Sorry for the incovenience, we're working for a better solution)") %>
</li>
</ul>
</p>
<%else%>
<h3> <%= _("Metric Results") %> </h3>
<% if @project.metrics_calculated? %>
<h3> <% _("Total Metrics") %> </h3>
<table id="total_metrics">
<% @total_metrics.each_with_index do |metric, index| %>
<tr id="tr_<%= metric.name %>" class="d<%= index % 2 %>">
<td class="metric_name"> <%= metric.name %> </td>
<td class="metric_value"> <%= metric.value %> </td>
</tr>
<% end %>
</table>
<h3> <%= _("Statistical Metrics") %> </h3>
<% @statistical_metrics.each_key do |metric_name| %>
<div id="statistical_metrics">
<%= "#{metric_name}_average: #{@statistical_metrics[metric_name]["average"]}" %>
<ul>
<% @statistical_metrics[metric_name].each do |stat_name, stat_value| %>
<% if stat_name != "average" %>
<li>
<%= "#{metric_name}_#{stat_name}: #{stat_value}" %>
</li>
<% end %>
<% end %>
</ul>
</div>
<% end %>
<% else %>
<div id="progress_message">
<%= _("Wait a moment while the metrics are calculated.<br/>
Reload the page manually in a few moment. ") %>
</div>
<% end %>
<% end %>