From 377acf2d61b8618f7b1e85f2a81c367b33d83a78 Mon Sep 17 00:00:00 2001 From: Byron Jones Date: Mon, 13 Jul 2015 15:38:59 +0800 Subject: Bug 1180880: Make the "URL" field in the new UI more prominent --- .../en/default/bug_modal/activity_stream.html.tmpl | 6 ++-- .../template/en/default/bug_modal/edit.html.tmpl | 41 +++++++++++++++------- .../template/en/default/bug_modal/module.html.tmpl | 19 ++++++++-- 3 files changed, 47 insertions(+), 19 deletions(-) (limited to 'extensions/BugModal/template/en/default/bug_modal') diff --git a/extensions/BugModal/template/en/default/bug_modal/activity_stream.html.tmpl b/extensions/BugModal/template/en/default/bug_modal/activity_stream.html.tmpl index 7e4bc29d8..b752a47fe 100644 --- a/extensions/BugModal/template/en/default/bug_modal/activity_stream.html.tmpl +++ b/extensions/BugModal/template/en/default/bug_modal/activity_stream.html.tmpl @@ -306,10 +306,8 @@ CASE 'bug_file_loc'; %] [% value FILTER truncate(256, '…') FILTER html %] + class="bug-url" data-safe="[% is_safe_url(value) ? 1 : 0 %]" + >[% value FILTER truncate(40) FILTER html %] [% CASE 'see_also'; diff --git a/extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl b/extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl index 9cfbd6727..8a3652673 100644 --- a/extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl +++ b/extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl @@ -454,11 +454,15 @@ [% unassigned = (bug.assigned_to.login == "nobody@mozilla.org") || (bug.assigned_to.login.search('\.bugs$')); - sub = - "Reporter: " _ bug.reporter.moz_nick - _ (unassigned ? ", Unassigned" : ", Assigned: " _ bug.assigned_to.moz_nick) - _ (bug.mentors.size ? ", Mentored" : "") - _ (needinfo.size ? ", NeedInfo" : "") + sub = []; + sub.push("Reporter: " _ bug.reporter.moz_nick); + sub.push(unassigned ? "Unassigned" : "Assigned: " _ bug.assigned_to.moz_nick); + IF bug.mentors.size; + sub.push("Mentored"); + END; + IF needinfo.size; + sub.push("NeedInfo"); + END; %] [% WRAPPER bug_modal/module.html.tmpl title = "People" @@ -645,7 +649,7 @@ %] [% WRAPPER bug_modal/module.html.tmpl title = "Tracking" - subtitle = sub.join(", ") + subtitle = sub collapsed = col %] [% WRAPPER fields_lhs %] @@ -834,11 +838,15 @@ IF bug.cf_crash_signature != ""; sub.push("crash signature"); END; + IF bug.bug_file_loc != ""; + loc_html = INCLUDE bug_url_link link_text="URL"; + sub.push({ unfiltered => loc_html }); + END; %] [% WRAPPER bug_modal/module.html.tmpl title = "Details" collapsed = 1 - subtitle = sub.join(", ") + subtitle = sub %] [% WRAPPER fields_lhs %] @@ -897,10 +905,7 @@ field_type = constants.FIELD_TYPE_FREETEXT hide_on_view = bug.bug_file_loc == "" %] - [% bug.bug_file_loc FILTER truncate(40) FILTER html %] + [% INCLUDE bug_url_link %] [% END %] [%# see also %] @@ -984,7 +989,7 @@ %] [% WRAPPER bug_modal/module.html.tmpl title = "Attachments" - subtitle = sub.join(", ") + subtitle = sub collapsed = active_attachments == 0 %] [% INCLUDE bug_modal/attachments.html.tmpl @@ -1060,3 +1065,15 @@ [% BLOCK fields_rhs %]
[% content FILTER none %]
[% END %] + +[% BLOCK bug_url_link %] +[% + IF !link_text.defined; + link_text = bug.bug_file_loc FILTER truncate(40); + END; +%] + [% link_text FILTER html %] +[% END %] diff --git a/extensions/BugModal/template/en/default/bug_modal/module.html.tmpl b/extensions/BugModal/template/en/default/bug_modal/module.html.tmpl index 838069a58..a36747f97 100644 --- a/extensions/BugModal/template/en/default/bug_modal/module.html.tmpl +++ b/extensions/BugModal/template/en/default/bug_modal/module.html.tmpl @@ -9,7 +9,11 @@ [%# # title: (string, optional) main title of module # collapse: (boolean) if true, show as collapsed by default (default false) - # subtitle: (string, optional) sub-title + # subtitle: (optional) any of: + # a string + # an array of: (will be joined with ", ") + # string (will be filtered) + # { unfiltered: html } (will not be filtered) # content: (string, required) module's content (use WRAPPER module..) # hide_on_view: (boolean) if true, the module won't be visible in view mode # hide_on_edit: (boolean) if true, the module won't be visible in edit mode @@ -26,8 +30,17 @@
[% collapsed ? "▸" : "▾" %]
[% title FILTER html %]
- [% IF subtitle %] -
([% subtitle FILTER html %])
+ [% IF subtitle != "" && subtitle.size %] +
+ ([% FOREACH st IN subtitle.list %] + [% IF st.unfiltered.defined %] + [% st.unfiltered FILTER none %] + [% ELSE %] + [% st FILTER html %] + [% END %] + [% ", " UNLESS loop.last %] + [% END %]) +
[% END %]
-- cgit v1.2.3-24-g4f1b