From 87a15c355ec0df3443ac60c446f64b9768b0ec0e Mon Sep 17 00:00:00 2001 From: Raghav Jajodia Date: Mon, 5 Jun 2017 23:29:14 +0530 Subject: [PATCH] Improve the look of profile page --- website/static/js/ui.js | 18 +++++--- website/templates/profile.html | 77 ++++++++++++++++++++-------------- 2 files changed, 58 insertions(+), 37 deletions(-) diff --git a/website/static/js/ui.js b/website/static/js/ui.js index 2cedaef33e..1cacbad834 100644 --- a/website/static/js/ui.js +++ b/website/static/js/ui.js @@ -1,20 +1,28 @@ $(document).ready(function(){ + var prev_html = $('.user-menu .dropdown-toggle').html(); var small_icon= false; - $(window).resize(function(){ - if($(window).width()<400 && !small_icon){ + + $(window).resize(function() + { + if($(window).width()<400 && !small_icon) + { small_icon = true; $('.user-menu .dropdown-toggle').html(""); return; } - if($(window).width()>400 && small_icon){ + if($(window).width()>400 && small_icon) + { small_icon = false; $('.user-menu .dropdown-toggle').html(prev_html); return; } + }); + $('.edit-pic').click(function(){ + $('.update-pic').show(); + $('.edit-pic').hide(); + }); - } - ); }); \ No newline at end of file diff --git a/website/templates/profile.html b/website/templates/profile.html index 7e70f1642b..0c4fd1c1b9 100644 --- a/website/templates/profile.html +++ b/website/templates/profile.html @@ -2,28 +2,36 @@ {% load gravatar %} {% block content %}
-
-

{{ user.username }}

+

{{ user.username }}

+
{% if user.userprofile.avatar %} - + {% else %} - {% gravatar user.email 150 %} + {% endif %} +
+
{% if request.user == user %} -
- {% csrf_token %} - {{ profile_form.user_avatar }} - -
+ + {% endif %} -

{{ my_score|default:0 }} points

+
+
+

{{ my_score|default:0 }} Points

@@ -31,7 +39,7 @@

{{ my_score|default:0 }} points

-
+
{{ user.username }}'s activity
@@ -45,28 +53,33 @@

{{ my_score|default:0 }} points

-
-
- {{ user.username }}'s top bug findings -
-
-
- {% for website in websites %} -
- - - - {{ website.name }} - {{ website.total }} bug{{ website.total|pluralize }} - -
- {% endfor %} -
- -
+
+
+ {{ user.username }}'s top bug findings +
+
+
+ {% for website in websites %} +
+ + + + + {{ website.name }} + + + {{ website.total }} Bug {{ website.total|pluralize }} + +
+ {% endfor %} +
+
+ {% endblock %} \ No newline at end of file