mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-17 05:22:16 +00:00
Refactored some views to make it more consistent with Django internal namings
This commit is contained in:
@@ -13,12 +13,14 @@
|
||||
<h3>People</h3>
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
<a href="{% url 'person_add' %}" class="btn btn-default pull-right">New <span class="glyphicon glyphicon-plus"></span></a>
|
||||
<a href="{% url 'person_create' %}" class="btn btn-default pull-right">New <span
|
||||
class="glyphicon glyphicon-plus"></span></a>
|
||||
</div>
|
||||
<div class="col-sm-3 col-sm-offset-9">
|
||||
<form class="form form-horizontal col-sm-12">
|
||||
<div class="form-group">
|
||||
<input type="search" name="q" placeholder="Search" value="{{ request.GET.q }}" class="form-control" />
|
||||
<input type="search" name="q" placeholder="Search" value="{{ request.GET.q }}"
|
||||
class="form-control"/>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@@ -48,7 +50,8 @@
|
||||
<a href="{% url 'person_detail' person.pk %}" class="btn btn-default modal-href">
|
||||
<span class="glyphicon glyphicon-eye-open"></span>
|
||||
</a>
|
||||
<a href="{% url 'person_update' person.pk %}" class="btn btn-default"><span class="glyphicon glyphicon-pencil"></span></a>
|
||||
<a href="{% url 'person_update' person.pk %}" class="btn btn-default"><span
|
||||
class="glyphicon glyphicon-pencil"></span></a>
|
||||
</td>
|
||||
</tr>
|
||||
{% empty %}
|
||||
|
||||
@@ -13,11 +13,11 @@ urlpatterns = patterns('',
|
||||
url('^user/login/$', 'RIGS.views.login', name='login'),
|
||||
|
||||
# People
|
||||
url(r'^people/$', permission_required_with_403('RIGS.view_person')(views.PersonIndex.as_view()),
|
||||
url(r'^people/$', permission_required_with_403('RIGS.view_person')(views.PersonList.as_view()),
|
||||
name='person_list'),
|
||||
url(r'^people/add/$',
|
||||
permission_required_with_403('RIGS.add_person')(views.PersonCreate.as_view()),
|
||||
name='person_add'),
|
||||
name='person_create'),
|
||||
url(r'^people/(?P<pk>\d+)/$',
|
||||
permission_required_with_403('RIGS.view_person')(views.PersonDetail.as_view()),
|
||||
name='person_detail'),
|
||||
@@ -27,8 +27,8 @@ urlpatterns = patterns('',
|
||||
|
||||
# Organisations
|
||||
url(r'^organisations/$',
|
||||
permission_required_with_403('RIGS.view_organisation')(views.OrganisationIndex.as_view()),
|
||||
name='organisation_index'),
|
||||
permission_required_with_403('RIGS.view_organisation')(views.OrganisationList.as_view()),
|
||||
name='organisation_list'),
|
||||
url(r'^organisations/add/$',
|
||||
permission_required_with_403('RIGS.add_organisation')(views.OrganisationCreate.as_view()),
|
||||
name='organisation_create'),
|
||||
|
||||
@@ -26,7 +26,8 @@ class CloseModal(generic.TemplateView):
|
||||
from django.contrib import messages
|
||||
return {'messages', messages.get_messages(self.request)}
|
||||
|
||||
class PersonIndex(generic.ListView):
|
||||
|
||||
class PersonList(generic.ListView):
|
||||
model = models.Person
|
||||
paginate_by = 20
|
||||
|
||||
@@ -60,7 +61,8 @@ class PersonUpdate(generic.UpdateView):
|
||||
'pk': self.object.pk,
|
||||
})
|
||||
|
||||
class OrganisationIndex(generic.ListView):
|
||||
|
||||
class OrganisationList(generic.ListView):
|
||||
model = models.Organisation
|
||||
paginate_by = 20
|
||||
|
||||
|
||||
Reference in New Issue
Block a user