notification-center.tt 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. [% USE Whostmgr -%]
  2. [% WRAPPER 'master_templates/master.tmpl'
  3. app_key = 'Notification Center'
  4. header = 'Notification Center'
  5. icon = '/addon_plugins/nfcenter.png'
  6. breadcrumburl = '/cgi/addon_notification-center.cgi'
  7. skipbreadcrumb = 0
  8. theme = "bootstrap"
  9. show_upgrade_message = 1
  10. stylesheets = ['/cjt/css/ajaxapp-min.css',
  11. '/templates/common/revised_notices.min.css',
  12. '/templates/packages/common.min.css',
  13. '/styles/unified_optimized.css',
  14. ]
  15. extrastyle = ''
  16. include_legacy_stylesheets = 1
  17. -%]
  18. [% PROCESS '_pkg_hover.tmpl' -%]
  19. [% PROCESS '_ajaxapp_header.tmpl' -%]
  20. <style>
  21. </style>
  22. <table class="table table-striped responsive-table" border="1" cellspacing="0" cellpadding="2" >
  23. <thead>
  24. <tr>
  25. <td>[% locale.maketext('Notification') %]</td>
  26. <td>[% locale.maketext('Time Occurred') %]</td>
  27. <td>[% locale.maketext('Show/Hide') %]</td>
  28. </tr>
  29. </thead>
  30. <tbody>
  31. [% FOREACH notification IN data.notifications.keys.sort %]
  32. <tr>
  33. <td>[% data.notifications.$notification.subject %]</td>
  34. <td class="timestamp">[% notification %]</td>
  35. <td><a class="button" href="javascript:toggleContentDisplay('[% notification %]')">Show/Hide</a></td>
  36. </tr>
  37. <tr style="display:none" id="[% notification %]">
  38. <td colspan=3 style="background-color: white !important;">
  39. <div style="margin: 0 auto; width: 700px">
  40. [% data.notifications.$notification.html %]
  41. </div>
  42. </td>
  43. </tr>
  44. [% END %]
  45. </tbody>
  46. </table>
  47. <script type="text/javascript">
  48. //Localize all the timestamps on the page
  49. window.onload = function () {
  50. var timestamps = document.querySelectorAll('.timestamp');
  51. for (var i=0; i < timestamps.length; i++) {
  52. var timestamp = timestamps[i];
  53. var t = new Date(0)
  54. t.setUTCSeconds(timestamp);
  55. timestamps[i].innerText = t.toLocaleDateString() + " " + t.toLocaleTimeString();
  56. }
  57. };
  58. function toggleContentDisplay(id) {
  59. var dstatus = document.getElementById(id).style.display;
  60. var newstatus = dstatus === '' ? 'none' : ''
  61. document.getElementById(id).style.display = newstatus;
  62. }
  63. </script>
  64. [% PROCESS '_ajaxapp_footer.tmpl' -%]
  65. [% END #wrapper -%]