summaryrefslogtreecommitdiff
path: root/app/helpers/notes_helper.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-12-25 22:33:40 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-12-25 22:33:40 +0200
commit9305ef8940988fc9baad7c5196819f272445dd9b (patch)
tree9ee0efa5ab522bd4e19e053b193df6762fef08fe /app/helpers/notes_helper.rb
parentf554aa38d504387aae09d4000bd208078e1c3c1b (diff)
downloadgitlab-ce-9305ef8940988fc9baad7c5196819f272445dd9b.tar.gz
Remove old methods and classes
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/helpers/notes_helper.rb')
-rw-r--r--app/helpers/notes_helper.rb19
1 files changed, 10 insertions, 9 deletions
diff --git a/app/helpers/notes_helper.rb b/app/helpers/notes_helper.rb
index 822d27cf179..ec5f8a6ded4 100644
--- a/app/helpers/notes_helper.rb
+++ b/app/helpers/notes_helper.rb
@@ -1,7 +1,7 @@
module NotesHelper
# Helps to distinguish e.g. commit notes in mr notes list
def note_for_main_target?(note)
- (@target_type.camelize == note.noteable_type && !note.for_diff_line?)
+ (@noteable.class.name == note.noteable_type && !note.for_diff_line?)
end
def note_target_fields
@@ -21,14 +21,6 @@ module NotesHelper
end
end
- def loading_more_notes?
- params[:loading_more].present?
- end
-
- def loading_new_notes?
- params[:loading_new].present?
- end
-
def note_timestamp(note)
# Shows the created at time and the updated at time if different
ts = "#{time_ago_with_tooltip(note.created_at, 'bottom', 'note_created_ago')} ago"
@@ -41,4 +33,13 @@ module NotesHelper
end
ts.html_safe
end
+
+ def noteable_json(noteable)
+ {
+ id: noteable.id,
+ class: noteable.class.name,
+ resources: noteable.class.table_name,
+ project_id: noteable.project.id,
+ }.to_json
+ end
end