summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorankitjavalkar2015-01-21 11:02:04 +0530
committerankitjavalkar2015-01-21 11:57:22 +0530
commit2c5a9183484c9becec86ffab311e22ad52fb6a4c (patch)
tree9fa04488eb1f262d615a6154a5283bc770068b72
parentab5eb7840ba1db8f68a512d3c4dfde711b28c8b4 (diff)
downloadPython-TBC-Interface-2c5a9183484c9becec86ffab311e22ad52fb6a4c.tar.gz
Python-TBC-Interface-2c5a9183484c9becec86ffab311e22ad52fb6a4c.tar.bz2
Python-TBC-Interface-2c5a9183484c9becec86ffab311e22ad52fb6a4c.zip
Pending Proposal notification - fix minor bugs, tooltip formatting
-rwxr-xr-xtbc/templates/base.html25
-rwxr-xr-xtbc/views.py12
2 files changed, 28 insertions, 9 deletions
diff --git a/tbc/templates/base.html b/tbc/templates/base.html
index f4ab7f1..62b2da4 100755
--- a/tbc/templates/base.html
+++ b/tbc/templates/base.html
@@ -69,6 +69,27 @@
-moz-border-radius: 9px;
border-radius: 15px;
}
+/* .tooltip-custom {
+ max-width: 150px;
+ width: auto;
+ background-color: #1ABC9C;
+ }*/
+
+ /* .tooltip-custom .tooltip-inner {
+ background-color: #1ABC9C;
+ }
+ .tooltip-custom .tooltip-arrow {
+ border-top-color: #1ABC9C;
+ }*/
+
+ .tooltip-inner {
+ background-color: #1ABC9C;
+ width: 150px;
+ }
+
+ .tooltip.bottom .tooltip-arrow {
+ border-bottom: 5px solid #1ABC9C;
+ }
</style>
{% block css %}
@@ -114,7 +135,7 @@
{% if user %}
{% if proposal_position %}
<li class="dropdown">
- <a href="#" class="dropdown-toggle" data-toggle="dropdown">{{ user.first_name }}<span class="badge-custom" rel="tooltip" title="Pending proposal Position: {{ proposal_position }}" data-placement="bottom" style="margin-left:5px; margin-right:5px; display: inline-block">{{ proposal_position }}</span>
+ <a href="#" class="dropdown-toggle" data-toggle="dropdown">{{ user.first_name }}<span class="badge-custom" rel="tooltip" title="Pending Proposal Position: {{ proposal_position }}" data-placement="bottom" style="margin-left:5px; margin-right:5px; display: inline-block">{{ proposal_position }}</span>
<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="{% url 'tbc:SubmitBook' %}">Submit Book (OLD)</a></li>
@@ -215,7 +236,7 @@
<center>
<div class="alert" style="width:650px;height:40px;">
<a class="close" data-dismiss="alert" href="#">&times;</a>
- <p>Thank you for showing interest in contributing to Python TBC. <br>We have recevied your proposal. Please be patient we will get back to you within few days.</p>
+ <p>Thank you for showing interest in contributing to Python TBC. <br>We have received your proposal. Please be patient we will get back to you within few days.</p>
</div>
</center>
<div class="clearfix"></div>
diff --git a/tbc/views.py b/tbc/views.py
index 6b3e31a..3d981f2 100755
--- a/tbc/views.py
+++ b/tbc/views.py
@@ -128,18 +128,16 @@ def Home(request):
book_images.append(obj)
context['items'] = book_images
- #Check if user is logged in, Fetch user's pending proposal ID
+ #Check if user is logged in and fetch user's pending proposal ID
if context.get('user'):
curr_user = request.user
proposal_pos = 0
- user_profile = Profile.objects.get(user=curr_user.id)
- pending_proposal = list(Proposal.objects.filter(status="pending"))
+ user_profile = Profile.objects.filter(user=curr_user)
user_proposal = Proposal.objects.filter(user=user_profile)
- user_proposal_pending = user_proposal.filter(status="pending")[0]
- if user_proposal_pending in pending_proposal:
- proposal_position = user_proposal_pending.id
- context['proposal_position'] = proposal_position
+ user_proposal_pending = user_proposal.filter(status="pending")
+ if user_proposal_pending:
+ context['proposal_position'] = user_proposal_pending[0].id
return render_to_response('base.html', context)