summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorashwinishinde2015-03-30 11:15:28 +0530
committerashwinishinde2015-03-30 11:15:28 +0530
commitb36782ec5fed77fd3f185c699f2d8adff980d01e (patch)
tree07cc62d3ea1e1b5349b08a33d03e1885155a2fda
parenta331b65a550e70424f0b799b1c90be0b0c688e85 (diff)
downloadFOSSEE-Forum-b36782ec5fed77fd3f185c699f2d8adff980d01e.tar.gz
FOSSEE-Forum-b36782ec5fed77fd3f185c699f2d8adff980d01e.tar.bz2
FOSSEE-Forum-b36782ec5fed77fd3f185c699f2d8adff980d01e.zip
Subject: Display Notifications on Header for Answer's
and Comment's .. Red color Description: 1) notification for answers and comments.
-rw-r--r--forums/settings.py2
-rw-r--r--forums/views.py9
-rw-r--r--static/website/templates/base.html30
-rw-r--r--website/views.py5
4 files changed, 29 insertions, 17 deletions
diff --git a/forums/settings.py b/forums/settings.py
index 63ec9c5..b556319 100644
--- a/forums/settings.py
+++ b/forums/settings.py
@@ -68,7 +68,7 @@ MEDIA_URL = ''
# Don't put anything in this directory yourself; store your static files
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
# Example: "/var/www/example.com/static/"
-STATIC_ROOT = ''
+STATIC_ROOT = '/static/'
# URL prefix for static files.
# Example: "http://example.com/static/", "http://static.example.com/"
diff --git a/forums/views.py b/forums/views.py
index 3e82a90..e757ab9 100644
--- a/forums/views.py
+++ b/forums/views.py
@@ -57,7 +57,7 @@ def account_register(request):
def send_registration_confirmation(user):
p = Profile.objects.get(user=user)
- #user.email = "k.sanmugam2@gmail.com"
+ user.email = "ashwinids03@gmail.com"
# Sending email when an answer is posted
subject = 'Account Active Notification'
message = """Dear {0},
@@ -65,7 +65,7 @@ def send_registration_confirmation(user):
{2}
Regards,
Admin
- Spoken Tutorials
+ FOSSEE forum
IIT Bombay.
""".format(
user.username,
@@ -73,15 +73,16 @@ def send_registration_confirmation(user):
"http://spoken-tutorial.org/accounts/confirm/" + str(p.confirmation_code) + "/" + user.username
)
email = EmailMultiAlternatives(
- subject, message, 'administrator@spoken-tutorial.org',
+ subject, message, 'sysads@fossee.in',
to = [user.email], bcc = [], cc = [],
headers={'Reply-To': 'no-replay@spoken-tutorial.org', "Content-type":"text/html;charset=iso-8859-1"}
)
- #email.attach_alternative(message, "text/html")
+ email.attach_alternative(message, "text/html")
try:
result = email.send(fail_silently=False)
except:
pass
+
def user_login(request):
if request.user.is_anonymous():
diff --git a/static/website/templates/base.html b/static/website/templates/base.html
index a2f2534..b174d69 100644
--- a/static/website/templates/base.html
+++ b/static/website/templates/base.html
@@ -56,27 +56,33 @@
</a>
</li>
{% if user.is_authenticated %}
- <li class="dropdown">
- <a href="#" class="dropdown-toggle" data-toggle="dropdown">
- <span class="glyphicon glyphicon-user"></span>
- {{ user }}<b class="caret"></b>
- </a>
- <ul class="dropdown-menu">
- <li><a href="{% url 'website:user_questions' user.id %}">My Questions</a></li>
- <li><a href="{% url 'website:user_answers' user.id %}">My Answers</a></li>
- <li>
+ <li>
<a href="{% url 'website:user_notifications' user.id %}">
Notifications
- <span class="badge" style="background:#a26dc8; color:#ffffff;">
+ <span class="badge" style="background:#ec0b16; color:#ffffff;">
{% load notify %}
{% notification_count user.id %}
</span>
</a>
- </li>
+ </li>
+
+ <li class="dropdown">
+ <a href="#" class="dropdown-toggle" data-toggle="dropdown">
+ <span class="glyphicon glyphicon-user"></span>
+ {{ user }}<b class="caret"></b>
+ </a>
+ <ul class="dropdown-menu">
+ <li><a href="{% url 'website:user_questions' user.id %}">My Questions
+
+ </a></li>
+ <li><a href="{% url 'website:user_answers' user.id %}">My Answers
+
+ </a></li>
+
<li class="divider"></li>
<li><a href="{% url 'user_logout' %}">Logout</a></li>
</ul>
- </li> <!-- /li.dropdown -->
+ </li>
{% else %}
<li>
<a href="{% url 'user_login' %}">
diff --git a/website/views.py b/website/views.py
index 5d1b1c1..3009a6a 100644
--- a/website/views.py
+++ b/website/views.py
@@ -24,6 +24,7 @@ admins = (
9, 4376, 4915, 14595, 12329, 22467, 5518, 30705
)
categories = FossCategory.objects.order_by('name')
+
def home(request):
questions = Question.objects.all().order_by('date_created').reverse()[:10]
context = {
@@ -305,6 +306,8 @@ def user_questions(request, user_id):
'total': total,
'marker': marker
}
+ print "total"
+ print total
return render(request, 'website/templates/user-questions.html', context)
return HttpResponse("go away")
@@ -323,6 +326,8 @@ def user_answers(request, user_id):
'total': total,
'marker': marker
}
+ print "anwer_total"
+ print total
return render(request, 'website/templates/user-answers.html', context)
return HttpResponse("go away")