Reporting buttons area. Data download button

This commit is contained in:
Naomi 2018-09-12 18:16:36 +01:00
parent 3faabda3f2
commit 987adc97ce
5 changed files with 19 additions and 12 deletions

View File

@ -6,3 +6,11 @@
li.facet-item {
list-style-type: none;
}
#opencase_reporting_buttons {
margin-bottom: 20px;
}
#opencase_reporting_buttons #download-data{
float: right;
}

View File

@ -0,0 +1,3 @@
jQuery('#opencase_reporting_buttons #download-data').click(function() {
location.href = location.href + "&_format=csv";
});

View File

@ -3,3 +3,5 @@ opencase-reporting-lib:
css:
theme:
css/opencase-reporting.css: {}
js:
js/opencase-reporting.js: {}

View File

@ -22,7 +22,7 @@ class Presets extends BlockBase {
*/
public function build() {
return array(
'#presets' => array(array('title'=>'me', 'url'=>'you'), array('title'=>'them', 'url'=>'us')),
'#presets' => array(array('title'=>'me and you', 'basis'=>'actors', 'filter'=>'&f%5B0%5D=actor_type%3Afat&f%5B1%5D=created%3A2018-09'), array('title'=>'them', 'basis'=>'actors')),
'#theme' => 'opencase_reporting_presets'
);
}

View File

@ -1,11 +1,5 @@
<select id="opencase_reporting_new">
<option disabled selected>Start a new report</option>
<option value="/opencase/reporting/actors">Actor based</option>
<option value="/opencase/reporting/cases">Case based</option>
</select>
<select id="opencase_reporting_presets_load">
<option disabled selected>Load a preset</option>
{% for preset in presets %}
<option value={{ preset.url }}>{{ preset.title }}</option>
{% endfor %}
</select>
<div id="opencase_reporting_buttons">
<button id="update-preset">Update template</button>
<button id="save-as-new-preset">Save as new template</button>
<button id="download-data">Download data</button>
</div>