diff --git a/app/controllers/notes_controller.rb b/app/controllers/notes_controller.rb index 6cb207108..1bbba3129 100644 --- a/app/controllers/notes_controller.rb +++ b/app/controllers/notes_controller.rb @@ -6,10 +6,11 @@ class NotesController < ApplicationController end def index - if params[:group_by] == "note" - index_by_note - else - index_by_post + @notes = Note.search(params[:search]).order("id desc").paginate(params[:page], :limit => params[:limit], :search_count => params[:search]) + respond_with(@notes) do |format| + format.xml do + render :xml => @notes.to_xml(:root => "notes") + end end end @@ -66,25 +67,4 @@ private def create_params params.require(:note).permit(:x, :y, :width, :height, :body, :post_id, :html_id) end - - def index_by_post - @post_set = PostSets::Note.new(params) - @posts = @post_set.posts - respond_with(@posts) do |format| - format.html {render :action => "index_by_post"} - format.xml do - render :xml => @posts.to_xml(:root => "posts") - end - end - end - - def index_by_note - @notes = Note.search(params[:search]).order("id desc").paginate(params[:page], :limit => params[:limit], :search_count => params[:search]) - respond_with(@notes) do |format| - format.html {render :action => "index_by_note"} - format.xml do - render :xml => @notes.to_xml(:root => "notes") - end - end - end end diff --git a/app/logical/post_sets/note.rb b/app/logical/post_sets/note.rb deleted file mode 100644 index 99a0e9087..000000000 --- a/app/logical/post_sets/note.rb +++ /dev/null @@ -1,17 +0,0 @@ -module PostSets - class Note < PostSets::Post - attr_reader :params - - def initialize(params) - # don't call super because we don't want to repeat these queries - @params = params - @tag_array = Tag.scan_query(params[:tags]) - @page = params[:page] || 1 - @posts = ::Post.tag_match(tag_string).has_notes.paginate(page, :limit => limit).reorder("last_noted_at desc") - end - - def limit - [(params[:limit] || CurrentUser.user.per_page).to_i, 1_000].min - end - end -end diff --git a/app/views/layouts/_main_links.html.erb b/app/views/layouts/_main_links.html.erb index bd2a7a4fe..b5606d77d 100644 --- a/app/views/layouts/_main_links.html.erb +++ b/app/views/layouts/_main_links.html.erb @@ -6,7 +6,7 @@ <% end %> <%= nav_link_to("Posts", posts_path) %> <%= nav_link_to("Comments", comments_path(:group_by => "post")) %> - <%= nav_link_to("Notes", notes_path(:group_by => "post")) %> + <%= nav_link_to("Notes", notes_path) %> <%= nav_link_to("Artists", artists_path) %> <%= nav_link_to("Tags", tags_path) %> <% if CurrentUser.is_builder? %> diff --git a/app/views/notes/_secondary_links.html.erb b/app/views/notes/_secondary_links.html.erb index 0e607b6c0..27ea91845 100644 --- a/app/views/notes/_secondary_links.html.erb +++ b/app/views/notes/_secondary_links.html.erb @@ -1,7 +1,8 @@ <% content_for(:secondary_links) do %>