admin.php 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016 Morris Jobke <hey@morrisjobke.de>
  4. *
  5. * @license GNU AGPL version 3 or any later version
  6. *
  7. * This program is free software: you can redistribute it and/or modify
  8. * it under the terms of the GNU Affero General Public License as
  9. * published by the Free Software Foundation, either version 3 of the
  10. * License, or (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU Affero General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Affero General Public License
  18. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  19. *
  20. */
  21. /** @var array $_ */
  22. /** @var \OCP\IL10N $l */
  23. ?>
  24. <div id="<?php p($_['appid']); ?>" class="section workflowengine">
  25. <h2 class="inlineblock"><?php p($_['heading']); ?></h2>
  26. <?php if (!empty($_['docs'])): ?>
  27. <a target="_blank" rel="noreferrer" class="icon-info svg"
  28. title="<?php p($l->t('Open documentation'));?>"
  29. href="<?php p(link_to_docs($_['docs'])); ?>">
  30. </a>
  31. <?php endif; ?>
  32. <?php if (!empty($_['description'])): ?>
  33. <p><?php p($_['description']); ?></p>
  34. <?php endif; ?>
  35. <script type="text/template" id="operations-template">
  36. <div class="operations"></div>
  37. <button class="button-add-operation"><?php p($l->t('Add rule group')); ?></button>
  38. </script>
  39. <script type="text/template" id="operation-template">
  40. <div class="operation{{#if hasChanged}} modified{{/if}}">
  41. <input type="text" class="operation-name" placeholder="<?php p($l->t('Short rule description')); ?>" value="{{operation.name}}">
  42. {{! delete only makes sense if the operation is already saved }}
  43. {{#if operation.id}}
  44. <span class="button-delete pull-right icon-delete"></span>
  45. {{/if}}
  46. <input type="text" class="pull-right operation-operation" value="{{operation.operation}}">
  47. <div class="checks">
  48. {{#each operation.checks}}
  49. <div class="check" data-id="{{@index}}">
  50. <select class="check-class">
  51. {{#each ../classes}}
  52. <option value="{{class}}" {{{selectItem class ../class}}}>{{name}}</option>
  53. {{/each}}
  54. </select>
  55. <select class="check-operator">
  56. {{#each (getOperators class)}}
  57. <option value="{{operator}}" {{{selectItem operator ../operator}}}>{{name}}</option>
  58. {{/each}}
  59. </select>
  60. <input type="text" class="check-value" value="{{value}}">
  61. <span class="button-delete-check pull-right icon-delete"></span>
  62. </div>
  63. {{/each}}
  64. </div>
  65. <button class="button-add"><?php p($l->t('Add rule')); ?></button>
  66. {{#if hasChanged}}
  67. {{! reset only makes sense if the operation is already saved }}
  68. {{#if operation.id}}
  69. <button class="button-reset pull-right"><?php p($l->t('Reset')); ?></button>
  70. {{/if}}
  71. <button class="button-save pull-right"><?php p($l->t('Save')); ?></button>
  72. {{/if}}
  73. {{#if saving}}
  74. <span class="icon-loading-small pull-right"></span>
  75. <span class="pull-right"><?php p($l->t('Saving…')); ?></span>
  76. {{else}}{{#if message}}
  77. <span class="msg pull-right {{#if errorMessage}}error{{else}}success{{/if}}">
  78. {{message}}{{#if errorMessage}} {{errorMessage}}{{/if}}
  79. </span>
  80. {{/if}}{{/if}}
  81. </div>
  82. </script>
  83. <div class="rules"><span class="icon-loading-small"></span> <?php p($l->t('Loading…')); ?></div>
  84. </div>