PageRenderTime 51ms CodeModel.GetById 21ms RepoModel.GetById 1ms app.codeStats 0ms

/indico/MaKaC/webinterface/tpls/ConfModifCollaborationProtection.tpl

https://github.com/davidmorrison/indico
Smarty Template | 92 lines | 84 code | 8 blank | 0 comment | 13 complexity | 55e9d34c487fbfa83314e7b3540ff07d MD5 | raw file
  1. <% from MaKaC.fossils.user import IAvatarFossil %>
  2. <% from MaKaC.plugins.Collaboration.collaborationTools import CollaborationTools %>
  3. <p style="font-style: italic; padding-bottom: 20px;" >
  4. Event managers have all the necessary rights for all of the <strong>Video Services</strong> section.<br />
  5. However, if you want to give other users access to this section, you may do so below.<br />
  6. They will be able to access the <strong>Video Services</strong> section by clicking in the <strong>Manage event</strong> button in the Event Display page.
  7. </p>
  8. <div style="padding-bottom: 30px;">
  9. <div class="groupTitle">${ _("Video Services Managers")}</div>
  10. <p style="font-style: italic;" >
  11. Users added here will be able to access <strong>all</strong> of the the Video Services section of this event, including this <strong>Protection</strong> tab.
  12. </p>
  13. <div style="padding-left: 20px;" id="userList_all">
  14. </div>
  15. </div>
  16. <% allowedPluginNames = [p.getName() for p in CSBM.getAllowedPlugins() if not CollaborationTools.isAdminOnlyPlugin(p)] %>
  17. <% allowedPluginNames.sort() %>
  18. <div class="groupTitle">${ _("Managers for individual systems") }</div>
  19. <p style="font-style: italic;" >
  20. Users added here will be able to create, edit, delete, etc. bookings / requests for the corresponding plugin only.
  21. </p>
  22. <table>
  23. % for name in allowedPluginNames:
  24. <tr>
  25. <td style="vertical-align: top; text-align: right;">
  26. <span class="dataCaptionFormat">${ _("Managers for ") + name }</span>
  27. </td>
  28. <td style="padding-bottom: 30px;">
  29. <div style="padding-left: 20px;" id="userList_${ name }">
  30. </div>
  31. </td>
  32. </tr>
  33. % endfor
  34. </table>
  35. <script type="text/javascript">
  36. var allManagers = $L(${ jsonEncode(AllManagers)});
  37. % for name in ["all"] + allowedPluginNames:
  38. var newPersonsHandler = function(userList, setResult) {
  39. indicoRequest(
  40. 'collaboration.addPluginManager',
  41. {
  42. conference: "${ Conference.getId() }",
  43. plugin: "${ name }",
  44. userList: userList
  45. },
  46. function(result,error) {
  47. if (!error) {
  48. setResult(true);
  49. each(userList, function(user){
  50. allManagers.append(user);
  51. });
  52. } else {
  53. IndicoUtil.errorReport(error);
  54. setResult(false);
  55. }
  56. }
  57. );
  58. }
  59. var removePersonHandler = function(user, setResult) {
  60. indicoRequest(
  61. 'collaboration.removePluginManager',
  62. {
  63. conference: "${ Conference.getId() }",
  64. plugin: "${ name }",
  65. user: user.get('id')
  66. },
  67. function(result,error) {
  68. if (!error) {
  69. setResult(true);
  70. } else {
  71. IndicoUtil.errorReport(error);
  72. setResult(false);
  73. }
  74. }
  75. );
  76. }
  77. var uf = new UserListField('PeopleListDiv', 'PeopleList',
  78. ${ jsonEncode(fossilize(CSBM.getPluginManagers(name), IAvatarFossil)) }, true, allManagers,
  79. true, false, null, null,
  80. false, false, true,
  81. newPersonsHandler, singleUserNothing, removePersonHandler)
  82. $E('userList_${name}').set(uf.draw())
  83. % endfor
  84. </script>