Skip to content

Commit

Permalink
Merge pull request #35140 from dimagi/jc/migrate-download-data-files
Browse files Browse the repository at this point in the history
[B5] Migrate Download Data Files View
  • Loading branch information
jingcheng16 authored Sep 18, 2024
2 parents 48b36b8 + 600f240 commit ab1c8e0
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 324 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
hqDefine("export/js/bootstrap5/download_data_files",[
hqDefine("export/js/download_data_files",[
'jquery',
'hqwebapp/js/bootstrap5/alert_user',
'hqwebapp/js/initial_page_data',
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{% block title %}{% trans "Download Files" %}{% endblock %}


{% requirejs_main_b5 'export/js/bootstrap5/download_data_files' %}
{% requirejs_main_b5 'export/js/download_data_files' %}


{% block page_content %}
Expand All @@ -29,12 +29,12 @@ <h2>{% trans "Download Files" %}</h2>
</td>
<td>
{{ data_file.description }}
<textarea id="url_{{ data_file.id }}" style="display: none">{{ url_base }}{% url 'download_data_file' domain data_file.id data_file.filename %}</textarea> {# todo B5: inline style #}
<textarea id="url_{{ data_file.id }}" class="d-none">{{ url_base }}{% url 'download_data_file' domain data_file.id data_file.filename %}</textarea>
</td>
<td>
{% trans "Available until" %}: {{ data_file.delete_after|to_user_time:request }}
</td>
<td style="width: 6em; text-align: right;"> {# todo B5: inline style #}
<td class="text-end" style="width: 6em;">
<a href="#"
class="copy-data-file"
data-id={{ data_file.id }}
Expand Down Expand Up @@ -75,41 +75,36 @@ <h2>{% trans "Download Files" %}</h2>
<fieldset>
<legend>{% trans "Upload file for transfer" %}</legend>

<div class="form-group"> {# todo B5: css:form-group #}
<label class="form-label col-lg-2 requiredField">
<div class="mb-3">
<label class="form-label requiredField">
{% trans "Description" %}<span class="asteriskField">*</span>
</label>
<div class="controls col-lg-6">
<input class="textinput textInput form-control"
name="description"
required=""
type="text" />
</div>
<input class="form-control"
name="description"
required=""
type="text" />
</div>

<div class="form-group"> {# todo B5: css:form-group #}
<label class="form-label col-lg-2 requiredField">
<div class="mb-3">
<label class="requiredField form-label">
{% trans "File" %}<span class="asteriskField">*</span>
</label>
<div class="controls col-lg-6">
<input name="file"
required=""
type="file" />
</div>
<input name="file"
class="form-control"
required=""
type="file" />
</div>

<div class="form-group"> {# todo B5: css:form-group #}
<label class="form-label col-lg-2 requiredField">
<div class="mb-3">
<label class="form-label requiredField">
{% trans "Delete after" %}<span class="asteriskField">*</span>
</label>
<div class="controls col-lg-6">
<select name="ttl" class="form-control">
<option value="12">{% trans "12 hours" %}</option>
<option selected="selected" value="24">{% trans "1 day" %}</option>
<option value="48">{% trans "2 days" %}</option>
<option value="72">{% trans "3 days" %}</option>
</select>
</div>
<select name="ttl" class="form-select">
<option value="12">{% trans "12 hours" %}</option>
<option selected="selected" value="24">{% trans "1 day" %}</option>
<option value="48">{% trans "2 days" %}</option>
<option value="72">{% trans "3 days" %}</option>
</select>
</div>

</fieldset>
Expand Down
4 changes: 3 additions & 1 deletion corehq/apps/export/views/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
)
from corehq.apps.export.models.new import DataFile, DatePeriod, CaseExportInstance
from corehq.apps.export.tasks import generate_schema_for_all_builds, process_populate_export_tables
from corehq.apps.hqwebapp.decorators import use_bootstrap5
from corehq.apps.locations.models import SQLLocation
from corehq.apps.locations.permissions import location_safe
from corehq.apps.reports.util import datespan_from_beginning
Expand Down Expand Up @@ -310,9 +311,10 @@ class DashboardFeedPaywall(BaseProjectDataView):

@location_safe
@method_decorator(login_and_domain_required, name='dispatch')
@method_decorator(use_bootstrap5, name='dispatch')
class DataFileDownloadList(BaseProjectDataView):
urlname = 'download_data_files'
template_name = 'export/bootstrap3/download_data_files.html'
template_name = 'export/download_data_files.html'
page_title = gettext_lazy("Secure File Transfer")

def dispatch(self, request, *args, **kwargs):
Expand Down

This file was deleted.

Loading

0 comments on commit ab1c8e0

Please sign in to comment.