1 diff --git a/lib/taskwarrior-web/helpers.rb b/lib/taskwarrior-web/helpers.rb
2 index 212aed7..94c57df 100644
3 --- a/lib/taskwarrior-web/helpers.rb
4 +++ b/lib/taskwarrior-web/helpers.rb
6 require 'active_support/core_ext/date/calculations'
8 module TaskwarriorWeb::App::Helpers
11 def format_date(timestamp)
12 format = TaskwarriorWeb::Config.dateformat || '%-m/%-d/%Y'
13 Time.parse(timestamp).localtime.strftime(format)
14 diff --git a/lib/taskwarrior-web/model/task.rb b/lib/taskwarrior-web/model/task.rb
15 index 212aed7..94c57df 100644
16 --- a/lib/taskwarrior-web/model/task.rb
17 +++ b/lib/taskwarrior-web/model/task.rb
20 def initialize(attributes = {})
21 attributes.each do |attr, value|
25 send("#{attr}=", value) if respond_to?(attr.to_sym)
27 + if attributes.has_key? "uuid"
28 + send("uuid=", attributes["uuid"])
32 @tags = [] if @tags.nil?
33 diff --git a/lib/taskwarrior-web/services/builder/base.rb b/lib/taskwarrior-web/services/builder/base.rb
34 index 58d246e..8f716ac 100644
35 --- a/lib/taskwarrior-web/services/builder/base.rb
36 +++ b/lib/taskwarrior-web/services/builder/base.rb
37 @@ -10,7 +10,7 @@ module TaskwarriorWeb::CommandBuilder::Base
38 :complete => ':id done',
39 :annotate => ':id annotate',
40 :denotate => ':id denotate',
41 - :projects => '_projects',
42 + :projects => '_unique project',
47 substitute_parts if @command_string =~ /:id/
50 - @built = "#{@command_string}#{@params}"
51 + @built = "#{@params}#{@command_string}"
59 - string << %( #{@params.delete(:description).shellescape}) if @params.has_key?(:description)
60 + string << %(#{@params.delete(:description).shellescape} ) if @params.has_key?(:description)
62 if tags = @params.delete(:tags)
63 tag_indicator = TaskwarriorWeb::Config.property('tag.indicator') || '+'
64 - tags.each { |tag| string << %( #{tag_indicator}#{tag.to_s.shellescape}) }
65 + tags.each { |tag| string << %(#{tag_indicator}#{tag.to_s.shellescape} ) }
68 if tags = @params.delete(:remove_tags)
69 - tags.each { |tag| string << %( -#{tag.to_s.shellescape}) }
70 + tags.each { |tag| string << %(-#{tag.to_s.shellescape} ) }
73 @params.each do |attr, value|
74 if @command != :update or attr != :uuid
75 if value.respond_to? :each
76 - value.each { |val| string << %( #{attr.to_s}:\\"#{val.to_s.shellescape}\\") }
77 + value.each { |val| string << %(#{attr.to_s}:\\"#{val.to_s.shellescape}\\" ) }
79 - string << %( #{attr.to_s}:\\"#{value.to_s.shellescape}\\")
80 + string << %(#{attr.to_s}:\\"#{value.to_s.shellescape}\\" )
84 diff --git a/lib/taskwarrior-web/views/tasks/_form.erb b/lib/taskwarrior-web/views/tasks/_form.erb
85 index 789e7a1..fa08698 100644
86 --- a/lib/taskwarrior-web/views/tasks/_form.erb
87 +++ b/lib/taskwarrior-web/views/tasks/_form.erb
89 <div class="control-group">
90 <label for="task-description" class="control-label">Description</label>
91 <div class="controls">
92 - <input type="text" required="required" id="task-description" name="task[description]" value="<%= @task.description unless @task.nil? %>" />
93 + <input type="text" required="required" id="task-description" name="task[description]" value="<%=h @task.description unless @task.nil? %>" />
97 <div class="control-group">
98 <label for="task-project" class="control-label">Project</label>
99 <div class="controls">
100 - <input type="text" id="task-project" name="task[project]" value="<%= @task.project unless @task.nil? %>" autocomplete="off" />
101 + <input type="text" id="task-project" name="task[project]" value="<%=h @task.project unless @task.nil? %>" autocomplete="off" />
106 <div class="control-group">
107 <label for="task-tags" class="control-label">Tags</label>
108 <div class="controls">
109 - <input type="text" id="task-tags" name="task[tags]" value="<%= @task.tags.join(', ') unless @task.nil? %>" autocomplete="off" />
110 + <input type="text" id="task-tags" name="task[tags]" value="<%=h @task.tags.join(', ') unless @task.nil? %>" autocomplete="off" />
111 <span class="help-block">Enter tags separated by commas or spaces (e.g. <em>each, word will,be a tag</em>)</span>