From 31f7407b35f45ef8942a6ea18bf71f4cfb6bec27 Mon Sep 17 00:00:00 2001 From: chiu Date: Fri, 1 Nov 2019 13:59:06 +0800 Subject: [PATCH] Update merge.html.erb --- app/views/admin/journal_papers/merge.html.erb | 74 +++++++++++++++---- 1 file changed, 58 insertions(+), 16 deletions(-) diff --git a/app/views/admin/journal_papers/merge.html.erb b/app/views/admin/journal_papers/merge.html.erb index 268688e..5caf30b 100644 --- a/app/views/admin/journal_papers/merge.html.erb +++ b/app/views/admin/journal_papers/merge.html.erb @@ -9,32 +9,74 @@ <%= t('personal_journal.paper_title') %> <%= t('personal_journal.journal_title') %> +<% if params['mode']!='simple' %> + <%= t('personal_journal.level_type') %> + <%= t('personal_journal.author_type') %> + <%= t('personal_journal.paper_type') %> + <%= t('personal_journal.publication_date') %> +<% end %> <%= t('module_name.personal_journal') %> -<% if params['mode']=='simple' %> -<% else %> - <% @journals.each do |key,journals| %> - - <% len = journals.length %> - - <%= key[0].values.map{|v| v=="" ? t('personal_journal.no_input') : v}.join('/') %> - - - <%= key[1].values.map{|v| v=="" ? t('personal_journal.no_input') : v}.join('/') %> - - <% journals.each_with_index do |journal,i| %> +<% @journals.each do |key,journals| %> + + <% if params['mode']=='simple' + len = journals.length + else + len = journals.values.reduce(0){|sum,num| sum+num.length} + %> + + <%= key[0].values.map{|v| v=="" ? t('personal_journal.no_input') : v}.join('/') %> + + + <%= key[1].values.map{|v| v=="" ? t('personal_journal.no_input') : v}.join('/') %> + + <% journals.each_with_index do |journal,i| %> + <% if params['mode']=='simple' %> <%= journal %> - <% if len!=(i+1) %> - - + <% else %> + <% j=0 %> + <% journal.each do |k,v| %> + <% len1 = v.length %> + + <%= k[0] %> + + + <%= k[1] %> + + + <%= k[2] %> + + + <%= k[3] %> + + <% v.each_with_index do |journal_child,index1| %> + <% len2 = v.length %> + + <%= journal_child %> + + <% if len2!=(i+1) %> + + + <% end %> + <% end %> + <% if len1!=(j+1) %> + + + <% end + j=j+1 + %> <% end %> <% end %> - + <% if len!=(i+1) %> + + + <% end %> <% end %> + <% end %> \ No newline at end of file