mark: A photo of Mark kneeling on top of the Taal Volcano in the Philippines. It was a long hike. (Default)
Mark Smith ([staff profile] mark) wrote in [site community profile] changelog2010-05-02 06:08 am

[dw-free] Greyed-out notifications should have an "upgrade to use these" notice

[commit: http://hg.dwscoalition.org/dw-free/rev/52c4c616c2b6]

http://bugs.dwscoalition.org/show_bug.cgi?id=840

Add a notice on the notification management page that says why some
notifications are unavailable.

Patch by [personal profile] ninetydegrees.

Files modified:
  • bin/upgrading/en.dat
  • cgi-bin/weblib.pl
--------------------------------------------------------------------------------
diff -r be1ddf76b147 -r 52c4c616c2b6 bin/upgrading/en.dat
--- a/bin/upgrading/en.dat	Sun May 02 05:48:26 2010 +0000
+++ b/bin/upgrading/en.dat	Sun May 02 06:08:31 2010 +0000
@@ -3476,6 +3476,8 @@ subscribe_interface.special_subs.note=Th
 
 subscribe_interface.subs.total=You are using [[active]] out of [[max_active]] active subscriptions.
 
+subscribe_interface.unavailable_subs.note=These notification options are only available to certain account types.
+
 success=Success
 
 taglib.error.access=You are not allowed to tag entries in this journal.
diff -r be1ddf76b147 -r 52c4c616c2b6 cgi-bin/weblib.pl
--- a/cgi-bin/weblib.pl	Sun May 02 05:48:26 2010 +0000
+++ b/cgi-bin/weblib.pl	Sun May 02 06:08:31 2010 +0000
@@ -3318,8 +3318,10 @@ sub subscribe_interface {
 
         # inbox method
         my $special_subs = 0;
+        my $unavailable_subs = 0;
         my $sub_count = 0;
         foreach my $pending_sub (@pending_subscriptions) {
+            my $upgrade_notice = ( !$u->is_paid && $pending_sub->disabled($u) ) ? " †" : "";
             if (!ref $pending_sub) {
                 next if $u->is_identity && $pending_sub->disabled($u);
 
@@ -3330,7 +3332,9 @@ sub subscribe_interface {
                 $sub_title = LJ::Hooks::run_hook("disabled_esn_sub", $u) . $sub_title if $pending_sub->disabled($u);
 
                 $cat_html .= "<tr class='$disabled_class $altrow_class'>";
-                $cat_html .= "<td>" . $pending_sub->htmlcontrol($u) . "$sub_title*</td>";
+                $cat_html .= "<td>" . $pending_sub->htmlcontrol($u) . "$sub_title*";
+                $cat_html .= "$upgrade_notice";
+                $cat_html .= "</td>";
                 $cat_html .= "<td>&nbsp;</td>";
                 foreach my $notify_class (@notify_classes) {
                     if ($notify_class eq "LJ::NotificationMethod::Email") {
@@ -3354,7 +3358,8 @@ sub subscribe_interface {
             my $subscribed = ! $pending_sub->pending;
 
             unless ($pending_sub->enabled) {
-                $title = LJ::Hooks::run_hook("disabled_esn_sub", $u) . $title;
+                $title = LJ::Hooks::run_hook("disabled_esn_sub", $u) . $title . $upgrade_notice;
+                $unavailable_subs++;
             }
             next if ! $pending_sub->event_class->is_visible && $showtracking;
 
@@ -3531,6 +3536,9 @@ sub subscribe_interface {
 
         $cat_html .= "</tr>";
         $cat_html .= "<tr><td colspan='$cols' style='font-size: smaller;'>* " . LJ::Lang::ml( 'subscribe_interface.special_subs.note', { sitenameabbrev => $LJ::SITENAMEABBREV } ) . "</td></tr>" if $special_subs;
+        $cat_html .= "<tr><td colspan='$cols' style='font-size: smaller;'>&dagger; " .
+                     LJ::Lang::ml('subscribe_interface.unavailable_subs.note') . "</td></tr>"
+            if !$u->is_paid && ( $special_subs || $unavailable_subs );
         $cat_html .= "</div>";
         $events_table .= $cat_html unless ($is_tracking_category && !$showtracking);
 
--------------------------------------------------------------------------------