Files
bricktracker
docs
static
templates
admin
instructions
delete.html
download.html
rename.html
socket.html
table.html
upload.html
macro
minifigure
part
set
wish
404.html
add.html
admin.html
base.html
bulk.html
delete.html
error.html
exception.html
index.html
instructions.html
login.html
minifigure.html
minifigures.html
missing.html
part.html
parts.html
refresh.html
set.html
sets.html
success.html
wishes.html
.dockerignore
.env.sample
.gitignore
CHANGELOG.md
Dockerfile
LICENSE
README.md
__init__.py
app.py
compose.legacy.yml
compose.local.yaml
compose.yaml
entrypoint.sh
requirements.txt
test-server.sh
BrickTracker/templates/instructions/upload.html

43 lines
2.4 KiB
HTML

{% import 'macro/accordion.html' as accordion %}
{% import 'macro/card.html' as card %}
<div class="container">
<div class="card mb-3">
<div class="card-header">
<h5 class="mb-0"><i class="ri-file-line"></i> Instructions</h5>
</div>
<div class="accordion accordion-flush" id="instructions">
{{ accordion.header('Management', 'instructions-upload', 'instructions', expanded=true) }}
<form action="{{ url_for('instructions.do_upload') }}" method="post" enctype="multipart/form-data">
{% if error %}<div class="alert alert-danger" role="alert"><strong>Error:</strong> {{ error }}.</div>{% endif %}
<div class="alert alert-info" role="alert">
<strong>File naming convention:</strong> You are free to use any name you want for your intructions files. <br>
However if you want an instructions file to be associated to a set, the filename must start with the set number (<code>number-version</code>). <br>
For instance, you could use:
<ul>
<li>Instructions.pdf: will <strong>not be</strong> matched to any set</li>
<li>107.pdf: will <strong>not be</strong> matched to set <code>107-1</code></li>
<li>107-1.pdf: will be matched to set <code>107-1</code></li>
<li>107-1-2.pdf: will be matched to set <code>107-1</code></li>
<li>107-1 Special instructions.pdf: will be matched to set <code>107-1</code></li>
<li>107-1_Special_instructions.pdf: will be matched to set <code>107-1</code></li>
</ul>
</div>
<div class="mb-3">
<label for="file" class="form-label">Instructions file</label>
<div class="input-group">
<input type="file" class="form-control" id="file" name="file" accept="{{ ','.join(config['INSTRUCTIONS_ALLOWED_EXTENSIONS']) }}">
<span class="input-group-text">{{ ', '.join(config['INSTRUCTIONS_ALLOWED_EXTENSIONS']) }}</span>
</div>
</div>
<div class="text-end">
<a class="btn btn-primary" href="{{ url_for('instructions.list') }}" role="button"><i class="ri-arrow-left-long-line"></i> Back to the instructions</a>
<button type="submit" class="btn btn-primary"><i class="ri-upload-line"></i> Upload an instructions file</button>
</div>
</form>
{{ accordion.footer() }}
</div>
<div class="card-footer"></div>
</div>
</div>