Skip to content
Snippets Groups Projects
Commit 9a16d71a authored by Carlos Vega's avatar Carlos Vega
Browse files

add view and template for provenance

parent 711a26a9
No related branches found
No related tags found
1 merge request!229Feature/provenance
<li><a href="{% url 'web.views.provenance' %}"><i class="fa fa-dashboard"></i> Dashboard</a></li>
<li class="active"><a href="{% url 'web.views.provenance' %}">Provenance</a></li>
\ No newline at end of file
{% extends "_base.html" %}
{% load static %}
{% block styles %}
{{ block.super }}
<!-- DataTables -->
<link rel="stylesheet" href="{% static 'AdminLTE/plugins/datatables/dataTables.bootstrap.css' %}">
{% endblock styles %}
{% block ui_active_tab %}'provenance'{% endblock ui_active_tab %}
{% block page_header %}Provenance{% endblock page_header %}
{% block page_description %}{% endblock page_description %}
{% block breadcrumb %}
{% include "languages/breadcrumb.html" %}
{% endblock breadcrumb %}
{% block maincontent %}
<div class="box-body">
<table id="table" class="table table-bordered table-striped">
<thead>
<tr>
<th>Table</th>
<th>Row</th>
<th>Date</th>
<th>Author</th>
<th>Field</th>
<th>Previous Value</th>
<th>New Value</th>
<th>Description</th>
</tr>
</thead>
<tbody>
{% for provenance in provenances %}
<tr>
<td>{{ provenance.modified_table }}</td>
<td>{{ provenance.modified_table_id }}</td>
<td>{{ provenance.modification_date }}</td>
<td>{{ provenance.modification_author }}</td>
<td>{{ provenance.modified_field }}</td>
<td>{{ provenance.previous_value }}</td>
<td>{{ provenance.new_value }}</td>
<td>{{ provenance.modification_description }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endblock maincontent %}
{% block scripts %}
{{ block.super }}
<script src="{% static 'AdminLTE/plugins/datatables/jquery.dataTables.min.js' %}"></script>
<script src="{% static 'AdminLTE/plugins/datatables/dataTables.bootstrap.min.js' %}"></script>
<script>
$(function () {
$('#table').DataTable({
"paging": true,
"lengthChange": false,
"searching": true,
"ordering": true,
"info": true,
"autoWidth": false
});
});
</script>
{% endblock scripts %}
# coding=utf-8
from django.views.generic import ListView
from . import WrappedView
from ..models import Provenance
from web.decorators import PermissionDecorator
class ProvenanceListView(ListView, WrappedView):
model = Provenance
context_object_name = "provenances"
template_name = 'provenance/list.html'
@PermissionDecorator('view_provenance', 'configuration')
def dispatch(self, *args, **kwargs):
return super(ProvenanceListView, self).dispatch(*args, **kwargs)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment