Commit 74a89d9ed6e79d6172ac2638a334bb31b9fea7da

Authored by gitlabhq
1 parent 8a8e77d5

ajax notes load

app/views/issues/show.js.haml 0 → 100644
@@ -0,0 +1,2 @@ @@ -0,0 +1,2 @@
  1 +:plain
  2 + $("#notes-list").html("#{escape_javascript(render(:partial => 'notes/notes_list'))}");
app/views/notes/_notes.html.haml
1 -%ul#notes-list  
2 - - @notes.each do |note|  
3 - - next unless note.author  
4 - = render :partial => "notes/show", :locals => {:note => note} 1 +%ul#notes-list= render "notes/notes_list"
5 2
6 %br 3 %br
7 %br 4 %br
@@ -12,4 +9,12 @@ @@ -12,4 +9,12 @@
12 $('.delete-note').live('ajax:success', function() { 9 $('.delete-note').live('ajax:success', function() {
13 $(this).closest('li').fadeOut(); }); 10 $(this).closest('li').fadeOut(); });
14 11
  12 +- if ["issues", "projects"].include?(controller.controller_name)
  13 + :javascript
  14 + $(function(){
  15 + var int =self.setInterval("updatePage()", 20000);
  16 + });
15 17
  18 + function updatePage(){
  19 + $.ajax({type: "GET", url: location.href, dataType: "script"});
  20 + }
app/views/notes/_notes_list.html.haml 0 → 100644
@@ -0,0 +1,4 @@ @@ -0,0 +1,4 @@
  1 +- @notes.each do |note|
  2 + - next unless note.author
  3 + = render :partial => "notes/show", :locals => {:note => note}
  4 +
app/views/projects/wall.js.haml 0 → 100644
@@ -0,0 +1,2 @@ @@ -0,0 +1,2 @@
  1 +:plain
  2 + $("#notes-list").html("#{escape_javascript(render(:partial => 'notes/notes_list'))}");