From 8d9c748a5e694fb544c082128c9756a0ca702334 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Buclin?= Date: Wed, 2 Aug 2017 12:59:20 +0200 Subject: Implement inline history --- .../hook/bug/comments-a_comment-end.html.tmpl | 76 ++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 extensions/Mageia/template/en/default/hook/bug/comments-a_comment-end.html.tmpl (limited to 'extensions/Mageia/template/en/default/hook/bug/comments-a_comment-end.html.tmpl') diff --git a/extensions/Mageia/template/en/default/hook/bug/comments-a_comment-end.html.tmpl b/extensions/Mageia/template/en/default/hook/bug/comments-a_comment-end.html.tmpl new file mode 100644 index 000000000..cbe11b4ca --- /dev/null +++ b/extensions/Mageia/template/en/default/hook/bug/comments-a_comment-end.html.tmpl @@ -0,0 +1,76 @@ +[%# This Source Code Form is subject to the terms of the Mozilla Public + # License, v. 2.0. If a copy of the MPL was not distributed with this + # file, You can obtain one at http://mozilla.org/MPL/2.0/. + # + # This Source Code Form is "Incompatible With Secondary Licenses", as + # defined by the Mozilla Public License, v. 2.0. + #%] + +[% RETURN IF user.setting('mga_inline_history') == 'off' %] + +[% FOREACH activity = comment.inline_history %] + [% IF activity.after %] + +
+
+ + [%# No need to recreate the exact same template if we already have it. %] + [% who_id = activity.who.id %] + [% UNLESS user_cache.$who_id %] + [% user_cache.$who_id = BLOCK %] + [% INCLUDE global/user.html.tmpl who = activity.who %] + [% END %] + [% END %] + [% user_cache.$who_id FILTER none %] + + + + [% FOREACH group = activity.who.groups_with_icon %] + [% group.name FILTER html %] + [% END %] + + + + [%+ activity.when FILTER time %] + +
+ [% ELSE %] +
+ [% END %] + +

+ [% FOREACH change = activity.changes %] + [% IF change.attachid AND field_descs.${change.fieldname}.match('^Attachment') %] + + [% field_descs.${change.fieldname}.replace('^Attachment', "Attachment ${change.attachid}") FILTER none %]: + [% ELSIF activity.comment_id AND field_descs.${change.fieldname}.match('^Comment') %] + [% comment_num = change.comment.count %] + + [% field_descs.${change.fieldname}.replace('^Comment', "Comment $comment_num") FILTER none %]: + [% ELSE %] + [% field_descs.${change.fieldname} FILTER html %]: + [% END %] + [% PROCESS format_field_value value = change.removed %] => + [% PROCESS format_field_value value = change.added %]
+ [% END %] +

+[% END %] + +[% BLOCK format_field_value %] + [% IF value.length %] + [% IF change.fieldname == 'assigned_to' || + change.fieldname == 'reporter' || + change.fieldname == 'qa_contact' || + change.fieldname == 'cc' || + change.fieldname == 'flagtypes.name' %] + [% display_value(change.fieldname, value) FILTER email FILTER html %] + [% ELSE %] + [% display_value(change.fieldname, value) FILTER html FILTER html_line_break %] + [% END %] + [% ELSE %] + (none) + [% END %] +[% END %] -- cgit v1.2.1