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 @@ ...@@ -19,5 +19,6 @@
{% else %} {% else %}
<p> There are no widget users currently. </p> <p> There are no widget users currently. </p>
{% endif %} {% endif %}
<button class="homepage-button" type="submit"><a href="/users/add/">Add Widget User</a></button>
{% endblock %} {% 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 %} {% csrf_token %}
{{ user_form }} {{ user_form }}
<<button class="button" type="submit">Save New User</button> <button class="button" type="submit">Save New User</button>
</form> </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): ...@@ -18,7 +18,7 @@ def newuser(request):
user_form = WidgetUserForm(request.POST) user_form = WidgetUserForm(request.POST)
if user_form.is_valid(): if user_form.is_valid():
new_user = user_form.save() new_user = user_form.save()
return redirect("homepage:index", pk=new_user.pk) return redirect("homepage:index")
else: else:
user_form = WidgetUserForm() user_form = WidgetUserForm()
return render(request, 'users/newuser.html', {"user_form": user_form}) 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