aboutsummaryrefslogtreecommitdiffstats
path: root/template/en/default/account
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2007-07-21 15:59:23 +0000
committerlpsolit%gmail.com <>2007-07-21 15:59:23 +0000
commit1879703e14d3e19803997e5f5e746d25c78faf71 (patch)
tree91188ed12d93ee3dbbab3b3dd2842acf125b014a /template/en/default/account
parent1b984c1173997419539b419e68ce893fc0dee4ee (diff)
downloadbugs-1879703e14d3e19803997e5f5e746d25c78faf71.tar
bugs-1879703e14d3e19803997e5f5e746d25c78faf71.tar.gz
bugs-1879703e14d3e19803997e5f5e746d25c78faf71.tar.bz2
bugs-1879703e14d3e19803997e5f5e746d25c78faf71.tar.xz
bugs-1879703e14d3e19803997e5f5e746d25c78faf71.zip
Bug 365890: Searches shared by users with bless rights are in the footer by default, with no warning - Patch by Teemu Mannermaa <wicked@sci.fi> r/a=LpSolit
Diffstat (limited to 'template/en/default/account')
-rw-r--r--template/en/default/account/prefs/prefs.html.tmpl1
-rw-r--r--template/en/default/account/prefs/saved-searches.html.tmpl33
2 files changed, 33 insertions, 1 deletions
diff --git a/template/en/default/account/prefs/prefs.html.tmpl b/template/en/default/account/prefs/prefs.html.tmpl
index da1b489e8..eada10557 100644
--- a/template/en/default/account/prefs/prefs.html.tmpl
+++ b/template/en/default/account/prefs/prefs.html.tmpl
@@ -41,6 +41,7 @@
title = "User Preferences"
subheader = filtered_login
style_urls = ['skins/standard/admin.css']
+ javascript_urls = ['js/util.js']
%]
[% tabs = [{ name => "settings", label => "General Preferences",
diff --git a/template/en/default/account/prefs/saved-searches.html.tmpl b/template/en/default/account/prefs/saved-searches.html.tmpl
index 2e5c8eac6..173933d00 100644
--- a/template/en/default/account/prefs/saved-searches.html.tmpl
+++ b/template/en/default/account/prefs/saved-searches.html.tmpl
@@ -22,8 +22,25 @@
[%# INTERFACE:
# queryshare_groups: list of groups the user may share queries with
# (id, name).
+ # bless_group_ids: list of group ids the user may bless.
#%]
+[% IF user.can_bless %]
+ <script type="text/javascript"><!--
+ function update_checkbox(group) {
+ var bless_groups = [[% bless_group_ids.join(",") FILTER js %]];
+ var checkbox = document.getElementById(group.name.replace(/share_(\d+)/, "force_$1"));
+
+ if (bz_isValueInArray(bless_groups, group.value)) {
+ checkbox.disabled = false;
+ } else {
+ checkbox.disabled = true;
+ checkbox.checked = false;
+ }
+ } //-->
+ </script>
+[% END %]
+
<p>Your saved searches are as follows:</p>
<blockquote>
@@ -103,7 +120,8 @@
</td>
[% IF may_share %]
<td>
- <select name="share_[% q.id FILTER html %]">
+ <select name="share_[% q.id FILTER html %]"
+ [% IF user.can_bless %] onchange="update_checkbox(this);"[% END %]>
<option value="">Don't share</option>
[% FOREACH group = queryshare_groups %]
<option value="[% group.id %]"
@@ -112,6 +130,14 @@
>[% group.name FILTER html %]</option>
[% END %]
</select>
+ [% IF user.can_bless %]
+ <input type="checkbox" id="force_[% q.id FILTER html %]"
+ name="force_[% q.id FILTER html %]" value="1"
+ [% " disabled"
+ IF !bless_group_ids.grep("^$q.shared_with_group.id\$").0
+ %]>
+ <label for="force_[% q.id FILTER html %]">Add to footer</label>
+ [% END %]
[% IF q.shared_with_users %]
(shared with [% q.shared_with_users FILTER html %]
[%+ q.shared_with_users > 1 ? "users" : "user" %])
@@ -121,6 +147,11 @@
</tr>
[% END %]
</table>
+[% IF user.can_bless %]
+ <p>Note that for every search that has the "Add to footer" selected, a
+ link to the shared search is added to the footer of every user that is
+ a direct member of the group at the time you click Submit Changes.</p>
+[% END %]
</blockquote>
<p>You may use these searches saved and shared by others:</p>