tracks/tracks/app/views/project/show.rhtml

99 lines
4 KiB
Text

<div id="display_box">
<div class="contexts">
<h2><%= sanitize(@project.name) %></h2>
<% if @project.description -%>
<div class="project_description"><%= sanitize(@project.description) %></div>
<% end -%>
<div id="next_actions">
<% if @project.done == 1 -%>
<p class="info">This project has been completed</p>
<% for item in @not_done -%>
<%= render_partial "show_items", item %>
<% end -%>
<% elsif @not_done.empty? -%>
<p>There are no next actions yet in this project</p>
<% else -%>
<%= render :partial => "show_items", :collection => @not_done %>
<% end -%>
</div><!-- [end:next_actions] -->
</div><!-- [end:contexts] -->
<div class="contexts">
<h2>Completed actions in this project</h2>
<div id="completed">
<% if @done.empty? %>
<p>There are no completed next actions yet in this project</p>
<% else %>
<%= render :partial => "show_items", :collection => @done %>
<% end %>
</div>
</div><!-- [end:contexts] -->
<!-- begin div.contexts -->
<div class="contexts">
<div id="notes">
<h2>Notes</h2>
<% if @notes.empty? -%>
<p>There are no notes yet for this project.</p>
<% else -%>
<%= render :partial => "note/notes_summary", :collection => @notes %>
<% end -%>
</div>
</div>
<!-- end div.contexts -->
<%= link_to_function( "Add a note", "Element.toggle('new-note'); Form.focusFirstElement('form-new-note');") %>
<div id="new-note" style="display:none;">
<%= form_remote_tag :url => { :controller => "note", :action => "add" },
:update => "notes",
:position => "bottom",
:complete => "new Effect.Highlight('notes');",
:html => {:id=>'form-new-note', :class => 'inline-form'} %>
<%= hidden_field( "new_note", "project_id", "value" => "#{@project.id}" ) %>
<%= text_area( "new_note", "body", "cols" => 50, "rows" => 3, "tabindex" => 1 ) %>
<br /><br />
<input type="submit" value="Add note" tabindex="2" />
<%= end_form_tag %>
</div>
</div><!-- [end:display_box] -->
<div id="input_box">
<%= link_to_function( "Add the next action in this project &#187;", "Element.toggle('project_new_action'); Form.focusFirstElement('project-form-new-action');", {:title => "Add the next action [Alt+n]", :accesskey => "n"}) %>
<div id="project_new_action" class="project_new" style="display:none">
<!--[form:project]-->
<%= form_remote_tag :url => { :controller => "todo", :action => "add_item" },
:update=> "next_actions",
:position=> "bottom",
:loading => "project.reset()",
:complete => "Form.focusFirstElement('project-form-new-action'); new Effect.Highlight('next_actions');",
:html=> { :id=>'project-form-new-action', :name=>'project', :class => 'inline-form' } %>
<%= hidden_field( "new_item", "project_id", "value" => "#{@project.id}") %>
<label for="new_item_description">Description</label><br />
<%= text_field( "new_item", "description", "size" => 25, "tabindex" => 1 ) %><br />
<label for="new_item_notes">Notes</label><br />
<%= text_area( "new_item", "notes", "cols" => 25, "rows" => 10, "tabindex" => 2 ) %><br />
<label for="new_item_context_id">Context</label><br />
<select name="new_item[context_id]" id="new_item_context_id" tabindex="3">
<%= options_from_collection_for_select(@contexts, "id", "name" ) %>
</select><br />
<label for="item_due">Due</label><br />
<%= text_field("new_item", "due", "size" => 10, "class" => "Date", "onFocus" => "Calendar.setup", "tabindex" => 4) %>
<br /><br />
<input type="submit" value="Add item" tabindex="5">
<%= end_form_tag %><!--[eoform:project]-->
<%= calendar_setup( "new_item_due" ) %>
</div><!-- [end:project-new-action] -->
<%= render "shared/sidebar" %>
</div><!-- End of input box -->
<% if @flash["confirmation"] %><div class="confirmation"><%= @flash["confirmation"] %></div><% end %>
<% if @flash["warning"] %><div class="warning"><%= @flash["warning"] %></div><% end %>