Hide event sidemenu items based on features
[cds-indico.git] / indico / modules / events / features / templates / features.html
blobf364a24b14363b83bf47673ce34c874322edd85b
1 {% extends 'layout/base.html' %}
2 {% from 'forms/_form.html' import form_rows %}
4 {% block title %}
5 {%- trans %}Features{% endtrans -%}
6 {% endblock %}
8 {% block description %}
9 {% trans -%}
10 You can enable/disable various features for your event.
11 Disabling a feature will hide it from both managers and users.
12 {%- endtrans %}
13 {% endblock %}
15 {% block content %}
16 <div class="flashed-messages"></div>
18 <div class="i-form horizontal" id="features-container">
19 {{ form_rows(form) }}
20 </div>
22 <script>
23 (function() {
24 'use strict';
26 var urlTemplate = {{ url_rule_to_js('event_features.switch') | tojson }};
27 $('#features-container input:checkbox').ajaxCheckbox({
28 sendData: false,
29 method: function() {
30 return this.checked ? 'PUT' : 'DELETE';
32 href: function() {
33 return build_url(urlTemplate, {
34 confId: {{ event.id }},
35 feature: this.name
36 });
38 }).on('ajaxCheckbox:changed', function(e, state) {
39 $('.js-event-feature-{0}'.format(this.name)).toggle(state);
40 });
41 })();
42 </script>
43 {% endblock %}