Skip to content

Commit ab76932

Browse files
Merge pull request #910 from SuffolkLITLab/902_zip_row_label
Switch back to using bundle title for zip row label. Add override keyword argument.
2 parents 2b28ad2 + 6d3d142 commit ab76932

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "3.3.0"
1+
__version__ = '3.3.0'

docassemble/AssemblyLine/al_document.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1970,6 +1970,7 @@ def download_list_html(
19701970
send_icon: str = "envelope",
19711971
zip_label: Optional[str] = None,
19721972
zip_icon: str = "file-archive",
1973+
zip_row_label: Optional[str] = "",
19731974
append_matching_suffix: bool = True,
19741975
include_email: bool = False,
19751976
use_previously_cached_files: bool = False,
@@ -1994,6 +1995,8 @@ def download_list_html(
19941995
send_icon (str): Fontawesome icon for the 'send' button. Default is "envelope".
19951996
zip_label (Optional[str]): Label for the zip option. If not provided, uses the generic template for `self.zip_label` ("Download all").
19961997
zip_icon (str): Icon for the zip option, default is "file-archive".
1998+
zip_row_label (str, optional): Text to go in the left-most column
1999+
of the table's zip row. Will default to the value of `self.title`.
19972000
append_matching_suffix (bool): Flag to determine if matching suffix should be appended to file name, default is True.
19982001
include_email (bool): Flag to include an option, default is False.
19992002
use_previously_cached_files (bool): Flag to use previously cached files (e.g., made in background) if defined. default is False.
@@ -2086,7 +2089,10 @@ def download_list_html(
20862089
size="md",
20872090
classname="al_zip al_button",
20882091
)
2089-
html += table_row(zip_label, zip_button)
2092+
safe_zip_row_label: str = (
2093+
zip_row_label or (hasattr(self, "title") and self.title) or zip_label
2094+
)
2095+
html += table_row(safe_zip_row_label, zip_button)
20902096

20912097
if include_full_pdf and bundled_pdf:
20922098
if not full_pdf_label:

docassemble/AssemblyLine/data/questions/test_aldocument.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,9 +234,9 @@ subquestion: |
234234
- Keep "view" as True
235235
- Keep "include_zip" as True
236236
237-
multi_bundle_1.download_list_html( key="test_key", format="docx", refresh=False, view_label="Custom view label", view_icon="circle", download_label="Custom download label", download_icon="square", include_email=True, zip_label="Custom zip label", zip_icon="clock", send_label="Custom send label", send_icon="search" )
237+
multi_bundle_1.download_list_html( key="test_key", format="docx", refresh=False, view_label="Custom view label", view_icon="circle", download_label="Custom download label", download_icon="square", include_email=True, zip_label="Custom zip label", zip_icon="clock", zip_row_label="Custom zip row label", send_label="Custom send label", send_icon="search" )
238238
239-
${ multi_bundle_1.download_list_html( key="test_key", format="docx", refresh=False, view_label="Custom view label", view_icon="circle", download_label="Custom download label", download_icon="square", include_email=True, zip_label="Custom zip label", zip_icon="clock", send_label="Custom send label", send_icon="search" ) }
239+
${ multi_bundle_1.download_list_html( key="test_key", format="docx", refresh=False, view_label="Custom view label", view_icon="circle", download_label="Custom download label", download_icon="square", include_email=True, zip_label="Custom zip label", zip_icon="clock", zip_row_label="Custom zip row label", send_label="Custom send label", send_icon="search" ) }
240240
241241
---
242242

0 commit comments

Comments
 (0)