mirror of
https://github.com/netbox-community/netbox.git
synced 2026-04-07 18:03:47 +02:00
Compare commits
1 Commits
21835-colo
...
21841-scri
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0a6451920e |
@@ -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>
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user