From bacee20d83e33674b12cd87ee75d1d14f6810610 Mon Sep 17 00:00:00 2001 From: holyantony Date: Thu, 24 Sep 2015 15:16:50 +0530 Subject: Subject: Fixed error if no profile is present Description: 1. Removed last question and view previous question from slick-list 2. Removed color for user_name 3. Tooltip removed from all table --- forums/views.py | 10 +++++++++- static/website/css/main.css | 5 ++--- static/website/templates/filter.html | 8 +++----- static/website/templates/get-question.html | 7 ++++--- static/website/templates/index.html | 8 ++++---- static/website/templates/questions.html | 6 +++--- 6 files changed, 25 insertions(+), 19 deletions(-) diff --git a/forums/views.py b/forums/views.py index ebb44ca..ffa4984 100644 --- a/forums/views.py +++ b/forums/views.py @@ -133,12 +133,20 @@ def account_profile(request, username): def account_view_profile(request, username): user = User.objects.get(username = username) - profile = Profile.objects.filter(user = user)[0] + profile = Profile.objects.filter(user = user) + prof = None + if profile: + prof = profile[0] + + print "profile" + print profile context = { 'profile' : profile, 'media_url' : settings.MEDIA_URL, } return render(request, 'forums/templates/view-profile.html', context) + + def send_registration_confirmation(user): diff --git a/static/website/css/main.css b/static/website/css/main.css index 4debbbd..19d4136 100644 --- a/static/website/css/main.css +++ b/static/website/css/main.css @@ -98,7 +98,6 @@ body { #content .question { position: relative; padding: 30px 0 15px 0; - border-bottom: 1px solid #f5f5f5; } #content .editable { padding: 15px 5px 15px 5px; @@ -361,12 +360,12 @@ table .question a{ color: #a26dc8; } .carousel, .slick-list { - height: 245px; + height: 178px; margin-right: -2px; } .carousel .thumbnail { width: 97%; - height: 245px; + height: 178px; border: 1px solid #cccccc; } .carousel .thumbnail img { diff --git a/static/website/templates/filter.html b/static/website/templates/filter.html index b51818a..4e589d4 100644 --- a/static/website/templates/filter.html +++ b/static/website/templates/filter.html @@ -17,8 +17,6 @@
These are the similar questions in: - - {% for category in categories %} {% if category %} {{ category }} @@ -59,14 +57,14 @@ - + {{ question.category|truncatechars:12 }} - + {{ question.title|truncatechars:40 }} @@ -88,7 +86,7 @@ - + {{ question.user|truncatechars:10 }} diff --git a/static/website/templates/get-question.html b/static/website/templates/get-question.html index 388a8c6..e7b3fe7 100644 --- a/static/website/templates/get-question.html +++ b/static/website/templates/get-question.html @@ -161,14 +161,15 @@ {% endif %} -
-
+
+
{% for comment in answer.answercomment_set.all %}
{{ comment.body|safe }}
+
@@ -177,7 +178,7 @@ - + {{ comment.user }} diff --git a/static/website/templates/index.html b/static/website/templates/index.html index f78d952..5bcec04 100644 --- a/static/website/templates/index.html +++ b/static/website/templates/index.html @@ -74,7 +74,7 @@ {{ category.description }} - {% latest_question category %} + Ask new question @@ -130,7 +130,7 @@ - + {{ question.category|truncatechars:12 }} @@ -140,7 +140,7 @@ - + {{ question.title|truncatechars:40 }} @@ -162,7 +162,7 @@ - + {{ question.user|truncatechars:10 }} diff --git a/static/website/templates/questions.html b/static/website/templates/questions.html index b7c2a45..cbed87a 100644 --- a/static/website/templates/questions.html +++ b/static/website/templates/questions.html @@ -38,7 +38,7 @@ - + {{ question.category|truncatechars:12 }} @@ -49,7 +49,7 @@ - + {{ question.title|truncatechars:40 }} @@ -76,7 +76,7 @@ - + {{ question.user|truncatechars:10 }} -- cgit