From b48774003570318d391d4ac91d0fa3961909b85e Mon Sep 17 00:00:00 2001 From: saurabhbhatia Date: Wed, 18 Sep 2013 16:10:39 +0800 Subject: [PATCH] Fixed Pagination Errors in member module --- .../personal_book/back_end/writing_books_controller.rb | 3 ++- .../personal_book/app/models/writing_book.rb | 2 ++ .../personal_book/back_end/writing_books/index.html.erb | 2 +- .../back_end/writing_conferences_controller.rb | 2 +- .../personal_conference/app/models/writing_conference.rb | 2 ++ .../back_end/writing_conferences/index.html.erb | 2 +- .../personal_diploma/back_end/diplomas_controller.rb | 1 + .../personal_diploma/app/models/diploma.rb | 3 ++- .../personal_diploma/back_end/diplomas/index.html.erb | 2 +- .../back_end/experiences_controller.rb | 1 + .../personal_experience/app/models/experience.rb | 3 ++- .../back_end/experiences/_sort_headers.html.erb | 6 ------ .../back_end/experiences/index.html.erb | 2 +- .../panel/personal_honor/back_end/honors_controller.rb | 1 + .../built_in_modules/personal_honor/app/models/honor.rb | 2 ++ .../personal_honor/back_end/honors/_sort_headers.html.erb | 5 ----- .../panel/personal_honor/back_end/honors/index.html.erb | 2 +- .../back_end/writing_journals_controller.rb | 3 ++- .../personal_journal/app/models/writing_journal.rb | 3 ++- .../back_end/writing_journals/_sort_headers.html.erb | 5 ----- .../back_end/writing_journals/index.html.erb | 2 +- .../panel/personal_lab/back_end/labs_controller.rb | 1 + .../panel/personal_lab/plugin/labs_controller.rb | 2 +- vendor/built_in_modules/personal_lab/app/models/lab.rb | 2 ++ .../personal_lab/back_end/labs/_sort_headers.html.erb | 5 ----- .../views/panel/personal_lab/back_end/labs/index.html.erb | 2 +- .../back_end/writing_patents_controller.rb | 1 + .../personal_patent/app/models/writing_patent.rb | 2 ++ .../back_end/writing_patents/_sort_headers.html.erb | 8 -------- .../back_end/writing_patents/index.html.erb | 2 +- .../personal_project/back_end/projects_controller.rb | 3 ++- .../personal_project/app/models/project.rb | 2 ++ .../back_end/projects/_sort_headers.html.erb | 7 ------- .../personal_project/back_end/projects/index.html.erb | 2 +- .../personal_research/app/models/research.rb | 2 ++ .../back_end/researchs/_sort_headers.html.erb | 6 ------ 36 files changed, 42 insertions(+), 59 deletions(-) diff --git a/vendor/built_in_modules/personal_book/app/controllers/panel/personal_book/back_end/writing_books_controller.rb b/vendor/built_in_modules/personal_book/app/controllers/panel/personal_book/back_end/writing_books_controller.rb index 60193c41..581acaed 100644 --- a/vendor/built_in_modules/personal_book/app/controllers/panel/personal_book/back_end/writing_books_controller.rb +++ b/vendor/built_in_modules/personal_book/app/controllers/panel/personal_book/back_end/writing_books_controller.rb @@ -37,7 +37,8 @@ class Panel::PersonalBook::BackEnd::WritingBooksController < OrbitBackendControl # @writing_books = WritingBook.search(params[:category_id]) #@writing_books = (params[:sort] || @filter) ? get_sorted_and_filtered_writing_books : WritingBook.all.page(params[:page]).per(10) - @writing_books = (params[:sort] || @filter) ? get_sorted_and_filtered("writing_book",:book_paper_type_id.in => @paper_type_ids) : get_viewable("writing_book",:book_paper_type_id.in => @paper_type_ids) + @writing_books = (params[:sort] || @filter) ? get_sorted_and_filtered("writing_book",:book_paper_type_id.in => @paper_type_ids) : get_viewable("writing_book",:book_paper_type_id.in => @paper_type_ids) + @books = @writing_books.page params[:page] @tags = get_tags diff --git a/vendor/built_in_modules/personal_book/app/models/writing_book.rb b/vendor/built_in_modules/personal_book/app/models/writing_book.rb index e273746f..8e1de496 100644 --- a/vendor/built_in_modules/personal_book/app/models/writing_book.rb +++ b/vendor/built_in_modules/personal_book/app/models/writing_book.rb @@ -36,6 +36,8 @@ class WritingBook field :note field :create_user_id, :type => BSON::ObjectId field :update_user_id, :type => BSON::ObjectId + + paginates_per 10 has_many :writing_book_files, :autosave => true, :dependent => :destroy diff --git a/vendor/built_in_modules/personal_book/app/views/panel/personal_book/back_end/writing_books/index.html.erb b/vendor/built_in_modules/personal_book/app/views/panel/personal_book/back_end/writing_books/index.html.erb index 6a71d385..d8537a9e 100644 --- a/vendor/built_in_modules/personal_book/app/views/panel/personal_book/back_end/writing_books/index.html.erb +++ b/vendor/built_in_modules/personal_book/app/views/panel/personal_book/back_end/writing_books/index.html.erb @@ -28,6 +28,6 @@ <%= link_to content_tag(:i, nil, :class => 'icon-cog icon-white') + t('setting'), panel_personal_book_back_end_writing_book_setting_path, :class => 'btn btn-primary pull-right' %> <%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_book_back_end_writing_book_path, :class => 'btn btn-primary pull-right' %>
- <%= paginate @writing_books, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %> + <%= paginate @books, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>
diff --git a/vendor/built_in_modules/personal_conference/app/controllers/panel/personal_conference/back_end/writing_conferences_controller.rb b/vendor/built_in_modules/personal_conference/app/controllers/panel/personal_conference/back_end/writing_conferences_controller.rb index a91b1407..20f587d7 100644 --- a/vendor/built_in_modules/personal_conference/app/controllers/panel/personal_conference/back_end/writing_conferences_controller.rb +++ b/vendor/built_in_modules/personal_conference/app/controllers/panel/personal_conference/back_end/writing_conferences_controller.rb @@ -38,7 +38,7 @@ class Panel::PersonalConference::BackEnd::WritingConferencesController < OrbitBa #@writing_conferences = (params[:sort] || @filter) ? get_sorted_and_filtered_writing_conferences : WritingConference.all.page(params[:page]).per(10) @writing_conferences = (params[:sort] || @filter) ? get_sorted_and_filtered("writing_conference",:conference_paper_type_id.in => @paper_type_ids) : get_viewable("writing_conference",:conference_paper_type_id.in => @paper_type_ids) - + @conferences = @writing_conferences.page params[:page] @tags = get_tags diff --git a/vendor/built_in_modules/personal_conference/app/models/writing_conference.rb b/vendor/built_in_modules/personal_conference/app/models/writing_conference.rb index b7504dba..9031cfec 100644 --- a/vendor/built_in_modules/personal_conference/app/models/writing_conference.rb +++ b/vendor/built_in_modules/personal_conference/app/models/writing_conference.rb @@ -32,6 +32,8 @@ class WritingConference field :create_user_id, :type => BSON::ObjectId field :update_user_id, :type => BSON::ObjectId + paginates_per 10 + has_many :writing_conference_files, :autosave => true, :dependent => :destroy accepts_nested_attributes_for :writing_conference_files, :allow_destroy => true diff --git a/vendor/built_in_modules/personal_conference/app/views/panel/personal_conference/back_end/writing_conferences/index.html.erb b/vendor/built_in_modules/personal_conference/app/views/panel/personal_conference/back_end/writing_conferences/index.html.erb index 3126f05c..5b9aad5c 100644 --- a/vendor/built_in_modules/personal_conference/app/views/panel/personal_conference/back_end/writing_conferences/index.html.erb +++ b/vendor/built_in_modules/personal_conference/app/views/panel/personal_conference/back_end/writing_conferences/index.html.erb @@ -28,6 +28,6 @@ <%= link_to content_tag(:i, nil, :class => 'icon-cog icon-white') + t('setting'), panel_personal_conference_back_end_writing_conference_setting_path, :class => 'btn btn-primary pull-right' %> <%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_conference_back_end_writing_conference_path, :class => 'btn btn-primary pull-right' %>
- <%= paginate @writing_conferences, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %> + <%= paginate @conferences, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>
diff --git a/vendor/built_in_modules/personal_diploma/app/controllers/panel/personal_diploma/back_end/diplomas_controller.rb b/vendor/built_in_modules/personal_diploma/app/controllers/panel/personal_diploma/back_end/diplomas_controller.rb index 45b5ca93..8350641e 100644 --- a/vendor/built_in_modules/personal_diploma/app/controllers/panel/personal_diploma/back_end/diplomas_controller.rb +++ b/vendor/built_in_modules/personal_diploma/app/controllers/panel/personal_diploma/back_end/diplomas_controller.rb @@ -27,6 +27,7 @@ class Panel::PersonalDiploma::BackEnd::DiplomasController < OrbitBackendControll @diplomas = (params[:sort] || @filter) ? get_sorted_and_filtered("diploma") : get_viewable("diploma") + @diplomas_page = @diplomas.page params[:page] @tags = get_tags diff --git a/vendor/built_in_modules/personal_diploma/app/models/diploma.rb b/vendor/built_in_modules/personal_diploma/app/models/diploma.rb index 8cd4c5ce..99cd6435 100644 --- a/vendor/built_in_modules/personal_diploma/app/models/diploma.rb +++ b/vendor/built_in_modules/personal_diploma/app/models/diploma.rb @@ -26,7 +26,8 @@ class Diploma field :note field :create_user_id, :type => BSON::ObjectId field :update_user_id, :type => BSON::ObjectId - + + paginates_per 10 # before_save :clean_checkboxs diff --git a/vendor/built_in_modules/personal_diploma/app/views/panel/personal_diploma/back_end/diplomas/index.html.erb b/vendor/built_in_modules/personal_diploma/app/views/panel/personal_diploma/back_end/diplomas/index.html.erb index e142916b..4f400180 100644 --- a/vendor/built_in_modules/personal_diploma/app/views/panel/personal_diploma/back_end/diplomas/index.html.erb +++ b/vendor/built_in_modules/personal_diploma/app/views/panel/personal_diploma/back_end/diplomas/index.html.erb @@ -28,6 +28,6 @@ <%= link_to content_tag(:i, nil, :class => 'icon-cog icon-white') + t('setting'), panel_personal_diploma_back_end_diploma_setting_path, :class => 'btn btn-primary pull-right' %> <%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_diploma_back_end_diploma_path, :class => 'btn btn-primary pull-right' %>
- <%= paginate @diplomas, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %> + <%= paginate @diplomas_page, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>
diff --git a/vendor/built_in_modules/personal_experience/app/controllers/panel/personal_experience/back_end/experiences_controller.rb b/vendor/built_in_modules/personal_experience/app/controllers/panel/personal_experience/back_end/experiences_controller.rb index fe15d329..079aab19 100644 --- a/vendor/built_in_modules/personal_experience/app/controllers/panel/personal_experience/back_end/experiences_controller.rb +++ b/vendor/built_in_modules/personal_experience/app/controllers/panel/personal_experience/back_end/experiences_controller.rb @@ -36,6 +36,7 @@ class Panel::PersonalExperience::BackEnd::ExperiencesController < OrbitBackendCo @experiences = (params[:sort] || @filter) ? get_sorted_and_filtered("experience",:experience_category_id.in => @experience_category_ids) : get_viewable("experience",:experience_category_id.in => @experience_category_ids) + @experience_pages = @experiences.page params[:page] @tags = get_tags diff --git a/vendor/built_in_modules/personal_experience/app/models/experience.rb b/vendor/built_in_modules/personal_experience/app/models/experience.rb index fda0ab8f..e9e20740 100644 --- a/vendor/built_in_modules/personal_experience/app/models/experience.rb +++ b/vendor/built_in_modules/personal_experience/app/models/experience.rb @@ -28,7 +28,8 @@ class Experience field :note field :create_user_id, :type => BSON::ObjectId field :update_user_id, :type => BSON::ObjectId - + + paginates_per 10 # before_save :clean_checkboxs diff --git a/vendor/built_in_modules/personal_experience/app/views/panel/personal_experience/back_end/experiences/_sort_headers.html.erb b/vendor/built_in_modules/personal_experience/app/views/panel/personal_experience/back_end/experiences/_sort_headers.html.erb index be4539f7..e69de29b 100644 --- a/vendor/built_in_modules/personal_experience/app/views/panel/personal_experience/back_end/experiences/_sort_headers.html.erb +++ b/vendor/built_in_modules/personal_experience/app/views/panel/personal_experience/back_end/experiences/_sort_headers.html.erb @@ -1,6 +0,0 @@ -<%= render_sort_bar(true, delete_panel_personal_experience_back_end_experiences_path(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options]), - ['date', 'date', 'span1', 'experience.date'], - ['organizationt_title', 'organizationt_title','span3', 'experience.organizationt_title'], - ['department', 'department','span3', 'experience.department'], - ['job_title', 'job_title','span3', 'experience.job_title'], - ['create_modified', 'create_user_id','span1-3', 'experience.create_modified']).html_safe %> \ No newline at end of file diff --git a/vendor/built_in_modules/personal_experience/app/views/panel/personal_experience/back_end/experiences/index.html.erb b/vendor/built_in_modules/personal_experience/app/views/panel/personal_experience/back_end/experiences/index.html.erb index 8bb03f1e..71b7e97c 100644 --- a/vendor/built_in_modules/personal_experience/app/views/panel/personal_experience/back_end/experiences/index.html.erb +++ b/vendor/built_in_modules/personal_experience/app/views/panel/personal_experience/back_end/experiences/index.html.erb @@ -30,6 +30,6 @@ <%= link_to content_tag(:i, nil, :class => 'icon-cog icon-white') + t('setting'), panel_personal_experience_back_end_experience_setting_path, :class => 'btn btn-primary pull-right' %> <%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_experience_back_end_experience_path, :class => 'btn btn-primary pull-right' %>
- <%= paginate @experiences, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %> + <%= paginate @experience_pages, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>
diff --git a/vendor/built_in_modules/personal_honor/app/controllers/panel/personal_honor/back_end/honors_controller.rb b/vendor/built_in_modules/personal_honor/app/controllers/panel/personal_honor/back_end/honors_controller.rb index dd749ce1..3bcf761c 100644 --- a/vendor/built_in_modules/personal_honor/app/controllers/panel/personal_honor/back_end/honors_controller.rb +++ b/vendor/built_in_modules/personal_honor/app/controllers/panel/personal_honor/back_end/honors_controller.rb @@ -35,6 +35,7 @@ class Panel::PersonalHonor::BackEnd::HonorsController < OrbitBackendController @honors = (params[:sort] || @filter) ? get_sorted_and_filtered("honor",:honor_category_id.in => @honor_category_ids) : get_viewable("honor",:honor_category_id.in => @honor_category_ids) + @honor_pages = @honors.page params[:page] @tags = get_tags diff --git a/vendor/built_in_modules/personal_honor/app/models/honor.rb b/vendor/built_in_modules/personal_honor/app/models/honor.rb index c44f5aee..fede2c5a 100644 --- a/vendor/built_in_modules/personal_honor/app/models/honor.rb +++ b/vendor/built_in_modules/personal_honor/app/models/honor.rb @@ -26,6 +26,8 @@ class Honor field :note field :create_user_id, :type => BSON::ObjectId field :update_user_id, :type => BSON::ObjectId + + paginates_per 10 # before_save :clean_checkboxs diff --git a/vendor/built_in_modules/personal_honor/app/views/panel/personal_honor/back_end/honors/_sort_headers.html.erb b/vendor/built_in_modules/personal_honor/app/views/panel/personal_honor/back_end/honors/_sort_headers.html.erb index cc392b5c..e69de29b 100644 --- a/vendor/built_in_modules/personal_honor/app/views/panel/personal_honor/back_end/honors/_sort_headers.html.erb +++ b/vendor/built_in_modules/personal_honor/app/views/panel/personal_honor/back_end/honors/_sort_headers.html.erb @@ -1,5 +0,0 @@ -<%= render_sort_bar(true, delete_panel_personal_honor_back_end_honors_path(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options]), - ['year', 'year', 'span1', 'honor.year'], - ['award_name', 'award_name','span3', 'honor.award_name'], - ['awarding_unit', 'awarding_unit','span3', 'honor.awarding_unit'], - ['create_modified', 'create_user_id','span1-3', 'honor.create_modified']).html_safe %> \ No newline at end of file diff --git a/vendor/built_in_modules/personal_honor/app/views/panel/personal_honor/back_end/honors/index.html.erb b/vendor/built_in_modules/personal_honor/app/views/panel/personal_honor/back_end/honors/index.html.erb index 8f9335cf..5a84d06e 100644 --- a/vendor/built_in_modules/personal_honor/app/views/panel/personal_honor/back_end/honors/index.html.erb +++ b/vendor/built_in_modules/personal_honor/app/views/panel/personal_honor/back_end/honors/index.html.erb @@ -28,6 +28,6 @@
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_honor_back_end_honor_path, :class => 'btn btn-primary pull-right' %>
- <%= paginate @honors, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %> + <%= paginate @honor_pages, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>
diff --git a/vendor/built_in_modules/personal_journal/app/controllers/panel/personal_journal/back_end/writing_journals_controller.rb b/vendor/built_in_modules/personal_journal/app/controllers/panel/personal_journal/back_end/writing_journals_controller.rb index 7ff654f9..1b4460ed 100644 --- a/vendor/built_in_modules/personal_journal/app/controllers/panel/personal_journal/back_end/writing_journals_controller.rb +++ b/vendor/built_in_modules/personal_journal/app/controllers/panel/personal_journal/back_end/writing_journals_controller.rb @@ -37,7 +37,8 @@ class Panel::PersonalJournal::BackEnd::WritingJournalsController < OrbitBackendC # @writing_journals = WritingJournal.search(params[:category_id]) #@writing_journals = (params[:sort] || @filter) ? get_sorted_and_filtered_writing_journals : WritingJournal.all.page(params[:page]).per(10) - @writing_journals = (params[:sort] || @filter) ? get_sorted_and_filtered("writing_journal",:journal_paper_type_id.in => @paper_type_ids) : get_viewable("writing_journal",:journal_paper_type_id.in => @paper_type_ids) + @writing_journals = (params[:sort] || @filter) ? get_sorted_and_filtered("writing_journal",:journal_paper_type_id.in => @paper_type_ids) : get_viewable("writing_journal",:journal_paper_type_id.in => @paper_type_ids) + @writing_journal_pages = @writing_journals.page params[:page] @tags = get_tags diff --git a/vendor/built_in_modules/personal_journal/app/models/writing_journal.rb b/vendor/built_in_modules/personal_journal/app/models/writing_journal.rb index ab54d055..ac81abc0 100644 --- a/vendor/built_in_modules/personal_journal/app/models/writing_journal.rb +++ b/vendor/built_in_modules/personal_journal/app/models/writing_journal.rb @@ -35,7 +35,8 @@ class WritingJournal field :note field :create_user_id, :type => BSON::ObjectId field :update_user_id, :type => BSON::ObjectId - + + paginates_per 10 accepts_nested_attributes_for :writing_journal_files, :allow_destroy => true after_save :save_writing_journal_files diff --git a/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/_sort_headers.html.erb b/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/_sort_headers.html.erb index 39722fc2..e69de29b 100644 --- a/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/_sort_headers.html.erb +++ b/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/_sort_headers.html.erb @@ -1,5 +0,0 @@ -<%= render_sort_bar(true, delete_panel_personal_journal_back_end_writing_journals_path(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options]), - ['publication_date', 'publication_date', 'span1', 'writing_journal.publication_date'], - ['paper_title', 'paper_title','span3', 'writing_journal.paper_title'], - ['create_modified', 'create_user_id','span1-3', 'writing_journal.create_modified']).html_safe %> - \ No newline at end of file diff --git a/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/index.html.erb b/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/index.html.erb index 97cbb20a..d5eebc3d 100644 --- a/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/index.html.erb +++ b/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/index.html.erb @@ -28,6 +28,6 @@ <%= link_to content_tag(:i, nil, :class => 'icon-cog icon-white') + t('setting'), panel_personal_journal_back_end_writing_journal_setting_path, :class => 'btn btn-primary pull-right' %> <%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_journal_back_end_writing_journal_path, :class => 'btn btn-primary pull-right' %>
- <%= paginate @writing_journals, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %> + <%= paginate @writing_journal_pages, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>
diff --git a/vendor/built_in_modules/personal_lab/app/controllers/panel/personal_lab/back_end/labs_controller.rb b/vendor/built_in_modules/personal_lab/app/controllers/panel/personal_lab/back_end/labs_controller.rb index e7f6776c..38f4063d 100644 --- a/vendor/built_in_modules/personal_lab/app/controllers/panel/personal_lab/back_end/labs_controller.rb +++ b/vendor/built_in_modules/personal_lab/app/controllers/panel/personal_lab/back_end/labs_controller.rb @@ -35,6 +35,7 @@ class Panel::PersonalLab::BackEnd::LabsController < OrbitBackendController @labs = (params[:sort] || @filter) ? get_sorted_and_filtered("lab") : get_viewable("lab") + @lab_pages = @labs.page params[:page] @tags = get_tags diff --git a/vendor/built_in_modules/personal_lab/app/controllers/panel/personal_lab/plugin/labs_controller.rb b/vendor/built_in_modules/personal_lab/app/controllers/panel/personal_lab/plugin/labs_controller.rb index 9c1f0e40..13042766 100644 --- a/vendor/built_in_modules/personal_lab/app/controllers/panel/personal_lab/plugin/labs_controller.rb +++ b/vendor/built_in_modules/personal_lab/app/controllers/panel/personal_lab/plugin/labs_controller.rb @@ -34,7 +34,7 @@ class Panel::PersonalLab::Plugin::LabsController < OrbitBackendController @labs = (params[:sort] || @filter) ? get_sorted_and_filtered("lab",:create_user_id => current_user.id) : get_viewable("lab", :create_user_id => current_user.id) - + @tags = get_tags respond_to do |format| diff --git a/vendor/built_in_modules/personal_lab/app/models/lab.rb b/vendor/built_in_modules/personal_lab/app/models/lab.rb index e924e1ae..f5402729 100644 --- a/vendor/built_in_modules/personal_lab/app/models/lab.rb +++ b/vendor/built_in_modules/personal_lab/app/models/lab.rb @@ -29,6 +29,8 @@ class Lab field :note field :create_user_id, :type => BSON::ObjectId field :update_user_id, :type => BSON::ObjectId + + paginates_per 10 has_many :lab_files, :autosave => true, :dependent => :destroy diff --git a/vendor/built_in_modules/personal_lab/app/views/panel/personal_lab/back_end/labs/_sort_headers.html.erb b/vendor/built_in_modules/personal_lab/app/views/panel/personal_lab/back_end/labs/_sort_headers.html.erb index 4c21f077..e69de29b 100644 --- a/vendor/built_in_modules/personal_lab/app/views/panel/personal_lab/back_end/labs/_sort_headers.html.erb +++ b/vendor/built_in_modules/personal_lab/app/views/panel/personal_lab/back_end/labs/_sort_headers.html.erb @@ -1,5 +0,0 @@ -<%= render_sort_bar(true, delete_panel_personal_lab_back_end_labs_path(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options]), - ['year', 'year', 'span1', 'lab.year'], - ['lab_title', 'lab_title','span3', 'lab.lab_title'], - ['location', 'location','span3', 'lab.location'], - ['create_modified', 'create_user_id','span1-3', 'lab.create_modified']).html_safe %> \ No newline at end of file diff --git a/vendor/built_in_modules/personal_lab/app/views/panel/personal_lab/back_end/labs/index.html.erb b/vendor/built_in_modules/personal_lab/app/views/panel/personal_lab/back_end/labs/index.html.erb index f56812f9..ac59222a 100644 --- a/vendor/built_in_modules/personal_lab/app/views/panel/personal_lab/back_end/labs/index.html.erb +++ b/vendor/built_in_modules/personal_lab/app/views/panel/personal_lab/back_end/labs/index.html.erb @@ -28,6 +28,6 @@
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_lab_back_end_lab_path, :class => 'btn btn-primary pull-right' %>
- <%= paginate @labs, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %> + <%= paginate @lab_pages, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>
diff --git a/vendor/built_in_modules/personal_patent/app/controllers/panel/personal_patent/back_end/writing_patents_controller.rb b/vendor/built_in_modules/personal_patent/app/controllers/panel/personal_patent/back_end/writing_patents_controller.rb index 49341619..3d957112 100644 --- a/vendor/built_in_modules/personal_patent/app/controllers/panel/personal_patent/back_end/writing_patents_controller.rb +++ b/vendor/built_in_modules/personal_patent/app/controllers/panel/personal_patent/back_end/writing_patents_controller.rb @@ -35,6 +35,7 @@ class Panel::PersonalPatent::BackEnd::WritingPatentsController < OrbitBackendCon @writing_patents = (params[:sort] || @filter) ? get_sorted_and_filtered("writing_patent",:writing_patent_category_id.in => @writing_patent_category_ids) : get_viewable("writing_patent",:writing_patent_category_id.in => @writing_patent_category_ids) + @writing_patent_pages = @writing_patents.page params[:page] @tags = get_tags diff --git a/vendor/built_in_modules/personal_patent/app/models/writing_patent.rb b/vendor/built_in_modules/personal_patent/app/models/writing_patent.rb index f6c5ebf3..533d1b9a 100644 --- a/vendor/built_in_modules/personal_patent/app/models/writing_patent.rb +++ b/vendor/built_in_modules/personal_patent/app/models/writing_patent.rb @@ -29,6 +29,8 @@ class WritingPatent field :note field :create_user_id, :type => BSON::ObjectId field :update_user_id, :type => BSON::ObjectId + + paginates_per 10 has_many :writing_patent_files, :autosave => true, :dependent => :destroy diff --git a/vendor/built_in_modules/personal_patent/app/views/panel/personal_patent/back_end/writing_patents/_sort_headers.html.erb b/vendor/built_in_modules/personal_patent/app/views/panel/personal_patent/back_end/writing_patents/_sort_headers.html.erb index a6dad620..e69de29b 100644 --- a/vendor/built_in_modules/personal_patent/app/views/panel/personal_patent/back_end/writing_patents/_sort_headers.html.erb +++ b/vendor/built_in_modules/personal_patent/app/views/panel/personal_patent/back_end/writing_patents/_sort_headers.html.erb @@ -1,8 +0,0 @@ -<%= render_sort_bar(true, delete_panel_personal_patent_back_end_writing_patents_path(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options]), - ['publish_date', 'publish_date', 'span1', 'writing_patent.publish_date'], - ['patent_title', 'patent_title','span3', 'writing_patent.patent_title'], - ['patent_no', 'patent_no','span3', 'writing_patent.patent_no'], - ['patent_country', 'patent_country','span3', 'writing_patent.patent_country'], - ['authors', 'authors','span3', 'writing_patent.authors'], - ['url', 'url','span3', 'writing_patent.url'], - ['create_modified', 'create_user_id','span1-3', 'writing_patent.create_modified']).html_safe %> \ No newline at end of file diff --git a/vendor/built_in_modules/personal_patent/app/views/panel/personal_patent/back_end/writing_patents/index.html.erb b/vendor/built_in_modules/personal_patent/app/views/panel/personal_patent/back_end/writing_patents/index.html.erb index f5e09271..f033fe78 100644 --- a/vendor/built_in_modules/personal_patent/app/views/panel/personal_patent/back_end/writing_patents/index.html.erb +++ b/vendor/built_in_modules/personal_patent/app/views/panel/personal_patent/back_end/writing_patents/index.html.erb @@ -32,6 +32,6 @@ <%= link_to content_tag(:i, nil, :class => 'icon-cog icon-white') + t('setting'), panel_personal_patent_back_end_writing_patent_setting_path, :class => 'btn btn-primary pull-right' %> <%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_patent_back_end_writing_patent_path, :class => 'btn btn-primary pull-right' %>
- <%= paginate @writing_patents, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %> + <%= paginate @writing_patent_pages, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>
diff --git a/vendor/built_in_modules/personal_project/app/controllers/panel/personal_project/back_end/projects_controller.rb b/vendor/built_in_modules/personal_project/app/controllers/panel/personal_project/back_end/projects_controller.rb index d712a916..0cd5e465 100644 --- a/vendor/built_in_modules/personal_project/app/controllers/panel/personal_project/back_end/projects_controller.rb +++ b/vendor/built_in_modules/personal_project/app/controllers/panel/personal_project/back_end/projects_controller.rb @@ -36,7 +36,8 @@ class Panel::PersonalProject::BackEnd::ProjectsController < OrbitBackendControll @projects = (params[:sort] || @filter) ? get_sorted_and_filtered("project",:project_category_id.in => @project_category_ids) : get_viewable("project",:project_category_id.in => @project_category_ids) - + @project_pages = @projects.page params[:page] + @tags = get_tags respond_to do |format| diff --git a/vendor/built_in_modules/personal_project/app/models/project.rb b/vendor/built_in_modules/personal_project/app/models/project.rb index bbe52c26..c53f86ef 100644 --- a/vendor/built_in_modules/personal_project/app/models/project.rb +++ b/vendor/built_in_modules/personal_project/app/models/project.rb @@ -31,6 +31,8 @@ class Project field :note field :create_user_id, :type => BSON::ObjectId field :update_user_id, :type => BSON::ObjectId + + paginates_per 10 has_many :project_files, :autosave => true, :dependent => :destroy diff --git a/vendor/built_in_modules/personal_project/app/views/panel/personal_project/back_end/projects/_sort_headers.html.erb b/vendor/built_in_modules/personal_project/app/views/panel/personal_project/back_end/projects/_sort_headers.html.erb index d641ebbd..e69de29b 100644 --- a/vendor/built_in_modules/personal_project/app/views/panel/personal_project/back_end/projects/_sort_headers.html.erb +++ b/vendor/built_in_modules/personal_project/app/views/panel/personal_project/back_end/projects/_sort_headers.html.erb @@ -1,7 +0,0 @@ -<%= render_sort_bar(true, delete_panel_personal_project_back_end_projects_path(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options]), - ['period', 'period', 'span1', 'project.period'], - ['project_title', 'project_title','span3', 'project.project_title'], - ['participator', 'participator','span3', 'project.participator'], - ['job_title', 'job_title','span3', 'project.job_title'], - ['unit', 'unit','span3', 'project.unit'], - ['create_modified', 'create_user_id','span1-3', 'project.create_modified']).html_safe %> \ No newline at end of file diff --git a/vendor/built_in_modules/personal_project/app/views/panel/personal_project/back_end/projects/index.html.erb b/vendor/built_in_modules/personal_project/app/views/panel/personal_project/back_end/projects/index.html.erb index 5b43573b..474589a6 100644 --- a/vendor/built_in_modules/personal_project/app/views/panel/personal_project/back_end/projects/index.html.erb +++ b/vendor/built_in_modules/personal_project/app/views/panel/personal_project/back_end/projects/index.html.erb @@ -30,6 +30,6 @@
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_project_back_end_project_path, :class => 'btn btn-primary pull-right' %>
- <%= paginate @projects, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %> + <%= paginate @project_pages, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>
diff --git a/vendor/built_in_modules/personal_research/app/models/research.rb b/vendor/built_in_modules/personal_research/app/models/research.rb index f9ad4d6b..ff37216a 100644 --- a/vendor/built_in_modules/personal_research/app/models/research.rb +++ b/vendor/built_in_modules/personal_research/app/models/research.rb @@ -27,6 +27,8 @@ class Research field :create_user_id, :type => BSON::ObjectId field :update_user_id, :type => BSON::ObjectId + paginates_per 10 + has_many :research_files, :autosave => true, :dependent => :destroy accepts_nested_attributes_for :research_files, :allow_destroy => true diff --git a/vendor/built_in_modules/personal_research/app/views/panel/personal_research/back_end/researchs/_sort_headers.html.erb b/vendor/built_in_modules/personal_research/app/views/panel/personal_research/back_end/researchs/_sort_headers.html.erb index a5cb6b47..e69de29b 100644 --- a/vendor/built_in_modules/personal_research/app/views/panel/personal_research/back_end/researchs/_sort_headers.html.erb +++ b/vendor/built_in_modules/personal_research/app/views/panel/personal_research/back_end/researchs/_sort_headers.html.erb @@ -1,6 +0,0 @@ -<%= render_sort_bar(true, delete_panel_personal_research_back_end_researchs_path(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options]), - ['publish_date', 'publish_date', 'span1', 'research.publish_date'], - ['research_title', 'research_title','span3', 'research.research_title'], - ['url', 'url','span3', 'research.url'], - ['create_modified', 'create_user_id','span1-3', 'research.create_modified']).html_safe %> - \ No newline at end of file