2025-02-03 10:49:23 +01:00
{% import 'macro/accordion.html' as accordion %}
2025-01-17 11:03:00 +01:00
{% extends 'base.html' %}
2025-01-31 15:45:28 +01:00
{% block title %} - {% if not bulk %}Add a set{% else %}Bulk add sets{% endif %}{% endblock %}
2025-01-17 11:03:00 +01:00
{% block main %}
< div class = "container" >
2025-01-31 15:45:28 +01:00
{% if not bulk and not config['HIDE_ADD_BULK_SET'] %}
2025-01-17 11:03:00 +01:00
< div class = "alert alert-primary" role = "alert" >
< h4 class = "alert-heading" > Too many to add?< / h4 >
< p class = "mb-0" > You can import multiple sets at once with < a href = "{{ url_for('add.bulk') }}" class = "btn btn-primary" > < i class = "ri-function-add-line" > < / i > Bulk add< / a > .< / p >
< / div >
{% endif %}
< div class = "row" >
< div class = "col-12" >
< div class = "card mb-3" >
< div class = "card-header" >
2025-01-31 15:45:28 +01:00
< h5 class = "mb-0" > < i class = "ri-add-circle-line" > < / i > {% if not bulk %}Add a set{% else %}Bulk add sets{% endif %}< / h5 >
2025-01-17 11:03:00 +01:00
< / div >
< div class = "card-body" >
< div id = "add-fail" class = "alert alert-danger d-none" role = "alert" > < / div >
2025-01-31 15:45:28 +01:00
{% if not bulk %}
< div id = "add-complete" class = "alert alert-success d-none" role = "alert" > < / div >
{% else %}
< div id = "add-complete" > < / div >
{% endif %}
2025-01-17 11:03:00 +01:00
< div class = "mb-3" >
2025-01-31 15:45:28 +01:00
< label for = "add-set" class = "form-label" > {% if not bulk %}Set number (only one){% else %}List of sets (separated by a comma){% endif %}< / label >
< input type = "text" class = "form-control" id = "add-set" placeholder = "{% if not bulk %}107-1 or 1642-1 or ...{% else %}107-1, 1642-1, ...{% endif %}" >
2025-01-17 11:03:00 +01:00
< / div >
< div class = "form-check" >
2025-01-31 15:45:28 +01:00
< input type = "checkbox" class = "form-check-input" id = "add-no-confirm" { % if bulk % } checked disabled { % endif % } >
2025-01-17 11:03:00 +01:00
< label class = "form-check-label" for = "add-no-confirm" >
Add without confirmation
< / label >
< / div >
2025-02-03 10:49:23 +01:00
< h6 class = "border-bottom mt-2" > Metadata< / h6 >
< div class = "accordion accordion" id = "metadata" >
{% if brickset_owners | length %}
{{ accordion.header('Owners', 'owners', 'metadata', icon='user-line') }}
< div id = "add-owners" >
{% for owner in brickset_owners %}
{% with id=owner.as_dataset() %}
< div class = "form-check" >
< input class = "form-check-input" type = "checkbox" value = "{{ owner.fields.id }}" id = "{{ id }}" autocomplete = "off" >
< label class = "form-check-label" for = "{{ id }}" > {{ owner.fields.name }}< / label >
< / div >
{% endwith %}
{% endfor %}
< / div >
{{ accordion.footer() }}
{% endif %}
{% if brickset_tags | length %}
{{ accordion.header('Tags', 'tags', 'metadata', icon='price-tag-2-line') }}
< div id = "add-tags" >
{% for tag in brickset_tags %}
{% with id=tag.as_dataset() %}
< div class = "form-check" >
< input class = "form-check-input" type = "checkbox" value = "{{ tag.fields.id }}" id = "{{ id }}" autocomplete = "off" >
< label class = "form-check-label" for = "{{ id }}" > {{ tag.fields.name }}< / label >
< / div >
{% endwith %}
{% endfor %}
< / div >
{{ accordion.footer() }}
{% endif %}
< / div >
2025-01-17 11:03:00 +01:00
< hr >
< div class = "mb-3" >
< p >
Progress < span id = "add-count" > < / span >
< span id = "add-spinner" class = "d-none" >
< span class = "spinner-border spinner-border-sm" aria-hidden = "true" > < / span >
< span class = "visually-hidden" role = "status" > Loading...< / span >
< / span >
< / p >
< div id = "add-progress" class = "progress" role = "progressbar" aria-label = "Add a set progress" aria-valuenow = "0" aria-valuemin = "0" aria-valuemax = "100" >
< div id = "add-progress-bar" class = "progress-bar" style = "width: 0%" > < / div >
< / div >
< p id = "add-progress-message" class = "text-center d-none" > < / p >
< / div >
< div id = "add-card" class = "d-flex d-none justify-content-center" >
< div class = "card mb-3 col-6" >
< div class = "card-header" >
< h5 class = "mb-0" >
2025-01-24 10:36:24 +01:00
< span class = "badge text-bg-secondary fw-normal" > < i class = "ri-hashtag" > < / i > < span id = "add-card-set" > < / span > < / span >
2025-01-17 11:03:00 +01:00
< span id = "add-card-name" > < / span >
< / h5 >
< / div >
< div id = "add-card-image-container" class = "card-img" >
< img id = "add-card-image" loading = "lazy" >
< / div >
2025-01-31 15:45:28 +01:00
{% if not bulk %}
< div id = "add-card-footer" class = "card-footer text-end d-none" >
< button id = "add-card-dismiss" type = "button" class = "btn btn-danger" > < i class = "ri-close-line" > < / i > Dismiss< / button >
< button id = "add-card-confirm" type = "button" class = "btn btn-primary" > < i class = "ri-check-double-line" > < / i > Confirm add< / button >
< / div >
{% endif %}
2025-01-17 11:03:00 +01:00
< / div >
< / div >
< / div >
< div class = "card-footer text-end" >
2025-01-31 15:45:28 +01:00
< span id = "add-status-icon" class = "me-1" > < / span > < span id = "add-status" class = "me-1" > < / span >
< button id = "add" type = "button" class = "btn btn-primary" > {% if not bulk %}< i class = "ri-add-circle-line" > < / i > Add{% else %}< i class = "ri-function-add-line" > < / i > Bulk add{% endif %}< / button >
2025-01-17 11:03:00 +01:00
< / div >
< / div >
< / div >
< / div >
< / div >
2025-01-31 15:45:28 +01:00
{% with id='add', bulk=bulk %}
2025-01-28 23:07:12 +01:00
{% include 'set/socket.html' %}
{% endwith %}
2025-01-17 11:03:00 +01:00
{% endblock %}