mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-24 17:02:18 +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>
|
<h3>People</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-2">
|
<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>
|
||||||
<div class="col-sm-3 col-sm-offset-9">
|
<div class="col-sm-3 col-sm-offset-9">
|
||||||
<form class="form form-horizontal col-sm-12">
|
<form class="form form-horizontal col-sm-12">
|
||||||
<div class="form-group">
|
<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>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
@@ -48,7 +50,8 @@
|
|||||||
<a href="{% url 'person_detail' person.pk %}" class="btn btn-default modal-href">
|
<a href="{% url 'person_detail' person.pk %}" class="btn btn-default modal-href">
|
||||||
<span class="glyphicon glyphicon-eye-open"></span>
|
<span class="glyphicon glyphicon-eye-open"></span>
|
||||||
</a>
|
</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>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% empty %}
|
{% empty %}
|
||||||
|
|||||||
@@ -13,11 +13,11 @@ urlpatterns = patterns('',
|
|||||||
url('^user/login/$', 'RIGS.views.login', name='login'),
|
url('^user/login/$', 'RIGS.views.login', name='login'),
|
||||||
|
|
||||||
# People
|
# 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'),
|
name='person_list'),
|
||||||
url(r'^people/add/$',
|
url(r'^people/add/$',
|
||||||
permission_required_with_403('RIGS.add_person')(views.PersonCreate.as_view()),
|
permission_required_with_403('RIGS.add_person')(views.PersonCreate.as_view()),
|
||||||
name='person_add'),
|
name='person_create'),
|
||||||
url(r'^people/(?P<pk>\d+)/$',
|
url(r'^people/(?P<pk>\d+)/$',
|
||||||
permission_required_with_403('RIGS.view_person')(views.PersonDetail.as_view()),
|
permission_required_with_403('RIGS.view_person')(views.PersonDetail.as_view()),
|
||||||
name='person_detail'),
|
name='person_detail'),
|
||||||
@@ -27,8 +27,8 @@ urlpatterns = patterns('',
|
|||||||
|
|
||||||
# Organisations
|
# Organisations
|
||||||
url(r'^organisations/$',
|
url(r'^organisations/$',
|
||||||
permission_required_with_403('RIGS.view_organisation')(views.OrganisationIndex.as_view()),
|
permission_required_with_403('RIGS.view_organisation')(views.OrganisationList.as_view()),
|
||||||
name='organisation_index'),
|
name='organisation_list'),
|
||||||
url(r'^organisations/add/$',
|
url(r'^organisations/add/$',
|
||||||
permission_required_with_403('RIGS.add_organisation')(views.OrganisationCreate.as_view()),
|
permission_required_with_403('RIGS.add_organisation')(views.OrganisationCreate.as_view()),
|
||||||
name='organisation_create'),
|
name='organisation_create'),
|
||||||
|
|||||||
@@ -26,7 +26,8 @@ class CloseModal(generic.TemplateView):
|
|||||||
from django.contrib import messages
|
from django.contrib import messages
|
||||||
return {'messages', messages.get_messages(self.request)}
|
return {'messages', messages.get_messages(self.request)}
|
||||||
|
|
||||||
class PersonIndex(generic.ListView):
|
|
||||||
|
class PersonList(generic.ListView):
|
||||||
model = models.Person
|
model = models.Person
|
||||||
paginate_by = 20
|
paginate_by = 20
|
||||||
|
|
||||||
@@ -60,7 +61,8 @@ class PersonUpdate(generic.UpdateView):
|
|||||||
'pk': self.object.pk,
|
'pk': self.object.pk,
|
||||||
})
|
})
|
||||||
|
|
||||||
class OrganisationIndex(generic.ListView):
|
|
||||||
|
class OrganisationList(generic.ListView):
|
||||||
model = models.Organisation
|
model = models.Organisation
|
||||||
paginate_by = 20
|
paginate_by = 20
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user