File tree Expand file tree Collapse file tree 4 files changed +24
-4
lines changed Expand file tree Collapse file tree 4 files changed +24
-4
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ def render_base_template(*args, **kwargs):
28
28
user_data = dumps ({'logged' : bool (is_logged ),
29
29
'user' : current_user .jsonable ()})
30
30
31
- kwargs .update (** {'__v__' : int (time .time ()), 'user_data' : user_data })
31
+ kwargs .update (** {'__v__' : int (time .time ()), 'user_data' : user_data , 'logged_in' : bool ( is_logged ) })
32
32
return render_template (* args , ** kwargs )
33
33
34
34
@@ -159,3 +159,7 @@ def logout():
159
159
return render_base_template ("logout.html" , master = "login_master.html" )
160
160
161
161
162
+ @main_app .route ("/profile" )
163
+ def profile ():
164
+
165
+ return render_base_template ("profile.html" )
Original file line number Diff line number Diff line change 151
151
< ul class ='nav navbar-nav pull-right '>
152
152
{% if logged_in %}
153
153
< li class ="dropdown ">
154
- < a href ="# " class ="dropdown-toggle " data-toggle ="dropdown "> < span
155
- id ='profile_link '> Dropdown </ span > < b class ="caret "> </ b > </ a >
154
+ < a href ="# " class ="dropdown-toggle " data-toggle ="dropdown ">
155
+ < img src ='{{ current_user.pic_url }} ' height ='25px ' width ="25px " class ="img-rounded "/>
156
+
157
+ < span id ='profile_link '> {{ current_user.nick }} </ span > < b class ="caret "> </ b > </ a >
156
158
< ul class ="dropdown-menu ">
157
159
{# < li > < a href ="# "> Action</ a > </ li > #}
158
160
< li > < a href ="/profile "> < i class ='icon-user '> </ i > Account</ a > </ li >
176
178
{% block content %}{% endblock %}
177
179
</ div >
178
180
</ div >
181
+ < hr />
179
182
< div class ='container footer '>
180
183
< p >
181
184
Made in Amsterdam
216
219
< script >
217
220
{ % autoescape off % }
218
221
var session = { { user_data } } ;
219
- document . getElementById ( "profile_link" ) . innerHTML = "Welcome, " + session . user . nick ;
222
+ { # document . getElementById ( "profile_link" ) . innerHTML = "Welcome, " + session . user . nick ; # }
220
223
{ % endautoescape % }
221
224
222
225
</ script >
Original file line number Diff line number Diff line change
1
+ {% extends "base.html" %}
2
+
3
+
4
+ {% block content %}
5
+ < div class ='container '>
6
+ < div class ='col-lg-4 '>
7
+ < img src ='{{ current_user.pic_url }} ' class ='img-responsive img-rounded ' />
8
+ < h1 > {{ current_user.nick }}</ h1 >
9
+ </ div >
10
+ < div class ='col-lg-8 '>
11
+ </ div >
12
+ </ div >
13
+ {% endblock %}
You can’t perform that action at this time.
0 commit comments