Merge github.com:Gluejar/regluit

pull/1/head
Andromeda Yelton 2012-03-29 08:54:59 -04:00
commit 28d3836175
15 changed files with 62 additions and 10 deletions

View File

@ -65,6 +65,7 @@ from notification import models as notification
def create_notice_types(app, created_models, verbosity, **kwargs):
notification.create_notice_type("wishlist_comment", _("Wishlist Comment"), _("a comment has been received on one of your wishlist books"))
notification.create_notice_type("coment_on_commented", _("Comment on Commented Work"), _("a comment has been received on a book that you've commented on"))
signals.post_syncdb.connect(create_notice_types, sender=notification)
@ -72,7 +73,10 @@ signals.post_syncdb.connect(create_notice_types, sender=notification)
from django.contrib.comments.signals import comment_was_posted
def notify_comment(comment, request, **kwargs):
notification.send(comment.content_object.wished_by(), "wishlist_comment", {'comment':comment}, True)
other_commenters = User.objects.filter(comment_comments__content_type=comment.content_type, comment_comments__object_pk=comment.object_pk).distinct().exclude(id=comment.user.id)
other_wishers = comment.content_object.wished_by().exclude(id=comment.user.id).exclude(id__in=other_commenters)
notification.send(other_commenters, "coment_on_commented", {'comment':comment}, True)
notification.send(other_wishers, "wishlist_comment", {'comment':comment}, True)
comment_was_posted.connect(notify_comment)

View File

@ -18,6 +18,7 @@
<div class="js-main">
<div id="js-leftcol">
{% include "faqmenu.html" %}
{% block subnav %}{% endblock %}
</div>
<div id="js-maincol-fr" class="have-right doc">
<div class="js-maincol-inner">

View File

@ -63,7 +63,7 @@ comments rss?
<div class="image">
<a href="{% url work id %}?tab=2"><img src="{{ comment.content_object.cover_image_thumbnail }}" alt="cover image" /></a>
</div>
<span><a href="{% url supporter supporter_username=user %}">{{ comment.name }}</a> on <a href="{% url work id %}?tab=2">{{ comment.content_object.title }}</a></span><br />
<span><a href="{% url supporter supporter_username=user %}">{{ comment.user.username }}</a> on <a href="{% url work id %}?tab=2">{{ comment.content_object.title }}</a></span><br />
<span class="text">{{ comment.comment|linebreaksbr }}</span>
</div>

View File

@ -0,0 +1,14 @@
{% extends "basedocumentation.html" %}
{% load i18n %}
{% block title %}Notices{% endblock %}
{% block subnav %}
<ul class="nav nav-list">
<li class="nav-header">{% trans "Notices" %}</li>
<li><a href="{% url notification_notices %}">{% trans "Notices" %}</a></li>
<li><a href="{% url notification_notice_settings %}">{% trans "Settings" %}</a></li>
</ul>
{% endblock %}

View File

@ -0,0 +1,5 @@
{{ comment.user.username }} on {{ comment.content_object.title }}
{{ comment.comment }}

View File

@ -0,0 +1,24 @@
{% with comment.content_object.id as id %}
{% with comment.user as user %}
<div class="comments {% cycle 'row1' 'row2' %}">
<div class="nonavatar">
<div class="image">
<a href="{% url work id %}?tab=2"><img src="{{ comment.content_object.cover_image_thumbnail }}" alt="cover image" /></a>
</div>
<span><a href="{% url supporter supporter_username=user %}">{{ user.username }}</a> on <a href="{% url work id %}?tab=2">{{ comment.content_object.title }}</a></span><br />
<span class="text">{{ comment.comment|linebreaksbr }}</span>
</div>
<div class="avatar">
<a href="{% url supporter supporter_username=user %}">
{% if supporter.profile.pic_url %}
<img class="user-avatar" src="{{ comment.user.profile.pic_url }}" height="50" width="50" alt="Picture of {{ comment.user }}" title="{{ comment.user }}" />
{% else %}
<img class="user-avatar" src="/static/images/header/avatar.png" height="50" width="50" alt="Generic Ungluer Avatar" title="Ungluer" />
{% endif %}
</a>
</div>
</div>
{% endwith %}
{% endwith %}

View File

@ -0,0 +1,5 @@
{{ comment.user.username }} on {{ comment.content_object.title }}
{{ comment.comment }}

View File

@ -0,0 +1 @@
{{ comment.user.username }} has commented on {{ comment.content_object.title }}

View File

@ -1,4 +1,4 @@
{% extends "basedocumentation.html" %}
{% extends "notification/base.html" %}
{% load i18n %}

View File

@ -1,4 +1,4 @@
{% extends "basedocumentation.html" %}
{% extends "notification/base.html" %}
{% load i18n %}

View File

@ -1,4 +1,4 @@
{{ comment.name }} on {{ comment.content_object.title }}
{{ comment.user.username }} on {{ comment.content_object.title }}
{{ comment.comment }}

View File

@ -5,7 +5,7 @@
<div class="image">
<a href="{% url work id %}?tab=2"><img src="{{ comment.content_object.cover_image_thumbnail }}" alt="cover image" /></a>
</div>
<span><a href="{% url supporter supporter_username=user %}">{{ comment.name }}</a> on <a href="{% url work id %}?tab=2">{{ comment.content_object.title }}</a></span><br />
<span><a href="{% url supporter supporter_username=user %}">{{ comment.user.username }}</a> on <a href="{% url work id %}?tab=2">{{ comment.content_object.title }}</a></span><br />
<span class="text">{{ comment.comment|linebreaksbr }}</span>
</div>

View File

@ -1,4 +1,4 @@
{{ comment.name }} on {{ comment.content_object.title }}
{{ comment.user.username }} on {{ comment.content_object.title }}
{{ comment.comment }}

View File

@ -248,7 +248,7 @@ $j(document).ready(function(){
<p> This work has been claimed by:</p>
<ul>
{% for claim in work.claim.all %}
<li>{{ claim.rights_holder.rights_holder_name }} </li>
<li>{{ claim.rights_holder.rights_holder_name }} <i>{{ claim.get_status_display}}</i></li>
{% endfor %}
</ul>
{% if request.user.rights_holder.all.count %}

View File

@ -223,5 +223,3 @@ IS_PREVIEW = True
JQUERY_HOME = "/static/js/jquery-1.7.1.min.js"
JQUERY_UI_HOME = "/static/js/jquery-ui-1.8.16.custom.min.js"
# a django-notification setting for whether to queue notifications or send_now (False)
NOTIFICATION_QUEUE_ALL = True