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
6e6472b8
Commit
6e6472b8
authored
Mar 02, 2014
by
Daniel W Bond
Browse files
Merge branch 'master' of github.com:srct/advisor
parents
e9bc30ad
633ffa09
Changes
3
Hide whitespace changes
Inline
Side-by-side
advisor/mainapp/templates/profile.html
View file @
6e6472b8
{% 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 @
6e6472b8
...
...
@@ -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>[^/]+)/$
',
P
rofile
View.as_view(
),
url
(
r
'^profile/'
,
p
rofile
,
name
=
'profile-detail'
),
#name='profile'),
)
advisor/mainapp/views.py
View file @
6e6472b8
from
django.shortcuts
import
render
from
django.contrib.auth.decorators
import
login_required
from
django.views.generic
import
(
CreateView
,
ListView
,
DetailView
,
DeleteView
,
UpdateView
,
FormView
)
...
...
@@ -35,6 +36,15 @@ def searchMajorMinor(request):
return
build_trajectory
(
request
)
#API SHIT
@
login_required
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 +158,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