mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-17 05:22:16 +00:00
Implemented person listing
This commit is contained in:
44
RIGS/templates/RIGS/person_list.html
Normal file
44
RIGS/templates/RIGS/person_list.html
Normal file
@@ -0,0 +1,44 @@
|
||||
{% extends request.is_ajax|yesno:"base_ajax.html,base.html" %}
|
||||
{% load widget_tweaks %}
|
||||
|
||||
{% block title %}People list{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="col-sm-10 col-sm-offset-1">
|
||||
<h3>People</h3>
|
||||
<a class="btn btn-default pull-right">New <span class="glyphicon glyphicon-plus"></span></a>
|
||||
<div class="align-right">{% include 'pagination.html' %}</div>
|
||||
<div>
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Name</td>
|
||||
<td>eMail</td>
|
||||
<td>Phone</td>
|
||||
<td>Comments</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for person in person_list %}
|
||||
<tr>
|
||||
<td>{{ person.pk }}</td>
|
||||
<td>{{ person.name }}</td>
|
||||
<td>{{ person.email }}</td>
|
||||
<td>{{ person.phone }}</td>
|
||||
<td>{{ person.comment_list|length }}</td>
|
||||
<td>Add buttons</td>
|
||||
</tr>
|
||||
{% empty %}
|
||||
<tr>
|
||||
<td></td>
|
||||
<td colspan="5">No people stored</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="align-right">{% include 'pagination.html' %}</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -1,6 +1,9 @@
|
||||
from django.conf.urls import patterns, include, url
|
||||
from django.contrib.auth.decorators import login_required
|
||||
from RIGS import views
|
||||
|
||||
from PyRIGS.decorators import permission_required_with_403
|
||||
|
||||
urlpatterns = patterns('',
|
||||
# Examples:
|
||||
# url(r'^$', 'PyRIGS.views.home', name='home'),
|
||||
@@ -9,6 +12,6 @@ urlpatterns = patterns('',
|
||||
url('^user/login/$', 'RIGS.views.login', name='login'),
|
||||
|
||||
# People
|
||||
url(r'^people/$', views.PersonIndex.as_view(), name='person')
|
||||
url(r'^people/$', permission_required_with_403('RIGS.view_person')(views.PersonIndex.as_view()), name='person')
|
||||
)
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{% if is_paginated %}
|
||||
{% if request.is_paginated %}
|
||||
<div>
|
||||
<ul class="pagination">
|
||||
{% if page_obj.has_previous %}
|
||||
|
||||
Reference in New Issue
Block a user