summaryrefslogtreecommitdiffstats
path: root/extensions/BugModal/template/en/default/bug_modal/common_header.html.tmpl
blob: ccc974a230e65dade6cfae0e8d557f39e71080f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
[%# 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;

  title = title

  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 tracking flags and needinfo extensions
  no_yui = 0;

  # add body classes for sec-groups, etc
  bodyclasses.push("bug_modal");

  # assets
  javascript_urls.push(
    "extensions/ProdCompSearch/web/js/prod_comp_search.js",
    "extensions/BugModal/web/common_bug_modal.js",
    "extensions/BugModal/web/comments.js",
    "js/bugzilla-readable-status-min.js",
    "js/field.js",
    "js/comments.js",
    "js/util.js"
  );
  jquery.push(
    "datetimepicker",
    "contextMenu",
    "visibility"
  );
  style_urls.unshift(
    "extensions/BugModal/web/common_bug_modal.css",
    "skins/custom/bug_groups.css",
    "js/jquery/plugins/datetimepicker/datetimepicker.css",
    "js/jquery/plugins/contextMenu/contextMenu.css"
  );
%]

[% javascript = BLOCK %]

  [%# expose useful data to js %]

  BUGZILLA.user = {
    id: [% user.id FILTER none %],
    login: '[% user.login FILTER js %]',
    is_insider: [% user.is_insider ? "true" : "false" %],
    is_timetracker: [% user.is_timetracker ? "true" : "false" %],
    can_tag: [% user.can_tag_comments ? "true" : "false" %],
    settings: {
      quote_replies: '[% user.settings.quote_replies.value FILTER js %]',
      zoom_textareas: [% user.settings.zoom_textareas.value == "on" ? "true" : "false" %],
      remember_collapsed: [% user.settings.ui_remember_collapsed.value == "on" ? "true" : "false" %]
    }
  };
[% END %]

[% Hook.process("end") %]