Application_Form/app/views/seminars/index.html.erb

66 lines
2.5 KiB
Plaintext

<% # encoding: utf-8 %>
<%
data = action_data
@seminars = data["seminars"]
@total_pages = data["total_pages"]
@time_now = data["time_now"]
%>
<% begin %>
<table class="table table-hover table-striped seminar-index">
<caption>
<h3><%= t('seminar.seminar') %></h3>
</caption>
<thead>
<tr>
<th class="col-md-2"><%= t(:category) %></th>
<th class="col-md-3"><%= t('seminar.title') %></th>
<th class="col-md-2"><%= t('seminar_signup.time') %></th>
<th class="col-md-2"><%= t('seminar_signup.place') %></th>
<th class="col-md-2"><%= t('seminar.signup') %></th>
</tr>
</thead>
<tbody>
<%
@seminars.each do |seminar|
if !seminar.registration_status.blank? and (seminar.signup_start_date <= @time_now rescue false) and ( seminar.signup_end_date.nil? or seminar.signup_end_date+1 >= @time_now )
sign_up = ('<a href="'+ OrbitHelper.url_to_show(seminar.to_param) + '" target="_blank">' + t('seminar.signup') + '</a>').html_safe
elsif seminar.registration_status.blank?
sign_up = t('seminar.sign_up_not_open')
elsif (seminar.signup_start_date > @time_now rescue false)
sign_up = t('seminar.sign_up_not_yet')
else
sign_up = t('seminar.sign_up_overdue')
end
%>
<tr>
<td><%= seminar.category.title %></td>
<td><%= ('<a href="'+ OrbitHelper.url_to_show(seminar.to_param) + '?method=show_data" target="_blank">' + seminar.title + '</a>').html_safe %></td>
<td><%= SeminarMain.time_range(seminar.seminar_start_date, seminar.seminar_end_date) %></td>
<td><%= seminar.act_place %></td>
<td>
<%= sign_up %> <br />
<%=
if !seminar.registration_status.blank? and seminar.registration_status.include?('C') and (seminar.contribute_start_date <= @time_now rescue false) and ( seminar.contribute_end_date.nil? or (seminar.contribute_end_date+1 >= @time_now rescue false) )
if !session[:seminar_signup_id].blank?
if session[:seminar_main_id] == seminar.id
('<a href="'+ OrbitHelper.url_to_show(seminar.to_param) + '?method=con_upload">' + t('seminar_signup.uploads') + '</a>').html_safe
else
('<a href="'+ OrbitHelper.url_to_show(seminar.to_param) + '?method=con_login">' + t('seminar_signup.con_login') + '</a>').html_safe
end
else
('<a href="'+ OrbitHelper.url_to_show(seminar.to_param) + '?method=con_login">' + t('seminar_signup.con_login') + '</a>').html_safe
end
end
%>
</td>
</tr>
<% end %>
</tbody>
</table>
<% rescue => e
puts [e,e.backtrace]
end
%>
<%= create_pagination(@total_pages).html_safe if @total_pages > 1 %>