mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-17 13:32:15 +00:00
FEAT: Initial implementation of asset activity stream
This commit is contained in:
@@ -14,6 +14,8 @@ urlpatterns = [
|
||||
path('asset/id/<str:pk>/duplicate/', permission_required_with_403('assets.add_asset')(views.AssetDuplicate.as_view()), name='asset_duplicate'),
|
||||
path('asset/id/<str:pk>/history/', views.AssetVersionHistory.as_view(),
|
||||
name='asset_history', kwargs={'model': models.Asset}),
|
||||
path('activity',
|
||||
permission_required_with_403('assets.view_asset')(views.ActivityTable.as_view()), name='asset_activity_table'),
|
||||
|
||||
path('asset/search/', views.AssetSearch.as_view(), name='asset_search_json'),
|
||||
|
||||
|
||||
@@ -217,3 +217,12 @@ class AssetVersionHistory(AssetIDUrlMixin, versioning.VersionHistory):
|
||||
{'verbose_name': queryset.model._meta.verbose_name})
|
||||
|
||||
return context
|
||||
|
||||
class ActivityTable(generic.ListView):
|
||||
model = versioning.RIGSVersion
|
||||
template_name = "RIGS/activity_table.html"
|
||||
paginate_by = 25
|
||||
|
||||
def get_queryset(self):
|
||||
versions = versioning.RIGSVersion.objects.get_for_multiple_models([models.Asset, models.Supplier])
|
||||
return versions
|
||||
|
||||
@@ -29,6 +29,6 @@
|
||||
</li>
|
||||
{% endif %}
|
||||
{% if perms.assets.view_asset %}
|
||||
<li><a href="{% url 'activity_table' %}">Recent Changes</a></li>
|
||||
<li><a href="{% url 'asset_activity_table' %}">Recent Changes</a></li>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user