Compare commits

..

1 Commits

Author SHA1 Message Date
Jeremy Stretch
0a6451920e Fixes #21841: Fix display of the "edit" button for script modules 2026-04-07 11:21:05 -04:00
2 changed files with 3 additions and 1 deletions

View File

@@ -11,7 +11,7 @@
<h2 class="card-header" id="module{{ module.pk }}">
<i class="mdi mdi-file-document-outline"></i> {{ module }}
<div class="card-actions">
{% if perms.extras.edit_scriptmodule %}
{% if perms.extras.change_scriptmodule %}
<a href="{% url 'extras:scriptmodule_edit' pk=module.pk %}" class="btn btn-ghost-warning btn-sm">
<i class="mdi mdi-pencil" aria-hidden="true"></i> {% trans "Edit" %}
</a>

View File

@@ -6,6 +6,7 @@ from django.core.exceptions import ObjectDoesNotExist
from django.db import models
from django.db.models.fields.mixins import FieldCacheMixin
from django.utils.functional import cached_property
from django.utils.safestring import mark_safe
from django.utils.translation import gettext_lazy as _
from .forms.widgets import ColorSelect
@@ -30,6 +31,7 @@ class ColorField(models.CharField):
def formfield(self, **kwargs):
kwargs['widget'] = ColorSelect
kwargs['help_text'] = mark_safe(_('RGB color in hexadecimal. Example: ') + '<code>00ff00</code>')
return super().formfield(**kwargs)