diff --git a/webtools/bugzilla/editmilestones.cgi b/webtools/bugzilla/editmilestones.cgi index fa1117ede240..18c3f62aa06e 100755 --- a/webtools/bugzilla/editmilestones.cgi +++ b/webtools/bugzilla/editmilestones.cgi @@ -84,6 +84,7 @@ unless ($action) { $vars->{'product'} = $product->name; $vars->{'milestones'} = \@milestones; + $vars->{'default_milestone'} = $product->default_milestone; $template->process("admin/milestones/list.html.tmpl", $vars) || ThrowTemplateError($template->error()); diff --git a/webtools/bugzilla/template/en/default/admin/milestones/list.html.tmpl b/webtools/bugzilla/template/en/default/admin/milestones/list.html.tmpl index 160dcd6da77a..d36b61a3d9ab 100644 --- a/webtools/bugzilla/template/en/default/admin/milestones/list.html.tmpl +++ b/webtools/bugzilla/template/en/default/admin/milestones/list.html.tmpl @@ -54,24 +54,37 @@ name => "sortkey" heading => "Sortkey" }, + { + name => "action" + heading => "Action" + content => "Delete" + contentlink => delete_contentlink + } ] %] -[% columns.push({ - heading => "Action" - content => "Delete" - contentlink => delete_contentlink - }) %] +[%# We want to override the usual 'Delete' link for the default + milestone %] +[% overrides.action = [ { + match_value => "$default_milestone" + match_field => 'name' + override_content => 1 + content => "(Default milestone)" + override_contentlink => 1 + contentlink => undef + } ] +%] [% PROCESS admin/table.html.tmpl columns = columns data = milestones + overrides = overrides %]
[% PROCESS admin/milestones/footer.html.tmpl no_edit_other_milestones_link = 1 - %] +%] [% PROCESS global/footer.html.tmpl %] diff --git a/webtools/bugzilla/template/en/default/admin/table.html.tmpl b/webtools/bugzilla/template/en/default/admin/table.html.tmpl index ff554429a009..76ed601d6a77 100644 --- a/webtools/bugzilla/template/en/default/admin/table.html.tmpl +++ b/webtools/bugzilla/template/en/default/admin/table.html.tmpl @@ -50,6 +50,21 @@ # Each hash contains data for a single row of data. The # keys are column names from columns subhashes name field. # + # overrides: + # Provides a method for overriding individual table cells. This is + # a hash, whose key is the column name, so the column must be + # named for one of it's cells to be overwritten. The hash value is + # an array. Each item in this array is a hash specifying + # row-matching criteria, and any overridden values. The + # row-matching criteria consist of keys: + # match_field: The name of the row value we want to match + # match_value: The value to match against + # Each column value mentioned in the 'columns' documentation above + # can be overwritten (apart from name and heading). To override a + # table-cell value 'xxx', specify a new 'xxx' value, and specify a + # 'override_xxx' value as well. See + # admin/milestones/list.html.tmpl for example + # #%] [% PROCESS "global/field-descs.none.tmpl" %] @@ -70,12 +85,47 @@ [%################### TABLE CONTENT ######################%] [% FOREACH row = data %] +