From 775362d8fb630da4fbb1e3f75c45183fd0a28667 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Buclin?= Date: Tue, 1 Aug 2017 16:37:44 +0200 Subject: Backport upstream bug 69267: Add the ability to deactivate keywords --- template/en/default/admin/keywords/edit.html.tmpl | 11 +++- template/en/default/admin/keywords/list.html.tmpl | 56 +++++++++-------- template/en/default/bug/create/create.html.tmpl | 2 +- template/en/default/bug/edit.html.tmpl | 2 +- template/en/default/global/user-error.html.tmpl | 2 +- template/en/default/reports/keywords.html.tmpl | 73 ++++++++++++++++------- 6 files changed, 94 insertions(+), 52 deletions(-) (limited to 'template/en/default') diff --git a/template/en/default/admin/keywords/edit.html.tmpl b/template/en/default/admin/keywords/edit.html.tmpl index 23158d36f..7e6617a84 100644 --- a/template/en/default/admin/keywords/edit.html.tmpl +++ b/template/en/default/admin/keywords/edit.html.tmpl @@ -18,14 +18,19 @@
- - - + + + + + [% INCLUDE bug/field.html.tmpl bug = default, field = bug_fields.keywords, editable = 1, - value = keywords, possible_values = all_keywords, + value = keywords, possible_values = active_keywords, desc_url = "describekeywords.cgi", value_span = 3 %] diff --git a/template/en/default/bug/edit.html.tmpl b/template/en/default/bug/edit.html.tmpl index 1e10d38e8..e269d438d 100644 --- a/template/en/default/bug/edit.html.tmpl +++ b/template/en/default/bug/edit.html.tmpl @@ -549,7 +549,7 @@ [% INCLUDE bug/field.html.tmpl bug = bug, field = bug_fields.keywords, value = bug.keywords editable = bug.check_can_change_field("keywords", 0, 1), - desc_url = "describekeywords.cgi", possible_values = all_keywords + desc_url = "describekeywords.cgi", possible_values = active_keywords %] [% END %] diff --git a/template/en/default/global/user-error.html.tmpl b/template/en/default/global/user-error.html.tmpl index 69afaf46a..dcf4fc789 100644 --- a/template/en/default/global/user-error.html.tmpl +++ b/template/en/default/global/user-error.html.tmpl @@ -1433,7 +1433,7 @@ Either you mis-typed the name or that user has not yet registered for a [% terms.Bugzilla %] account. [% ELSIF class == "Bugzilla::Keyword" %] - See the list of available keywords. + See the list of available keywords. [% END %] [% ELSIF error == "old_password_incorrect" %] diff --git a/template/en/default/reports/keywords.html.tmpl b/template/en/default/reports/keywords.html.tmpl index 598979d33..6e7ad0c50 100644 --- a/template/en/default/reports/keywords.html.tmpl +++ b/template/en/default/reports/keywords.html.tmpl @@ -18,36 +18,67 @@ title = "$terms.Bugzilla Keyword Descriptions" style_urls = ['skins/standard/admin.css'] %] +[% cgi = Bugzilla.cgi %] +[% show_inactive_keywords = cgi.param("show_inactive_keywords") %] -
Name: +
Description:
[% INCLUDE global/textarea.html.tmpl + id = 'description' name = 'description' minrows = 4 cols = 64 diff --git a/template/en/default/admin/keywords/list.html.tmpl b/template/en/default/admin/keywords/list.html.tmpl index c3f4a5292..9d920036e 100644 --- a/template/en/default/admin/keywords/list.html.tmpl +++ b/template/en/default/admin/keywords/list.html.tmpl @@ -10,6 +10,7 @@ # keywords: array keyword objects having the properties: # - id: number. The ID of the keyword. # - name: string. The name of the keyword. + # - is_active: boolean. true if the keyword can be used. # - description: string. The description of the keyword. # - bug_count: number. The number of bugs with the keyword. #%] @@ -20,34 +21,39 @@ %] [% columns = [ - { - name => "name" - heading => "Edit keyword..." - contentlink => "editkeywords.cgi?action=edit&id=%%id%%" - }, - { - name => "description" - heading => "Description" - allow_html_content => 1 - }, - { - name => "bug_count" - heading => "$terms.Bugs" - class => "right" - contentlink => "buglist.cgi?keywords=%%name%%" - }, - { - heading => "Action" - content => "Delete" - contentlink => "editkeywords.cgi?action=del&id=%%id%%" - } - ] + { + name => "name" + heading => "Edit keyword..." + contentlink => "editkeywords.cgi?action=edit&id=%%id%%" + }, + { + name => "description" + heading => "Description" + allow_html_content => 1 + }, + { + name => "is_active", + heading => "Active", + yesno_field => 1 + }, + { + name => "bug_count" + heading => "$terms.Bugs" + class => "right" + contentlink => "buglist.cgi?keywords=%%name%%" + }, + { + heading => "Action" + content => "Delete" + contentlink => "editkeywords.cgi?action=del&id=%%id%%" + } +] %] [% PROCESS admin/table.html.tmpl - columns = columns - data = keywords - footer = footer_row + columns = columns + data = keywords + footer = footer_row %]

Add a new keyword

diff --git a/template/en/default/bug/create/create.html.tmpl b/template/en/default/bug/create/create.html.tmpl index 61faf1c1a..d76c082cc 100644 --- a/template/en/default/bug/create/create.html.tmpl +++ b/template/en/default/bug/create/create.html.tmpl @@ -537,7 +537,7 @@ TUI_hide_default('attachment_text_field');
+ + +

+ [% show_inactive_keywords ? "Show" : "Hide" FILTER html %] inactive keywords +

+ +
+ [% FOREACH keyword = keywords %] - - - - - - + + + + + + + [% END %]
Name DescriptionActive Open [% terms.Bugs %] Total [% terms.Bugs %]
[% keyword.name FILTER html %][% keyword.description FILTER html_light %] - [% IF keyword.bug_count > 0 %] - - Search - [% ELSE %] - none - [% END %] - - [% IF keyword.bug_count > 0 %] - - [% keyword.bug_count %] - [% ELSE %] - none - [% END %] -
[% keyword.name FILTER html %][% keyword.description FILTER html_light %][% keyword.is_active ? "Yes" : "No" FILTER html %] + [% IF keyword.bug_count > 0 %] + + Search + [% ELSE %] + none + [% END %] + + [% IF keyword.bug_count > 0 %] + + [% keyword.bug_count %] + [% ELSE %] + none + [% END %] +
-- cgit v1.2.1