aboutsummaryrefslogtreecommitdiffstats
path: root/templates/web/fixmybarangay/header.html
diff options
context:
space:
mode:
Diffstat (limited to 'templates/web/fixmybarangay/header.html')
-rw-r--r--templates/web/fixmybarangay/header.html26
1 files changed, 14 insertions, 12 deletions
diff --git a/templates/web/fixmybarangay/header.html b/templates/web/fixmybarangay/header.html
index 55cf47789..e60e46ab2 100644
--- a/templates/web/fixmybarangay/header.html
+++ b/templates/web/fixmybarangay/header.html
@@ -23,20 +23,22 @@
[% INCLUDE 'common_header_tags.html', js_override = '/cobrands/fixmystreet/fixmystreet.js' %]
<script src="[% version('/js/fancybox/jquery.fancybox-1.3.4.pack.js') %]" charset="utf-8"></script>
- <script src="[% version('/cobrands/fixmybarangay/message_manager_client.js') %]" charset="utf-8"></script>
[% allow_creation = !c.cobrand.only_authed_can_create || (c.user && c.user.from_council); %]
- [%IF allow_creation && problem.service %]
- <script>
- $(document).ready(function() {
- var mm_msg_id ="[% problem.service %]".match(/\d+$/);
- var fms_id = "[% problem.id %]";
- if (mm_msg_id && fms_id) {
- message_manager.config({url_root: "[% c.config.MESSAGE_MANAGER_URL %]"});
- message_manager.assign_fms_id(mm_msg_id, fms_id);
- }
- });
- </script>
+ [% IF allow_creation %]
+ <script src="[% version('/cobrands/fixmybarangay/message_manager_client.js') %]" charset="utf-8"></script>
+ [% IF c.req.params.mm_msg_id && problem && problem.mm_msg_id.match('^\d+$') %]
+ <script>
+ $(document).ready(function() {
+ var mm_msg_id ="[% c.req.params.mm_msg_id %]";
+ var fms_id = "[% problem.id %]";
+ if (mm_msg_id && fms_id) {
+ message_manager.config({url_root: "[% c.config.MESSAGE_MANAGER_URL %]"});
+ message_manager.assign_fms_id(mm_msg_id, fms_id);
+ }
+ });
+ </script>
+ [% END %]
[% END %]
</head>
<body class="[% bodyclass | html IF bodyclass %]">