Commit 3e3d6946 authored by Mavrick Jordan Lee's avatar Mavrick Jordan Lee

Added Edit Widget User Page. Updated urls, views, and widgetuser-details.html.

parent b06aba32
......@@ -6,5 +6,7 @@
{{ object.user_department.dept_name }}<br>
{{ object.user_department.home_unit }}
</p>
<button>Edit Widget User</button>
<a href="{% url 'dashboard:widgetuser-edit' object.id %}">
<button>Edit Widget User</button>
</a>
{% endblock %}
\ No newline at end of file
{% extends 'base.html' %}
{% block title %}Edit Widget User{% endblock %}
{% block content %}
<h2>Edit Widget User:</h2>
<form method="POST">
{% csrf_token %}
{{ form.as_p }}
<input type="Submit" value="Save Changes to Widget User">
</form>
{% endblock %}
\ No newline at end of file
......@@ -2,13 +2,14 @@ from django.urls import path
from . import views
from .views import (
WidgetUserDetailsView, WidgetUserCreateView
WidgetUserDetailsView, WidgetUserCreateView, WidgetUserUpdateView
)
urlpatterns = [
path('dashboard/', views.dashboard, name = "dashboard"),
path('widgetusers/<int:pk>/details/', WidgetUserDetailsView.as_view(), name = "widgetuser-detail"),
path('widgetusers/add/', WidgetUserCreateView.as_view(), name = "widgetuser-add"),
path('widgetusers/<int:pk>/edit/', WidgetUserUpdateView.as_view(), name = "widgetuser-edit"),
]
app_name = 'dashboard'
\ No newline at end of file
......@@ -18,3 +18,8 @@ class WidgetUserCreateView(CreateView):
model = WidgetUser
fields = '__all__'
template_name = 'dashboard/widgetuser-add.html'
class WidgetUserUpdateView(UpdateView):
model = WidgetUser
fields = '__all__'
template_name = 'dashboard/widgetuser-edit.html'
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment