personal-conference/app/views/admin/writing_conferences/merge.html.erb

118 lines
4.0 KiB
Plaintext
Raw Permalink Normal View History

<%= csrf_meta_tags %>
<% 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" %>
<style>
table.table.main-list.tablet.footable-loaded td{
vertical-align: middle;
}
</style>
<% end %>
<script>
function change_mode(){
var value = $("form[name='mode_form']").find("input[type='checkbox']")[0].checked
if (value){
$("input[name='mode']").val("strict")
}
else{
$("input[name='mode']").val("simple")
}
document.mode_form.submit()
}
</script>
<nobr>
<form method="get" action='?' name='mode_form'>
<%= t('strict_compare_mode') +':' %>
<input type='hidden' name='mode' value=''>
<% if params['mode']!='simple' %>
<input type="checkbox" onchange='change_mode()' checked><span style="margin-right: 2em;"><%= t('yes_') %></span>
<% else %>
<input type="checkbox" onchange='change_mode()'><span style="margin-right: 2em;"><%= t('no_') %></span>
<% end %>
<button type="button" onclick="merge_form.submit()"><%= t('personal_conference.merge') %></button>
</form>
</nobr>
<form method="post" action='/admin/writing_conferences/merge_process?' name='merge_form'>
<%= token_tag(nil) %>
<table class="table main-list">
<thead>
<tr>
<th><%= t('personal_conference.paper_title') %></th>
<th><%= t('personal_conference.conference_title') %></th>
<% if params['mode']!='simple' %>
<th><%= t('personal_conference.sponsor') %></th>
<th><%= t('personal_conference.author_type') %></th>
<th><%= t('personal_conference.paper_type') %></th>
<th><%= t('personal_conference.publication_date') %></th>
<% end %>
<th><%= t("personal_conference.merge") %></th>
<th><%= t("personal_plugins.author") %></th>
</tr>
</thead>
<tbody>
<% @writing_conferences.each do |key,writing_conferences| %>
<tr>
<% if params['mode']=='simple'
len = writing_conferences.length
else
len = writing_conferences.values.reduce(0){|sum,num| sum+num.length}
end
%>
<td rowspan="<%= len %>">
<%= key[0].values.map{|v| v=="" ? t('personal_conference.no_input') : v}.join('/') %>
</td>
<td rowspan="<%= len %>">
<%= key[1].values.map{|v| v=="" ? t('personal_conference.no_input') : v}.join('/') %>
</td>
<% if params['mode']=='simple' %>
<td rowspan="<%= len %>">
<input type="checkbox" class="checkbox" name="writing_conference_id[]" value="<%= writing_conferences.collect(&:id).join('/') %>">
</td>
<% writing_conferences.each_with_index do |writing_conference,i| %>
<td>
<a href="<%= edit_admin_writing_conference_path(writing_conference) %>" target="_blank">
<%= get_member(writing_conference).collect(&:name).join(' / ') rescue t('personal_conference.no_input') %>
</a>
</td>
<% if len!=(i+1) %>
</tr>
<tr>
<% end %>
<% end %>
<% else %>
<% i=0 %>
<% writing_conferences.each do |k,v| %>
<% len1 = v.length %>
<% k.each do |keychild| %>
<td rowspan="<%= len1 %>">
<%= keychild.to_s.blank? ? t('personal_conference.no_input') : keychild %>
</td>
<% end %>
<td rowspan="<%= len1 %>">
<input type="checkbox" class="checkbox" name="writing_conference_id[]" value="<%= v.collect(&:id).join('/') %>">
</td>
<% v.each_with_index do |writing_conference_child,index1| %>
<td>
<a href="<%= edit_admin_writing_conference_path(writing_conference_child) %>" target="_blank">
<%= get_member(writing_conference_child).collect(&:name).join(' / ') rescue t('personal_conference.no_input') %>
</a>
</td>
<% if len1!=index1 %>
</tr>
<tr>
<% end %>
<% end %>
<% if len1!=(i+1) %>
</tr>
<tr>
<% end %>
<% i =i+1 %>
<% end %>
<% end %>
</tr>
<% end %>
</tbody>
</table>
</form>