]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 918013: Add Bugzilla messaging system in quips page
authorSunil Joshi <joshi_sunil@in.com>
Sun, 22 Dec 2013 15:26:57 +0000 (16:26 +0100)
committerFrédéric Buclin <LpSolit@gmail.com>
Sun, 22 Dec 2013 15:26:57 +0000 (16:26 +0100)
r=LpSolit a=justdave

quips.cgi
template/en/default/global/messages.html.tmpl
template/en/default/list/quips.html.tmpl

index 6ded450918afbeffc39a8d09999b16c1cb6dc8c9..03fd49548d0b843c4fc6e0282bf59949360b3b4d 100755 (executable)
--- a/quips.cgi
+++ b/quips.cgi
@@ -75,6 +75,7 @@ if ($action eq "add") {
              undef, ($user->id, $comment, $approved));
 
     $vars->{'added_quip'} = $comment;
+    $vars->{'message'} = 'quips_added';
 }
 
 if ($action eq 'approve') {
@@ -115,6 +116,7 @@ if ($action eq 'approve') {
             join(",", @unapproved) . ")") if($#unapproved > -1);
     $vars->{ 'approved' }   = \@approved;
     $vars->{ 'unapproved' } = \@unapproved;
+    $vars->{'message'} = 'quips_approved_unapproved';
 }
 
 if ($action eq "delete") {
@@ -130,6 +132,7 @@ if ($action eq "delete") {
                                     "SELECT quip FROM quips WHERE quipid = ?",
                                     undef, $quipid);
     $dbh->do("DELETE FROM quips WHERE quipid = ?", undef, $quipid);
+    $vars->{'message'} = 'quips_deleted';
 }
 
 print $cgi->header();
index 59614c5a521223ccc083d5add54669759541f03d..b8e2c790698346f3cc55f020925d1260de5cd6d7 100644 (file)
     or you don't have access to it. The following is a list of the
     products you can choose from.
 
+  [% ELSIF message_tag == "quips_added" %]
+    Your quip <em>[% added_quip FILTER html %]</em> has been added.
+    [% IF Param("quip_list_entry_control") == "moderated" AND
+          !user.in_group('bz_quip_moderators') %]
+      It will be used as soon as it gets approved.
+    [% END %]
+
+  [% ELSIF message_tag == "quips_deleted" %]
+    The quip <em>[% deleted_quip FILTER html %]</em> has been deleted.
+
+  [% ELSIF message_tag == "quips_approved_unapproved" %]
+    [% IF approved.size == 1 %]
+      One quip
+    [% ELSE %]
+      [% approved.size %] quips
+    [% END %]
+    approved and
+    [% IF unapproved.size == 1 %]
+      one quip
+    [% ELSE %]
+      [%+ unapproved.size %] quips
+    [% END %]
+    unapproved.
+
   [% ELSIF message_tag == "report_created" %]
     OK, you have a new saved report named <em>[% reportname FILTER html %]</em>.
 
index 31e766a9b5a9251d7f31a9e6dd8e005f87f31a2d..99e376dae5ee7af89281c4cbbd5fea71638e0899 100644 (file)
            header = "Add your own clever headline"
  %]
 
-[% IF added_quip %]
-  <p>
-    <font color="red">
-      Your quip '<tt>[% added_quip FILTER html %]</tt>' has been added.
-      [% IF Param("quip_list_entry_control") == "moderated" AND !user.in_group('bz_quip_moderators') %]
-        It will be used as soon as it gets approved.
-      [% END %]
-    </font>
-  </p>
-[% END %]
-
-[% IF deleted_quip %]
-  <p>
-    <font color="red">
-      The quip '<tt>[% deleted_quip FILTER html %]</tt>' has been deleted.
-    </font>
-  </p>
-[% END %]
-
-[% IF approved or unapproved %]
-  <p>[% approved.size %] quips approved and [% unapproved.size %] quips unapproved</p>
-[% END %]
-
-
 <p>
   [% terms.Bugzilla %] will pick a random quip for the headline on each 
   [% terms.bug %] list.