Skip to content
Draft
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
24 changes: 24 additions & 0 deletions lib/importer/templates/previews/upload.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{% from "govuk/components/button/macro.njk" import govukButton %}
{% from "govuk/components/file-upload/macro.njk" import govukFileUpload %}

{% macro show() %}
<div class="govuk-grid-column-two-thirds">
<h1 class="govuk-heading-l">Upload your data</h1>

<form method="POST" enctype="multipart/form-data">
<div>
{{ govukFileUpload({
id: "file-upload",
name: "file",
label: { text: "Upload an XLSX, ODS, or CSV file"},
attributes: { "accept":
".xlsx,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,.csv,text/csv,application/vnd.oasis.opendocument.spreadsheet,.ods"},
errorMessage: false })
}}
</div>
<div class="govuk-button-group">
{{ govukButton({ text: "Upload" }) }}
</div>
</form>
</div>
{% endmacro %}
47 changes: 26 additions & 21 deletions lib/importer/templates/upload.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,36 @@

{% block pageTitle %} {{ serviceName }} – GOV.UK Prototype Kit {% endblock %}
{% block beforeContent %}
{{ govukBackLink({ text: "Back", href: "javascript:window.history.back()" }) }}
{{ govukBackLink({ text: "Back", href: "javascript:window.history.back()" }) }}
{% endblock %}

{% block content %}
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<h1 class="govuk-heading-l">Upload your data</h1>
{% if importerUploadPath %}
<div class="govuk-grid-column-two-thirds">
<h1 class="govuk-heading-l">Upload your data</h1>

<form action="{{importerUploadPath('/select_sheet')}}" method="POST" enctype="multipart/form-data">
<div>
{{ govukFileUpload({
id: "file-upload",
name: "file",
label: { text: "Upload an XLSX, ODS, or CSV file"},
attributes: { "accept": ".xlsx,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,.csv,text/csv,application/vnd.oasis.opendocument.spreadsheet,.ods"},
errorMessage: importerError(data)
})
}}
</div>
<div class="govuk-button-group">
{{ govukButton({ text: "Upload" }) }}
</div>
</form>
</div>
<form action="{{importerUploadPath('/select_sheet')}}" method="POST" enctype="multipart/form-data">
<div>
{{
govukFileUpload({
id: "file-upload",
name: "file",
label: { text: "Upload an XLSX, ODS, or CSV file"},
attributes: { "accept":
".xlsx,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,.csv,text/csv,application/vnd.oasis.opendocument.spreadsheet,.ods"},
errorMessage: importerError(data)
})
}}
</div>
<div class="govuk-button-group">
{{ govukButton({ text: "Upload" }) }}
</div>
</form>
</div>
{% else %}
{% import "./previews/upload.html" as preview %}
{{ preview.show() }}
{% endif %}
</div>


{% endblock %}
Loading