app/views/shared/_group_form_fields.html.haml
= f.input :name
= f.input :description, as: :text, input_html: {rows: 4}
= captured if defined? captured
= f.input :user_tokens, :as => :string
- content_for :javascript do
:javascript
function toggleWeeklyTaskFields() {
if ($('#workgroup_weekly_task').is(':checked')) {
$('#weekly_task_fields .control-group').show();
$('#weekly_task_fields input').removeAttr('disabled');
} else {
$('#weekly_task_fields .control-group').hide();
$('#weekly_task_fields input').attr('disabled', 'disabled');
}
}
$(function() {
toggleWeeklyTaskFields();
$('#workgroup_weekly_task').click(function() {
toggleWeeklyTaskFields();
});
$("##{f.object.class.to_s.underscore}_user_tokens").select2_remote({
tags: true,
remote_url: '#{users_path(:format => :json)}',
remote_init: #{search_data(f.object.users, proc {|u| show_user u})[:results].to_json}
});
});