Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rework user-interface for editing recurring tasks
- Loading branch information
Showing
7 changed files
with
79 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,11 @@ | ||
- 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 | ||
= form.hidden_field :current_user_id | ||
= form.input :name | ||
= form.input :description, as: :text, input_html: {rows: 10} | ||
= form.input :duration, :as => :select, :collection => 1..3 | ||
- unless local_assigns[:periodic] | ||
= form.input :user_list, :as => :string, :input_html => { 'data-pre' => form.object.users.map(&:token_attributes).to_json } | ||
= form.input :required_users | ||
= form.association :workgroup | ||
= form.input :due_date, as: :date_picker | ||
- unless local_assigns[:periodic] | ||
= form.input :done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
- 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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,15 @@ | ||
- title t('.title') | ||
- title @periodic ? t('.title_periodic') : t('.title') | ||
|
||
= render 'form' | ||
- if @task.periodic? && !@periodic | ||
.alert.alert-info= raw t('tasks.edit.warning_periodic') | ||
|
||
= render 'form_sidebar' | ||
|
||
= simple_form_for @task do |form| | ||
= render 'form', form: form, periodic: @periodic | ||
.form-actions | ||
- if @periodic | ||
= form.submit t('.submit_periodic'), name: 'periodic', class: 'btn btn-primary' | ||
- else | ||
= form.submit class: 'btn btn-primary' | ||
= link_to t('ui.or_cancel'), :back |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,10 @@ | ||
- title t('.title') | ||
|
||
= render 'form' | ||
= render 'form_sidebar' | ||
|
||
= simple_form_for @task do |form| | ||
= render 'form', form: form, periodic: nil | ||
.form-actions | ||
= form.submit class: 'btn btn-primary' | ||
= form.submit t('.submit_periodic'), name: 'periodic', class: 'btn' | ||
= link_to t('ui.or_cancel'), :back |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters