Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
advisor
Commits
648a7b9c
Commit
648a7b9c
authored
Mar 02, 2014
by
Ben Waters
Browse files
working on profile
parent
90b2ddf7
Changes
3
Hide whitespace changes
Inline
Side-by-side
advisor/mainapp/templates/profile.html
View file @
648a7b9c
{% 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>
...
...
advisor/mainapp/urls.py
View file @
648a7b9c
...
...
@@ -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'),
)
advisor/mainapp/views.py
View file @
648a7b9c
...
...
@@ -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
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment