Commit 7179931b authored by Anya Habana's avatar Anya Habana

Added navigation buttons and add widget user title

parent 50c552c3
No preview for this file type
......@@ -19,5 +19,6 @@
{% else %}
<p> There are no widget users currently. </p>
{% endif %}
<button class="homepage-button" type="submit"><a href="/users/add/">Add Widget User</a></button>
{% endblock %}
<form action="{% url 'homepage:newuser' %}" method="POST">
{% extends 'base.html' %}
{% load static %}
{% block title %}New User{% endblock %}
{% block styles %}
<link rel="stylesheet" href="{% static 'homepage.css' %}">
{% endblock %}
{% block content %}
<h1 class="homepage-heading">Add Widget User</h1>
<form class="homepage-form" action="{% url 'homepage:newuser' %}" method="POST">
{% csrf_token %}
{{ user_form }}
<<button class="button" type="submit">Save New User</button>
</form>
\ No newline at end of file
<button class="button" type="submit">Save New User</button>
</form>
<button class="button" type="submit"><a href="/homepage">Back to Homepage</a></button>
{% endblock %}
\ No newline at end of file
......@@ -18,7 +18,7 @@ def newuser(request):
user_form = WidgetUserForm(request.POST)
if user_form.is_valid():
new_user = user_form.save()
return redirect("homepage:index", pk=new_user.pk)
return redirect("homepage:index")
else:
user_form = WidgetUserForm()
return render(request, 'users/newuser.html', {"user_form": user_form})
......
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