mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-07 16:18:16 -06:00
17186 change choice to default
This commit is contained in:
parent
1d9dbae104
commit
90b423812c
@ -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,
|
||||||
|
@ -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}">' \
|
||||||
|
@ -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'
|
||||||
|
Loading…
Reference in New Issue
Block a user