-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
95 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
from django.urls import path | ||
|
||
from .views import ProjectDetailView, ProjectListView, ProjectUpdateView | ||
from .views import DepartmentDetailView, DepartmentListView, ProjectDetailView, ProjectListView, ProjectUpdateView | ||
|
||
urlpatterns = [ | ||
path("projects/", ProjectListView.as_view(), name="projects-list"), | ||
path("projects/<int:extid>/", ProjectDetailView.as_view(), name="projects-detail"), | ||
path("projects/<slug:slug>/", ProjectDetailView.as_view(), name="projects-detail"), | ||
path("projects/<slug:slug>/edit/", ProjectUpdateView.as_view(), name="projects-edit"), | ||
path("departments/", DepartmentListView.as_view(), name="departments-list"), | ||
path("departments/<slug:slug>/", DepartmentDetailView.as_view(), name="departments-detail"), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
{% load static i18n %} | ||
|
||
<nav class="navbar navbar-expand-md navbar-light bg-light"> | ||
<div class="container-fluid"> | ||
<button class="navbar-toggler navbar-toggler-right" | ||
type="button" | ||
data-bs-toggle="collapse" | ||
data-bs-target="#navbarSupportedContent" | ||
aria-controls="navbarSupportedContent" | ||
aria-expanded="false" | ||
aria-label="Toggle navigation"> | ||
<span class="navbar-toggler-icon"></span> | ||
</button> | ||
<a class="navbar-brand" href="{% url 'home' %}">Metadata Catalogue</a> | ||
<div class="collapse navbar-collapse" id="navbarSupportedContent"> | ||
<ul class="navbar-nav mr-auto"> | ||
<li class="nav-item active"> | ||
<a class="nav-link" href="{% url 'home' %}">Home <span class="visually-hidden">(current)</span></a> | ||
</li> | ||
<li class="nav-item"> | ||
<a class="nav-link" href="{% url 'departments-list' %}">Departments</a> | ||
</li> | ||
<li class="nav-item"> | ||
<a class="nav-link" href="{% url 'projects-list' %}">Projects</a> | ||
</li> | ||
{% if request.user.is_authenticated %} | ||
<li class="nav-item"> | ||
<a class="nav-link" href="{% url 'users:detail' request.user.pk %}">{% translate "My Profile" %}</a> | ||
</li> | ||
<li class="nav-item"> | ||
{# URL provided by django-allauth/account/urls.py #} | ||
<a class="nav-link" href="{% url 'account_logout' %}">{% translate "Sign Out" %}</a> | ||
</li> | ||
{% else %} | ||
{% if ACCOUNT_ALLOW_REGISTRATION %} | ||
<li class="nav-item"> | ||
{# URL provided by django-allauth/account/urls.py #} | ||
<a id="sign-up-link" class="nav-link" href="{% url 'account_signup' %}">{% translate "Sign Up" %}</a> | ||
</li> | ||
{% endif %} | ||
<li class="nav-item"> | ||
{# URL provided by django-allauth/account/urls.py #} | ||
<a id="log-in-link" class="nav-link" href="{% url 'account_login' %}">{% translate "Sign In" %}</a> | ||
</li> | ||
{% endif %} | ||
</ul> | ||
</div> | ||
</div> | ||
</nav> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{% extends 'base.html' %} | ||
|
||
{% block content %} | ||
<h2>{{ object.name }}</h2> | ||
<p>{{ object.description|default_if_none:"No description" }}</p> | ||
<div class="d-flex"> | ||
<a class="btn btn-secondary mx-1" href="{% url 'projects-list' %}">Back</a> | ||
</div> | ||
{% endblock content %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{% extends 'base.html' %} | ||
|
||
{% block content %} | ||
<h2>Departments</h2> | ||
<div class="pb-5 mt-3"> | ||
<ul class="list-group"> | ||
{% for project in object_list %} | ||
<li class="list-group-item"> | ||
<h5> | ||
<a href="{% url 'departments-detail' slug=project.slug %}">{{ project.name }}</a> | ||
</h5> | ||
<p>{{ project.description|default_if_none:'No description' }}</p> | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
<div class="mt-3">{% include 'includes/pagination.html' %}</div> | ||
</div> | ||
{% endblock content %} |