17186 change choice to default

This commit is contained in:
Arthur Hanson 2024-08-27 09:00:16 -07:00
parent 1d9dbae104
commit 90b423812c
3 changed files with 8 additions and 3 deletions

View File

@ -18,7 +18,7 @@ class Migration(migrations.Migration):
migrations.AlterField( migrations.AlterField(
model_name='customlink', model_name='customlink',
name='button_class', name='button_class',
field=models.CharField(default='outline-secondary', max_length=30), field=models.CharField(default='default', max_length=30),
), ),
migrations.RunPython( migrations.RunPython(
code=update_link_buttons, code=update_link_buttons,

View File

@ -61,8 +61,13 @@ def custom_links(context, obj):
else: else:
try: try:
if rendered := cl.render(link_context): if rendered := cl.render(link_context):
if cl.button_class == "default":
button_class = 'outline-secondary'
else:
button_class = cl.button_class
template_code += LINK_BUTTON.format( template_code += LINK_BUTTON.format(
rendered['link'], rendered['link_target'], cl.button_class, rendered['text'] rendered['link'], rendered['link_target'], button_class, rendered['text']
) )
except Exception as e: except Exception as e:
template_code += f'<a class="btn btn-sm btn-outline-secondary" disabled="disabled" title="{e}">' \ template_code += f'<a class="btn btn-sm btn-outline-secondary" disabled="disabled" title="{e}">' \

View File

@ -84,7 +84,7 @@ class ButtonColorChoices(ChoiceSet):
""" """
Map standard button color choices to Bootstrap 3 button classes Map standard button color choices to Bootstrap 3 button classes
""" """
DEFAULT = 'outline-secondary' DEFAULT = 'default'
BLUE = 'blue' BLUE = 'blue'
INDIGO = 'indigo' INDIGO = 'indigo'
PURPLE = 'purple' PURPLE = 'purple'