From 32ffdce5d2c5265831c291e26bb4ed8516398703 Mon Sep 17 00:00:00 2001 From: manson Date: Tue, 15 Jul 2014 13:52:03 +0800 Subject: [PATCH] Added rss2id and fix profile --- app/models/journal_paper.rb | 1 + app/views/plugin/journal_paper/_profile.html.erb | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/models/journal_paper.rb b/app/models/journal_paper.rb index 1b4bb1c..ef32aa5 100644 --- a/app/models/journal_paper.rb +++ b/app/models/journal_paper.rb @@ -22,6 +22,7 @@ class JournalPaper field :publication_date, type: DateTime field :url, type: String field :note, type: String + field :rss2_id paginates_per 10 diff --git a/app/views/plugin/journal_paper/_profile.html.erb b/app/views/plugin/journal_paper/_profile.html.erb index 594f68b..307c5a8 100644 --- a/app/views/plugin/journal_paper/_profile.html.erb +++ b/app/views/plugin/journal_paper/_profile.html.erb @@ -23,7 +23,8 @@ @filter = {new_filter[:type] => [new_filter[:id].to_s]} end - if @member && @member.user.is_admin? + is_autorized_user = (current_user==@member.user || current_user.is_admin?) + if is_autorized_user @writing_journals = JournalPaper.where(member_profile_id: @member.id).desc(:year).page(params[:page]).per(10) else @writing_journals = JournalPaper.where(is_hidden: false, member_profile_id: @member.id).desc(:year).page(params[:page]).per(10)