From 2a9bf4dc2b28c4d323af6bc7529a14a7077ff201 Mon Sep 17 00:00:00 2001 From: James Turk Date: Thu, 9 Apr 2015 16:58:04 -0400 Subject: [PATCH] start on edit profile view --- profiles/urls.py | 7 ++++ profiles/views.py | 10 ++++++ templates/profiles/edit.html | 63 ++++++++++++++++++++++++++++++++++++ web/urls.py | 3 +- 4 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 profiles/urls.py create mode 100644 profiles/views.py create mode 100644 templates/profiles/edit.html diff --git a/profiles/urls.py b/profiles/urls.py new file mode 100644 index 0000000..a8d7128 --- /dev/null +++ b/profiles/urls.py @@ -0,0 +1,7 @@ +from django.conf.urls import url + +from . import views + +urlpatterns = [ + url(r'^edit/$', views.edit_profile, name='edit-profile'), +] diff --git a/profiles/views.py b/profiles/views.py new file mode 100644 index 0000000..840b1ff --- /dev/null +++ b/profiles/views.py @@ -0,0 +1,10 @@ +from django.shortcuts import render +from django import forms +from django.contrib.auth.decorators import login_required + + +@login_required +def edit_profile(request): + form = request.user.profile + + return render(request, 'profiles/edit.html', {'form': form}) diff --git a/templates/profiles/edit.html b/templates/profiles/edit.html new file mode 100644 index 0000000..14d0010 --- /dev/null +++ b/templates/profiles/edit.html @@ -0,0 +1,63 @@ +{% extends "base.html" %} + +{% block content %} + +
+
+
+
User Information
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+
+
Lifting
+
+
+
+ +
+
+ lbs +
+
+ kg +
+
+
+
+ +
+
+ Men's Olympic (44lbs / 20kg) +
+
+ Women's Olympic (33lbs / 15kg) +
+
+
+
+
+
+
+
+{% endblock %} diff --git a/web/urls.py b/web/urls.py index eca80b5..3076103 100644 --- a/web/urls.py +++ b/web/urls.py @@ -4,10 +4,11 @@ from django.contrib import admin from django.conf.urls.static import static import lifting.urls +import profiles.urls urlpatterns = [ url(r'^admin/', include(admin.site.urls)), - + url(r'^profile/', include(profiles.urls.urlpatterns)), url(r'^lifting/', include(lifting.urls.urlpatterns)), ] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)