Added CBVs for SecretRoles

This commit is contained in:
Jeremy Stretch
2016-05-16 12:07:12 -04:00
parent a07aa69321
commit b481935b9a
8 changed files with 125 additions and 5 deletions

View File

@@ -0,0 +1,14 @@
{% load render_table from django_tables2 %}
{% if perms.secrets.delete_secretrole %}
<form method="post" class="form form-horizontal">
{% csrf_token %}
<input type="hidden" name="redirect_url" value="{{ request.path }}{% if request.GET %}?{{ request.GET.urlencode }}{% endif %}" />
{% render_table table table_template|default:'table.html' %}
<button type="submit" name="_delete" formaction="{% url 'secrets:secretrole_bulk_delete' %}" class="btn btn-danger btn-sm">
<span class="glyphicon glyphicon-trash" aria-hidden="true"></span>
Delete Selected
</button>
</form>
{% else %}
{% render_table table table_template|default:'table.html' %}
{% endif %}

View File

@@ -0,0 +1,21 @@
{% extends '_base.html' %}
{% load helpers %}
{% block title %}Secret Roles{% endblock %}
{% block content %}
<div class="pull-right">
{% if perms.dcim.add_devicerole %}
<a href="{% url 'secrets:secretrole_add' %}" class="btn btn-primary">
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
Add a secret role
</a>
{% endif %}
</div>
<h1>Device Roles</h1>
<div class="row">
<div class="col-md-12">
{% include 'secrets/inc/secretrole_table.html' %}
</div>
</div>
{% endblock %}