From 4210c192808aa21c98e8ac663bec4c2295f5559d Mon Sep 17 00:00:00 2001 From: tomtom5152 Date: Wed, 29 Oct 2014 14:39:10 +0000 Subject: [PATCH] Implemented person listing --- RIGS/templates/RIGS/person_list.html | 44 ++++++++++++++++++++++++++++ RIGS/urls.py | 5 +++- templates/pagination.html | 2 +- 3 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 RIGS/templates/RIGS/person_list.html diff --git a/RIGS/templates/RIGS/person_list.html b/RIGS/templates/RIGS/person_list.html new file mode 100644 index 00000000..ebd7d913 --- /dev/null +++ b/RIGS/templates/RIGS/person_list.html @@ -0,0 +1,44 @@ +{% extends request.is_ajax|yesno:"base_ajax.html,base.html" %} +{% load widget_tweaks %} + +{% block title %}People list{% endblock %} + +{% block content %} +
+

People

+ New +
{% include 'pagination.html' %}
+
+ + + + + + + + + + + + + {% for person in person_list %} + + + + + + + + + {% empty %} + + + + + {% endfor %} + +
NameeMailPhoneComments
{{ person.pk }}{{ person.name }}{{ person.email }}{{ person.phone }}{{ person.comment_list|length }}Add buttons
No people stored
+
+
{% include 'pagination.html' %}
+
+{% endblock %} \ No newline at end of file diff --git a/RIGS/urls.py b/RIGS/urls.py index 32acf9c4..1c8884cf 100644 --- a/RIGS/urls.py +++ b/RIGS/urls.py @@ -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') ) diff --git a/templates/pagination.html b/templates/pagination.html index dec49e47..a8dc4121 100644 --- a/templates/pagination.html +++ b/templates/pagination.html @@ -1,4 +1,4 @@ -{% if is_paginated %} +{% if request.is_paginated %}