| Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame^] | 1 | {% extends 'edit.twig' %} | 
|  | 2 |  | 
|  | 3 | {% block inner_content %} | 
|  | 4 | {% if result %} | 
|  | 5 | <h4>Filter</h4> | 
|  | 6 | <form class="form-horizontal" data-id="editfilter" role="form" method="post"> | 
|  | 7 | <input type="hidden" value="0" name="active"> | 
|  | 8 | <div class="form-group"> | 
|  | 9 | <label class="control-label col-sm-2" for="script_desc">{{ lang.edit.sieve_desc }}</label> | 
|  | 10 | <div class="col-sm-10"> | 
|  | 11 | <input type="text" class="form-control" name="script_desc" id="script_desc" value="{{ result.script_desc }}" required maxlength="255"> | 
|  | 12 | </div> | 
|  | 13 | </div> | 
|  | 14 | <div class="form-group"> | 
|  | 15 | <label class="control-label col-sm-2" for="filter_type">{{ lang.edit.sieve_type }}</label> | 
|  | 16 | <div class="col-sm-10"> | 
|  | 17 | <select id="addFilterType" name="filter_type" id="filter_type" required> | 
|  | 18 | <option value="prefilter"{% if result.filter_type == 'prefilter' %} selected{% endif %}>Prefilter</option> | 
|  | 19 | <option value="postfilter"{% if result.filter_type == 'postfilter' %} selected{% endif %}>Postfilter</option> | 
|  | 20 | </select> | 
|  | 21 | </div> | 
|  | 22 | </div> | 
|  | 23 | <div class="form-group"> | 
|  | 24 | <label class="control-label col-sm-2" for="script_data">Script:</label> | 
|  | 25 | <div class="col-sm-10"> | 
|  | 26 | <textarea spellcheck="false" autocorrect="off" autocapitalize="none" class="form-control textarea-code" rows="20" id="script_data" name="script_data" required>{{ result.script_data|raw }}</textarea> | 
|  | 27 | </div> | 
|  | 28 | </div> | 
|  | 29 | <div class="form-group"> | 
|  | 30 | <div class="col-sm-offset-2 col-sm-10"> | 
|  | 31 | <div class="checkbox"> | 
|  | 32 | <label><input type="checkbox" value="1" name="active"{% if result.active == '1' %} checked{% endif %}> {{ lang.edit.active }}</label> | 
|  | 33 | </div> | 
|  | 34 | </div> | 
|  | 35 | </div> | 
|  | 36 | <div class="form-group"> | 
|  | 37 | <div class="col-sm-offset-2 col-sm-10"> | 
|  | 38 | <button class="btn btn-xs-lg visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-success" data-action="edit_selected" data-id="editfilter" data-item="{{ result.id }}" data-api-url='edit/filter' data-api-attr='{}' href="#">{{ lang.edit.validate_save }}</button> | 
|  | 39 | </div> | 
|  | 40 | </div> | 
|  | 41 | </form> | 
|  | 42 | {% else %} | 
|  | 43 | {{ parent() }} | 
|  | 44 | {% endif %} | 
|  | 45 | {% endblock %} |