2021-04-24 10:41:50 +00:00
|
|
|
<table class="table main-list" style="background: #ffffff;">
|
2021-03-17 07:33:31 +00:00
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<% render :partial => "get_display_fields" %>
|
|
|
|
<% if @seminar.nil? %>
|
|
|
|
<th><%= t('seminar.title') %></th>
|
|
|
|
<% end %>
|
|
|
|
<% if @drag%>
|
|
|
|
<th></th>
|
|
|
|
<% end %>
|
2022-07-07 09:27:52 +00:00
|
|
|
<%
|
|
|
|
@field_name_translations = @field_name_translations.map.with_index{|trans,i| [@field_names[i], trans]}.to_h
|
|
|
|
%>
|
|
|
|
<% @display_field.each do |field_name| %>
|
|
|
|
<th class="span2" id="<%= field_name %>"><%= @field_name_translations[field_name] %></th>
|
2021-03-17 07:33:31 +00:00
|
|
|
<% end %>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody class="sort-holder" <%=@reviewer_id.nil? ? "" : "data-id=#{@reviewer_id}" %>>
|
2021-03-24 13:06:49 +00:00
|
|
|
<% display_title = @seminar.nil? %>
|
2021-03-17 07:33:31 +00:00
|
|
|
<% @seminar_signups.each do |seminar_signup| %>
|
2021-03-24 13:06:49 +00:00
|
|
|
<% @seminar = seminar_signup.seminar_main if display_title %>
|
2021-03-17 07:33:31 +00:00
|
|
|
<% vals = [] %>
|
2021-04-24 10:41:50 +00:00
|
|
|
<% edit_urls = {} %>
|
|
|
|
<% contribute_ids = seminar_signup.seminar_signup_contribute_ids.map{|id| id.to_s} %>
|
|
|
|
<% @append_contribute_ids = @append_contribute_ids.to_a
|
|
|
|
@remove_contribute_ids = @remove_contribute_ids.to_a
|
|
|
|
%>
|
|
|
|
<% intersection_contribute_ids = @append_contribute_ids & contribute_ids rescue [] %>
|
|
|
|
<% if intersection_contribute_ids.count != 0
|
|
|
|
contribute_ids = intersection_contribute_ids
|
|
|
|
else
|
|
|
|
if @preferred_sessions
|
|
|
|
contribute_ids = seminar_signup.seminar_signup_contributes.any_of({:preferred_session.in=>@preferred_sessions,:final_session=>nil},{:final_session.in=>@preferred_sessions}).pluck(:id).map{|id| id.to_s}
|
|
|
|
end
|
|
|
|
end %>
|
|
|
|
<% contribute_ids = contribute_ids - @remove_contribute_ids
|
|
|
|
seminar_signup_contributes = seminar_signup.seminar_signup_contributes.where(:id.in=>contribute_ids).sort_ordered.to_a
|
|
|
|
contribute_ids = seminar_signup_contributes.map{|s| s.id}
|
|
|
|
%>
|
|
|
|
<tr data-id="<%=seminar_signup.id.to_s%>" data-contribute_id="<%=contribute_ids[0].to_s%>">
|
2021-03-17 07:33:31 +00:00
|
|
|
<% if @drag%>
|
2021-04-24 10:41:50 +00:00
|
|
|
<td><span class="brand"><i class="icons-list-2"></i></span></td>
|
2021-03-17 07:33:31 +00:00
|
|
|
<% end %>
|
2021-03-24 13:06:49 +00:00
|
|
|
<% vals << seminar_signup.seminar_main.title if display_title %>
|
2021-03-17 07:33:31 +00:00
|
|
|
<% @display_field.each_with_index do |fn,i|%>
|
|
|
|
<% names = fn.split(".") %>
|
|
|
|
<% val = "" %>
|
|
|
|
<% if names[0] == "seminar_signup_field_set" %>
|
|
|
|
<% if names[1] == "name" %>
|
|
|
|
<% val = seminar_signup.name
|
|
|
|
val += "<div class=\"quick-edit\">
|
|
|
|
<ul class=\"nav nav-pills\">"
|
2021-04-24 10:41:50 +00:00
|
|
|
if @can_edit
|
2021-03-17 07:33:31 +00:00
|
|
|
val += "<li><a href=\"/admin/seminar_signups/#{seminar_signup.id}/edit\">#{t(:edit)}</a></li>
|
|
|
|
<li><a href=\"#{admin_seminar_signup_path(seminar_signup.id)}\" class=\"delete text-error\" rel=\"nofollow\" data-method=\"delete\" data-confirm=\"Are you sure?\">#{t(:delete_)}</a></li>"
|
|
|
|
end
|
|
|
|
val += "</ul>
|
|
|
|
</div>"
|
|
|
|
%>
|
|
|
|
<% elsif names[1] == 'status' %>
|
|
|
|
<% val = t("seminar.registration_status_#{seminar_signup.status}") if !seminar_signup.status.blank? %>
|
|
|
|
<% elsif names[1] != 'recaptcha' %>
|
|
|
|
<% val = seminar_signup.send("#{names[1]}") %>
|
|
|
|
<% end %>
|
|
|
|
<% elsif names[0] == "default" %>
|
|
|
|
<% if names[2] == "name" %>
|
|
|
|
<% val = seminar_signup.name
|
|
|
|
val += "<div class=\"quick-edit\">
|
|
|
|
<ul class=\"nav nav-pills\">"
|
2021-04-24 10:41:50 +00:00
|
|
|
if @can_edit
|
2021-03-17 07:33:31 +00:00
|
|
|
val += "<li><a href=\"/admin/seminar_signups/#{seminar_signup.id}/edit\">#{t(:edit)}</a></li>
|
|
|
|
<li><a href=\"#{admin_seminar_signup_path(seminar_signup.id)}\" class=\"delete text-error\" rel=\"nofollow\" data-method=\"delete\" data-confirm=\"Are you sure?\">#{t(:delete_)}</a></li>"
|
|
|
|
end
|
|
|
|
val += "</ul>
|
|
|
|
</div>"
|
|
|
|
%>
|
|
|
|
<% elsif names[2] == "tel" %>
|
|
|
|
<% val = seminar_signup.tel %>
|
|
|
|
<% elsif names[2] == "registration_status" %>
|
|
|
|
<% val = t("seminar.registration_status_#{seminar_signup.status}") if !seminar_signup.status.blank? %>
|
|
|
|
<% end %>
|
|
|
|
<% elsif names[0] == "seminar_signup_field_custom" || names[0] == "seminar_signup_fields" %>
|
|
|
|
<% val = seminar_signup.seminar_signup_values.where(:key=>names[1]).first.get_value_by_locale(I18n.locale) rescue "" %>
|
|
|
|
<% elsif names[0] == "seminar_signup_contributes" %>
|
|
|
|
<% if names[1] == "file" %>
|
2021-04-24 10:41:50 +00:00
|
|
|
<% val = seminar_signup_contributes %>
|
2021-03-17 07:33:31 +00:00
|
|
|
<% else %>
|
2021-03-24 13:06:49 +00:00
|
|
|
<% if names[1] == "description" %>
|
2021-04-24 10:41:50 +00:00
|
|
|
<% descriptions = seminar_signup_contributes.collect{|s| s.send(names[1])} %>
|
2021-03-24 13:06:49 +00:00
|
|
|
<% if @seminar.enable_summary_choice
|
|
|
|
descriptions = descriptions.map do |description|
|
|
|
|
if (description.to_s.to_i.to_s == description)
|
|
|
|
description = @seminar.summary_chioices[description.to_i] rescue description
|
|
|
|
else
|
|
|
|
description = description.map{|i| @seminar.summary_chioices[i.to_i] rescue "" }.join("<br>") rescue description
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end %>
|
|
|
|
<% val = descriptions %>
|
|
|
|
<% else %>
|
2021-04-24 10:41:50 +00:00
|
|
|
<% val = seminar_signup_contributes.collect{|s| s.send(names[1]).to_s} %>
|
2021-03-24 13:06:49 +00:00
|
|
|
<% end %>
|
2021-03-17 07:33:31 +00:00
|
|
|
<% end %>
|
|
|
|
<% elsif names[0] == "seminar_submission_fields" %>
|
2021-04-24 10:41:50 +00:00
|
|
|
<% val = seminar_signup_contributes.collect{|s| (s.seminar_submission_values.where(:key=>names[1]).first.get_value_by_locale(I18n.locale) rescue "")} %>
|
|
|
|
<% seminar_submission_field = seminar_signup.seminar_main.seminar_submission_fields.where(:key=>names[1]).first %>
|
|
|
|
<% if seminar_submission_field && seminar_submission_field.markup == "seminar_preferred_session"
|
|
|
|
val = seminar_signup_contributes.collect{|s|
|
|
|
|
seminar_submission_value = s.seminar_submission_values.where(:key=>names[1]).first
|
|
|
|
"<span data-id=\"#{seminar_submission_value.id rescue ''}\">#{(seminar_submission_value.get_value_by_locale(I18n.locale) rescue "")}</span>"}
|
|
|
|
edit_urls[i] = []
|
|
|
|
seminar_submission_values = seminar_signup_contributes.collect{|s| s.seminar_submission_values.where(:key=>names[1]).first }
|
|
|
|
edit_urls[i] = seminar_submission_values.map{|seminar_submission_value| edit_admin_seminar_submission_value_path(seminar_submission_value.id) rescue "#"}
|
|
|
|
end %>
|
2021-03-29 14:27:08 +00:00
|
|
|
<% elsif names[0] == "seminar_signup" %>
|
|
|
|
<% val = (seminar_signup.send("display_"+names[1]) rescue seminar_signup.send(names[1])) rescue nil %>
|
2021-04-24 10:41:50 +00:00
|
|
|
<% elsif names[0] == "seminar_review_result" %>
|
|
|
|
<% if names[1] == "review" %>
|
|
|
|
<% val = contribute_ids.map{|contribute_id| "<a href=\"#{edit_admin_seminar_review_result_path(contribute_id)}\" class=\"btn\">#{t("seminar.review")}</a>"} %>
|
|
|
|
<% elsif names[1] == "presentation_type" %>
|
|
|
|
<% val = seminar_signup_contributes.map{|seminar_signup_contribute| seminar_signup_contribute.presentation_type} %>
|
|
|
|
<% elsif names[1] == "abstract_number" %>
|
|
|
|
<% val = seminar_signup_contributes.map{|seminar_signup_contribute| seminar_signup_contribute.abstract_number} %>
|
|
|
|
<% end %>
|
2021-03-17 07:33:31 +00:00
|
|
|
<% end %>
|
|
|
|
<% vals << val %>
|
|
|
|
<% end %>
|
|
|
|
<% count = 0 %>
|
|
|
|
<% indices = [] %>
|
|
|
|
<% vals.each_with_index do |val,i| %>
|
|
|
|
<% if val.class == Array %>
|
|
|
|
<% count = val.count - 1 %>
|
|
|
|
<% indices << i%>
|
|
|
|
<td>
|
|
|
|
<% if val[0].class == SeminarSignupContribute #File %>
|
|
|
|
<% seminar_signup_contribute = val[0] %>
|
2021-03-24 13:06:49 +00:00
|
|
|
<% description = seminar_signup_contribute.description.to_s %>
|
|
|
|
<% if @seminar.enable_summary_choice
|
|
|
|
if (seminar_signup_contribute.description.to_s.to_i.to_s == seminar_signup_contribute.description)
|
|
|
|
description = @seminar.summary_chioices[seminar_signup_contribute.description.to_i] rescue seminar_signup_contribute.description
|
|
|
|
else
|
|
|
|
description = seminar_signup_contribute.description.map{|i| @seminar.summary_chioices[i.to_i] rescue "" }.join("<br>") rescue seminar_signup_contribute.description
|
|
|
|
end
|
|
|
|
end %>
|
2022-06-18 15:13:29 +00:00
|
|
|
<%= link_to seminar_signup_contribute.disp_filename , seminar_signup_contribute.file.url, {:target => '_blank', :title => Nokogiri::HTML(description.gsub("<br>"," , ")).text, :download=>seminar_signup_contribute.disp_filename} if seminar_signup_contribute.file.file %>
|
2021-03-17 07:33:31 +00:00
|
|
|
<% else %>
|
|
|
|
<%= val[0].html_safe.to_s rescue "" %>
|
|
|
|
<% end %>
|
2021-04-24 10:41:50 +00:00
|
|
|
<% if edit_urls[i].present? %>
|
|
|
|
<div class="quick-edit">
|
|
|
|
<ul class="nav nav-pills">
|
|
|
|
<% if @can_edit %>
|
|
|
|
<li>
|
|
|
|
<a class="btn jquery_edit" data-href="<%=edit_urls[i][0]%>"><%= t(:edit) %></a>
|
|
|
|
</li>
|
|
|
|
<% end %>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
2021-03-17 07:33:31 +00:00
|
|
|
</td>
|
|
|
|
<% else %>
|
2021-04-24 10:41:50 +00:00
|
|
|
<td><%= val.to_s.html_safe %></td>
|
2021-03-17 07:33:31 +00:00
|
|
|
<% end %>
|
|
|
|
<% end %>
|
2021-04-10 02:47:33 +00:00
|
|
|
<% (1...count+1).each do |i|%>
|
2021-04-24 10:41:50 +00:00
|
|
|
<tr data-id="<%=seminar_signup.id.to_s%>" data-contribute_id="<%=contribute_ids[i].to_s%>">
|
|
|
|
<% if @drag%>
|
|
|
|
<td><span class="brand"><i class="icons-list-2"></i></span></td>
|
|
|
|
<% end %>
|
|
|
|
<% (0...vals.count).each do |index| %>
|
|
|
|
<% if indices.include?(index)
|
|
|
|
extra_class= ""
|
|
|
|
val = vals[index][i]
|
|
|
|
else
|
|
|
|
extra_class = "repeated"
|
|
|
|
val = vals[index]
|
|
|
|
end %>
|
|
|
|
<td class="<%= extra_class %>">
|
|
|
|
<% if (val.class == SeminarSignupContribute rescue false) #File %>
|
|
|
|
<% seminar_signup_contribute = val %>
|
2021-03-24 13:06:49 +00:00
|
|
|
<% description = seminar_signup_contribute.description.to_s %>
|
|
|
|
<% if @seminar.enable_summary_choice
|
|
|
|
if (seminar_signup_contribute.description.to_s.to_i.to_s == seminar_signup_contribute.description)
|
|
|
|
description = @seminar.summary_chioices[seminar_signup_contribute.description.to_i] rescue seminar_signup_contribute.description
|
|
|
|
else
|
|
|
|
description = seminar_signup_contribute.description.map{|i| @seminar.summary_chioices[i.to_i] rescue "" }.join("<br>") rescue seminar_signup_contribute.description
|
|
|
|
end
|
|
|
|
end %>
|
2022-06-18 15:13:29 +00:00
|
|
|
<%= link_to seminar_signup_contribute.disp_filename , seminar_signup_contribute.file.url, {:target => '_blank', :title => Nokogiri::HTML(description.gsub("<br>"," , ")).text, :download=>seminar_signup_contribute.disp_filename} if seminar_signup_contribute.file.file %>
|
2021-03-17 07:33:31 +00:00
|
|
|
<% else %>
|
2021-04-24 10:41:50 +00:00
|
|
|
<%= val.html_safe.to_s rescue "" %>
|
|
|
|
<% end %>
|
|
|
|
<% if (edit_urls[index][i].present? rescue false) %>
|
|
|
|
<div class="quick-edit">
|
|
|
|
<ul class="nav nav-pills">
|
|
|
|
<% if @can_edit %>
|
|
|
|
<li>
|
|
|
|
<a class="btn jquery_edit" data-href="<%=edit_urls[index][i]%>"><%= t(:edit) %></a>
|
|
|
|
</li>
|
|
|
|
<% end %>
|
|
|
|
</ul>
|
|
|
|
</div>
|
2021-03-17 07:33:31 +00:00
|
|
|
<% end %>
|
|
|
|
</td>
|
|
|
|
<% end %>
|
|
|
|
</tr>
|
|
|
|
<% end %>
|
|
|
|
</tr>
|
|
|
|
<% end %>
|
2021-04-04 12:33:09 +00:00
|
|
|
<% if @include_blank %>
|
2021-03-17 07:33:31 +00:00
|
|
|
<tr class="blank_tr">
|
|
|
|
<% if @drag %>
|
|
|
|
<td rowspan="3"></td>
|
|
|
|
<% end %>
|
|
|
|
<% (0...@display_field.count).each do |f| %>
|
|
|
|
<td rowspan="3"></td>
|
|
|
|
<% end %>
|
|
|
|
</tr>
|
|
|
|
<% end %>
|
|
|
|
</tbody>
|
2021-04-24 10:41:50 +00:00
|
|
|
</table>
|
|
|
|
<style type="text/css">
|
|
|
|
.repeated{
|
|
|
|
visibility: hidden;
|
|
|
|
}
|
|
|
|
</style>
|