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>{{ lang.edit.resource }}</h4> |
| 6 | <form class="form-horizontal" role="form" method="post" data-id="editresource"> |
| 7 | <input type="hidden" value="0" name="active"> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 8 | <div class="row mb-4"> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 9 | <label class="control-label col-sm-2" for="description">{{ lang.add.description }}</label> |
| 10 | <div class="col-sm-10"> |
| 11 | <input type="text" class="form-control" name="description" value="{{ result.description }}" required> |
| 12 | </div> |
| 13 | </div> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 14 | <div class="row mb-2"> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 15 | <label class="control-label col-sm-2" for="domain">{{ lang.edit.kind }}</label> |
| 16 | <div class="col-sm-10"> |
| 17 | <select name="kind" title="{{ lang.edit.select }}" required> |
| 18 | <option value="location"{% if result.kind == 'location' %} selected{% endif %}>Location</option> |
| 19 | <option value="group"{% if result.kind == 'group' %} selected{% endif %}>Group</option> |
| 20 | <option value="thing"{% if result.kind == 'thing' %} selected{% endif %}>Thing</option> |
| 21 | </select> |
| 22 | </div> |
| 23 | </div> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 24 | <div class="row mb-4"> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 25 | <label class="control-label col-sm-2" for="multiple_bookings_select">{{ lang.add.multiple_bookings }}</label> |
| 26 | <div class="col-sm-10"> |
| 27 | <select name="multiple_bookings_select" id="editSelectMultipleBookings" title="{{ lang.add.select }}" required> |
| 28 | <option value="0"{% if result.multiple_bookings == 0 %} selected{% endif %}>{{ lang.mailbox.booking_null }}</option> |
| 29 | <option value="-1"{% if result.multiple_bookings == -1 %} selected{% endif %}>{{ lang.mailbox.booking_ltnull }}</option> |
| 30 | <option value="custom"{% if result.multiple_bookings >= 1 %} selected{% endif %}>{{ lang.mailbox.booking_custom }}</option> |
| 31 | </select> |
| 32 | <div style="display:none" id="multiple_bookings_custom_div"> |
| 33 | <hr> |
| 34 | <input type="number" class="form-control" name="multiple_bookings_custom" id="multiple_bookings_custom"{% if result.multiple_bookings >= 1 %} value="{{ result.multiple_bookings }}"{% endif %}> |
| 35 | </div> |
| 36 | <input type="hidden" name="multiple_bookings" id="multiple_bookings"> |
| 37 | </div> |
| 38 | </div> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 39 | <div class="row mb-2"> |
| 40 | <div class="offset-sm-2 col-sm-10"> |
Matthias Andreas Benkard | d1f5b68 | 2023-11-18 13:18:30 +0100 | [diff] [blame] | 41 | <div class="form-check"> |
| 42 | <label><input type="checkbox" class="form-check-input" value="1" name="active"{% if result.active == '1' %} checked{% endif %}> {{ lang.edit.active }}</label> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 43 | </div> |
| 44 | </div> |
| 45 | </div> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 46 | <div class="row"> |
| 47 | <div class="offset-sm-2 col-sm-10"> |
| 48 | <button class="btn btn-xs-lg d-block d-sm-inline btn-success" data-action="edit_selected" data-id="editresource" data-item="{{ result.name }}" data-api-url='edit/resource' data-api-attr='{}' href="#">{{ lang.edit.save }}</button> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 49 | </div> |
| 50 | </div> |
| 51 | </form> |
| 52 | {% else %} |
| 53 | {{ parent() }} |
| 54 | {% endif %} |
| 55 | {% endblock %} |