# HG changeset patch
# User reno
# Date 1258988865 -3600
# Node ID bc4b7b630f6a69fb9989208dcf96bd5f75e766ef
# Parent 089bd48ac50e8ea28969818f244c6bec72f29249
fix notifications
diff -r 089bd48ac50e -r bc4b7b630f6a .hgignore
--- a/.hgignore Mon Nov 23 15:31:03 2009 +0100
+++ b/.hgignore Mon Nov 23 16:07:45 2009 +0100
@@ -1,5 +1,7 @@
syntax: regexp
+^downloads$
+syntax: regexp
^settings_local\.py$
syntax: regexp
^urls_local\.py$
@@ -10,4 +12,8 @@
syntax: regexp
^eggs$
syntax: regexp
-^src/comt\.egg-info$
\ No newline at end of file
+^src/comt\.egg-info$
+syntax: regexp
+^parts$
+syntax: regexp
+^\.installed\.cfg$
diff -r 089bd48ac50e -r bc4b7b630f6a src/cm/templates/site/text_notifications.html
--- a/src/cm/templates/site/text_notifications.html Mon Nov 23 15:31:03 2009 +0100
+++ b/src/cm/templates/site/text_notifications.html Mon Nov 23 16:07:45 2009 +0100
@@ -70,20 +70,17 @@
-->
-
{% blocktrans %}Embed the text{% endblocktrans %}
+{% blocktrans %}Embed text{% endblocktrans %}
+{% blocktrans %}Copy this code into your site to display text with comments. Users will also be able to add comments from your site depending an anonymous users' roles.{% endblocktrans %}
(?)
-
-{% blocktrans %}Copy this code into your site to display text with comments. Users will also be able to add comments from your site depending an anonymous users' roles.{% endblocktrans %}
-
{% if not anonymous_can_view_text %}
{% url text-share text.key as text_users_link %}
-{% blocktrans %}Warning:{% endblocktrans %}{% blocktrans %}You won't be able to successfully embed the text before you give anonymous users a role allowing them to view the text{% endblocktrans %}
+{% blocktrans %}Warning:{% endblocktrans %}{% blocktrans %}You won't successfully embed the text before you give anonymous users a role allowing them to view the text{% endblocktrans %}
{% endif %}
diff -r 089bd48ac50e -r bc4b7b630f6a src/cm/views/notifications.py
--- a/src/cm/views/notifications.py Mon Nov 23 15:31:03 2009 +0100
+++ b/src/cm/views/notifications.py Mon Nov 23 16:07:45 2009 +0100
@@ -13,7 +13,6 @@
from django.template.loader import render_to_string
from django.utils import feedgenerator
from django.utils.translation import ugettext as _
-from cm.security import user_has_perm # import here!
import re
import time
@@ -72,12 +71,14 @@
text = get_text_by_keys_or_404(key)
user = request.user if request.user.is_authenticated() else None
- anonymous_can_view_text = False
- anonymous_user_role = UserRole.objects.get(user=None, text=text)
- if anonymous_user_role :
- anonymous_can_view_text = user_has_perm(anonymous_user_role.user, 'can_view_text', text=text)
+ from cm.security import user_has_perm # import here!
+ anonymous_can_view_text = user_has_perm(None, 'can_view_text', text=text)
own_check = Notification.objects.filter(text=text,type='own',user=user).count()
all_check = Notification.objects.filter(text=text,type=None,user=user).count()
+
+
+ embed_code = '