Implemented person listing

This commit is contained in:
tomtom5152
2014-10-29 14:39:10 +00:00
parent 2f8b451ee0
commit 4210c19280
3 changed files with 49 additions and 2 deletions

View 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 %}

View File

@@ -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')
)

View File

@@ -1,4 +1,4 @@
{% if is_paginated %}
{% if request.is_paginated %}
<div>
<ul class="pagination">
{% if page_obj.has_previous %}