foodsoft/app/views/foodcoop/workgroups/edit.html.haml

41 lines
No EOL
1.4 KiB
Text

- title "Gruppe bearbeiten"
= simple_form_for [:foodcoop, @workgroup] do |f|
= f.input :name
= f.input :description
= f.input :weekly_task
= f.input :weekday, :as => :select, :collection => Workgroup.weekdays, :input_html => {:class => 'weekly_option'}
= f.input :task_name, :input_html => {:class => 'weekly_option'}
= f.input :task_required_users, :input_html => {:class => 'weekly_option'}
= f.input :task_duration, :input_html => {:class => 'weekly_option'}
= f.input :task_description, :input_html => {:class => 'weekly_option'}
= f.input :user_tokens, :as => :string, :input_html => { 'data-pre' => @workgroup.users.map { |u| u.token_attributes }.to_json }
= f.submit
= link_to "oder abbrechen", foodcoop_workgroups_path
- content_for :head do
:javascript
function toggleWeeklyTask() {
$('.weekly_option').each(function() {
if ($("#workgroup_weekly_task").is(':checked')) {
$(this).removeAttr('disabled');
} else {
$(this).attr('disabled', 'disabled');
}
});
}
$(function() {
toggleWeeklyTask();
$('#workgroup_weekly_task').click(function() {
toggleWeeklyTask();
})
$("#workgroup_user_tokens").tokenInput("#{users_path(:format => :json)}", {
crossDomain: false,
prePopulate: $("#workgroup_user_tokens").data("pre")
});
})