2009-01-15 12:14:01 +01:00
|
|
|
- title "Gruppe bearbeiten"
|
|
|
|
|
2011-05-16 00:34:43 +02:00
|
|
|
= simple_form_for [:foodcoop, @workgroup] do |f|
|
|
|
|
= f.input :name
|
|
|
|
= f.input :description
|
2009-08-02 18:42:52 +02:00
|
|
|
|
2011-05-16 00:34:43 +02:00
|
|
|
= 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'}
|
2009-01-15 12:14:01 +01:00
|
|
|
|
2011-05-16 00:34:43 +02:00
|
|
|
= 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")
|
|
|
|
});
|
|
|
|
})
|