From 3ac701266452d3509776fe58f9e1b2b8e9f33c1e Mon Sep 17 00:00:00 2001 From: Byron Jones Date: Tue, 24 Mar 2015 13:45:44 +0800 Subject: Bug 1096798: prototype modal show_bug view --- .../template/en/default/bug_modal/header.html.tmpl | 100 +++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 extensions/BugModal/template/en/default/bug_modal/header.html.tmpl (limited to 'extensions/BugModal/template/en/default/bug_modal/header.html.tmpl') diff --git a/extensions/BugModal/template/en/default/bug_modal/header.html.tmpl b/extensions/BugModal/template/en/default/bug_modal/header.html.tmpl new file mode 100644 index 000000000..c6dd8b74c --- /dev/null +++ b/extensions/BugModal/template/en/default/bug_modal/header.html.tmpl @@ -0,0 +1,100 @@ +[%# 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. + #%] + +[% + PROCESS global/variables.none.tmpl; + + # + IF bugs.defined; + bug = bugs.0; + END; + title = "$bug.bug_id - "; + IF bug.alias; + title = title _ "($bug.alias) "; + END; + unfiltered_title = title _ bug.short_desc; + filtered_desc = bug.short_desc FILTER html; + title = title _ filtered_desc; + + generate_api_token = 1; + + # these aren't always defined + UNLESS bodyclasses.defined; + bodyclasses = []; + END; + UNLESS javascript_urls.defined; + javascript_urls = []; + END; + UNLESS style_urls.defined; + style_urls = []; + END; + UNLESS jquery.defined; + jquery = []; + END; + + # right now we need yui for the user fields + no_yui = 0; + yui = ['autocomplete']; + + # add body classes for sec-groups, etc + FOREACH group IN bug.groups_in; + bodyclasses.push("bz_group_$group.name"); + END; + bodyclasses.push("bug_modal"); + + # assets + javascript_urls.push( + "extensions/BugModal/web/bug_modal.js", + "extensions/BugModal/web/ZeroClipboard/ZeroClipboard.min.js", + "js/field.js", + "js/comments.js", + ); + jquery.push( + "datetimepicker", + ); + style_urls.push( + "extensions/BugModal/web/bug_modal.css", + "skins/custom/bug_groups.css", + "js/jquery/plugins/datetimepicker/datetimepicker.css", + ); + + IF user.in_group('canconfirm'); + style_urls.push('extensions/TagNewUsers/web/style.css'); + END; +%] + +[% javascript = BLOCK %] + [%# add tracking flags json if available %] + [% IF tracking_flags %] + [% javascript_urls.push("extensions/TrackingFlags/web/js/tracking_flags.js") %] + TrackingFlags = [% tracking_flags_json FILTER none %]; + [% END %] + + [%# update last-visited %] + [% IF user.id && user.is_involved_in_bug(bug) %] + $(function() { + bugzilla_ajax({ + url: 'rest/bug_user_last_visit/[% bug.id FILTER none %]', + type: 'POST' + }); + }); + [% END %] + + [%# expose useful data to js %] + BUGZILLA.bug_id = [% bug.id FILTER none %]; + BUGZILLA.bug_title = '[% unfiltered_title FILTER js %]'; + BUGZILLA.user = { + id: [% user.id FILTER none %], + login: '[% user.login FILTER js %]', + is_insider: [% user.is_insider ? "true" : "false" %], + settings: { + quote_replies: '[% user.settings.quote_replies.value FILTER js %]', + zoom_textareas: [% user.settings.zoom_textareas.value == "on" ? "true" : "false" %] + } + }; +[% END %] -- cgit v1.2.3-24-g4f1b