[snowy] Show better message when you can't see another user's notes
- From: Sanford Armstrong <sharm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [snowy] Show better message when you can't see another user's notes
- Date: Sat, 15 May 2010 00:26:38 +0000 (UTC)
commit 50ce579141e91182a7232b84472db4154c93df34
Author: Sandy Armstrong <sanfordarmstrong gmail com>
Date: Fri May 14 17:24:08 2010 -0700
Show better message when you can't see another user's notes
https://bugzilla.gnome.org/show_bug.cgi?id=614816
notes/templates/notes/note_index.html | 11 +++++++++++
notes/views.py | 5 ++++-
2 files changed, 15 insertions(+), 1 deletions(-)
---
diff --git a/notes/templates/notes/note_index.html b/notes/templates/notes/note_index.html
index 741121f..bbe35b6 100644
--- a/notes/templates/notes/note_index.html
+++ b/notes/templates/notes/note_index.html
@@ -42,10 +42,21 @@
<table id="content-layout" cellspacing="0" cellpadding="0">
<tr>
<td id="note">
+ {% comment %}
+ Django 1.1 does not support == operator, so we can't do:
+ if author == request.user
+ {% endcomment %}
+ {% if author_is_user %}
<h1>{% trans "Notice" %}</h1>
<div id="funcooker">
{% trans "You haven't synced any notes with Snowy yet." %}
</div>
+ {% else %}
+ <h1>{% trans "Notice" %}</h1>
+ <div id="funcooker">
+ {% trans "This user is not sharing any notes with you." %}
+ </div>
+ {% endif %}
</td>
<td>
</td>
diff --git a/notes/views.py b/notes/views.py
index f2f0697..927f930 100644
--- a/notes/views.py
+++ b/notes/views.py
@@ -41,7 +41,10 @@ def note_index(request, username,
# TODO: Instruction page to tell user to either sync or create a new note
return render_to_response(template_name,
- {'author': author},
+ {'author': author,
+ # Django 1.1 does not support == operator, so
+ # we need to do the check here and pass it along
+ 'author_is_user': username==request.user.username},
context_instance=RequestContext(request))
def note_list(request, username,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]