Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com>2011-10-17 20:48:10 +0400
committerDmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com>2011-10-17 20:48:10 +0400
commite5502790dd13a6fe1d674ea204a73f39ec977e53 (patch)
tree60e8669568e14fdaa04829b1d4868a5439f234dc /app
parentadd45eb8fb49c8f6d1bd111d499c9e31fb4cd796 (diff)
ajax notes load
Diffstat (limited to 'app')
-rw-r--r--app/views/issues/show.js.haml2
-rw-r--r--app/views/notes/_notes.html.haml13
-rw-r--r--app/views/notes/_notes_list.html.haml4
-rw-r--r--app/views/projects/wall.js.haml2
4 files changed, 17 insertions, 4 deletions
diff --git a/app/views/issues/show.js.haml b/app/views/issues/show.js.haml
new file mode 100644
index 00000000000..5b9a34c0a9c
--- /dev/null
+++ b/app/views/issues/show.js.haml
@@ -0,0 +1,2 @@
+:plain
+ $("#notes-list").html("#{escape_javascript(render(:partial => 'notes/notes_list'))}");
diff --git a/app/views/notes/_notes.html.haml b/app/views/notes/_notes.html.haml
index 9d1d4b941c8..040c2f28053 100644
--- a/app/views/notes/_notes.html.haml
+++ b/app/views/notes/_notes.html.haml
@@ -1,7 +1,4 @@
-%ul#notes-list
- - @notes.each do |note|
- - next unless note.author
- = render :partial => "notes/show", :locals => {:note => note}
+%ul#notes-list= render "notes/notes_list"
%br
%br
@@ -12,4 +9,12 @@
$('.delete-note').live('ajax:success', function() {
$(this).closest('li').fadeOut(); });
+- if ["issues", "projects"].include?(controller.controller_name)
+ :javascript
+ $(function(){
+ var int =self.setInterval("updatePage()", 20000);
+ });
+ function updatePage(){
+ $.ajax({type: "GET", url: location.href, dataType: "script"});
+ }
diff --git a/app/views/notes/_notes_list.html.haml b/app/views/notes/_notes_list.html.haml
new file mode 100644
index 00000000000..1e4a6bb2b2f
--- /dev/null
+++ b/app/views/notes/_notes_list.html.haml
@@ -0,0 +1,4 @@
+- @notes.each do |note|
+ - next unless note.author
+ = render :partial => "notes/show", :locals => {:note => note}
+
diff --git a/app/views/projects/wall.js.haml b/app/views/projects/wall.js.haml
new file mode 100644
index 00000000000..5b9a34c0a9c
--- /dev/null
+++ b/app/views/projects/wall.js.haml
@@ -0,0 +1,2 @@
+:plain
+ $("#notes-list").html("#{escape_javascript(render(:partial => 'notes/notes_list'))}");