Allow hiding the damaged and missing columns from the parts table
This commit is contained in:
parent
6903667946
commit
eac9fc1793
10
.env.sample
10
.env.sample
@ -110,12 +110,20 @@
|
|||||||
# Optional: Hide the 'Problems' entry from the menu. Does not disable the route.
|
# Optional: Hide the 'Problems' entry from the menu. Does not disable the route.
|
||||||
# Default: false
|
# Default: false
|
||||||
# Legacy name: BK_HIDE_MISSING_PARTS
|
# Legacy name: BK_HIDE_MISSING_PARTS
|
||||||
# BK_HIDE_PROBLEMS_PARTS=true
|
# BK_HIDE_ALL_PROBLEMS_PARTS=true
|
||||||
|
|
||||||
# Optional: Hide the 'Instructions' entry in a Set card
|
# Optional: Hide the 'Instructions' entry in a Set card
|
||||||
# Default: false
|
# Default: false
|
||||||
# BK_HIDE_SET_INSTRUCTIONS=true
|
# BK_HIDE_SET_INSTRUCTIONS=true
|
||||||
|
|
||||||
|
# Optional: Hide the 'Damaged' column from the parts table.
|
||||||
|
# Default: false
|
||||||
|
# BK_HIDE_TABLE_DAMAGED_PARTS=true
|
||||||
|
|
||||||
|
# Optional: Hide the 'Missing' column from the parts table.
|
||||||
|
# Default: false
|
||||||
|
# BK_HIDE_TABLE_MISSING_PARTS=true
|
||||||
|
|
||||||
# Optional: Hide the 'Wishlist' entry from the menu. Does not disable the route.
|
# Optional: Hide the 'Wishlist' entry from the menu. Does not disable the route.
|
||||||
# Default: false
|
# Default: false
|
||||||
# BK_HIDE_WISHES=true
|
# BK_HIDE_WISHES=true
|
||||||
|
@ -6,7 +6,13 @@
|
|||||||
> "Missing" part has been renamed to "Problems" to accomodate for missing and damaged parts.
|
> "Missing" part has been renamed to "Problems" to accomodate for missing and damaged parts.
|
||||||
> The associated environment variables have changed named (the old names are still valid)
|
> The associated environment variables have changed named (the old names are still valid)
|
||||||
|
|
||||||
## Code
|
### Environment
|
||||||
|
|
||||||
|
- Renamed: `BK_HIDE_MISSING_PARTS` -> `BK_HIDE_ALL_PROBLEMS_PARTS`
|
||||||
|
- Added: `BK_HIDE_TABLE_MISSING_PARTS`, hide the Missing column in all tables
|
||||||
|
- Added: `BK_HIDE_TABLE_DAMAGED_PARTS`, hide the Damaged column in all tables
|
||||||
|
|
||||||
|
### Code
|
||||||
|
|
||||||
- Form
|
- Form
|
||||||
- Migrate missing input fields to BrickChanger
|
- Migrate missing input fields to BrickChanger
|
||||||
|
@ -29,8 +29,10 @@ CONFIG: Final[list[dict[str, Any]]] = [
|
|||||||
{'n': 'HIDE_ALL_MINIFIGURES', 'c': bool},
|
{'n': 'HIDE_ALL_MINIFIGURES', 'c': bool},
|
||||||
{'n': 'HIDE_ALL_PARTS', 'c': bool},
|
{'n': 'HIDE_ALL_PARTS', 'c': bool},
|
||||||
{'n': 'HIDE_ALL_SETS', 'c': bool},
|
{'n': 'HIDE_ALL_SETS', 'c': bool},
|
||||||
{'n': 'HIDE_PROBLEMS_PARTS', 'e': 'BK_HIDE_MISSING_PARTS', 'c': bool},
|
{'n': 'HIDE_ALL_PROBLEMS_PARTS', 'e': 'BK_HIDE_MISSING_PARTS', 'c': bool},
|
||||||
{'n': 'HIDE_SET_INSTRUCTIONS', 'c': bool},
|
{'n': 'HIDE_SET_INSTRUCTIONS', 'c': bool},
|
||||||
|
{'n': 'HIDE_TABLE_DAMAGED_PARTS', 'c': bool},
|
||||||
|
{'n': 'HIDE_TABLE_MISSING_PARTS', 'c': bool},
|
||||||
{'n': 'HIDE_WISHES', 'c': bool},
|
{'n': 'HIDE_WISHES', 'c': bool},
|
||||||
{'n': 'MINIFIGURES_DEFAULT_ORDER', 'd': '"rebrickable_minifigures"."name" ASC'}, # noqa: E501
|
{'n': 'MINIFIGURES_DEFAULT_ORDER', 'd': '"rebrickable_minifigures"."name" ASC'}, # noqa: E501
|
||||||
{'n': 'MINIFIGURES_FOLDER', 'd': 'minifigs', 's': True},
|
{'n': 'MINIFIGURES_FOLDER', 'd': 'minifigs', 's': True},
|
||||||
|
@ -11,7 +11,7 @@ NAVBAR: Final[list[dict[str, Any]]] = [
|
|||||||
{'e': 'set.list', 't': 'Sets', 'i': 'grid-line', 'f': 'HIDE_ALL_SETS'}, # noqa: E501
|
{'e': 'set.list', 't': 'Sets', 'i': 'grid-line', 'f': 'HIDE_ALL_SETS'}, # noqa: E501
|
||||||
{'e': 'add.add', 't': 'Add', 'i': 'add-circle-line', 'f': 'HIDE_ADD_SET'}, # noqa: E501
|
{'e': 'add.add', 't': 'Add', 'i': 'add-circle-line', 'f': 'HIDE_ADD_SET'}, # noqa: E501
|
||||||
{'e': 'part.list', 't': 'Parts', 'i': 'shapes-line', 'f': 'HIDE_ALL_PARTS'}, # noqa: E501
|
{'e': 'part.list', 't': 'Parts', 'i': 'shapes-line', 'f': 'HIDE_ALL_PARTS'}, # noqa: E501
|
||||||
{'e': 'part.problem', 't': 'Problems', 'i': 'error-warning-line', 'f': 'HIDE_PROBLEMS_PARTS'}, # noqa: E501
|
{'e': 'part.problem', 't': 'Problems', 'i': 'error-warning-line', 'f': 'HIDE_ALL_PROBLEMS_PARTS'}, # noqa: E501
|
||||||
{'e': 'minifigure.list', 't': 'Minifigures', 'i': 'group-line', 'f': 'HIDE_ALL_MINIFIGURES'}, # noqa: E501
|
{'e': 'minifigure.list', 't': 'Minifigures', 'i': 'group-line', 'f': 'HIDE_ALL_MINIFIGURES'}, # noqa: E501
|
||||||
{'e': 'instructions.list', 't': 'Instructions', 'i': 'file-line', 'f': 'HIDE_ALL_INSTRUCTIONS'}, # noqa: E501
|
{'e': 'instructions.list', 't': 'Instructions', 'i': 'file-line', 'f': 'HIDE_ALL_INSTRUCTIONS'}, # noqa: E501
|
||||||
{'e': 'wish.list', 't': 'Wishlist', 'i': 'gift-line', 'f': 'HIDE_WISHES'},
|
{'e': 'wish.list', 't': 'Wishlist', 'i': 'gift-line', 'f': 'HIDE_WISHES'},
|
||||||
|
@ -9,8 +9,12 @@
|
|||||||
{% if quantity %}
|
{% if quantity %}
|
||||||
<th data-table-number="true" scope="col"><i class="ri-functions fw-normal"></i> Quantity</th>
|
<th data-table-number="true" scope="col"><i class="ri-functions fw-normal"></i> Quantity</th>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<th data-table-number="true" scope="col"><i class="ri-question-line fw-normal"></i> Missing{% if missing_parts %} parts{% endif %}</th>
|
{% if not config['HIDE_TABLE_MISSING_PARTS'] %}
|
||||||
|
<th data-table-number="true" scope="col"><i class="ri-question-line fw-normal"></i> Missing{% if missing_parts %} parts{% endif %}</th>
|
||||||
|
{% endif %}
|
||||||
|
{% if not config['HIDE_TABLE_DAMAGED_PARTS'] %}
|
||||||
<th data-table-number="true" scope="col"><i class="ri-error-warning-line fw-normal"></i> Damaged{% if damaged_parts %} parts{% endif %}</th>
|
<th data-table-number="true" scope="col"><i class="ri-error-warning-line fw-normal"></i> Damaged{% if damaged_parts %} parts{% endif %}</th>
|
||||||
|
{% endif %}
|
||||||
{% if sets %}
|
{% if sets %}
|
||||||
<th data-table-number="true" scope="col"><i class="ri-hashtag fw-normal"></i> Sets</th>
|
<th data-table-number="true" scope="col"><i class="ri-hashtag fw-normal"></i> Sets</th>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -27,12 +27,16 @@
|
|||||||
<td>{% if quantity %}{{ item.fields.quantity * quantity }}{% else %}{{ item.fields.quantity }}{% endif %}</td>
|
<td>{% if quantity %}{{ item.fields.quantity * quantity }}{% else %}{{ item.fields.quantity }}{% endif %}</td>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<td data-sort="{{ item.fields.total_missing }}" class="table-td-input">
|
{% if not config['HIDE_TABLE_MISSING_PARTS'] %}
|
||||||
{{ form.input('Missing', item.fields.id, item.html_id('missing'), item.url_for_problem('missing'), item.fields.total_missing, all=all, read_only=read_only) }}
|
<td data-sort="{{ item.fields.total_missing }}" class="table-td-input">
|
||||||
</td>
|
{{ form.input('Missing', item.fields.id, item.html_id('missing'), item.url_for_problem('missing'), item.fields.total_missing, all=all, read_only=read_only) }}
|
||||||
<td data-sort="{{ item.fields.total_damaged }}" class="table-td-input">
|
</td>
|
||||||
{{ form.input('Damaged', item.fields.id, item.html_id('damaged'), item.url_for_problem('damaged'), item.fields.total_damaged, all=all, read_only=read_only) }}
|
{% endif %}
|
||||||
</td>
|
{% if not config['HIDE_TABLE_DAMAGED_PARTS'] %}
|
||||||
|
<td data-sort="{{ item.fields.total_damaged }}" class="table-td-input">
|
||||||
|
{{ form.input('Damaged', item.fields.id, item.html_id('damaged'), item.url_for_problem('damaged'), item.fields.total_damaged, all=all, read_only=read_only) }}
|
||||||
|
</td>
|
||||||
|
{% endif %}
|
||||||
{% if all %}
|
{% if all %}
|
||||||
<td>{{ item.fields.total_sets }}</td>
|
<td>{{ item.fields.total_sets }}</td>
|
||||||
<td>{{ item.fields.total_minifigures }}</td>
|
<td>{{ item.fields.total_minifigures }}</td>
|
||||||
|
Loading…
Reference in New Issue
Block a user