summaryrefslogtreecommitdiffstats
path: root/extensions/ProductDashboard/template/en/default/pages/productdashboard.html.tmpl
blob: c0c5dc6b27bbf6d208d4d850faa7418ce40c970c (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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
[%# This Source Code Form is subject to the terms of the Mozilla Public
  # License, v. 2.0. If a copy of the MPL was not distributed with this
  # file, You can obtain one at http://mozilla.org/MPL/2.0/.
  #
  # This Source Code Form is "Incompatible With Secondary Licenses", as
  # defined by the Mozilla Public License, v. 2.0.
  #%]

[% PROCESS global/variables.none.tmpl %]

[% javascript_urls = [ "js/yui3/yui/yui-min.js",
                       "js/util.js",
                       "js/field.js" ]
%]

[% IF current_tab_name == 'summary' %]
  [% javascript_urls.push("extensions/ProductDashboard/web/js/summary.js") %]
  [% ELSIF current_tab_name == 'recents' %]
  [% yui = [ "calendar" ] %]
  [% javascript_urls.push("js/field.js") %]
  [% javascript_urls.push("js/util.js") %]
  [% javascript_urls.push("extensions/ProductDashboard/web/js/recents.js") %]
[% ELSIF current_tab_name == 'components' %]
  [% javascript_urls.push("extensions/ProductDashboard/web/js/components.js") %]
[% ELSIF current_tab_name == 'duplicates' %]
  [% javascript_urls.push("extensions/ProductDashboard/web/js/duplicates.js") %]
[% ELSIF current_tab_name == 'popularity' %]
  [% javascript_urls.push("extensions/ProductDashboard/web/js/popularity.js") %]
[% ELSIF current_tab_name == 'roadmap' && Param('usetargetmilestone') %]
  [% javascript_urls.push("extensions/ProductDashboard/web/js/roadmap.js") %]
[% END %]

[% filtered_product = product.name FILTER html %]
[% PROCESS global/header.html.tmpl
  title = "Product Dashboard: $filtered_product"
  style_urls = [ "skins/standard/buglist.css",
                 "js/yui/assets/skins/sam/paginator.css",
                 "extensions/ProductDashboard/web/styles/productdashboard.css" ]
%]

<script type="text/javascript">
<!--
  PD = {};
  [%# Set up severities list for proper sorting %]
  PD.severities = new Array();
  [% sort_count = 0 %]
  [% FOREACH s = severities %]
    PD.severities['[% s FILTER js %]'] = [% sort_count FILTER js %];
    [% sort_count = sort_count + 1 %]
  [% END %]
-->
</script>

[% url_filtered_product = product.name FILTER uri %]
[% url_filtered_status  = bug_status FILTER uri %]

[% tabs = [
    {
      name  => "summary",
      label => "Summary",
      link  => "page.cgi?id=productdashboard.html&product=$url_filtered_product&bug_status=$url_filtered_status&tab=summary"
    },
    {
      name  => "recents",
      label => "Recents",
      link  => "page.cgi?id=productdashboard.html&product=$url_filtered_product&bug_status=$url_filtered_status&tab=recents"
    },
    {
      name  => "components",
      label => "Components/Versions",
      link  => "page.cgi?id=productdashboard.html&product=$url_filtered_product&bug_status=$url_filtered_status&tab=components"
    },
    {
      name  => "duplicates",
      label => "Duplicates",
      link  => "page.cgi?id=productdashboard.html&product=$url_filtered_product&bug_status=$url_filtered_status&tab=duplicates"
    },
    {
      name  => "roadmap",
      label => "Road Map",
      link  => "page.cgi?id=productdashboard.html&product=$url_filtered_product&bug_status=$url_filtered_status&tab=roadmap"
    },
  ]
%]

[% IF product.votesperuser %]
  [%
    tabs.push({
      name  => "popularity",
      label => "Popularity",
      link  => "page.cgi?id=productdashboard.html&product=$url_filtered_product&bug_status=$url_filtered_status&tab=popularity"
    })
  %]
[% END %]

[% FOREACH tab IN tabs %]
  [% IF tab.name == current_tab_name %]
    [% current_tab = tab %]
    [% LAST %]
  [% END %]
[% END %]

[% full_bug_count = 0 %]
[% IF bug_status == 'open' %]
  [% full_bug_count = total_open_bugs %]
[% ELSIF bug_status == 'closed' %]
  [% full_bug_count = total_closed_bugs %]
[% ELSE %]
  [% full_bug_count = total_bugs %]
[% END %]

[% bug_link = bug_link_all %]
[% IF bug_status == 'open' %]
  [% bug_link = bug_link_open %]
[% ELSIF bug_status == 'closed' %]
  [% bug_link = bug_link_closed %]
[% END %]

<div class="yui3-skin-sam">
  <a name="top"></a>

  <form action="page.cgi" method="get">
  <input type="hidden" name="id"  value="productdashboard.html">
  <input type="hidden" name="tab" value="[% current_tab.name FILTER html %]">

  [% IF summary.keys %]
    <input type="hidden" name="[% summary.type FILTER html %]" value="[% summary.value FILTER html %]">
  [% END %]

  [% IF product %]
    <span id="product_dashboard_links">
      <ul>
        <li><a href="[% urlbase FILTER none %]enter_bug.cgi?product=[% product.name FILTER uri %]">
            Create a new [% terms.bug %] in this product</a></li>
        <li><a href="[% urlbase FILTER none %]describecomponents.cgi?product=[% product.name FILTER uri %]">
            Show full component descriptions for this product</a></li>
      </ul>
    </span>
  [% END %]

  <strong>Choose product:</strong>
  [% INCLUDE "global/product-select.html.tmpl"
    id       => "product"
    name     => "product"
  %]
  <select name="bug_status" id="bug_status">
    [% statuses = [ { name = 'open', label = "Open $terms.Bugs" },
                    { name = 'closed', label = "Closed $terms.Bugs" },
                    { name = 'all', label = "All $terms.Bugs" } ] %]
    [% FOREACH status = statuses %]
      <option value="[% status.name FILTER html %]" 
        [% " selected" IF bug_status == "${status.name}" %]>
        [% status.label FILTER html %]
      </option>
    [% END %]
  </select>

  <input type="submit" value="[% IF product %]Change[% ELSE %]Submit[% END %]">

  [% IF product %]
    <div class="product_name">
      [% product.name FILTER html %]
    </div>

    <div class="product_description">
      [% product.description FILTER none %]
    </div>

    [% WRAPPER global/tabs.html.tmpl 
       tabs        = tabs
       current_tab = current_tab
    %]

    [% IF current_tab.name == 'summary' %]
      [% PROCESS pages/productdashboard/summary.html.tmpl %]
    [% END %]

    [% IF current_tab.name == 'recents' %]
      [% PROCESS pages/productdashboard/recents.html.tmpl %]
    [% END %]

    [% IF current_tab.name == 'components' %]
      [% PROCESS pages/productdashboard/components.html.tmpl %]
    [% END %]

    [% IF current_tab.name == 'duplicates' %]
      [% PROCESS pages/productdashboard/duplicates.html.tmpl %]
    [% END %]

    [% IF current_tab.name == 'popularity' %]
      [% PROCESS pages/productdashboard/popularity.html.tmpl %]
    [% END %]

    [% IF current_tab.name == 'roadmap' && Param('usetargetmilestone') %]
      [% PROCESS pages/productdashboard/roadmap.html.tmpl %]
    [% END %]

    [% END %][%# END WRAPPER %]
  [% END %]

  </form>
</div>

[% PROCESS global/footer.html.tmpl %]

[% BLOCK bar_graph %]
  [% IF full_bug_count > 0 %][%# No divide by zero %]
    [% percentage_bugs = (count / full_bug_count) * 100 FILTER format('%02.2f') %]
  [% ELSE %]
    [% percentage_bugs = 0 %]
  [% END %]
  <div class="bar_graph">
    <table cellpadding="0" cellspacing="0" width="300px">
    <tr>
      <td width="[% percentage_bugs FILTER html %]%">
        <table cellpadding="0" cellspacing="0" width="100%">
        <tr>
          <td bgcolor="#3c78b5">
            <a title="[% percentage_bugs FILTER html %]%">
              <img src="extensions/ProductDashboard/web/images/spacer.gif" height=10 width="100%" title="[% percentage_bugs FILTER html %]%">
            </a>
          </td>
        </tr>
        </table>
      </td>
      <td width="[% 100 - percentage_bugs FILTER html %]%">&nbsp;&nbsp;&nbsp;[% percentage_bugs FILTER html %]%</td>
    </tr>
    </table>
  </div>
[% END %]