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.
This commit is contained in:
parent
cfe54415c7
commit
c30a81df1f
2 changed files with 9 additions and 2 deletions
|
@ -98,8 +98,8 @@
|
|||
<a href="/tours/scene/{{ scene.id }}/edit/">{{ scene.title }}</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="/tours/scene/{{ scene.id }}/"><i class="ph-light ph-eye"></i></a>
|
||||
<a href="/tours/scene/{{ scene.id }}/edit/"><i class="ph-light ph-pencil"></i></a>
|
||||
<a title="View" href="/tours/scene/{{ scene.id }}/"><i class="ph-light ph-eye"></i></a>
|
||||
<a title="Edit" href="{% url "quackscape.users:scene-edit" category.id scene.id %}"><i class="ph-light ph-pencil"></i></a>
|
||||
<a title="Delete" style="color: red;" href="{% url "quackscape.users:scene-delete" category.id scene.id %}"><i class="ph-light ph-trash"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -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/<uuid:category>/scene/<uuid:pk>/edit/",
|
||||
SceneEditView.as_view(),
|
||||
name="scene-edit",
|
||||
),
|
||||
path("login/", Login.as_view(), name="login"),
|
||||
path("logout/", Logout.as_view(), name="logout"),
|
||||
]
|
||||
|
|
Loading…
Reference in a new issue