foodsoft/app/views/tasks/_form.html.haml

31 lines
1.2 KiB
Text

- content_for :javascript do
:javascript
$(function() {
$("#task_user_list").tokenInput("#{users_path(:format => :json)}", {
crossDomain: false,
prePopulate: $("#task_user_list").data("pre"),
hintText: '#{escape_javascript(t('.search.hint'))}',
noResultText: '#{escape_javascript(t('.search.noresult'))}',
searchingText: '#{escape_javascript(t('.search.placeholder'))}',
theme: 'facebook'
});
});
- content_for :sidebar do
= render "shared/workgroup_members"
= simple_form_for @task do |f|
= f.hidden_field :current_user_id
= f.input :name
= f.input :description, as: :text, input_html: {rows: 10}
= f.input :duration, :as => :select, :collection => 1..3
= f.input :user_list, :as => :string, :input_html => { 'data-pre' => @task.users.map(&:token_attributes).to_json }
= f.input :required_users
= f.association :workgroup
= f.input :due_date, as: :date_picker
= f.input :done
.form-actions
= f.submit class: 'btn btn-primary'
- if @task.new_record? or @task.periodic?
= f.submit t('.submit.periodic'), name: 'periodic', class: 'btn'
= link_to t('ui.or_cancel'), :back