553d3c02863e0da1e7005359e27230e18978f959
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / includes / chart.inc
1 <div class="modal" id="chartModal" tabindex="-1" role="dialog" aria-labelledby="chartModalLabel">
2     <div class="modal-dialog modal-wide" role="document">
3         <div class="modal-content">
4             <div class="modal-header">
5                 <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
6                 <h4 class="modal-title" id="chartModalLabel">Chart settings</h4>
7             </div>
8             <div class="modal-body" id="makechart">
9                 [% supposed_x = header_row.shift.cell %]
10                 <fieldset class="rows">
11                     <ol>
12                         <li>
13                             <label for="chart-type">Chart type: </label>
14                             <select name="chart-type" id="chart-type">
15                                 <option value="pie">Pie</option>
16                                 <option value="bar">Bar</option>
17                                 <option value="line">Line</option>
18                             </select>
19                         </li>
20
21                         <li id="chart-column-horizontal">
22                             <label for="horizontal">Horizontal bar:</label>
23                             <input id="horizontal" name="column-horizontal" type="checkbox" />
24                         </li>
25
26                         <li>
27                             <label for="x_element">x column:</label>
28                             <select id="x_element" name="x">
29                                 <option value="[% supposed_x | html %]" selected>[% supposed_x | html %]</option>
30                                 [% FOREACH header IN header_row %]
31                                     <option value="[% header.cell | html %]">[% header.cell | html %]</option>
32                                 [% END %]
33                             </select>
34                         </li>
35
36                         [% IF allresults.size %]
37                             <li>
38                                 <label for="include-all">Include all rows (ignore pagination):</label>
39                                 <input id="include-all" name="chart-include-all" type="checkbox" checked="checked"/>
40                             </li>
41                         [% ELSE %]
42                             <li>
43                                 <p>This chart will use only visible rows, click 'Fetch all data' to chart the full report</p>
44                             </li>
45                         [% END %]
46
47                         <li>
48                             <label for="exclude-last">Exclude last line (Rollup): </label>
49                             <input id="exclude-last" name="chart-exclude-last" type="checkbox" />
50                         </li>
51                         [% column = 1 %]
52                         <li class="column_config_row">
53                             [% FOREACH header IN header_row %]
54                                 <fieldset class="chart-column-conf" id="column_[% column | html %]">
55                                     <legend>
56                                         Column [% column | html %]
57                                         <a class="chart-column-delete" href="#" data-column="[% column | html %]">
58                                             <i class="fa fa-remove error"></i>
59                                         </a>
60                                     </legend>
61                                     <div>
62                                         <label for="y_[% column | html %]" >y:</label>
63                                         <select id="y_[% column | html %]" name="y">
64                                             <option value="[% supposed_x | html %]" selected>[% supposed_x | html %]</option>
65                                             [% FOREACH h IN header_row %]
66                                                 [% IF header.cell == h.cell %]
67                                                     <option value="[% h.cell | html %]" selected>[% h.cell | html %]</option>
68                                                 [% ELSE %]
69                                                     <option value="[% h.cell | html %]">[% h.cell | html %]</option>
70                                                 [% END %]
71                                         [% END %]
72                                         </select>
73                                     </div>
74
75                                     <div class="chart-column-group">
76                                         [% i = 1 %]
77                                         <label for="group_[% column | html %]">Group:</label>
78                                         <select id="group_[% column | html %]" name="group">
79                                             [% FOREACH h IN header_row %]
80                                                 [% IF i == column %]
81                                                     <option value="[% i | html %]" selected>[% i | html %]</option>
82                                                 [% ELSE %]
83                                                     <option value="[% i | html %]">[% i | html %]</option>
84                                                 [% END %]
85                                                 [% i = i + 1 %]
86                                             [% END %]
87                                         </select>
88                                     </div>
89
90                                     <div class="chart-column-line">
91                                         <label for="line_[% column | html %]">Line:</label>
92                                         <input class="column-line" id="line_[% column | html %]" name="[% header.cell | html %]" type="checkbox" />
93                                     </div>
94                                 </fieldset>
95                                 [% column = column + 1 %]
96                             [% END %]
97                         </li>
98                     </ol>
99                 </fieldset>
100
101                 [% item = { cell = supposed_x } %]
102                 [% header_row.unshift(item) | html %]
103             </div>
104             <div class="modal-footer">
105                 <button id="draw-chart" class="btn btn-default">Draw</button>
106                 <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
107             </div>
108         </div>
109     </div>
110 </div>