mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-21 09:40:13 +01:00
Add note working again for Projects
This commit is contained in:
parent
00da0b36aa
commit
94ec1d46bb
3 changed files with 23 additions and 3 deletions
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
<div class="container">
|
||||
<div id="notes">
|
||||
<div class="add_note_link"><%= link_to_function( "Add a note", "Element.toggle('new-note'); Form.focusFirstElement('form-new-note');", :id=>"add_note_href") %></div>
|
||||
<div class="add_note_link"><%= link_to 'Add a note', '#' %> </div>
|
||||
<h2>Notes</h2>
|
||||
<div id="empty-n" style="display:<%= @project.notes.empty? ? 'block' : 'none'%>;">
|
||||
<%= render :partial => "shared/empty",
|
||||
|
|
@ -26,7 +26,7 @@
|
|||
:method => :post,
|
||||
:update => "notes",
|
||||
:position => "bottom",
|
||||
:complete => "new Effect.Highlight('notes');$('empty-n').hide();Form.reset('form-new-note');",
|
||||
:complete => "$('#notes').effect('highlight', 1000);$('#empty-n').hide();$('#new-note form').clearForm();",
|
||||
:html => {:id=>'form-new-note', :class => 'inline-form'} do %>
|
||||
<%= hidden_field( "new_note", "project_id", "value" => "#{@project.id}" ) %>
|
||||
<%= text_area( "new_note", "body", "cols" => 50, "rows" => 3, "tabindex" => 1 ) %>
|
||||
|
|
|
|||
|
|
@ -427,6 +427,12 @@ $(document).ready(function() {
|
|||
$(this).parents('.edit-form').find('form').clearForm();
|
||||
});
|
||||
|
||||
$(".add_note_link a").live('click', function(){
|
||||
$('#new-note').show();
|
||||
$('#new-note form').clearForm();
|
||||
$('#new-note form input:first').focus();
|
||||
});
|
||||
|
||||
$("#list-active-projects").sortable({handle: '.handle', update: update_order});
|
||||
$("#list-hidden-projects").sortable({handle: '.handle', update: update_order});
|
||||
$("#list-completed-projects").sortable({handle: '.handle', update: update_order});
|
||||
|
|
|
|||
14
test/selenium/project_detail/add_note.rsel
Normal file
14
test/selenium/project_detail/add_note.rsel
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
setup :fixtures => :all
|
||||
login :as => 'admin'
|
||||
|
||||
#first, defer a todo
|
||||
open "/projects/1"
|
||||
|
||||
click "css=.add_note_link a"
|
||||
|
||||
assert_visible "new-note"
|
||||
|
||||
type "new_note_body", "this is a note"
|
||||
click 'css=#new-note input[type=submit]'
|
||||
|
||||
wait_for_text_present "this is a note"
|
||||
Loading…
Add table
Add a link
Reference in a new issue