Add a flag to hide instructions in a set card

This commit is contained in:
2025-01-26 09:59:53 +01:00
parent ff1f02b7e3
commit 4350ade65b
4 changed files with 11 additions and 3 deletions
+1
View File
@@ -30,6 +30,7 @@ CONFIG: Final[list[dict[str, Any]]] = [
{'n': 'HIDE_ALL_PARTS', 'c': bool},
{'n': 'HIDE_ALL_SETS', 'c': bool},
{'n': 'HIDE_MISSING_PARTS', 'c': bool},
{'n': 'HIDE_SET_INSTRUCTIONS', 'c': bool},
{'n': 'HIDE_WISHES', 'c': bool},
{'n': 'MINIFIGURES_DEFAULT_ORDER', 'd': '"minifigures"."name" ASC'},
{'n': 'MINIFIGURES_FOLDER', 'd': 'minifigs', 's': True},
+5 -2
View File
@@ -3,7 +3,7 @@ import traceback
from typing import Any, Self
from uuid import uuid4
from flask import url_for
from flask import current_app, url_for
from .exceptions import DatabaseException, NotFoundException
from .minifigure_list import BrickMinifigureList
@@ -179,7 +179,10 @@ class BrickSet(RebrickableSet):
# Compute the url for the set instructions
def url_for_instructions(self, /) -> str:
if len(self.instructions):
if (
not current_app.config['HIDE_SET_INSTRUCTIONS'] and
len(self.instructions)
):
return url_for(
'set.details',
id=self.fields.id,