acls.tx 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. Visibility<br />
  2. <select id="<: $post.id :>-visibility" class="cooltext" name="visibility">
  3. : for $post_visibilities -> $visibility {
  4. <option <: $post.visibility == $visibility ? 'selected' : '' :> value="<: $visibility :>"><: $visibility :></option>
  5. : }
  6. </select>
  7. <div id="<: $post.id :>-aclselect" style="display:none;" >
  8. ACLs / Series<br/ >
  9. <select multiple class="cooltext" name="acls">
  10. : for $acls -> $acl {
  11. <option value="<: $acl.aclname :>"><: $acl.data :></option>
  12. : }
  13. </select>
  14. </div>
  15. <script type="text/javascript">
  16. document.addEventListener("DOMContentLoaded", function(event) {
  17. var viselect = document.getElementById("<: $post.id :>-visibility");
  18. if (viselect.value == 'private') {
  19. switchMenu("<: $post.id :>-aclselect");
  20. }
  21. viselect.addEventListener("change", function(event) {
  22. var el = document.getElementById("<: $post.id :>-aclselect");
  23. var shown = el.style.display != 'none'
  24. if (shown) {
  25. if (this.value != 'private') {
  26. switchMenu("<: $post.id :>-aclselect");
  27. }
  28. return;
  29. }
  30. if (this.value == 'private') {
  31. switchMenu("<: $post.id :>-aclselect");
  32. }
  33. });
  34. });
  35. </script>