Commit fb7c6344 authored by KaoruSawade's avatar KaoruSawade

created widgetuser-details.html; edited views.py: fixed WidgetUserDetailView;...

created widgetuser-details.html; edited views.py: fixed WidgetUserDetailView; edited dashboard.html: stylistic edits
parent bc384732
......@@ -3,7 +3,7 @@
{% block title %}Widget v2{% endblock %}
{% block content %}
<h2>Welcome to Widget!</h2>
</h3>Widget Users:</h3><br>
<h3>Widget Users:</h3>
{% for user in widgetusers %}
<a href="{{ user.get_absolute_url }}">{{user.last_name}}, {{user.first_name}}</a><br>
{% endfor %}
......
{% extends 'base.html' %}
{% load static %}
{% block title %}{{ user.last_name }}, {{user.first_name}}{% endblock %}
{% block content %}
<h2>{{ user.first_name }} {{ user.middle_name }} {{ user.last_name }}</h2>
<h3>{{ department.dept_name }}</h3>
<h3>{{ department.home_unit }}</h3>
<br>
<form action='edit'>
<input type="submit" value="Edit Widget User"/>
</form>
{% endblock %}
\ No newline at end of file
......@@ -11,4 +11,5 @@ def pageview(request):
class WidgetUserDetailView(DetailView):
def get(self, request, pk):
user = WidgetUser.objects.get(pk=pk)
return render(request, 'dashboard/widgetuser-details.html', {'user': user})
department = user.department
return render(request, 'dashboard/widgetuser-details.html', {'department': department, 'user': user})
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