update path names

This commit is contained in:
2023-01-07 12:26:24 +00:00
parent 5a8d993cbb
commit b5f274328f
21 changed files with 63 additions and 56 deletions

View File

@@ -11,11 +11,11 @@ urlpatterns = [
path(
"change-password/",
views.LdapPasswordChangeView.as_view(),
name="change-password",
name="password_change",
),
path(
"change-password/done/",
views.LdapPasswordChangeDoneView.as_view(),
name="password-change-done",
name="password_change_done",
),
]

View File

@@ -1,5 +1,9 @@
from django.contrib.auth import logout
from django.contrib.auth.views import LoginView, PasswordChangeDoneView, PasswordChangeView
from django.contrib.auth.views import (
LoginView,
PasswordChangeDoneView,
PasswordChangeView,
)
from django.shortcuts import redirect
from documents.etherpadlib import del_ep_cookie
@@ -9,6 +13,7 @@ from .forms import LdapPasswordChangeForm, LoginForm
from django.urls import reverse_lazy, reverse
class AuthLoginView(LoginView):
authentication_form = LoginForm
redirect_authenticated_user = True
@@ -31,7 +36,7 @@ def logoutUser(request):
class LdapPasswordChangeView(PasswordChangeView):
form_class = LdapPasswordChangeForm
success_url = reverse_lazy('authentications:password-change-done')
success_url = reverse_lazy("authentications:password_change_done")
template_name = "authentications/change_password.html"

View File

@@ -8,5 +8,5 @@ app_name = apps.GalleryConfig.name
urlpatterns = [
path("", views.index, name="index"),
path("<slug:slug>/", views.show_album, name="album"),
path("draft/<slug:slug>/", views.show_draft_album, name="draft-album"),
path("draft/<slug:slug>/", views.show_draft_album, name="album_draft"),
]

View File

@@ -26,17 +26,17 @@ attachment_urlpatterns = [
path(
"update/",
AttachmentUpdateView.as_view(),
name="attachment-update",
name="attachment_update",
),
path(
"etherpad-create/",
"create-etherpad/",
EtherpadCreateView.as_view(),
name="etherpad-create",
name="etherpad_create",
),
path(
"file-create/",
"create-file/",
FileUploadCreateView.as_view(),
name="file-create",
name="file_create",
),
]
@@ -45,22 +45,22 @@ topic_urlpatterns = [
path(
"update/",
TopicUpdateView.as_view(),
name="topic-update",
name="topic_update",
),
path(
"attachment-create/",
"create-attachment/",
AttachmentCreateView.as_view(),
name="attachment-create",
name="attachment_create",
),
path("create/", TaskCreateView.as_view(), name="task-create"),
path("create-task/", TaskCreateView.as_view(), name="task_create"),
]
urlpatterns = [
path("", views.index, name="index"),
path(
"<slug:topic_group_slug>/topic-create/",
"<slug:topic_group_slug>/create-topic/",
TopicCreateView.as_view(),
name="topic-create",
name="topic_create",
),
path("<slug:topic_group_slug>/<slug:slug>/", include(topic_urlpatterns)),
path(

View File

@@ -138,7 +138,7 @@ class Post(models.Model):
)
def get_absolute_url(self):
return reverse("posts:post-detail", kwargs={"slug": self.slug})
return reverse("posts:post", kwargs={"slug": self.slug})
def save(self, *args, **kwargs):
# save the post with some defaults

View File

@@ -11,12 +11,12 @@ urlpatterns = [
# fet calendar (path have to be ahead show)
path("fet_calendar.ics", views.calendar, name="calendar"),
path(
"fetmeeting-create/",
"create-fetmeeting/",
views.FetMeetingCreateView.as_view(),
name="fetmeeting-create",
name="fetmeeting_create",
),
path("<slug:slug>/", views.PostDetailView.as_view(), name="post-detail"),
path("<slug:slug>/update/", views.PostUpdateView.as_view(), name="post-update"),
path("<slug:slug>/", views.PostDetailView.as_view(), name="post"),
path("<slug:slug>/update/", views.PostUpdateView.as_view(), name="post_update"),
re_path(
r"^(?P<id>[-\w]+)/agenda.pdf$",
views.show_pdf_agenda,

View File

@@ -91,7 +91,7 @@ class Task(models.Model):
return self.title
def get_absolute_url(self):
return reverse("tasks:task-detail", kwargs={"slug": self.slug})
return reverse("tasks:task", kwargs={"slug": self.slug})
def save(self, *args, **kwargs):
if not self.slug:

View File

@@ -9,8 +9,10 @@ app_name = apps.TasksConfig.name
urlpatterns = [
path("", views.index, name="index"),
path("add/", TaskCreateView.as_view(), name="task-create"),
path("<slug:slug>/", TaskDetailView.as_view(), name="task-detail"),
path("<slug:slug>/update/", TaskUpdateView.as_view(), name="task-update"),
path("<slug:slug>/add/", DocumentCreateView.as_view(), name="docu-create"),
path("create-task/", TaskCreateView.as_view(), name="task_create"),
path("<slug:slug>/", TaskDetailView.as_view(), name="task"),
path("<slug:slug>/update/", TaskUpdateView.as_view(), name="task_update"),
path(
"<slug:slug>/create-document/", DocumentCreateView.as_view(), name="docu_create"
),
]

View File

@@ -146,4 +146,4 @@ class DocumentCreateView(LoginRequiredMixin, CreateView):
return context
def get_success_url(self):
return reverse("tasks:task-detail", kwargs=self.kwargs)
return reverse("tasks:task", kwargs=self.kwargs)

View File

@@ -13,7 +13,7 @@
<div class="w-full h-full flex-1 flex justify-center items-center">
<form action="{% url 'authentications:change-password' %}" method="POST" class="sm:p-4 sm:w-3/5 md:w-1/2 lg:w-2/5 xl:w-1/3 2xl:w-1/4 grid grid-cols-1 gap-3 sm:gap-6">
<form action="{% url 'authentications:password_change' %}" method="POST" class="sm:p-4 sm:w-3/5 md:w-1/2 lg:w-2/5 xl:w-1/3 2xl:w-1/4 grid grid-cols-1 gap-3 sm:gap-6">
{% csrf_token %}
{% include "baseform/non_field_errors.html" %}

View File

@@ -16,7 +16,7 @@
<div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5 justify-items-center gap-4">
{% for album in albums %}
{% if request.user.is_authenticated and album.status == album.DRAFT %}
<a href="{% url 'gallery:draft-album' album.slug %}" class="block max-w-xs sm:max-w-none">
<a href="{% url 'gallery:album_draft' album.slug %}" class="block max-w-xs sm:max-w-none">
<img src="{{ album.thumbnail }}" class="rounded">
<h2 class="px-2 text-proprietary-dark dark:text-sky-300">{{ album.title }}</h2>
<h3 class="px-2 text-sm text-proprietary dark:text-sky-400 font-normal"><i class="fa-solid fa-calendar-day mr-1"></i>{{ album.event_date }}</h3>

View File

@@ -37,7 +37,7 @@
<div id="speed-dial-menu-dropdown" class="flex hidden flex-col justify-end py-1 mb-4 space-y-2 bg-white rounded-lg border border-gray-100 shadow-sm dark:border-gray-600 dark:bg-gray-700">
<ul class="text-sm text-gray-500 dark:text-gray-300">
<li>
<a href="{% url 'posts:fetmeeting-create' %}" class="flex items-center py-2 px-5 hover:bg-gray-100 dark:hover:bg-gray-600 hover:text-gray-900 dark:hover:text-white">
<a href="{% url 'posts:fetmeeting_create' %}" class="flex items-center py-2 px-5 hover:bg-gray-100 dark:hover:bg-gray-600 hover:text-gray-900 dark:hover:text-white">
<i class="fa-solid fa-plus mr-2"></i>
<span class="text-sm font-medium">Neue Fachschaftssitzung</span>
</a>

View File

@@ -29,7 +29,7 @@
</a> -->
</div>
<div class="documentList rounded divide-y divide-gray-300 dark:divide-gray-600">
<a href="{% url 'intern:etherpad-create' attachment.topic.topic_group.slug attachment.topic.slug attachment.slug %}" class="flex justify-between">
<a href="{% url 'intern:etherpad_create' attachment.topic.topic_group.slug attachment.topic.slug attachment.slug %}" class="flex justify-between">
<h3 class="text-gray-800 dark:text-gray-200"><i class="fa-solid fa-plus fa-fw mr-1"></i>Neues Etherpad erstellen</h2>
</a>
@@ -45,7 +45,7 @@
<section>
<h2 class="text-lg font-medium text-gray-900 dark:text-gray-100">Dokumente:</h2>
<div class="documentList rounded divide-y divide-gray-300 dark:divide-gray-600">
<a href="{% url 'intern:file-create' attachment.topic.topic_group.slug attachment.topic.slug attachment.slug %}" class="flex justify-between">
<a href="{% url 'intern:file_create' attachment.topic.topic_group.slug attachment.topic.slug attachment.slug %}" class="flex justify-between">
<h3 class="text-gray-800 dark:text-gray-200"><i class="fa-solid fa-plus fa-fw mr-1"></i>Neues Dokument hochladen</h2>
</a>
@@ -58,7 +58,7 @@
</div>
</section>
<a href="{% url 'intern:attachment-update' attachment.topic.topic_group.slug attachment.topic.slug attachment.slug %}" class="btn btn-primary block place-self-end"><i class="fa-solid fa-pen-to-square mr-2"></i>Beschreibung bearbeiten</a>
<a href="{% url 'intern:attachment_update' attachment.topic.topic_group.slug attachment.topic.slug attachment.slug %}" class="btn btn-primary block place-self-end"><i class="fa-solid fa-pen-to-square mr-2"></i>Beschreibung bearbeiten</a>
</div>
</main>
{% endblock %}

View File

@@ -25,14 +25,14 @@
x-transition:leave="transition ease-in duration-150"
x-transition:leave-start="transform origin-top opacity-100 translate-x-0"
x-transition:leave-end="transform origin-top opacity-0 -translate-x-6"
><a href="{% url 'intern:topic-create' topic_group.grouper.slug %}"><i class="fa-solid fa-plus mr-1"></i>Eintrag hinzufügen</a></button>
><a href="{% url 'intern:topic_create' topic_group.grouper.slug %}"><i class="fa-solid fa-plus mr-1"></i>Eintrag hinzufügen</a></button>
</div>
<ul class="ml-7 w-fit" x-show="getExpandList" x-collapse>
{% for topic in topic_group.list %}
<li><a href="{% url 'intern:topic' topic.topic_group.slug topic.slug %}" class="w-full py-1 inline-block">{{ topic.title }}</a></li>
{% endfor %}
<li class="py-1">
<a href="{% url 'intern:topic-create' topic_group.grouper.slug %}" class="border border-gray-700 dark:border-gray-300 rounded px-1.5 py-1 text-sm sm:hidden">
<a href="{% url 'intern:topic_create' topic_group.grouper.slug %}" class="border border-gray-700 dark:border-gray-300 rounded px-1.5 py-1 text-sm sm:hidden">
<i class="fa-solid fa-plus mr-1"></i>Eintrag hinzufügen
</a>
</li>
@@ -57,11 +57,11 @@
x-transition:leave="transition ease-in duration-150"
x-transition:leave-start="transform origin-top opacity-100 translate-x-0"
x-transition:leave-end="transform origin-top opacity-0 -translate-x-6"
><a href="{% url 'intern:topic-create' topic_group.slug %}"><i class="fa-solid fa-plus mr-1"></i>Eintrag hinzufügen</a></button>
><a href="{% url 'intern:topic_create' topic_group.slug %}"><i class="fa-solid fa-plus mr-1"></i>Eintrag hinzufügen</a></button>
</div>
<ul class="ml-7 w-fit" x-show="getExpandList" x-collapse>
<li class="py-1">
<a href="{% url 'intern:topic-create' topic_group.slug %}" class="border border-gray-700 dark:border-gray-300 rounded px-1.5 py-1 text-sm sm:hidden">
<a href="{% url 'intern:topic_create' topic_group.slug %}" class="border border-gray-700 dark:border-gray-300 rounded px-1.5 py-1 text-sm sm:hidden">
<i class="fa-solid fa-plus mr-1"></i>Eintrag hinzufügen
</a>
</li>

View File

@@ -24,7 +24,7 @@
<ul class="flex flex-col gap-1 max-w-fit">
{% for task in tasks %}
<li>
<span class="ml-2">{{ task.title|truncatechars:45 }} <a href="{% url 'tasks:task-detail' task.slug %}" class="inline-block text-proprietary dark:text-proprietary-lighter">Link <i class="fa-solid fa-link"></i></a></span>
<span class="ml-2">{{ task.title|truncatechars:45 }} <a href="{% url 'tasks:task' task.slug %}" class="inline-block text-proprietary dark:text-proprietary-lighter">Link <i class="fa-solid fa-link"></i></a></span>
</li>
{% endfor %}
</ul>
@@ -36,16 +36,16 @@
{% endfor %}
<li class="mt-2">
<a href="{% url 'intern:attachment-create' topic.topic_group.slug topic.slug %}" class="border border-gray-700 dark:border-gray-300 rounded px-1.5 py-1">
<a href="{% url 'intern:attachment_create' topic.topic_group.slug topic.slug %}" class="border border-gray-700 dark:border-gray-300 rounded px-1.5 py-1">
<i class="fa-solid fa-plus mr-1"></i>Eintrag hinzufügen
</a>
</li>
</ul>
<section class="flex flex-col sm:flex-row justify-end gap-4">
<a href="{% url 'intern:topic-update' topic.topic_group.slug topic.slug %}" class="btn btn-primary block"><i class="fa-solid fa-pen-to-square mr-2"></i>Thema bearbeiten</a>
<a href="{% url 'intern:topic_update' topic.topic_group.slug topic.slug %}" class="btn btn-primary block"><i class="fa-solid fa-pen-to-square mr-2"></i>Thema bearbeiten</a>
{% if topic.task_list %}
<a href="{% url 'intern:task-create' topic.topic_group.slug topic.slug %}" class="btn btn-primary block"><i class="fa-solid fa-plus-square mr-2"></i>Task hinzufügen</a>
<a href="{% url 'intern:task_create' topic.topic_group.slug topic.slug %}" class="btn btn-primary block"><i class="fa-solid fa-plus-square mr-2"></i>Task hinzufügen</a>
{% endif %}
</section>
</div>

View File

@@ -12,7 +12,7 @@
{% block update_button_desktop %}
{% if request.user.is_authenticated %}
<a href="{% url 'posts:post-update' post.slug %}" class="hidden sm:block btn-small btn-primary">
<a href="{% url 'posts:post_update' post.slug %}" class="hidden sm:block btn-small btn-primary">
<i class="fa-solid fa-pen-to-square mr-1"></i>Event bearbeiten
</a>
{% endif %}
@@ -100,7 +100,7 @@
{% block update_button_mobile %}
{% if request.user.is_authenticated %}
<a href="{% url 'posts:post-update' post.slug %}" class="sm:hidden block w-full btn btn-primary mt-4">
<a href="{% url 'posts:post_update' post.slug %}" class="sm:hidden block w-full btn btn-primary mt-4">
<i class="fa-solid fa-pen-to-square mr-1"></i>Event bearbeiten
</a>
{% endif %}

View File

@@ -12,7 +12,7 @@
{% block update_button_desktop %}
{% if request.user.is_authenticated %}
<a href="{% url 'posts:post-update' post.slug %}" class="hidden sm:block btn-small btn-primary">
<a href="{% url 'posts:post_update' post.slug %}" class="hidden sm:block btn-small btn-primary">
<i class="fa-solid fa-pen-to-square mr-1"></i>FET Sitzung bearbeiten
</a>
{% endif %}
@@ -215,7 +215,7 @@
{% block update_button_mobile %}
{% if request.user.is_authenticated %}
<a href="{% url 'posts:post-update' post.slug %}" class="sm:hidden block w-full btn btn-primary mt-4">
<a href="{% url 'posts:post_update' post.slug %}" class="sm:hidden block w-full btn btn-primary mt-4">
<i class="fa-solid fa-pen-to-square mr-1"></i>FET Sitzung bearbeiten
</a>
{% endif %}

View File

@@ -6,7 +6,7 @@
{% block update_button_desktop %}
{% if request.user.is_authenticated %}
<a href="{% url 'posts:post-update' post.slug %}" class="hidden sm:block btn-small btn-primary">
<a href="{% url 'posts:post_update' post.slug %}" class="hidden sm:block btn-small btn-primary">
<i class="fa-solid fa-pen-to-square mr-1"></i>Artikel bearbeiten
</a>
{% endif %}
@@ -55,7 +55,7 @@
{% block update_button_mobile %}
{% if request.user.is_authenticated %}
<a href="{% url 'posts:post-update' post.slug %}" class="sm:hidden block w-full btn btn-primary mt-4">
<a href="{% url 'posts:post_update' post.slug %}" class="sm:hidden block w-full btn btn-primary mt-4">
<i class="fa-solid fa-pen-to-square mr-1"></i>Artikel bearbeiten
</a>
{% endif %}

View File

@@ -12,7 +12,7 @@
{% block content %}
<!-- Main Content -->
<main class="container mx-auto w-full flex-1 my-8 sm:flex flex-col sm:px-4">
<a href="{% url 'posts:post-detail' previous %}" class="hidden z-20 fixed left-0 top-1/2 -mt-8 p-2 xl:flex items-center text-gray-400 dark:text-gray-300 rounded-md"
<a href="{% url 'posts:post' previous %}" class="hidden z-20 fixed left-0 top-1/2 -mt-8 p-2 xl:flex items-center text-gray-400 dark:text-gray-300 rounded-md"
x-data="prevArticleButton"
@mouseleave="closeShowPrevArticleButton"
@mouseover="openShowPrevArticleButton"
@@ -28,7 +28,7 @@
x-transition:leave-end="opacity-0 bg-opacity-0 transform scale-100"
>{% block prev_text_big %}Vorheriger<br>Artikel{% endblock %}</span>
</a>
<a href="{% url 'posts:post-detail' next %}" class="hidden z-20 fixed right-0 top-1/2 -mt-8 p-2 xl:flex items-center text-gray-400 dark:text-gray-300 rounded-md"
<a href="{% url 'posts:post' next %}" class="hidden z-20 fixed right-0 top-1/2 -mt-8 p-2 xl:flex items-center text-gray-400 dark:text-gray-300 rounded-md"
x-data="nextArticleButton"
@mouseleave="closeShowNextArticleButton"
@mouseover="openShowNextArticleButton"
@@ -104,11 +104,11 @@
<hr class="-mx-4 border-gray-200 dark:border-gray-800 dark:border my-4">
<div class="-m-4 flex divide-x divide-gray-200 dark:divide-gray-800 dark:divide-x-2 text-sm sm:text-base">
<a href="{% url 'posts:post-detail' previous %}" class="w-1/2 p-4 flex items-center gap-2">
<a href="{% url 'posts:post' previous %}" class="w-1/2 p-4 flex items-center gap-2">
<i class="fa-solid fa-chevron-left text-gray-600 dark:text-gray-400"></i>
<span class="text-gray-700 dark:text-gray-300 font-medium">{% block prev_text %}Vorheriger Artikel{% endblock %}</span>
</a>
<a href="{% url 'posts:post-detail' next %}" class="w-1/2 p-4 flex flex-row-reverse items-center gap-2">
<a href="{% url 'posts:post' next %}" class="w-1/2 p-4 flex flex-row-reverse items-center gap-2">
<i class="fa-solid fa-chevron-right text-gray-600 dark:text-gray-400"></i>
<span class="text-gray-700 dark:text-gray-300 font-medium">{% block next_text %}Nächster Artikel{% endblock %}</span>
</a>

View File

@@ -95,7 +95,7 @@
<label class="mb-2 flex justify-between items-start">
<div class="inline-flex items-baseline mr-2">
<input type="checkbox" name="checkbox" value="{{ task.id }}" {% if task.completed %}checked{% endif %} class="rounded border-gray-300 dark:border-none text-proprietary shadow-sm focus:border-blue-300 focus:ring focus:ring-offset-0 focus:ring-blue-200 dark:focus:ring-sky-700 focus:ring-opacity-50">
<span class="ml-2">{{ task.title|truncatechars:45 }} <a href="{% url 'tasks:task-detail' task.slug %}" class="inline-block text-proprietary dark:text-proprietary-lighter">Link <i class="fa-solid fa-link"></i></a></span>
<span class="ml-2">{{ task.title|truncatechars:45 }} <a href="{% url 'tasks:task' task.slug %}" class="inline-block text-proprietary dark:text-proprietary-lighter">Link <i class="fa-solid fa-link"></i></a></span>
</div>
{% if task.due_date %}
<div class="inline-flex gap-2 flex-shrink-0">
@@ -110,7 +110,7 @@
<div class="flex flex-col md:flex-row gap-y-2 md:gap-y-0 md:gap-x-2 lg:justify-end mt-4">
<input type="submit" name="btn_checkbox" value="Tasks abschließen" class="btn btn-success block md:flex-grow lg:flex-grow-0">
<a href="{% url 'tasks:task-create' %}" class="btn btn-primary block md:flex-grow lg:flex-grow-0"><i class="fa-solid fa-plus-square mr-2"></i>Task hinzufügen</a>
<a href="{% url 'tasks:task_create' %}" class="btn btn-primary block md:flex-grow lg:flex-grow-0"><i class="fa-solid fa-plus-square mr-2"></i>Task hinzufügen</a>
</div>
</form>
{% else %}
@@ -118,7 +118,7 @@
<h2 class="mb-1 text-gray-700 dark:text-gray-200">Keine Tasks in dieser Liste für dich.</h2>
<div class="flex flex-col md:flex-row gap-y-2 md:gap-y-0 md:gap-x-2 lg:justify-end mt-4">
<a href="{% url 'tasks:task-create' %}" class="btn btn-primary block md:flex-grow lg:flex-grow-0"><i class="fa-solid fa-plus-square mr-2"></i>Task hinzufügen</a>
<a href="{% url 'tasks:task_create' %}" class="btn btn-primary block md:flex-grow lg:flex-grow-0"><i class="fa-solid fa-plus-square mr-2"></i>Task hinzufügen</a>
</div>
</section>
{% endif %}

View File

@@ -26,7 +26,7 @@
<section>
<div class="documentList rounded divide-y divide-gray-300 dark:divide-gray-600">
<a href="{% url 'tasks:docu-create' task.slug %}" class="flex justify-between">
<a href="{% url 'tasks:docu_create' task.slug %}" class="flex justify-between">
<h3 class="text-gray-800 dark:text-gray-200"><i class="fa-solid fa-plus fa-fw mr-1"></i>Neues Etherpad erstellen</h2>
</a>
@@ -40,7 +40,7 @@
</div>
</section>
<a href="{% url 'tasks:task-update' task.slug %}" class="btn btn-primary block place-self-end"><i class="fa-solid fa-pen-to-square mr-2"></i>Task bearbeiten</a>
<a href="{% url 'tasks:task_update' task.slug %}" class="btn btn-primary block place-self-end"><i class="fa-solid fa-pen-to-square mr-2"></i>Task bearbeiten</a>
</div>
</main>
{% endblock %}