mirror of
https://github.com/lucaspalomodevelop/indico-plugins.git
synced 2026-03-20 02:26:12 +00:00
VC/Vidyo: Move LinkingWidget template to core
This commit is contained in:
parent
c1c4c51a57
commit
6d3f5796eb
@ -1,32 +0,0 @@
|
||||
{% from 'forms/form_widget.html' import form_field %}
|
||||
|
||||
{% for subfield in field %}
|
||||
<div class="i-radio i-linking form-subfield{% if has_error[subfield.data] %} has-error{% endif %}">
|
||||
{% set dropdown = form[subfield.data] if subfield.data in form.conditional_fields %}
|
||||
{% set disabled = dropdown is defined and dropdown.choices|length <= 1 %}
|
||||
{{ subfield(disabled=disabled) }}
|
||||
{{ subfield.label }}
|
||||
{% if dropdown %}
|
||||
{{ form_field(dropdown, "i-linking-dropdown form-subfield") }}
|
||||
{% elif subfield.data == 'event' %}
|
||||
<span class='static-text'>{{ form.event.getTitle() }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
<script>
|
||||
$(function() {
|
||||
function update_dropdown_state() {
|
||||
var $this = $(this);
|
||||
if ($this.prop('checked')) {
|
||||
$this.closest('.i-radio').siblings('.i-radio').find('.i-linking-dropdown select').prop('disabled', true);
|
||||
$this.siblings('.i-linking-dropdown').find('select').prop('disabled', false);
|
||||
}
|
||||
}
|
||||
|
||||
$('.i-linking > .i-linking-dropdown > select > option[value=""]').prop('disabled', true);
|
||||
|
||||
$('.i-linking.i-radio input[type="radio"]')
|
||||
.off('change').on('change', update_dropdown_state)
|
||||
.each(update_dropdown_state);
|
||||
});
|
||||
</script>
|
||||
Loading…
x
Reference in New Issue
Block a user