operation.handlebars 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <div class="operation{{#if hasChanged}} modified{{/if}}">
  2. <div class="operation-header">
  3. <input type="text" class="operation-name" placeholder="{{shortRuleDescTXT}}" value="{{operation.name}}" />
  4. <input type="text" class="operation-operation" value="{{operation.operation}}" />
  5. {{! delete only makes sense if the operation is already saved }}
  6. {{#if operation.id}}
  7. <span class="button-delete icon-delete"></span>
  8. {{/if}}
  9. </div>
  10. <div class="checks">
  11. {{#each operation.checks}}
  12. <div class="check" data-id="{{@index}}">
  13. <select class="check-class">
  14. {{#each ../classes}}
  15. <option value="{{class}}" {{{selectItem class ../class}}}>{{name}}</option>
  16. {{/each}}
  17. </select>
  18. <select class="check-operator">
  19. {{#each (getOperators class)}}
  20. <option value="{{operator}}" {{{selectItem operator ../operator}}}>{{name}}</option>
  21. {{/each}}
  22. </select>
  23. <input type="text" class="check-value" value="{{value}}">
  24. <span class="button-delete-check icon-delete"></span>
  25. </div>
  26. {{/each}}
  27. </div>
  28. <button class="button-add">{{addRuleTXT}}</button>
  29. {{#if hasChanged}}
  30. {{! reset only makes sense if the operation is already saved }}
  31. {{#if operation.id}}
  32. <button class="button-reset pull-right">{{resetTXT}}</button>
  33. {{/if}}
  34. <button class="button-save pull-right">{{saveTXT}}</button>
  35. {{/if}}
  36. {{#if saving}}
  37. <span class="icon-loading-small pull-right"></span>
  38. <span class="pull-right">{{savingTXT}}</span>
  39. {{else}}{{#if message}}
  40. <span class="msg pull-right {{#if errorMessage}}error{{else}}success{{/if}}">
  41. {{message}}{{#if errorMessage}} {{errorMessage}}{{/if}}
  42. </span>
  43. {{/if}}{{/if}}
  44. </div>