mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-16 04:02:52 -06:00
added changelog views for Tag
This commit is contained in:
parent
de52f21905
commit
8e548605c8
@ -10,10 +10,15 @@ context data may observe a performance drop when returning multiple objects. To
|
|||||||
Config Context is not needed, the query parameter `?exclude=config_context` may be added to the request as to remove
|
Config Context is not needed, the query parameter `?exclude=config_context` may be added to the request as to remove
|
||||||
the Config Context from being included in any results.
|
the Config Context from being included in any results.
|
||||||
|
|
||||||
|
### Tag Permissions Changed
|
||||||
|
|
||||||
|
NetBox now makes use of its own `Tag` model instead of the vanilla model which ships with django-taggit. This new model lives in the `extras` app and thus any permissions that you may have configured using "Taggit | Tag" should be changed to now use "Extras | Tag."
|
||||||
|
|
||||||
## Enhancements
|
## Enhancements
|
||||||
|
|
||||||
* [#2324](https://github.com/digitalocean/netbox/issues/2324) - Add color option for tags
|
* [#2324](https://github.com/digitalocean/netbox/issues/2324) - Add color option for tags
|
||||||
* [#2791](https://github.com/digitalocean/netbox/issues/2791) - Add a comment field for tags
|
* [#2791](https://github.com/digitalocean/netbox/issues/2791) - Add a comment field for tags
|
||||||
|
* [#2926](https://github.com/digitalocean/netbox/issues/2926) - Add changelog to the Tag model
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -881,6 +881,9 @@ class Tag(TagBase, ChangeLoggedModel):
|
|||||||
default=''
|
default=''
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def get_absolute_url(self):
|
||||||
|
return reverse('extras:tag', args=[self.slug])
|
||||||
|
|
||||||
|
|
||||||
class TaggedItem(GenericTaggedItemBase):
|
class TaggedItem(GenericTaggedItemBase):
|
||||||
tag = models.ForeignKey(
|
tag = models.ForeignKey(
|
||||||
|
@ -5,6 +5,9 @@ from utilities.tables import BaseTable, BooleanColumn, ColorColumn, ToggleColumn
|
|||||||
from .models import ConfigContext, ObjectChange, Tag, TaggedItem
|
from .models import ConfigContext, ObjectChange, Tag, TaggedItem
|
||||||
|
|
||||||
TAG_ACTIONS = """
|
TAG_ACTIONS = """
|
||||||
|
<a href="{% url 'extras:tag_changelog' slug=record.slug %}" class="btn btn-default btn-xs" title="Changelog">
|
||||||
|
<i class="fa fa-history"></i>
|
||||||
|
</a>
|
||||||
{% if perms.taggit.change_tag %}
|
{% if perms.taggit.change_tag %}
|
||||||
<a href="{% url 'extras:tag_edit' slug=record.slug %}" class="btn btn-xs btn-warning"><i class="glyphicon glyphicon-pencil" aria-hidden="true"></i></a>
|
<a href="{% url 'extras:tag_edit' slug=record.slug %}" class="btn btn-xs btn-warning"><i class="glyphicon glyphicon-pencil" aria-hidden="true"></i></a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
from django.conf.urls import url
|
from django.conf.urls import url
|
||||||
|
|
||||||
from extras import views
|
from extras import views
|
||||||
|
from extras.models import Tag
|
||||||
|
|
||||||
|
|
||||||
app_name = 'extras'
|
app_name = 'extras'
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
@ -11,6 +13,7 @@ urlpatterns = [
|
|||||||
url(r'^tags/(?P<slug>[\w-]+)/$', views.TagView.as_view(), name='tag'),
|
url(r'^tags/(?P<slug>[\w-]+)/$', views.TagView.as_view(), name='tag'),
|
||||||
url(r'^tags/(?P<slug>[\w-]+)/edit/$', views.TagEditView.as_view(), name='tag_edit'),
|
url(r'^tags/(?P<slug>[\w-]+)/edit/$', views.TagEditView.as_view(), name='tag_edit'),
|
||||||
url(r'^tags/(?P<slug>[\w-]+)/delete/$', views.TagDeleteView.as_view(), name='tag_delete'),
|
url(r'^tags/(?P<slug>[\w-]+)/delete/$', views.TagDeleteView.as_view(), name='tag_delete'),
|
||||||
|
url(r'^tags/(?P<slug>[\w-]+)/changelog/$', views.ObjectChangeLogView.as_view(), name='tag_changelog', kwargs={'model': Tag}),
|
||||||
|
|
||||||
# Config contexts
|
# Config contexts
|
||||||
url(r'^config-contexts/$', views.ConfigContextListView.as_view(), name='configcontext_list'),
|
url(r'^config-contexts/$', views.ConfigContextListView.as_view(), name='configcontext_list'),
|
||||||
|
@ -31,6 +31,15 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
<h1>{% block title %}Tag: {{ tag }}{% endblock %}</h1>
|
<h1>{% block title %}Tag: {{ tag }}{% endblock %}</h1>
|
||||||
|
{% include 'inc/created_updated.html' with obj=tag %}
|
||||||
|
<ul class="nav nav-tabs">
|
||||||
|
<li role="presentation"{% if not active_tab %} class="active"{% endif %}>
|
||||||
|
<a href="{{ tag.get_absolute_url }}">Tag</a>
|
||||||
|
</li>
|
||||||
|
<li role="presentation"{% if active_tab == 'changelog' %} class="active"{% endif %}>
|
||||||
|
<a href="{% url 'extras:tag_changelog' slug=tag.slug %}">Changelog</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
Loading…
Reference in New Issue
Block a user