You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

admin.php 3.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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($_['settings-hint'])): ?>
  33. <p class="settings-hint"><?php p($_['settings-hint']); ?></p>
  34. <?php endif; ?>
  35. <?php if (!empty($_['description'])): ?>
  36. <p><?php p($_['description']); ?></p>
  37. <?php endif; ?>
  38. <script type="text/template" id="operations-template">
  39. <div class="operations"></div>
  40. <button class="button-add-operation"><?php p($l->t('Add rule group')); ?></button>
  41. </script>
  42. <script type="text/template" id="operation-template">
  43. <div class="operation{{#if hasChanged}} modified{{/if}}">
  44. <input type="text" class="operation-name" placeholder="<?php p($l->t('Short rule description')); ?>" value="{{operation.name}}">
  45. {{! delete only makes sense if the operation is already saved }}
  46. {{#if operation.id}}
  47. <span class="button-delete pull-right icon-delete"></span>
  48. {{/if}}
  49. <input type="text" class="pull-right operation-operation" value="{{operation.operation}}">
  50. <div class="checks">
  51. {{#each operation.checks}}
  52. <div class="check" data-id="{{@index}}">
  53. <select class="check-class">
  54. {{#each ../classes}}
  55. <option value="{{class}}" {{{selectItem class ../class}}}>{{name}}</option>
  56. {{/each}}
  57. </select>
  58. <select class="check-operator">
  59. {{#each (getOperators class)}}
  60. <option value="{{operator}}" {{{selectItem operator ../operator}}}>{{name}}</option>
  61. {{/each}}
  62. </select>
  63. <input type="text" class="check-value" value="{{value}}">
  64. <span class="button-delete-check pull-right icon-delete"></span>
  65. </div>
  66. {{/each}}
  67. </div>
  68. <button class="button-add"><?php p($l->t('Add rule')); ?></button>
  69. {{#if hasChanged}}
  70. {{! reset only makes sense if the operation is already saved }}
  71. {{#if operation.id}}
  72. <button class="button-reset pull-right"><?php p($l->t('Reset')); ?></button>
  73. {{/if}}
  74. <button class="button-save pull-right"><?php p($l->t('Save')); ?></button>
  75. {{/if}}
  76. {{#if saving}}
  77. <span class="icon-loading-small pull-right"></span>
  78. <span class="pull-right"><?php p($l->t('Saving…')); ?></span>
  79. {{else}}{{#if message}}
  80. <span class="msg pull-right {{#if errorMessage}}error{{else}}success{{/if}}">
  81. {{message}}{{#if errorMessage}} {{errorMessage}}{{/if}}
  82. </span>
  83. {{/if}}{{/if}}
  84. </div>
  85. </script>
  86. <div class="rules"><span class="icon-loading-small"></span> <?php p($l->t('Loading…')); ?></div>
  87. </div>