Admin: add rule admin
This commit is contained in:
11
passbook/admin/templates/administration/rule/create.html
Normal file
11
passbook/admin/templates/administration/rule/create.html
Normal file
@ -0,0 +1,11 @@
|
||||
{% extends "generic/create.html" %}
|
||||
|
||||
{% load i18n %}
|
||||
|
||||
{% block title %}
|
||||
{% blocktrans with type=request.GET.type %}Create {{ type }}{% endblocktrans %}
|
||||
{% endblock %}
|
||||
|
||||
{% block above_form %}
|
||||
<h1>{% blocktrans with type=request.GET.type %}Create {{ type }}{% endblocktrans %}</h1>
|
||||
{% endblock %}
|
||||
45
passbook/admin/templates/administration/rule/list.html
Normal file
45
passbook/admin/templates/administration/rule/list.html
Normal file
@ -0,0 +1,45 @@
|
||||
{% extends "administration/base.html" %}
|
||||
|
||||
{% load i18n %}
|
||||
{% load utils %}
|
||||
|
||||
{% block title %}
|
||||
{% title %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
<div class="dropdown">
|
||||
<button class="btn btn-primary dropdown-toggle" type="button" id="createDropdown" data-toggle="dropdown">
|
||||
{% trans 'Create...' %}
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu" role="menu" aria-labelledby="createDropdown">
|
||||
{% for type, name in types.items %}
|
||||
<li role="presentation"><a role="menuitem" tabindex="-1" href="{% url 'passbook_admin:rule-create' %}?type={{ type }}">{{ name }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
<hr>
|
||||
<table class="table table-striped table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{% trans 'Name' %}</th>
|
||||
<th>{% trans 'Class' %}</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for rule in object_list %}
|
||||
<tr>
|
||||
<td>{{ rule.name }}</td>
|
||||
<td>{{ rule|fieldtype }}</td>
|
||||
<td><a href="{% url 'passbook_admin:rule-update' pk=rule.uuid %}">{% trans 'Edit' %}</a></td>
|
||||
<td><a href="{% url 'passbook_admin:rule-delete' pk=rule.uuid %}">{% trans 'Delete' %}</a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user