polish up notice settings [finish #27014673]

pull/1/head
eric 2012-04-25 10:06:22 -04:00
parent ae1983be3d
commit 3709fa3ba8
3 changed files with 108 additions and 28 deletions

View File

@ -66,24 +66,24 @@ registration.signals.user_activated.connect(merge_emails)
# create notification types (using django-notification) -- tie to syncdb
def create_notice_types(app, created_models, verbosity, **kwargs):
notification.create_notice_type("comment_on_commented", _("Comment on Commented Work"), _("A comment has been received on a book that you've commented on"))
notification.create_notice_type("wishlist_comment", _("Wishlist Comment"), _("A comment has been received on one of your wishlist books"), default = 1)
notification.create_notice_type("wishlist_work_claimed", _("Rights Holder is Active"), _("A rights holder has shown up for a book that you want unglued"), default = 1)
notification.create_notice_type("wishlist_active", _("New Campaign"), _("A book you've wishlisted has a newly launched campaign"))
notification.create_notice_type("wishlist_near_target", _("Campaign Near Target"), _("A book you want is near its ungluing target"))
notification.create_notice_type("wishlist_near_deadline", _("Campaign Near Deadline"), _("A book you want is almost out of time"))
notification.create_notice_type("wishlist_premium_limited_supply", _("Only a Few Premiums Left"), _("Last chance for aan ungluing premium you might like"))
notification.create_notice_type("wishlist_successful", _("Successful Campaign"), _("An ungluing campaign that you have supported or followed has succeeded"))
notification.create_notice_type("wishlist_unsuccessful", _("Unsuccessful Campaign"), _("An ungluing campaign that you supported didn't succeed this time"))
notification.create_notice_type("wishlist_updated", _("Campaign Updated"), _("An ungluing campaign you support has been updated"), default = 1)
notification.create_notice_type("wishlist_message", _("Campaign Communication"), _("There's a message about an ungluing campaign you're interested in"))
notification.create_notice_type("wishlist_price_drop", _("Campaign Price Drop"), _("An ungluing campign yu're interested in has a price reduction"), default = 1)
notification.create_notice_type("comment_on_commented", _("Comment on Commented Work"), _("A comment has been received on a book that you've commented on."))
notification.create_notice_type("wishlist_comment", _("Wishlist Comment"), _("A comment has been received on one of your wishlist books."), default = 1)
notification.create_notice_type("wishlist_work_claimed", _("Rights Holder is Active"), _("A rights holder has shown up for a book that you want unglued."), default = 1)
notification.create_notice_type("wishlist_active", _("New Campaign"), _("A book you've wishlisted has a newly launched campaign."))
notification.create_notice_type("wishlist_near_target", _("Campaign Near Target"), _("A book you want is near its ungluing target."))
notification.create_notice_type("wishlist_near_deadline", _("Campaign Near Deadline"), _("A book you want is almost out of time."))
notification.create_notice_type("wishlist_premium_limited_supply", _("Only a Few Premiums Left"), _("You have a last chance for an ungluing premium you might like."))
notification.create_notice_type("wishlist_successful", _("Successful Campaign"), _("An ungluing campaign that you have supported or followed has succeeded."))
notification.create_notice_type("wishlist_unsuccessful", _("Unsuccessful Campaign"), _("An ungluing campaign that you supported didn't succeed this time."))
notification.create_notice_type("wishlist_updated", _("Campaign Updated"), _("An ungluing campaign you support has been updated."), default = 1)
notification.create_notice_type("wishlist_message", _("Campaign Communication"), _("There's a message about an ungluing campaign you're interested in."))
notification.create_notice_type("wishlist_price_drop", _("Campaign Price Drop"), _("An ungluing campign you're interested in has a reduced target."), default = 1)
notification.create_notice_type("wishlist_unglued_book_released", _("Unglued Book!"), _("Another book you wanted has been unglued!"))
notification.create_notice_type("pledge_you_have_pledged", _("Thanks For Your Pledge!"), _("Your ungluing pledge has been entered"))
notification.create_notice_type("pledge_status_change", _("Your Pledge Has Been Modified"), _("Your ungluing plegde has been modified"))
notification.create_notice_type("pledge_charged", _("Your Pledge has been Executed"), _("Thank you fro supporting a successful ungluing campaign"))
notification.create_notice_type("rights_holder_created", _("Agreement Accepted"), _("You are now a verified Ungue.it rights holder"))
notification.create_notice_type("rights_holder_claim_approved", _("Claim Accepted"), _("The claim you've entered has been accepted"))
notification.create_notice_type("pledge_you_have_pledged", _("Thanks For Your Pledge!"), _("Your ungluing pledge has been entered."))
notification.create_notice_type("pledge_status_change", _("Your Pledge Has Been Modified"), _("Your ungluing plegde has been modified."))
notification.create_notice_type("pledge_charged", _("Your Pledge has been Executed"), _("You have contributed to a successful ungluing campaign."))
notification.create_notice_type("rights_holder_created", _("Agreement Accepted"), _("You become a verified Ungue.it rights holder."))
notification.create_notice_type("rights_holder_claim_approved", _("Claim Accepted"), _("A claim you've entered has been accepted."))
signals.post_syncdb.connect(create_notice_types, sender=notification)

View File

@ -1,7 +1,7 @@
{% extends "notification/base.html" %}
{% load i18n %}
{% load truncatechars %}
{% block title %}{% trans "Notification Settings" %}{% endblock %}
{% block extra_css %}
@ -9,7 +9,7 @@
{% endblock %}
{% block doccontent %}
<h2>{% trans "Settings" %}</h2>
<h2>{% trans "Notification Settings" %}</h2>
<a href="{% url notification_notices %}">
<div class="notices_menu">
@ -19,19 +19,20 @@
<div class="comments"></div>
<div class="notice_settings">
<p>Which notifications would you like to receive via email?</p>
<form method="POST" action="">
{% csrf_token %}
<table class="notice_settings table table-striped">
<h3>Comment Notifications</h3>
<table class="notice_settings table table-striped" width="90%">
<tr>
<th>{% trans "Notification Type" %}</th>
<th>{% trans "Notify me when..." %}</th>
{% for header in notice_settings.column_headers %}
<th>{{ header }}</th>
{% endfor %}
</tr>
{% for row in notice_settings.rows %}
{% if row.notice_type.label|truncatechars:11 == 'comment_...' %}
<tr class="{% cycle 'row1' 'row2' %}">
<td>{% trans row.notice_type.display %}<br/>
<td>
<span class="notice_type_description">{% trans row.notice_type.description %}</span>
</td>
{% for cell in row.cells %}
@ -40,6 +41,85 @@
</td>
{% endfor %}
</tr>
{% endif %}
{% endfor %}
<tr>
<td colspan="2" id="last"><input type="submit" value="{% trans 'Change' %}"></input></td>
</tr>
</table>
<h3>Wishlist Notifications</h3>
<table class="notice_settings table table-striped" width="90%">
<tr>
<th>{% trans "Notify me when..." %}</th>
{% for header in notice_settings.column_headers %}
<th>{{ header }}</th>
{% endfor %}
</tr>
{% for row in notice_settings.rows %}
{% if row.notice_type.label|truncatechars:12 == 'wishlist_...' %}
<tr class="{% cycle 'row1' 'row2' %}">
<td>
<span class="notice_type_description">{% trans row.notice_type.description %}</span>
</td>
{% for cell in row.cells %}
<td>
<input type="checkbox" name="{{ cell.0 }}" {% if cell.1 %}checked="yes"{% endif %}/>
</td>
{% endfor %}
</tr>
{% endif %}
{% endfor %}
<tr>
<td colspan="2" id="last"><input type="submit" value="{% trans 'Change' %}"></input></td>
</tr>
</table>
<h3>Pledge Notifications</h3>
<table class="notice_settings table table-striped" width="90%">
<tr>
<th>{% trans "Notify me when..." %}</th>
{% for header in notice_settings.column_headers %}
<th>{{ header }}</th>
{% endfor %}
</tr>
{% for row in notice_settings.rows %}
{% if row.notice_type.label|truncatechars:10 == 'pledge_...' %}
<tr class="{% cycle 'row1' 'row2' %}">
<td>
<span class="notice_type_description">{% trans row.notice_type.description %}</span>
</td>
{% for cell in row.cells %}
<td>
<input type="checkbox" name="{{ cell.0 }}" {% if cell.1 %}checked="yes"{% endif %}/>
</td>
{% endfor %}
</tr>
{% endif %}
{% endfor %}
<tr>
<td colspan="2" id="last"><input type="submit" value="{% trans 'Change' %}"></input></td>
</tr>
</table>
<h3>Rights Holder Notifications</h3>
<table class="notice_settings table table-striped" width="90%">
<tr>
<th>{% trans "Notify me when..." %}</th>
{% for header in notice_settings.column_headers %}
<th>{{ header }}</th>
{% endfor %}
</tr>
{% for row in notice_settings.rows %}
{% if row.notice_type.label|truncatechars:10 == 'rights_...' %}
<tr class="{% cycle 'row1' 'row2' %}">
<td>
<span class="notice_type_description">{% trans row.notice_type.description %}</span>
</td>
{% for cell in row.cells %}
<td>
<input type="checkbox" name="{{ cell.0 }}" {% if cell.1 %}checked="yes"{% endif %}/>
</td>
{% endfor %}
</tr>
{% endif %}
{% endfor %}
<tr>
<td colspan="2" id="last"><input type="submit" value="{% trans 'Change' %}"></input></td>
@ -47,20 +127,20 @@
</table>
</form>
{% url acct_email as email_url %}
<h4>Your email</h4>
<h3>Your email</h3>
{% if user.email %}
<p>
{{ user.email }}<br />
</p>
<p>
({% blocktrans %}You can change this under <a href="{{ email_url }}">Account</a>.{% endblocktrans %})
({% blocktrans %}You can change this under <a href="{{ editurl }}">Account</a>.{% endblocktrans %})
</p>
{% else %}
<div class="errorlist">
{% blocktrans %}
You do not have a verified email address to which notices can be sent.
You can add one by going to <a href="{{ email_url }}">Account</a>.
You can add one by going to <a href="{{ editurl }}">Account</a>.
{% endblocktrans %}
</div>
{% endif %}

View File

@ -39,7 +39,7 @@
{% endif %}
{% endfor %}
{% else %}
<p>{% trans "No notices." %}</p>
<p>{% trans "You have no unseen notices." %}</p>
{% endif %}
{% endblock %}