Fix up user rfid urls

This commit is contained in:
Oliver Marks 2018-01-15 18:32:19 +00:00
parent 1fb2b65df2
commit 9d50b92f40
4 changed files with 15 additions and 14 deletions

View File

@ -2,6 +2,7 @@ from django.conf.urls import url
from mhackspace.rfid import views from mhackspace.rfid import views
app_name = 'rfid'
access_card_patterns = ([ access_card_patterns = ([
url( url(
regex=r'^$', regex=r'^$',

View File

@ -6,7 +6,7 @@
{% block content %} {% block content %}
{% if form %} {% if form %}
<h1>{{ user.username }}</h1> <h1>{{ user.username }}</h1>
<form class="form-horizontal" method="post" action="{% url 'users:access_cards:create' %}" enctype="multipart/form-data"> <form class="form-horizontal" method="post" action="{% url 'users:rfid::create' %}" enctype="multipart/form-data">
{% csrf_token %} {% csrf_token %}
{{ form|crispy }} {{ form|crispy }}
{{ form_blurb|crispy }} {{ form_blurb|crispy }}
@ -23,7 +23,7 @@
<th>#</th> <th>#</th>
<th>Code</th> <th>Code</th>
<th>Short Description</th> <th>Short Description</th>
<th><a class="btn btn-primary pull-right" href="{% url 'users:access_cards:create' %}">Create</a></th> <th><a class="btn btn-primary pull-right" href="{% url 'users:rfid:create' %}">Create</a></th>
</tr> </tr>
</thead> </thead>
{% for rfid in rfids %} {% for rfid in rfids %}
@ -36,7 +36,7 @@
{{ rfid.description }} {{ rfid.description }}
</td> </td>
<td> <td>
<a href="{% url 'users:access_cards:delete' rfid.id %}">Delete</a> <a href="{% url 'users:rfid::delete' rfid.id %}">Delete</a>
</td> </td>
</tr> </tr>
{% endfor %} {% endfor %}

View File

@ -74,7 +74,7 @@
<div class="col-sm-12"> <div class="col-sm-12">
<p> <p>
<a class="btn btn-primary" href="{% url 'users:update' %}" role="button">My Info</a> <a class="btn btn-primary" href="{% url 'users:update' %}" role="button">My Info</a>
<a class="btn btn-primary" href="{% url 'users:access_cards' %}" role="button">My Rfid Cards</a> <a class="btn btn-primary" href="{% url 'users:rfid:index' %}" role="button">My Rfid Cards</a>
<a class="btn btn-primary" href="{% url 'account_email' %}" role="button">E-Mail</a> <a class="btn btn-primary" href="{% url 'account_email' %}" role="button">E-Mail</a>
</p> </p>
<!-- Your Stuff: Custom user template urls --> <!-- Your Stuff: Custom user template urls -->

View File

@ -7,7 +7,7 @@ from mhackspace.rfid.urls import access_card_patterns
from . import views from . import views
urlpatterns = [ urlpatterns = [
url('^access-cards/', include(access_card_patterns)), url('^access-cards/', include(access_card_patterns, namespace='rfid')),
url( url(
regex=r'^$', regex=r'^$',
view=views.UserListView.as_view(), view=views.UserListView.as_view(),