aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-server/src/main/webapp/WEB-INF/app/views/manual_measures/index.html.erb
blob: 634dc52890172ffa7f3e81f6e104d8dcb9596275 (plain)
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
<style type="text/css">
  #manualMeasures td {
    vertical-align: top;
  }

  #manualMeasures td.pendingMeasure {
    background-color: orange;
    cursor: help;
    padding: 0 2px;
    width: 2px;
  }
</style>

<div class="line-block marginbottom10">
  <ul class="operations">
    <li class="last">
      <%= image_tag 'add.png' -%>
      <a href="<%= ApplicationController.root_context -%>/manual_measures/new/<%= @resource.id -%>" id="addMeasureLink"><%= message('manual_measures.add_measure_link') -%></a>
    </li>
  </ul>
  <h1><%= message('manual_measures.page') -%></h1>
</div>


<table class="width100 data sortable" id="manualMeasures">
  <thead>
  <tr>
    <th style="padding: 0; margin: 0" class="nosort"></th>
    <th class="thin nowrap sortfirstasc"><%= message('manual_measures.col.domain') -%></th>
    <th class="thin nowrap"><%= message('manual_measures.col.metric') -%></th>
    <th class="thin nowrap" style="text-align: right"><%= message('manual_measures.col.value') -%></th>
    <th><%= message('manual_measures.col.description') -%></th>
    <th style="text-align: right"><%= message('manual_measures.col.author') -%></th>
    <th style="text-align: right"><%= message('manual_measures.col.date') -%></th>
    <th class="thin nowrap nosort"><%= message('manual_measures.col.operations') -%></th>
  </tr>
  </thead>
  <tbody>
  <% if @measures.empty? %>
    <td colspan="8" class="even">No measures</td>
  <% end %>
  <%
     @measures.each do |measure|
  %>
    <a name="<%= measure.metric.key -%>"></a>
    <tr>
      <% if measure.pending?(@snapshot) %>
        <td class="pendingMeasure" title="Pending. New value will be available during next project analysis."></td>
      <% else %>
        <td style="padding: 0"></td>
      <% end %>
      <td class="thin nowrap"><%= measure.metric.domain -%></td>
      <td class="thin nowrap"><%= measure.metric.short_name -%></td>
      <td class="thin nowrap" align="right"><%= measure.value -%></td>
      <td id="desc"><%= measure.description -%></td>
      <td align="right"><%= measure.username -%>
      </td>
      <td align="right">
        <%= l(measure.updated_at) -%>
      </td>
      <td class="thin nowrap">
        <a href="<%= url_for :controller => 'manual_measures', :action => 'new', :metric => measure.metric.key, :id => @resource.id -%>"><%= message('edit') -%></a>
        <%= link_to message('delete'), {:action => 'delete', :metric => measure.metric.key, :id => @resource.id}, {:method => 'POST', :confirm => "This measure will be deleted during next project analysis", :class => 'action'} -%>
      </td>
    </tr>
  <% end %>
  </tbody>
</table>
<script>TableKit.Sortable.init('manualMeasures');</script>