forked from FrederikBaerentsen/BrickTracker
Add a flag to hide instructions in a set card
This commit is contained in:
@@ -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
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user