From 516f867d87315b4a0ac553db843cb212f50a4658 Mon Sep 17 00:00:00 2001 From: Andromeda Yelton Date: Tue, 23 Apr 2013 10:07:59 -0400 Subject: [PATCH 1/4] removing word 'official' --- core/signals.py | 2 +- .../templates/notification/wishlist_official_comment/full.txt | 2 +- .../notification/wishlist_official_comment/notice.html | 2 +- .../templates/notification/wishlist_official_comment/short.txt | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/signals.py b/core/signals.py index ea28b99d..c701f09a 100644 --- a/core/signals.py +++ b/core/signals.py @@ -83,7 +83,7 @@ registration.signals.user_activated.connect(handle_same_email_account) 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_official_comment", _("Wishlist Comment"), _("An official comment has been received on one of your wishlist books.")) + notification.create_notice_type("wishlist_official_comment", _("Wishlist Comment"), _("A campaign manager or Unglue.it staffer has left a comment on one of your wishlist books.")) 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.")) diff --git a/frontend/templates/notification/wishlist_official_comment/full.txt b/frontend/templates/notification/wishlist_official_comment/full.txt index 98c87745..b7b9f929 100644 --- a/frontend/templates/notification/wishlist_official_comment/full.txt +++ b/frontend/templates/notification/wishlist_official_comment/full.txt @@ -1,4 +1,4 @@ -{{ comment.user.username }} has official news about a book on your wishlist, {{ comment.content_object.title }}. +{{ comment.user.username }}, a campaign manager for {{ comment.content_object.title }} (a book on your Unglue.it wishlist), has made a comment: {{ comment.comment }} diff --git a/frontend/templates/notification/wishlist_official_comment/notice.html b/frontend/templates/notification/wishlist_official_comment/notice.html index 619a3b71..b857f3c1 100644 --- a/frontend/templates/notification/wishlist_official_comment/notice.html +++ b/frontend/templates/notification/wishlist_official_comment/notice.html @@ -5,7 +5,7 @@ {% endblock %} {% block comments_graphical %} - {{ comment.user.username }} has made an official comment on {{ comment.content_object.title }} + {{ comment.user.username }}, a campaign manager for{{ comment.content_object.title }}, has commented on the campaign. {% endblock %} {% block comments_textual %} diff --git a/frontend/templates/notification/wishlist_official_comment/short.txt b/frontend/templates/notification/wishlist_official_comment/short.txt index 03aced47..be170efd 100644 --- a/frontend/templates/notification/wishlist_official_comment/short.txt +++ b/frontend/templates/notification/wishlist_official_comment/short.txt @@ -1 +1 @@ -{{ comment.user.username }} has made an official comment on {{ comment.content_object.title }} at Unglue.it \ No newline at end of file +Campaign manager {{ comment.user.username }} has commented on {{ comment.content_object.title }} at Unglue.it \ No newline at end of file From 80ee4771980c036085b09b2d306d7a92f41e6650 Mon Sep 17 00:00:00 2001 From: Andromeda Yelton Date: Tue, 23 Apr 2013 10:22:08 -0400 Subject: [PATCH 2/4] disambiguate staff and RH --- core/signals.py | 7 +++++-- .../notification/wishlist_official_comment/full.txt | 6 +++++- .../notification/wishlist_official_comment/notice.html | 6 +++++- .../notification/wishlist_official_comment/short.txt | 2 +- 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/core/signals.py b/core/signals.py index c701f09a..dea86d8b 100644 --- a/core/signals.py +++ b/core/signals.py @@ -83,7 +83,7 @@ registration.signals.user_activated.connect(handle_same_email_account) 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_official_comment", _("Wishlist Comment"), _("A campaign manager or Unglue.it staffer has left a comment on one of your wishlist books.")) + notification.create_notice_type("wishlist_official_comment", _("Wishlist Comment"), _("The author or publisher, or and Unglue.it staffer, has commented on one of your wishlist books.")) 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.")) @@ -119,7 +119,10 @@ def notify_comment(comment, request, **kwargs): domain = Site.objects.get_current().domain if comment.content_object.last_campaign() and comment.user in comment.content_object.last_campaign().managers.all(): #official - notification.queue(all_wishers, "wishlist_official_comment", {'comment':comment, 'domain':domain}, True) + if comment.user.is_staff: + notification.queue(all_wishers, "wishlist_official_comment", {'comment':comment, 'domain':domain, 'staff':True}, True) + else: + notification.queue(all_wishers, "wishlist_official_comment", {'comment':comment, 'domain':domain, 'staff':False}, True) else: notification.send(other_commenters, "comment_on_commented", {'comment':comment}, True, sender=comment.user) notification.send(other_wishers, "wishlist_comment", {'comment':comment}, True, sender=comment.user) diff --git a/frontend/templates/notification/wishlist_official_comment/full.txt b/frontend/templates/notification/wishlist_official_comment/full.txt index b7b9f929..f7a0fad5 100644 --- a/frontend/templates/notification/wishlist_official_comment/full.txt +++ b/frontend/templates/notification/wishlist_official_comment/full.txt @@ -1,4 +1,8 @@ -{{ comment.user.username }}, a campaign manager for {{ comment.content_object.title }} (a book on your Unglue.it wishlist), has made a comment: +{% if staff %} +Unglue.it staffer {{ comment.user.username }} has made a comment on {{ comment.content_object.title }} (a book on your Unglue.it wishlist): +{% else %} +{{ comment.user.username }}, the author or publisher of {{ comment.content_object.title }} (a book on your Unglue.it wishlist), has made a comment: +{% endif %} {{ comment.comment }} diff --git a/frontend/templates/notification/wishlist_official_comment/notice.html b/frontend/templates/notification/wishlist_official_comment/notice.html index b857f3c1..86978691 100644 --- a/frontend/templates/notification/wishlist_official_comment/notice.html +++ b/frontend/templates/notification/wishlist_official_comment/notice.html @@ -5,7 +5,11 @@ {% endblock %} {% block comments_graphical %} - {{ comment.user.username }}, a campaign manager for{{ comment.content_object.title }}, has commented on the campaign. + {% if staff %} + Unglue.it staffer {{ comment.user.username }} has commented on {{ comment.content_object.title }}. + {% else %} + {{ comment.user.username }}, the author or publisher of {{ comment.content_object.title }}, has commented on the campaign. + {% endif %} {% endblock %} {% block comments_textual %} diff --git a/frontend/templates/notification/wishlist_official_comment/short.txt b/frontend/templates/notification/wishlist_official_comment/short.txt index be170efd..b9781f71 100644 --- a/frontend/templates/notification/wishlist_official_comment/short.txt +++ b/frontend/templates/notification/wishlist_official_comment/short.txt @@ -1 +1 @@ -Campaign manager {{ comment.user.username }} has commented on {{ comment.content_object.title }} at Unglue.it \ No newline at end of file +News from {{ comment.user.username }} about {{ comment.content_object.title }} \ No newline at end of file From 51dddd9353270648a85aedc72138f8d602bf2f14 Mon Sep 17 00:00:00 2001 From: Andromeda Yelton Date: Wed, 24 Apr 2013 10:38:07 -0400 Subject: [PATCH 3/4] just stashing marc records somewhere commonly accessible. can build infrastructure later. --- .../marc/81834/oral_literature_in_africa.mrk | 23 +++++++++++++++++++ .../marc/81834/oral_literature_in_africa.xml | 5 ++++ 2 files changed, 28 insertions(+) create mode 100755 static/marc/81834/oral_literature_in_africa.mrk create mode 100755 static/marc/81834/oral_literature_in_africa.xml diff --git a/static/marc/81834/oral_literature_in_africa.mrk b/static/marc/81834/oral_literature_in_africa.mrk new file mode 100755 index 00000000..eeddd897 --- /dev/null +++ b/static/marc/81834/oral_literature_in_africa.mrk @@ -0,0 +1,23 @@ +=LDR 01021cam 2200301 a 4500 +=006 m\\\\\\\\u\\\\\\\\ +=007 cr mnu--- +=008 \\\\\\s2012\\\\enkb\\\\\b\\\\000\0\eng\\ +=020 \\$a9781906924720$a9781906924737$a9781906924744 +=043 \\$af------ +=082 00$a398.2/096$220 +=090 00$aPL8010$b.F5 2012 +=100 1\$aFinnegan, Ruth H. +=245 10$aOral literature in Africa $h[electronic resource] /$cRuth Finnegan. +=260 \\$aCambridge :$bOpenBook Publishers, $cc2012. +=300 \\$a1 online resource (xliii, 570 p.) :$bill. (some col.), col. map +=490 0\$aWorld Oral Literature Series, $x2050-7933 ;$vv.1 +=500 \\$a "This unglued edition is freely available to download from our website and distributed under the terms of the Creative Commons CC-BY license"--p. [572] +=588 \\$aDescription based on online resource; title from ePub ed. t.p. (viewed Sept. 9, 2012) +=504 \\$aIncludes index and bibliographical references (p.511-546). +=650 \0$aFolk literature, African$xHistory and criticism. +=650 \0$aOral tradition$zAfrica. +=776 08$IPrint version: $aFinnegan, Ruth H.$tOral literature in Africa$z9781906924713$z9781906924706 + + + + diff --git a/static/marc/81834/oral_literature_in_africa.xml b/static/marc/81834/oral_literature_in_africa.xml new file mode 100755 index 00000000..f269a68a --- /dev/null +++ b/static/marc/81834/oral_literature_in_africa.xml @@ -0,0 +1,5 @@ + +01161cam a2200241 a 4500 +m u +cr mnu--- s2012 enkb b 000 0 eng 978190692472097819069247379781906924744f------398.2/09620PL8010.F5 2012Finnegan, Ruth H.Oral literature in Africa [electronic resource] /Ruth Finnegan.Cambridge :OpenBook Publishers, c2012.1 online resource (xliii, 570 p.) :ill. (some col.), col. mapWorld Oral Literature Series, 2050-7933 ;v.1 "This unglued edition is freely available to download from our website and distributed under the terms of the Creative Commons CC-BY license"--p. [572]Description based on online resource; title from ePub ed. t.p. (viewed Sept. 9, 2012)Includes index and bibliographical references (p.511-546).Folk literature, AfricanHistory and criticism.Oral traditionAfrica.Print version: Finnegan, Ruth H.Oral literature in Africa97819069247139781906924706 + From aca759447d3de614d8e868190e6653d657b21387 Mon Sep 17 00:00:00 2001 From: Andromeda Yelton Date: Wed, 24 Apr 2013 11:28:05 -0400 Subject: [PATCH 4/4] test for staffness in template --- core/signals.py | 5 +---- .../notification/wishlist_official_comment/full.txt | 2 +- .../notification/wishlist_official_comment/notice.html | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/core/signals.py b/core/signals.py index dea86d8b..52f5b097 100644 --- a/core/signals.py +++ b/core/signals.py @@ -119,10 +119,7 @@ def notify_comment(comment, request, **kwargs): domain = Site.objects.get_current().domain if comment.content_object.last_campaign() and comment.user in comment.content_object.last_campaign().managers.all(): #official - if comment.user.is_staff: - notification.queue(all_wishers, "wishlist_official_comment", {'comment':comment, 'domain':domain, 'staff':True}, True) - else: - notification.queue(all_wishers, "wishlist_official_comment", {'comment':comment, 'domain':domain, 'staff':False}, True) + notification.queue(all_wishers, "wishlist_official_comment", {'comment':comment, 'domain':domain}, True) else: notification.send(other_commenters, "comment_on_commented", {'comment':comment}, True, sender=comment.user) notification.send(other_wishers, "wishlist_comment", {'comment':comment}, True, sender=comment.user) diff --git a/frontend/templates/notification/wishlist_official_comment/full.txt b/frontend/templates/notification/wishlist_official_comment/full.txt index f7a0fad5..029dc6a7 100644 --- a/frontend/templates/notification/wishlist_official_comment/full.txt +++ b/frontend/templates/notification/wishlist_official_comment/full.txt @@ -1,4 +1,4 @@ -{% if staff %} +{% if comment.user.is_staff %} Unglue.it staffer {{ comment.user.username }} has made a comment on {{ comment.content_object.title }} (a book on your Unglue.it wishlist): {% else %} {{ comment.user.username }}, the author or publisher of {{ comment.content_object.title }} (a book on your Unglue.it wishlist), has made a comment: diff --git a/frontend/templates/notification/wishlist_official_comment/notice.html b/frontend/templates/notification/wishlist_official_comment/notice.html index 86978691..bd984654 100644 --- a/frontend/templates/notification/wishlist_official_comment/notice.html +++ b/frontend/templates/notification/wishlist_official_comment/notice.html @@ -5,7 +5,7 @@ {% endblock %} {% block comments_graphical %} - {% if staff %} + {% if comment.user.is_staff %} Unglue.it staffer {{ comment.user.username }} has commented on {{ comment.content_object.title }}. {% else %} {{ comment.user.username }}, the author or publisher of {{ comment.content_object.title }}, has commented on the campaign.