aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-server/src/main/webapp/WEB-INF/app/views/issues/manage.html.erb
blob: 2280c9938801b1cb1c50817b0dd7c960d0c93e5a (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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<% content_for :script do %>
  <script>
    $j(document).ready(function () {
      $j(".issue-filter-star").click(function () {
        var filterId = $j(this).attr('filter-id');
        $j.ajax({
          type: 'POST',
          url: baseUrl + "/issues/toggle_fav",
          data: {id: filterId},
          success: function (data) {
            window.location = baseUrl + '/issues/manage';
          }
        });
      });
    });
  </script>
<% end %>
<div>
  <div class="page-split-left">
    <%= render :partial => 'issues/sidebar' -%>
  </div>
  <div class="page-split-right">
    <div id="content">
      <%= render :partial => 'display_errors' %>
      <h1><%= message 'issue_filter.manage.my_filters' -%></h1>
      <table class="data marginbottom10" id="my-issue-filters">
        <thead>
        <tr>
          <th class="thin"></th>
          <th><%= message('issue_filter.form.name') -%></th>
          <th><%= message('issue_filter.sharing') -%></th>
          <th class="right"><%= message('operations') -%></th>
        </tr>
        </thead>
        <tbody>
        <% if @filters.empty? %>
          <tr class="even">
            <td colspan="4"><%= message('issue_filter.no_filters') -%></td>
          </tr>
        <% else %>
          <% @filters.each do |filter| %>
            <tr id="my-issue-filter-<%= filter.name.parameterize -%>" class="<%= cycle('even', 'odd', :name => 'my-filters') -%>">
              <td>
                <%= issue_filter_star(filter, @favourite_filter_ids.include?(filter.id)) -%>
              </td>
              <td>
                <%= link_to h(filter.name), :action => 'filter', :id => filter.id -%>
                <% if filter.description %>
                  <div class="note"><%= h filter.description -%></div>
                <% end %>
              </td>
              <td>
                <% if filter.shared %>
                  <%= message 'issue_filter.shared_with_all_users' -%>
                <% else %>
                  <%= message 'issue_filter.private' -%>
                <% end %>
              </td>
              <td class="thin nowrap right">
                <a id="copy-<%= filter.name.parameterize -%>" href="<%= ApplicationController.root_context -%>/issues/copy_form/<%= filter.id -%>"
                   class="link-action open-modal"><%= message('copy') -%></a>
                &nbsp;
                <a id="edit_<%= filter.name.parameterize -%>" href="<%= ApplicationController.root_context -%>/issues/edit_form/<%= filter.id -%>"
                   class="link-action open-modal"><%= message('edit') -%></a>
                &nbsp;
                <%= link_to_action message('delete'), "#{ApplicationController.root_context}/issues/delete/#{filter.id}",
                                   :class => 'link-action link-red',
                                   :id => "delete_#{filter.name.parameterize}",
                                   :confirm_button => message('delete'),
                                   :confirm_title => 'issue_filter.delete_confirm_title',
                                   :confirm_msg => 'issue_filter.are_you_sure_want_delete_filter_x',
                                   :confirm_msg_params => [filter.name] -%>
              </td>
            </tr>
          <% end %>
        <% end %>
        </tbody>
      </table>

      <br/>

      <h1><%= message 'issue_filter.manage.shared_filters' -%></h1>
      <table class="data" id="shared-filters">
        <thead>
        <tr>
          <th class="thin"></th>
          <th><%= message('issue_filter.form.name') -%></th>
          <th><%= message('shared_by') -%></th>
          <th class="right"><%= message('operations') -%></th>
        </tr>
        </thead>
        <tbody>
        <% if @shared_filters.empty? %>
          <tr class="even">
            <td colspan="4"><%= message('issue_filter.no_filters') -%></td>
          </tr>
        <% else %>
          <% @shared_filters.each do |filter| %>
            <tr id="shared-<%= filter.name.parameterize -%>" class="<%= cycle('even', 'odd', :name => 'shared-filters') -%>">
              <td>
                <%= issue_filter_star(filter, @favourite_filter_ids.include?(filter.id)) -%>
              </td>
              <td>
                <%= link_to h(filter.name), :action => 'filter', :id => filter.id -%>
                <% if filter.description %>
                  <div class="note"><%= h filter.description -%></div>
                <% end %>
              </td>
              <td>
                <%= h Api.users.findByLogin(filter.user).name -%>
              </td>
              <td class="thin nowrap right">
                <a id="copy-<%= filter.name.parameterize -%>" href="<%= ApplicationController.root_context -%>/issues/copy_form/<%= filter.id -%>" class="link-action open-modal"><%= message('copy') -%></a>
                <% if has_role?(:admin) %>
                  &nbsp;
                  <a id="edit_shared_<%= filter.name.parameterize -%>" href="<%= ApplicationController.root_context -%>/issues/edit_form/<%= filter.id -%>" class="link-action open-modal"><%= message('edit') -%></a>
                  &nbsp;
                  <%= link_to_action message('delete'), "#{ApplicationController.root_context}/issues/delete/#{filter.id}",
                                     :class => 'link-action link-red',
                                     :id => "delete_system_#{filter.name.parameterize}",
                                     :confirm_button => message('delete'),
                                     :confirm_title => 'issue_filter.delete_confirm_title',
                                     :confirm_msg => 'issue_filter.are_you_sure_want_delete_filter_x',
                                     :confirm_msg_params => [filter.name] -%>
                <% end %>
              </td>
            </tr>
          <% end %>
        <% end %>
        </tbody>
      </table>

    </div>
  </div>
</div>