summaryrefslogtreecommitdiffstats
path: root/extensions/Voting/template/en/default/hook/admin
diff options
context:
space:
mode:
authorMax Kanat-Alexander <mkanat@bugzilla.org>2010-02-16 00:22:55 +0100
committerMax Kanat-Alexander <mkanat@bugzilla.org>2010-02-16 00:22:55 +0100
commit120b63d507a3316666b25494bc890a024948aef8 (patch)
tree0a96e60d6316cc8471b066def8b1e1273f38e4ab /extensions/Voting/template/en/default/hook/admin
parent7802dbcf7bedcc09e5f1052ceb1ba82347a124b7 (diff)
downloadbugzilla-120b63d507a3316666b25494bc890a024948aef8.tar.gz
bugzilla-120b63d507a3316666b25494bc890a024948aef8.tar.xz
Bug 372979: Make voting into an extension
r=mkanat, a=mkanat, a=LpSolit
Diffstat (limited to 'extensions/Voting/template/en/default/hook/admin')
-rw-r--r--extensions/Voting/template/en/default/hook/admin/products/edit-common-rows.html.tmpl60
-rw-r--r--extensions/Voting/template/en/default/hook/admin/products/updated-changes.html.tmpl102
-rw-r--r--extensions/Voting/template/en/default/hook/admin/sanitycheck/messages-statuses.html.tmpl40
-rw-r--r--extensions/Voting/template/en/default/hook/admin/users/confirm-delete-warn_safe.html.tmpl38
4 files changed, 240 insertions, 0 deletions
diff --git a/extensions/Voting/template/en/default/hook/admin/products/edit-common-rows.html.tmpl b/extensions/Voting/template/en/default/hook/admin/products/edit-common-rows.html.tmpl
new file mode 100644
index 000000000..fbbda3ea0
--- /dev/null
+++ b/extensions/Voting/template/en/default/hook/admin/products/edit-common-rows.html.tmpl
@@ -0,0 +1,60 @@
+[%# The contents of this file are subject to the Mozilla Public
+ # License Version 1.1 (the "License"); you may not use this file
+ # except in compliance with the License. You may obtain a copy of
+ # the License at http://www.mozilla.org/MPL/
+ #
+ # Software distributed under the License is distributed on an "AS
+ # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ # implied. See the License for the specific language governing
+ # rights and limitations under the License.
+ #
+ # The Original Code is the Bugzilla Bug Tracking System.
+ #
+ # The Initial Developer of the Original Code is Everything Solved, Inc.
+ # Portions created by the Initial Developer are Copyright (C) 2010
+ # the Initial Developer. All Rights Reserved.
+ #
+ # Contributor(s):
+ # Max Kanat-Alexander <mkanat@bugzilla.org>
+ #%]
+
+[% DEFAULT
+ product.maxvotesperbug = constants.DEFAULT_VOTES_PER_BUG
+ product.votesperuser = 0
+ product.votestoconfirm = 0
+%]
+
+<tr>
+ <th align="right">Maximum votes per person:</th>
+ <td><input size="5" maxlength="5" name="votesperuser" id="votesperuser"
+ value="[% product.votesperuser FILTER html %]">
+ </td>
+</tr>
+
+<tr>
+ <th align="right">
+ Maximum votes a person can put on a single [% terms.bug %]:
+ </th>
+ <td><input size="5" maxlength="5" name="maxvotesperbug" id="maxvotesperbug"
+ value="[% product.maxvotesperbug FILTER html %]">
+ </td>
+</tr>
+
+<tr id="votes_to_confirm_container"
+ [%- ' class="bz_default_hidden"' IF !product.allows_unconfirmed %]>
+ <th align="right">
+ Confirm [% terms.abug %] if it gets this many votes:
+ </th>
+ <td>
+ <input size="3" maxlength="5" name="votestoconfirm" id="votestoconfirm"
+ value="[% product.votestoconfirm FILTER html %]">
+ <br>(Setting this to 0 disables auto-confirming [% terms.bugs %]
+ by vote.)
+ <script type="text/javascript">
+ YAHOO.util.Event.addListener('allows_unconfirmed', 'change',
+ function() { bz_toggleClass('votes_to_confirm_container',
+ 'bz_default_hidden'); });
+ </script>
+ </td>
+</tr>
+
diff --git a/extensions/Voting/template/en/default/hook/admin/products/updated-changes.html.tmpl b/extensions/Voting/template/en/default/hook/admin/products/updated-changes.html.tmpl
new file mode 100644
index 000000000..876c51187
--- /dev/null
+++ b/extensions/Voting/template/en/default/hook/admin/products/updated-changes.html.tmpl
@@ -0,0 +1,102 @@
+[%# The contents of this file are subject to the Mozilla Public
+ # License Version 1.1 (the "License"); you may not use this file
+ # except in compliance with the License. You may obtain a copy of
+ # the License at http://www.mozilla.org/MPL/
+ #
+ # Software distributed under the License is distributed on an "AS
+ # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ # implied. See the License for the specific language governing
+ # rights and limitations under the License.
+ #
+ # The Original Code is the Bugzilla Bug Tracking System.
+ #
+ # The Initial Developer of the Original Code is Everything Solved, Inc.
+ # Portions created by the Initial Developer are Copyright (C) 2010
+ # the Initial Developer. All Rights Reserved.
+ #
+ # Contributor(s):
+ # Max Kanat-Alexander <mkanat@bugzilla.org>
+ #%]
+
+[% SET checkvotes = 0 %]
+
+[% IF changes.votesperuser.defined %]
+ <p>
+ Updated votes per user from
+ [%+ changes.votesperuser.0 FILTER html %] to
+ [%+ product.votesperuser FILTER html %].
+ </p>
+ [% checkvotes = 1 %]
+[% END %]
+
+[% IF changes.maxvotesperbug.defined %]
+ <p>
+ Updated maximum votes per [% terms.bug %] from
+ [%+ changes.maxvotesperbug.0 FILTER html %] to
+ [%+ product.maxvotesperbug FILTER html %].
+ </p>
+ [% checkvotes = 1 %]
+[% END %]
+
+[% IF changes.votestoconfirm.defined %]
+ <p>
+ Updated number of votes needed to confirm a [% terms.bug %] from
+ [%+ changes.votestoconfirm.0 FILTER html %] to
+ [%+ product.votestoconfirm FILTER html %].
+ </p>
+ [% checkvotes = 1 %]
+[% END %]
+
+[%# Note that this display of changed votes and/or confirmed bugs is
+ not very scalable. We could have a _lot_, and we just list them all.
+ One day we should limit this perhaps, or have a more scalable display %]
+
+[% IF checkvotes %]
+ <hr>
+
+ <p>Checking existing votes in this product for anybody who now
+ has too many votes for [% terms.abug %]...<br>
+ [% IF changes.too_many_votes.size %]
+ [% FOREACH detail = changes.too_many_votes %]
+ &rarr;removed votes for [% terms.bug %] <a href="show_bug.cgi?id=
+ [%- detail.id FILTER url_quote %]">
+ [%- detail.id FILTER html %]</a> from [% detail.name FILTER html %]<br>
+ [% END %]
+ [% ELSE %]
+ &rarr;there were none.
+ [% END %]
+ </p>
+
+ <p>Checking existing votes in this product for anybody
+ who now has too many total votes...<br>
+ [% IF changes.too_many_total_votes.size %]
+ [% FOREACH detail = changes.too_many_total_votes %]
+ &rarr;removed votes for [% terms.bug %] <a href="show_bug.cgi?id=
+ [%- detail.id FILTER url_quote %]">
+ [%- detail.id FILTER html %]</a> from [% detail.name FILTER html %]<br>
+ [% END %]
+ [% ELSE %]
+ &rarr;there were none.
+ [% END %]
+ </p>
+
+ <p>Checking unconfirmed [% terms.bugs %] in this product for any which now have
+ sufficient votes...<br>
+ [% IF changes.confirmed_bugs.size %]
+ [% FOREACH id = changes.confirmed_bugs %]
+
+ [%# This is INCLUDED instead of PROCESSED to avoid variables getting
+ overwritten, which happens otherwise %]
+ [% INCLUDE bug/process/results.html.tmpl
+ type = 'votes'
+ mailrecipients = { 'changer' => user.login }
+ header_done = 1
+ id = id
+ %]
+ [% END %]
+ [% ELSE %]
+ &rarr;there were none.
+ [% END %]
+ </p>
+
+[% END %]
diff --git a/extensions/Voting/template/en/default/hook/admin/sanitycheck/messages-statuses.html.tmpl b/extensions/Voting/template/en/default/hook/admin/sanitycheck/messages-statuses.html.tmpl
new file mode 100644
index 000000000..afb81d34c
--- /dev/null
+++ b/extensions/Voting/template/en/default/hook/admin/sanitycheck/messages-statuses.html.tmpl
@@ -0,0 +1,40 @@
+[%# The contents of this file are subject to the Mozilla Public
+ # License Version 1.1 (the "License"); you may not use this file
+ # except in compliance with the License. You may obtain a copy of
+ # the License at http://www.mozilla.org/MPL/
+ #
+ # Software distributed under the License is distributed on an "AS
+ # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ # implied. See the License for the specific language governing
+ # rights and limitations under the License.
+ #
+ # The Original Code is the Bugzilla Bug Tracking System.
+ #
+ # The Initial Developer of the Original Code is Everything Solved, Inc.
+ # Portions created by the Initial Developer are Copyright (C) 2010
+ # the Initial Developer. All Rights Reserved.
+ #
+ # Contributor(s):
+ # Max Kanat-Alexander <mkanat@bugzilla.org>
+ #%]
+
+[% IF san_tag == "voting_cache_rebuild_fix" %]
+ <a href="sanitycheck.cgi?rebuild_vote_cache=1">Click here to
+ rebuild the vote cache</a>
+
+[% ELSIF san_tag == "voting_cache_alert" %]
+ Bad vote cache for [% PROCESS bug_link bug_id = id %]
+
+[% ELSIF san_tag == "voting_count_start" %]
+ Checking cached vote counts.
+
+[% ELSIF san_tag == "voting_count_alert" %]
+ Bad vote sum for [% terms.bug %] [%+ id FILTER html %].
+
+[% ELSIF san_tag == "voting_cache_rebuild_start" %]
+ OK, now rebuilding vote cache.
+
+[% ELSIF san_tag == "voting_cache_rebuild_end" %]
+ Vote cache has been rebuilt
+
+[% END %]
diff --git a/extensions/Voting/template/en/default/hook/admin/users/confirm-delete-warn_safe.html.tmpl b/extensions/Voting/template/en/default/hook/admin/users/confirm-delete-warn_safe.html.tmpl
new file mode 100644
index 000000000..f799f1254
--- /dev/null
+++ b/extensions/Voting/template/en/default/hook/admin/users/confirm-delete-warn_safe.html.tmpl
@@ -0,0 +1,38 @@
+[%# The contents of this file are subject to the Mozilla Public
+ # License Version 1.1 (the "License"); you may not use this file
+ # except in compliance with the License. You may obtain a copy of
+ # the License at http://www.mozilla.org/MPL/
+ #
+ # Software distributed under the License is distributed on an "AS
+ # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ # implied. See the License for the specific language governing
+ # rights and limitations under the License.
+ #
+ # The Original Code is the Bugzilla Bug Tracking System.
+ #
+ # The Initial Developer of the Original Code is Everything Solved, Inc.
+ # Portions created by the Initial Developer are Copyright (C) 2010
+ # the Initial Developer. All Rights Reserved.
+ #
+ # Contributor(s):
+ # Max Kanat-Alexander <mkanat@bugzilla.org>
+ #%]
+
+[% IF votes %]
+ <li>
+ [% otheruser.login FILTER html %] has voted on
+ [% IF votes == 1 %]
+ [%+ terms.abug %]
+ [% ELSE %]
+ [%+ votes %] [%+ terms.bugs %]
+ [% END %].
+
+ If you delete the user account,
+ [% IF votes == 1 %]
+ this vote
+ [% ELSE %]
+ these votes
+ [% END %]
+ will be deleted along with the user account.
+ </li>
+[% END %]