personal-journal1/app/views/admin/journal_papers/merge.html.erb

95 lines
3.1 KiB
Plaintext
Raw Normal View History

2019-10-31 12:50:02 +00:00
<% content_for :page_specific_css do %>
<%= stylesheet_link_tag "lib/main-forms" %>
<%= stylesheet_link_tag "lib/fileupload" %>
<%= stylesheet_link_tag "lib/main-list" %>
<%= stylesheet_link_tag "lib/main-form-col2" %>
<% end %>
2019-11-01 09:42:28 +00:00
<form method="get" action='?' name='mode_form'>
<nobr>
2019-11-01 09:42:47 +00:00
<%= '嚴格比較模式'+':' %>
2019-11-01 09:42:28 +00:00
<% if params['mode']!='simple' %>
2019-11-01 09:48:30 +00:00
<input type="checkbox" name="mode" value="simple" onchange='this.form.submit()'><span>是</span>
2019-11-01 09:42:28 +00:00
<% else %>
2019-11-01 09:47:19 +00:00
<input type="checkbox" name="mode" value="strict" onchange='this.form.submit()'><span>否</span>
2019-11-01 09:42:28 +00:00
<% end %>
</nobr>
</form>
2019-10-31 12:51:37 +00:00
<table class="table main-list">
2019-10-31 12:37:59 +00:00
<thead>
<tr>
<th><%= t('personal_journal.paper_title') %></th>
<th><%= t('personal_journal.journal_title') %></th>
2019-11-01 05:59:06 +00:00
<% if params['mode']!='simple' %>
<th><%= t('personal_journal.level_type') %></th>
<th><%= t('personal_journal.author_type') %></th>
<th><%= t('personal_journal.paper_type') %></th>
<th><%= t('personal_journal.publication_date') %></th>
<% end %>
2019-11-01 09:26:42 +00:00
<th><%= t("personal_plugins.merge") %></th>
2019-11-01 06:47:53 +00:00
<th><%= t("personal_plugins.author") %></th>
2019-10-31 12:37:59 +00:00
</tr>
</thead>
<tbody>
2019-11-01 05:59:06 +00:00
<% @journals.each do |key,journals| %>
<tr>
<% if params['mode']=='simple'
len = journals.length
else
len = journals.values.reduce(0){|sum,num| sum+num.length}
2019-11-01 06:04:34 +00:00
end
2019-11-01 05:59:06 +00:00
%>
<td rowspan="<%= len %>">
<%= key[0].values.map{|v| v=="" ? t('personal_journal.no_input') : v}.join('/') %>
</td>
<td rowspan="<%= len %>">
<%= key[1].values.map{|v| v=="" ? t('personal_journal.no_input') : v}.join('/') %>
</td>
2019-11-01 06:17:01 +00:00
<% if params['mode']=='simple' %>
2019-11-01 09:31:44 +00:00
<td rowspan="<%= len %>">
<input type="checkbox" class="checkbox" name="journal_id" value="<%= journals.collect(&:id).join('/') %>">
</td>
2019-11-01 06:17:01 +00:00
<% journals.each_with_index do |journal,i| %>
2019-10-31 12:44:37 +00:00
<td>
2019-11-01 09:01:14 +00:00
<a href="<%= edit_admin_journal_paper_path(journal) %>" target="_blank">
2019-11-01 08:59:22 +00:00
<%= get_member(journal).collect(&:name).join(' / ') rescue t('personal_journal.no_input') %>
</a>
2019-10-31 12:44:37 +00:00
</td>
2019-11-01 06:20:52 +00:00
<% if len!=(i+1) %>
</tr>
<tr>
<% end %>
2019-11-01 06:17:01 +00:00
<% end %>
<% else %>
2019-11-01 06:24:54 +00:00
<% i=0 %>
2019-11-01 06:23:17 +00:00
<% journals.each do |k,v| %>
2019-11-01 06:17:01 +00:00
<% len1 = v.length %>
2019-11-01 06:33:37 +00:00
<% k.each do |keychild| %>
2019-11-01 06:32:12 +00:00
<td rowspan="<%= len1 %>">
2019-11-01 06:33:37 +00:00
<%= keychild.to_s.blank? ? t('personal_journal.no_input') : keychild %>
2019-11-01 06:32:12 +00:00
</td>
<% end %>
2019-11-01 09:31:44 +00:00
<td rowspan="<%= len1 %>">
<input type="checkbox" class="checkbox" name="journal_id" value="<%= v.collect(&:id).join('/') %>">
</td>
2019-11-01 06:17:01 +00:00
<% v.each_with_index do |journal_child,index1| %>
<td>
2019-11-01 09:02:08 +00:00
<a href="<%= edit_admin_journal_paper_path(journal_child) %>" target="_blank">
2019-11-01 08:59:22 +00:00
<%= get_member(journal_child).collect(&:name).join(' / ') rescue t('personal_journal.no_input') %>
</a>
2019-11-01 06:17:01 +00:00
</td>
2019-11-01 06:30:18 +00:00
<% if len1!=index1 %>
2019-11-01 06:17:01 +00:00
</tr>
<tr>
<% end %>
<% end %>
2019-11-01 06:30:18 +00:00
<% if len1!=(i+1) %>
2019-11-01 06:17:01 +00:00
</tr>
<tr>
2019-10-31 12:37:59 +00:00
<% end %>
2019-11-01 06:30:18 +00:00
<% i =i+1 %>
2019-10-31 12:37:59 +00:00
<% end %>
<% end %>
2019-11-01 05:59:06 +00:00
</tr>
2019-10-31 12:37:59 +00:00
<% end %>
</tbody>
2019-11-01 06:42:24 +00:00
</table>