@@ -1936,6 +1936,8 @@ def download_list_html(
19361936 view_icon : str = "eye" ,
19371937 download_label : str = "Download" ,
19381938 download_icon : str = "download" ,
1939+ send_label : str = "Send" ,
1940+ send_icon : str = "envelope" ,
19391941 zip_label : Optional [str ] = None ,
19401942 zip_icon : str = "file-archive" ,
19411943 append_matching_suffix : bool = True ,
@@ -1958,10 +1960,13 @@ def download_list_html(
19581960 view_icon (str): Icon for the 'view' button, default is "eye".
19591961 download_label (str): Label for the 'download' button, default is "Download".
19601962 download_icon (str): Icon for the 'download' button, default is "download".
1963+ send_label (str): Label for the 'send' button. Default is "Send".
1964+ send_icon (str): Fontawesome icon for the 'send' button. Default is "envelope".
19611965 zip_label (Optional[str]): Label for the zip option. If not provided, uses the generic template for `self.zip_label` ("Download all").
19621966 zip_icon (str): Icon for the zip option, default is "file-archive".
19631967 append_matching_suffix (bool): Flag to determine if matching suffix should be appended to file name, default is True.
1964- include_email (bool): Flag to include an email option, default is False.
1968+ include_email (bool): Flag to include an
1969+ option, default is False.
19651970 use_previously_cached_files (bool): Flag to use previously cached files (e.g., made in background) if defined. default is False.
19661971 include_full_pdf (bool): Flag to include a full PDF option, default is False.
19671972 full_pdf_label (Optional[str]): Label for the full PDF option. If not provided, uses the generic template for `self.full_pdf_label` ("Download all").
@@ -2071,7 +2076,7 @@ def download_list_html(
20712076 html += table_row (full_pdf_label , full_pdf_button )
20722077
20732078 if include_email :
2074- html += self .send_email_table_row (key = key )
2079+ html += self .send_email_table_row (key = key , send_label = send_label , send_icon = send_icon )
20752080
20762081 html += "\n </div>"
20772082
@@ -2150,13 +2155,15 @@ def download_html(
21502155
21512156 return html
21522157
2153- def send_email_table_row (self , key : str = "final" ) -> str :
2158+ def send_email_table_row (self , key : str = "final" , send_label : str = "Send" , send_icon : str = "envelope" ) -> str :
21542159 """
21552160 Generate HTML doc table row for an input box and button that allows
21562161 someone to send the bundle to the specified email address.
21572162
21582163 Args:
21592164 key (str): A key used to identify which version of the ALDocument to send. Defaults to "final".
2165+ send_label (str): Label for the 'send' button. Default is "Send".
2166+ send_icon (str): Icon for the 'send' button. Default is "envelope".
21602167
21612168 Returns:
21622169 str: The generated HTML string for the table row.
@@ -2189,7 +2196,7 @@ def send_email_table_row(self, key: str = "final") -> str:
21892196 """
21902197
21912198 # "Send" button for the 2nd column of the table row
2192- send_button = f'{ action_button_html (javascript_string , label = "Send" , icon = "envelope" , color = "primary" , size = "md" , classname = "al_send_email_button al_button" , id_tag = al_send_button_id )} '
2199+ send_button = f'{ action_button_html (javascript_string , label = send_label , icon = send_icon , color = "primary" , size = "md" , classname = "al_send_email_button al_button" , id_tag = al_send_button_id )} '
21932200
21942201 # Whole row put together
21952202 html = f"""
@@ -2206,8 +2213,10 @@ def send_button_to_html(
22062213 email : str ,
22072214 editable : bool = False ,
22082215 template_name : str = "" ,
2209- label : str = "Send" ,
2210- icon : str = "envelope" ,
2216+ label : Optional [str ] = None ,
2217+ send_label : str = "Send" ,
2218+ icon : Optional [str ] = None ,
2219+ send_icon : str = "envelope" ,
22112220 color : str = "primary" ,
22122221 key : str = "final" ,
22132222 ) -> str :
@@ -2220,14 +2229,23 @@ def send_button_to_html(
22202229 email (str): The recipient's email address.
22212230 editable (bool, optional): Flag indicating if the bundle is editable. Defaults to False.
22222231 template_name (str, optional): The name of the template to be used. Defaults to an empty string.
2223- label (str, optional): The label for the button. Defaults to "Send".
2224- icon (str, optional): The Fontawesome icon for the button. Defaults to "envelope".
2232+ label (Optional[str]): The label for the send button. Defaults to
2233+ `send_label`.
2234+ send_label (str): Alias for `label`. Matches other methods.
2235+ Defaults to "Send".
2236+ icon (Optional[str]): The Fontawesome icon for the send button.
2237+ Defaults to `send_icon`.
2238+ send_icon (str): Alias for `icon`. Matches other methods. Defaults
2239+ to "envelope".
22252240 color (str, optional): The Bootstrap color of the button. Defaults to "primary".
22262241 key (str, optional): A key used to identify which version of the ALDocument to send. Defaults to "final".
22272242
22282243 Returns:
22292244 str: The generated HTML string for the button.
22302245 """
2246+ label = label or send_label
2247+ icon = icon or send_icon
2248+
22312249 if not self .has_enabled_documents ():
22322250 return "" # Don't let people email an empty set of documents
22332251 if not hasattr (self , "_cached_get_email_copy" ):
@@ -2261,6 +2279,10 @@ def send_button_html(
22612279 key : str = "final" ,
22622280 show_editable_checkbox : bool = True ,
22632281 template_name : str = "" ,
2282+ label : Optional [str ] = None ,
2283+ send_label : str = "Send" ,
2284+ icon : Optional [str ] = None ,
2285+ send_icon : str = "envelope" ,
22642286 ) -> str :
22652287 """
22662288 Generate HTML for an input box and button that allows someone to send the bundle
@@ -2276,10 +2298,21 @@ def send_button_html(
22762298 Defaults to True.
22772299 template_name (str, optional): Name of the template variable that is used to fill
22782300 the email contents. By default, the `x.send_email_template` template will be used.
2301+ label (str, optional): The label for the send button. Defaults to
2302+ `send_label`. Matches other methods.
2303+ send_label (str): Alias for `label`. Matches other methods.
2304+ Defaults to "Send".
2305+ icon (str, optional): The Fontawesome icon for the send button.
2306+ Defaults to `send_icon`. Matches other methods.
2307+ send_icon (str): Alias for `icon`. Matches other methods. Defaults
2308+ to "envelope".
22792309
22802310 Returns:
22812311 str: The generated HTML string for the input box and button.
22822312 """
2313+ label = label or send_label
2314+ icon = icon or send_icon
2315+
22832316 if not self .has_enabled_documents ():
22842317 return "" # Don't let people email an empty set of documents
22852318 if not hasattr (self , "_cached_get_email_copy" ):
@@ -2327,7 +2360,7 @@ def send_button_html(
23272360 <input value="{ user_info ().email if user_logged_in () else '' } " alt="Email address for document" class="form-control" type="email" size="35" name="{ al_email_input_id } " id="{ al_email_input_id } ">
23282361 </span>
23292362
2330- { action_button_html (javascript_string , label = "Send" , icon = "envelope" , color = "primary" , size = "md" , classname = "al_send_email_button" , id_tag = al_send_button_id )}
2363+ { action_button_html (javascript_string , label = label , icon = icon , color = "primary" , size = "md" , classname = "al_send_email_button" , id_tag = al_send_button_id )}
23312364
23322365 </div>
23332366 """
0 commit comments