Added rss2id and fix profile

This commit is contained in:
manson 2014-07-15 13:52:03 +08:00
parent f811cfc34f
commit 32ffdce5d2
2 changed files with 3 additions and 1 deletions

View File

@ -22,6 +22,7 @@ class JournalPaper
field :publication_date, type: DateTime field :publication_date, type: DateTime
field :url, type: String field :url, type: String
field :note, type: String field :note, type: String
field :rss2_id
paginates_per 10 paginates_per 10

View File

@ -23,7 +23,8 @@
@filter = {new_filter[:type] => [new_filter[:id].to_s]} @filter = {new_filter[:type] => [new_filter[:id].to_s]}
end 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) @writing_journals = JournalPaper.where(member_profile_id: @member.id).desc(:year).page(params[:page]).per(10)
else else
@writing_journals = JournalPaper.where(is_hidden: false, member_profile_id: @member.id).desc(:year).page(params[:page]).per(10) @writing_journals = JournalPaper.where(is_hidden: false, member_profile_id: @member.id).desc(:year).page(params[:page]).per(10)