2011-07-10 21:48:43 +02:00
|
|
|
<% @tag_list_text = ""
|
2008-08-04 16:13:51 +02:00
|
|
|
@tag_list_text = tag_list_text if @todo -%>
|
|
|
|
|
<span class="errors">
|
2012-05-12 13:37:36 +02:00
|
|
|
<%= get_list_of_error_messages_for(@todo) if @todo %>
|
2008-08-04 16:13:51 +02:00
|
|
|
</span>
|
2011-01-16 18:14:07 +01:00
|
|
|
<h2><label for="todo_description"><%= t('common.description') %></label></h2>
|
2015-05-14 13:41:01 +02:00
|
|
|
<%= text_field( "todo", "description", "maxlength" => 100, "size" => 50) %>
|
2012-05-10 13:53:01 -05:00
|
|
|
<h2><label for="tag_list"><%= t('todos.tags') %></label></h2>
|
2015-05-14 13:41:01 +02:00
|
|
|
<%= text_field_tag "tag_list", @tag_list_text, :size => 50 %>
|
2011-01-16 18:14:07 +01:00
|
|
|
<h2><label for="todo_context_id"><%= t('common.context') %></label></h2>
|
2008-08-04 16:13:51 +02:00
|
|
|
<%= unless @mobile_from_context
|
2015-05-14 13:41:01 +02:00
|
|
|
collection_select( "todo", "context_id", @contexts, "id", "name", {} )
|
2008-08-04 16:13:51 +02:00
|
|
|
else
|
|
|
|
|
select_tag("todo[context_id]", options_from_collection_for_select(
|
2011-07-10 21:48:43 +02:00
|
|
|
@contexts, "id", "name", @mobile_from_context.id),
|
2015-05-14 13:41:01 +02:00
|
|
|
{"id" => :todo_context_id} )
|
2008-08-04 16:13:51 +02:00
|
|
|
end %>
|
2011-02-08 09:24:56 +01:00
|
|
|
<h2><label for="todo_project_id"><%= t('common.project') %></label></h2>
|
2008-08-04 16:13:51 +02:00
|
|
|
<%= unless @mobile_from_project
|
|
|
|
|
collection_select( "todo", "project_id", @projects, "id", "name",
|
2015-05-14 13:41:01 +02:00
|
|
|
{:include_blank => t('todos.no_project')} )
|
2008-08-04 16:13:51 +02:00
|
|
|
else
|
2011-07-10 21:48:43 +02:00
|
|
|
# manually add blank option since :include_blank does not work
|
2008-08-04 16:13:51 +02:00
|
|
|
# with options_from_collection_for_select
|
2012-05-12 13:37:36 +02:00
|
|
|
empty_option = content_tag(:option, "", :value => "")
|
|
|
|
|
select_tag("todo[project_id]", empty_option+options_from_collection_for_select(
|
2011-07-10 21:48:43 +02:00
|
|
|
@projects, "id", "name", @mobile_from_project.id),
|
2015-05-14 13:41:01 +02:00
|
|
|
{"id" => :todo_project_id} )
|
2008-08-04 16:13:51 +02:00
|
|
|
end %>
|
2011-11-22 09:46:44 -06:00
|
|
|
<h2><label for="todo_notes"><%= t('common.notes') %></label></h2>
|
2015-05-14 13:41:01 +02:00
|
|
|
<%= text_area( "todo", "notes", "cols" => 40, "rows" => 3) %>
|
2011-01-16 18:14:07 +01:00
|
|
|
<h2><label for="todo_due"><%= t('todos.due') %></label></h2>
|
2008-11-09 11:15:49 +01:00
|
|
|
<%= date_select("todo", "due", {:order => [:day, :month, :year],
|
2015-05-14 13:41:01 +02:00
|
|
|
:start_year => Date.current.year, :include_blank => '--'}) %>
|
2011-01-16 18:14:07 +01:00
|
|
|
<h2><label for="todo_show_from"><%= t('todos.show_from') %></label></h2>
|
2011-07-10 21:48:43 +02:00
|
|
|
<%= date_select("todo", "show_from", {:order => [:day, :month, :year],
|
2015-05-14 13:41:01 +02:00
|
|
|
:start_year => Date.current.year, :include_blank => true}) %>
|