start on edit profile view

This commit is contained in:
James Turk 2015-04-09 16:58:04 -04:00
parent 3ba9cce88a
commit 2a9bf4dc2b
4 changed files with 82 additions and 1 deletions

7
profiles/urls.py Normal file
View File

@ -0,0 +1,7 @@
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^edit/$', views.edit_profile, name='edit-profile'),
]

10
profiles/views.py Normal file
View File

@ -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})

View File

@ -0,0 +1,63 @@
{% extends "base.html" %}
{% block content %}
<div class="row">
<div class="col-sm-6">
<section class="panel panel-default">
<header class="panel-heading font-bold">User Information</header>
<div class="panel-body">
<div class="form-horizontal">
<div class="form-group">
<label class="col-sm-4 control-label">Email:</label>
<div class="col-sm-8">
<input type="text" class="form-control" name="email">
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">Password:</label>
<div class="col-sm-8">
<input type="password" class="form-control" name="password">
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">Confirm Password:</label>
<div class="col-sm-8">
<input type="password" class="form-control" name="password2">
</div>
</div>
</div>
</div>
</section>
<section class="panel panel-default">
<header class="panel-heading font-bold">Lifting</header>
<div class="panel-body">
<div class="form-horizontal">
<div class="form-group">
<label class="col-sm-4 control-label">Lifting Units:</label>
<div class="col-sm-8">
<div class="radio">
<input type="radio" name="lifting_unit" value="i">lbs</input>
</div>
<div class="radio">
<input type="radio" name="lifting_unit" value="m">kg</input>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">Barbell:</label>
<div class="col-sm-8">
<div class="radio">
<input type="radio" name="barbell" value="1">Men's Olympic (44lbs / 20kg) </input>
</div>
<div class="radio">
<input type="radio" name="barbell" value="2">Women's Olympic (33lbs / 15kg) </input>
</div>
</div>
</div>
</div>
</div>
</section>
</div>
</div>
{% endblock %}

View File

@ -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)