From db1f78d3efc9553935361ceff110da0cdb0efbde Mon Sep 17 00:00:00 2001 From: Drew Larson Date: Thu, 23 Jun 2016 14:39:17 -0600 Subject: [PATCH] Add members list. --- bikeshop_project/core/static/scss/screen.scss | 1 + .../registration/templates/members.html | 22 +++++++++++++++++++ bikeshop_project/registration/urls.py | 5 +++-- bikeshop_project/registration/views.py | 8 +++++++ 4 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 bikeshop_project/registration/templates/members.html diff --git a/bikeshop_project/core/static/scss/screen.scss b/bikeshop_project/core/static/scss/screen.scss index 09d0b5e..d5c9245 100644 --- a/bikeshop_project/core/static/scss/screen.scss +++ b/bikeshop_project/core/static/scss/screen.scss @@ -13,6 +13,7 @@ @import "vendor/material-design-lite/src/menu/menu"; @import "vendor/material-design-lite/src/card/card"; @import "vendor/material-design-lite/src/data-table/data-table"; +@import "vendor/material-design-lite/src/list/list"; html, body { font-family: 'Roboto', 'Helvetica', sans-serif; diff --git a/bikeshop_project/registration/templates/members.html b/bikeshop_project/registration/templates/members.html new file mode 100644 index 0000000..26c105a --- /dev/null +++ b/bikeshop_project/registration/templates/members.html @@ -0,0 +1,22 @@ +{% extends 'dashboard.html' %} + +{% block content %} +
+ +
+{% endblock %} \ No newline at end of file diff --git a/bikeshop_project/registration/urls.py b/bikeshop_project/registration/urls.py index bd0c724..181c90b 100644 --- a/bikeshop_project/registration/urls.py +++ b/bikeshop_project/registration/urls.py @@ -1,9 +1,10 @@ from django.conf.urls import url -from .views import MemberFormView, MemberSearchView, MemberSignIn +from .views import MemberFormView, MemberSearchView, MemberSignIn, Members urlpatterns = [ url(r'^new/$', MemberFormView.as_view(), name='member_new'), url(r'^search/(?P[\w@\.\+]+)/$', MemberSearchView.as_view(), name='member_search'), url(r'^edit/(?P[0-9]+)/$', MemberFormView.as_view(), name='member_edit'), - url(r'^signin/$', MemberSignIn.as_view(), name='member_signin') + url(r'^signin/$', MemberSignIn.as_view(), name='member_signin'), + url(r'^$', Members.as_view(), name='members'), ] diff --git a/bikeshop_project/registration/views.py b/bikeshop_project/registration/views.py index 688c902..0adc00c 100644 --- a/bikeshop_project/registration/views.py +++ b/bikeshop_project/registration/views.py @@ -9,6 +9,7 @@ from django.utils import timezone from django.utils.decorators import method_decorator from django.views.decorators.csrf import csrf_exempt from django.views.generic import View +from django.views.generic import TemplateView from core.models import Visit from haystack.query import SearchQuerySet @@ -103,3 +104,10 @@ class MemberSignIn(View): json = JSONRenderer().render(serializer.data) return JsonResponse(data=json.decode(), safe=False, status=200) + +class Members(TemplateView): + template_name = 'members.html' + + def get(self, request): + members = Member.objects.all() + return self.render_to_response(dict(members=members)) \ No newline at end of file