From c30a81df1f09c4d7238c778c682572d1f8ff5eaa Mon Sep 17 00:00:00 2001 From: Kumi Date: Tue, 7 May 2024 16:24:30 +0200 Subject: [PATCH] feat: Enhance scene links with titles and dynamic URL This commit improves the usability and maintenance of the scene management section in the 'category' template by adding 'title' attributes to 'View' and 'Edit' links, making them more accessible. It also shifts the 'Edit' link to use Django's URL template tag for dynamic URL resolution, ensuring the link remains accurate even if the routing structure changes. Additionally, the 'Delete' action has been similarly updated for consistency and future-proofing. A corresponding URL pattern for 'SceneEditView' has been added to 'urls.py', enabling this dynamic URL resolution and ensuring the system is scalable and easier to maintain. This adjustment not only enhances the user experience by providing clear action labels on hover but also improves the robustness of the application's URL management. --- quackscape/users/templates/users/category.html | 4 ++-- quackscape/users/urls.py | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/quackscape/users/templates/users/category.html b/quackscape/users/templates/users/category.html index ce4e605..f41d3df 100644 --- a/quackscape/users/templates/users/category.html +++ b/quackscape/users/templates/users/category.html @@ -98,8 +98,8 @@ {{ scene.title }} - - + + diff --git a/quackscape/users/urls.py b/quackscape/users/urls.py index ab62680..5d38a69 100644 --- a/quackscape/users/urls.py +++ b/quackscape/users/urls.py @@ -12,6 +12,8 @@ from .views import ( SceneDeleteView, ) +from quackscape.tours.views import SceneEditView + from django.urls import path app_name = "quackscape.users" @@ -46,6 +48,11 @@ urlpatterns = [ SceneDeleteView.as_view(), name="scene-delete", ), + path( + "category//scene//edit/", + SceneEditView.as_view(), + name="scene-edit", + ), path("login/", Login.as_view(), name="login"), path("logout/", Logout.as_view(), name="logout"), ]