fix error

This commit is contained in:
邱博亞 2023-03-04 12:43:45 +08:00
parent 9e891605c5
commit 50ec5bbd62
2 changed files with 16 additions and 8 deletions

View File

@ -144,12 +144,17 @@ class PersonalJournalsController < ApplicationController
def index_by_author(journal_papers)
journal_papers_total_pages = journal_papers.total_pages
journal_papers_list = journal_papers.group_by{|jp| jp.member_profiles.collect{|v| v.name}.join(', ') rescue jp.authors}.collect do |name, jps|
journal_papers_list = journal_papers.group_by{|jp| jp.year}.collect do |year, jps|
jps_data = jps.group_by do |jp|
jp.member_profiles.collect{|v| v.name}.join(', ') rescue jp.authors
end.collect do |name, jps|
jps_data = jps.collect do |jp|
{'title' => jp.create_link_tag_for_title}
end
{'name' => name, 'jps' => jps_data}
end
{'year' => year, 'jps_list'=> jps_data}
end
{
'journal_papers' => journal_papers_list,
'extras' => { 'widget-title' => t('module_name.journal_paper')},

View File

@ -1,10 +1,13 @@
<h3 class="page-module-title">{{page-title}}</h3>
<article>
<div data-level="0" data-list="journal_papers">
<h3 class="year">{{year}}</h3>
<div data-level="1" data-list="jps_list">
<h4>{{name}}</h4>
<ul data-level="1" data-list="jps">
<ul data-level="2" data-list="jps">
<li>{{title}}</li>
</ul>
</div>
</div>
</article>
{{pagination_goes_here}}