Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

B3 Exports Cleanup #11519

Merged
merged 3 commits into from
May 6, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion corehq/apps/export/static/export/js/customize_export.js
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ var CustomExportView = {
};

self.row_label_classes = function(row) {
return (row === 'no data' || row === 'deleted') ? "label label-warning" : "label";
return (row === 'no data' || row === 'deleted') ? "label label-warning" : "label label-default";
};

setTimeout(function () {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
{% extends "settings/bootstrap2/base_template.html" %}
{% extends "settings/bootstrap3/base_template.html" %}
{% load hq_shared_tags %}
{% load i18n %}

{% block js %}
{{ block.super }}
<script src="{% static 'style/lib/knockout_plugins/knockout_mapping.ko.min.js' %}"></script>
<script src="{% static 'style/ko/knockout_bindings.ko.js' %}"></script>
<script src="{% static 'jquery-ui-1.8.23-legacy/jquery-ui.min.js' %}"></script>
<script src="{% static 'export/js/customize_export.js' %}"></script>
{% endblock %}

Expand Down Expand Up @@ -54,7 +51,7 @@
</script>
{% endblock %}

{% block main_column %}
{% block page_content %}
<div id="customize-export" style="display: none;" data-bind="visible: true">
{# content for multi-select help popover #}
{% if custom_export.type == 'case' %}
Expand All @@ -77,48 +74,58 @@
<form class="form-horizontal" method="post">
{% csrf_token %}
<fieldset>
<div class="control-group">
<label for="export-name" class="control-label">{% trans "Export Name" %}</label>
<div class="controls">
<input type="text" id="export-name" data-bind="value: custom_export.name" />
<div class="form-group">
<label for="export-name" class="control-label col-sm-3 col-md-2">{% trans "Export Name" %}</label>
<div class="col-sm-9 col-md-8 col-lg-6">
<input type="text" id="export-name" class="form-control" data-bind="value: custom_export.name" />
</div>
</div>
<div class="control-group">
<label for="format-select" class="control-label">{% trans "Default file type" %}</label>
<div class="controls">
<select id="format-select" data-bind="value: custom_export.default_format">
<div class="form-group">
<label for="format-select" class="control-label col-sm-3 col-md-2">{% trans "Default file type" %}</label>
<div class="col-sm-9 col-md-8 col-lg-6">
<select id="format-select" class="form-control" data-bind="value: custom_export.default_format">
<option value="csv">{% trans "CSV (Zip file)" %}</option>
<option value="xlsx">{% trans "Excel 2007" %}</option>
<option value="xls">{% trans "Excel (older versions)" %}</option>
<option value="html">{% trans "Web Page (Excel Dashboards)" %}</option>
</select>
</div>
</div>
<div class="control-group">
<div class="controls">
<div class="form-group">
<div class="col-sm-9 col-md-8 col-lg-6 col-sm-offset-3 col-md-offset-2">
{% if commtrack_domain %}
<label class="checkbox">
<input type="checkbox" id="presave-checkbox" data-bind="checked: export_stock" />
{% trans "Export stock data columns" %}
</label>
<div class="checkbox">
<label>
<input type="checkbox" id="presave-checkbox" data-bind="checked: export_stock" />
{% trans "Export stock data columns" %}
</label>
</div>
{% endif %}
<label class="checkbox">
<input type="checkbox" id="transform-dates-checkbox" data-bind="checked: custom_export.transform_dates" />
{% trans "Automatically convert dates for Excel" %}
</label>
<label class="checkbox">
<input type="checkbox" id="presave-checkbox" data-bind="checked: presave" />
{% trans "Create a Daily Saved Export" %}
</label>
<div class="checkbox">
<label>
<input type="checkbox" id="transform-dates-checkbox" data-bind="checked: custom_export.transform_dates" />
{% trans "Automatically convert dates for Excel" %}
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" id="presave-checkbox" data-bind="checked: presave" />
{% trans "Create a Daily Saved Export" %}
</label>
</div>
{% if custom_export.type == 'form' %}
<label class="checkbox">
<input type="checkbox" id="include-errors-checkbox" data-bind="checked: custom_export.include_errors" />
{% trans "Include duplicates and other unprocessed forms" %}
</label>
<label class="checkbox">
<input type="checkbox" id="split-multiselects-checkbox" data-bind="checked: custom_export.split_multiselects" />
{% trans "Expand Checkbox Questions" %}
</label>
<div class="checkbox">
<label>
<input type="checkbox" id="include-errors-checkbox" data-bind="checked: custom_export.include_errors" />
{% trans "Include duplicates and other unprocessed forms" %}
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" id="split-multiselects-checkbox" data-bind="checked: custom_export.split_multiselects" />
{% trans "Expand Checkbox Questions" %}
</label>
</div>
{% endif %}
</div>
</div>
Expand All @@ -134,9 +141,9 @@
</span>
</legend>
<div data-bind="visibleFade: selected">
<div class="control-group pull-right">
<div class="controls">
<button type="button" class="btn" data-bind="
<div class="form-group">
<div class="col-sm-9 col-md-8 col-lg-6 col-sm-offset-3 col-md-offset-2">
<button type="button" class="btn btn-default" data-bind="
click: function() {show_deleted(!show_deleted());},
css: {active: show_deleted}">
<span data-bind="visible: !show_deleted()">
Expand All @@ -156,26 +163,26 @@
</button>
</div>
</div>
<div class="control-group" data-bind="visible: $root.repeatsEnabled()">
<label class="control-label">{% trans "Sheet Name" %}</label>
<div class="controls">
<input type="text" data-bind="value: display" />
<div class="form-group" data-bind="visible: $root.repeatsEnabled()">
<label class="control-label col-sm-3 col-md-2">{% trans "Sheet Name" %}</label>
<div class="col-sm-9 col-md-8 col-lg-6">
<input type="text" class="form-control" data-bind="value: display" />
</div>
</div>

<div class="control-group">
<label class="control-label">
<div class="form-group">
<label class="control-label col-sm-3 col-md-2">
<strong>{% trans "Choose the fields you want to export." %}</strong><br />
{% trans "You can drag and drop fields to reorder them. You can also rename fields, which will update the headers in the export file." %}
</label>
<div class="controls">
<div class="col-sm-9 col-md-10">
<table class="table table-striped table-bordered table-condensed" id="field-select">
<thead>
<tr class="nodrag nodrop">
<th></th>
<th>{% trans "Include this Field?" %}<br>
<a href="#" class="btn btn-mini" data-bind="click: $root.selectAll">{% trans "Select All" %}</a>
<a href="#" class="btn btn-mini btn-inverse" data-bind="click: $root.selectNone">{% trans "Select None" %}</a></th>
<a href="#" class="btn btn-xs btn-info" data-bind="click: $root.selectAll">{% trans "Select All" %}</a>
<a href="#" class="btn btn-xs btn-default" data-bind="click: $root.selectNone">{% trans "Select None" %}</a></th>
<th>
{% if custom_export.type == 'form' %}
{% trans "Question" %}
Expand All @@ -201,8 +208,8 @@
visible: $parent.show_deleted() || ($data.show || selected)
{% if not minimal %}, attr: {'data-order': _sortableOrder}{% endif %}
">
<td class="sortable-handle">
<i class="icon-resize-vertical"></i>
<td>
<i class="fa fa-arrows-v"></i>
</td>
<td>
<!--ko if: ($root.custom_export.is_safe() && isCaseName()) -->
Expand All @@ -221,9 +228,8 @@
<span data-bind="text: $data, visible: $data, attr: { 'class': $root.row_label_classes($data)}"></span>
</span>
<code data-bind="text: _niceField.field"></code>

</td>
<td><input class="input-xlarge" type="text" data-bind="value: display" /></td>
<td><input class="form-control" type="text" data-bind="value: display" /></td>
{% if custom_export.type == 'case' and request|feature_preview_enabled:"SPLIT_MULTISELECT_CASE_EXPORT"%}
<td class="input">
<div data-bind="if: !allOptions()">
Expand All @@ -245,16 +251,16 @@
<select class="select2" data-bind="options: allOptions, selectedOptions: options" multiple="true">
</select>
<br/>
<input class="input input-small" type="text" data-bind="value: newOption"/>
<button class="btn" data-bind="click: addOption">{% trans "Add" %}</button>
<input class="form-control" type="text" data-bind="value: newOption"/>
<button class="btn btn-default" data-bind="click: addOption">{% trans "Add" %}</button>
</div>
</div>
</div>
</td>
{% endif %}
{% if helper.allow_deid %}
<td class="deid-column" data-bind="visible: $root.showDeidColumn()">
<select data-bind="
<select class="form-control" data-bind="
value: transform || '',
foreach: $root.deid_options,
visible: (index() !== 'id' || transform()) && !isCaseName()
Expand All @@ -279,48 +285,55 @@
{% if helper.allow_deid %}
<fieldset>
<legend>{% trans "Privacy Settings" %}</legend>
<div class="control-group">
<label for="is_safe" class="control-label"></label>
<div class="controls deid-column" data-bind="visible: $root.showDeidColumn()">
<label class="checkbox">
<input type="checkbox" id="is_safe" data-bind="checked: custom_export.is_safe" />
{% trans "Publish in" %} {{ DeidExportReport_name }}
</label>
<span class="help-inline">{% trans "Check only if this export has been fully and safely de-identified." %}</span>
<div class="form-group">
<div class="col-sm-9 col-md-8 col-lg-6 col-sm-offset-3 col-md-offset-2 deid-column" data-bind="visible: $root.showDeidColumn()">
<div class="checkbox">
<label>
<input type="checkbox" id="is_safe" data-bind="checked: custom_export.is_safe" />
{% trans "Publish in" %} {{ DeidExportReport_name }}
</label>
</div>
<p class="help-block">{% trans "Check only if this export has been fully and safely de-identified." %}</p>
</div>
</div>
<div class="form-group" data-bind="
visible: !showDeidColumn(),
click: animateShowDeidColumn
">
<div class="col-sm-9 col-md-8 col-lg-6 col-sm-offset-3 col-md-offset-2">
<button class="btn btn-default" >
{% trans "Allow me to mark sensitive data" %}
</button>
</div>
<button class="btn" data-bind="
visible: !showDeidColumn(),
click: animateShowDeidColumn
">
{% trans "Allow me to mark sensitive data" %}
</button>
</div>
</fieldset>
{% endif %}
<div class="form-actions">
<button type="submit" class="btn btn-large btn-primary" data-bind="
click: save_no_preview,
disable: (save.state() === 'saving') || (save.state() === 'saving-preview')
">
<span data-bind="visible: (save.state() !== 'saving') && (save.state() !== 'error')">
<span data-bind="visible: custom_export._id && custom_export._id()">{% trans "Save" %}</span>
<span data-bind="visible: !custom_export._id || !custom_export._id()">{% trans "Create" %}</span>
</span>
<span data-bind="visible: save.state() === 'saving'">
<i class="icon-refresh icon-spin"></i>
{% trans "Saving" %}
</span>
<span data-bind="visible: save.state() === 'error'">
{% trans "Try Again" %}
</span>
</button>
<a class="btn btn-large" href="{{ export_home_url }}" data-bind="click: cancel">{% trans "Cancel" %}</a>
{% if custom_export.get_id %}
<a class="btn btn-large btn-danger pull-right" data-toggle="modal" href="#delete-export-modal-{{ custom_export.get_id }}">
<i class="icon-remove icon-white"></i>
{% trans "Delete this Export" %}
</a>
{% endif %}
<div class="col-sm-9 col-md-8 col-lg-6 col-sm-offset-3 col-md-offset-2">
<button type="submit" class="btn btn-large btn-primary" data-bind="
click: save_no_preview,
disable: (save.state() === 'saving') || (save.state() === 'saving-preview')
">
<span data-bind="visible: (save.state() !== 'saving') && (save.state() !== 'error')">
<span data-bind="visible: custom_export._id && custom_export._id()">{% trans "Save" %}</span>
<span data-bind="visible: !custom_export._id || !custom_export._id()">{% trans "Create" %}</span>
</span>
<span data-bind="visible: save.state() === 'saving'">
<i class="fa fa-refresh fa-spin"></i>
{% trans "Saving" %}
</span>
<span data-bind="visible: save.state() === 'error'">
{% trans "Try Again" %}
</span>
</button>
<a class="btn btn-default" href="{{ export_home_url }}" data-bind="click: cancel">{% trans "Cancel" %}</a>
{% if custom_export.get_id %}
<a class="btn btn-danger pull-right" data-toggle="modal" href="#delete-export-modal-{{ custom_export.get_id }}">
<i class="fa fa-remove"></i>
{% trans "Delete this Export" %}
</a>
{% endif %}
</div>
</div>
</form>
</div>
Expand Down
Loading