Commit 648a7b9c authored by Ben Waters's avatar Ben Waters

working on profile

parent 90b2ddf7
{% extends 'layouts/base.html' %}
{% block title %}
{% user.full_name %} | {% user.advisorname %}
{% endblock %}
{% block content %}
<div class="container">
<div class="row clearfix">
<div class="col-md-12 column">
<h2>
Welcome User to your profile!
</h2>
</div>
</div>
{% load gravator %}
<div class="row clearfix">
<div class="col-md-4 column">
<img alt="140x140" src="http://lorempixel.com/140/140/" />
<img class="img-circle img-responsive center-block" src="{% gravatar url
'{% user.email %}' 200 %}">
</div>
<div class="col-md-4 column">
</div>
......
......@@ -23,7 +23,7 @@ urlpatterns = patterns('',
url(r'^build/', build_trajectory, name='build'),
#url(r'^student/(?P<slug>[^/]+)/$', DetailStudent.as_view(),
#name='detail-student'),
#url(r'^profile/(?P<slug>[^/]+)/$', ProfileView.as_view(),
url(r'^profile/', views.profile, name='profile-detail'),
#name='profile'),
)
......@@ -35,6 +35,14 @@ def searchMajorMinor(request):
return build_trajectory(request)
#API SHIT
def profile(request):
current_user = Student.objects.get(user__username=request.user.username)
return render_to_response('profile.html', {
"user" : current_user,
},
context_instance = RequestContext(request),
)
class RequirementViewSet(viewsets.ReadOnlyModelViewSet):
queryset = Requirement.objects.all()
......@@ -148,11 +156,3 @@ class CoursesTaken(UpdateView):
model = Student
template_name = 'student_form.html'
form_class = StudentForm
class ProfileView(LoginRequiredMixin, DetailView):
model = Student
template_name = 'profile.html'
def get_queryset(self):
qs = super(ProfileView,self).get_queryset()
return qs.filter(user=self.request.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