Debian Codegraph @

flask_peewee/templates/admin/models/export.html

raw
1 {% extends "admin/models/base_filters.html" %}
2
3 {% block breadcrumbs %}
4 {{ super() }}
5 <li class="breadcrumb-item"><a href=".">Export</a></li>
6 {% endblock %}
7
8 {% block tab_export_class %}active{% endblock %}
9
10 {% block extra_tabs %}
11 {% with filter_dropdown_class='ms-auto' %}
12 {% include "admin/includes/filter_dropdown.html" %}
13 {% endwith %}
14 {% endblock %}
15
16 {% block content %}
17 {% include "admin/includes/filter_widgets.html" %}
18
19 <div class="card card-body mb-3">
20 <h4 id="export-summary" class="mb-0">Currently {{ query.count() }} records are scheduled for export <small><a href="#" onclick="document.getElementById('export-details').classList.toggle('d-none'); return false;">details</a></small></h4>
21 <div id="export-details" class="d-none">
22 <pre class="mb-0 mt-3">SQL:
23 {{ sql[0] }}
24
25 PARAMS:
26 {{ sql[1] }}</pre>
27 </div>
28 </div>
29
30 <form action="./?{{ request.query_string.decode('utf8') }}" method="post">
31 <fieldset>
32 {% if csrf_token %}{# Support for flask-seasurf #}<input type="hidden" name="_csrf_token" value="{{ csrf_token() }}">{% endif %}
33 <legend>Select fields to export</legend>
34 <div class="row mb-3">
35 <label class="col-sm-3 col-form-label">Fields on {{ model.__name__ }}</label>
36 <div class="col-sm-9">
37 {% for field in export_fields %}
38 <div class="form-check">
39 <input class="form-check-input" type="checkbox" name="fields" value="{{ field.name }}" id="export-{{ field.name }}" checked="checked" />
40 <label class="form-check-label" for="export-{{ field.name }}">{{ field.name }}</label>
41 </div>
42 {% endfor %}
43 </div>
44 </div>
45
46 {% for (model, path), fields in related_fields.items() %}
47 <legend>Select related fields to export</legend>
48 <div class="row mb-3">
49 <label class="col-sm-3 col-form-label">Fields on {{ model.__name__ }}</label>
50 <div class="col-sm-9">
51 {% for field in fields %}
52 <div class="form-check">
53 <input class="form-check-input" type="checkbox" name="fields" value="{{ path }}__{{ field.name }}" id="export-{{ path }}__{{ field.name }}" />
54 <label class="form-check-label" for="export-{{ path }}__{{ field.name }}">{{ field.name }}</label>
55 </div>
56 {% endfor %}
57 </div>
58 </div>
59 {% endfor %}
60
61 <div class="form-actions d-flex gap-2">
62 <button class="btn btn-primary" type="submit">Export JSON</button>
63 <a class="btn btn-outline-secondary" href="{{ url_for(model_admin.get_url_name('index')) }}?{{ request.query_string.decode('utf8') }}">Cancel</a>
64 </div>
65 </fieldset>
66 </form>
67 {% endblock %}