Use {% url %}
instead of hard-coded urls
This commit is contained in:
parent
29c0afadcc
commit
813e432399
@ -20,7 +20,7 @@ from django.contrib.auth.views import LoginView, LogoutView
|
|||||||
|
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
path("", lambda request: redirect("/tasks/")),
|
path("", lambda request: redirect("/tasks/"), name="root"),
|
||||||
path("tasks/", include("tasks.urls")),
|
path("tasks/", include("tasks.urls")),
|
||||||
path("rentals/", include("rentals.urls")),
|
path("rentals/", include("rentals.urls")),
|
||||||
path("admin/", admin.site.urls),
|
path("admin/", admin.site.urls),
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{% extends "base.dj.html" %}
|
{% extends "base.dj.html" %}
|
||||||
|
|
||||||
{% block title %}Lockers Index{% endblock %}
|
{% block title %}Lockers Index{% endblock %}
|
||||||
{% block admin_link %}/admin/rentals/{% endblock %}
|
{% block admin_link %}{% url 'admin:app_list' 'rentals' %}{% endblock %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<style>
|
<style>
|
||||||
.locker-bank {
|
.locker-bank {
|
||||||
|
@ -43,7 +43,10 @@
|
|||||||
<nav aria-label="breadcrumb">
|
<nav aria-label="breadcrumb">
|
||||||
<ol class="breadcrumb">
|
<ol class="breadcrumb">
|
||||||
<li class="breadcrumb-item">
|
<li class="breadcrumb-item">
|
||||||
<a href="/">Home</a>
|
<a href="{% url 'root' %}">Manage</a>
|
||||||
|
</li>
|
||||||
|
<li class="breadcrumb-item">
|
||||||
|
<a href="{% url 'tasks:index' %}">Tasks</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="breadcrumb-item">
|
<li class="breadcrumb-item">
|
||||||
<a href="{{ tool.get_absolute_url }}">{{ tool.name }}</a>
|
<a href="{{ tool.get_absolute_url }}">{{ tool.name }}</a>
|
||||||
|
@ -10,7 +10,10 @@
|
|||||||
<nav aria-label="breadcrumb">
|
<nav aria-label="breadcrumb">
|
||||||
<ol class="breadcrumb">
|
<ol class="breadcrumb">
|
||||||
<li class="breadcrumb-item">
|
<li class="breadcrumb-item">
|
||||||
<a href="/">Home</a>
|
<a href="{% url 'root' %}">Manage</a>
|
||||||
|
</li>
|
||||||
|
<li class="breadcrumb-item">
|
||||||
|
<a href="{% url 'tasks:index' %}">Tasks</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="breadcrumb-item active" aria-current="page">{{ tool }}</li>
|
<li class="breadcrumb-item active" aria-current="page">{{ tool }}</li>
|
||||||
</ol>
|
</ol>
|
||||||
|
@ -10,13 +10,13 @@
|
|||||||
integrity="sha384-+0n0xVW2eSR5OomGNYDnhzAbDsOXxcvSN1TPprVMTNDbiYZCxYbOOl7+AMvyTG2x"
|
integrity="sha384-+0n0xVW2eSR5OomGNYDnhzAbDsOXxcvSN1TPprVMTNDbiYZCxYbOOl7+AMvyTG2x"
|
||||||
crossorigin="anonymous">
|
crossorigin="anonymous">
|
||||||
<title>
|
<title>
|
||||||
{% block title %}RecMaint{% endblock %}
|
{% block title %}Claremont MakerSpace{% endblock %}
|
||||||
</title>
|
</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<nav class="navbar navbar-expand-lg navbar-light bg-light">
|
<nav class="navbar navbar-expand-lg navbar-light bg-light">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<a class="navbar-brand" href="/">RecMaint</a>
|
<a class="navbar-brand" href="{% url 'root' %}">Claremont MakerSpace</a>
|
||||||
<button class="navbar-toggler"
|
<button class="navbar-toggler"
|
||||||
type="button"
|
type="button"
|
||||||
data-toggle="collapse"
|
data-toggle="collapse"
|
||||||
@ -31,13 +31,13 @@
|
|||||||
{% block nav_extra %}{% endblock %}
|
{% block nav_extra %}{% endblock %}
|
||||||
{% if user.is_staff %}
|
{% if user.is_staff %}
|
||||||
<a class="nav-item nav-link"
|
<a class="nav-item nav-link"
|
||||||
href="{% block admin_link %}/admin{% endblock %}">Admin</a>
|
href="{% block admin_link %}{% url 'admin:index' %}{% endblock %}">Admin</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if user.is_authenticated %}
|
{% if user.is_authenticated %}
|
||||||
<a class="nav-item nav-link" href="/auth/logout">Logout: {{ user }}</a>
|
<a class="nav-item nav-link" href="{% url 'logout' %}">Logout: {{ user }}</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
<a class="nav-item nav-link"
|
<a class="nav-item nav-link"
|
||||||
href="/auth/login?next={{ request.get_full_path }}">Login</a>
|
href="{% url 'login' %}?next={{ request.get_full_path }}">Login</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user