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

73 lines
2.9 KiB
Plaintext
Raw Normal View History

2016-06-29 06:57:45 +00:00
<% # encoding: utf-8 %>
<%
data = action_data
@seminars = data["seminars"]
@total_pages = data["total_pages"]
@time_now = data["time_now"]
%>
2021-03-31 08:15:12 +00:00
<% begin %>
2016-06-29 06:57:45 +00:00
<table class="table table-hover table-striped seminar-index">
<caption>
2021-10-26 14:01:36 +00:00
<% page = OrbitHelper.page rescue Page.where(:page_id => params[:page_id]).first %>
<h3><%= page.name rescue t('seminar.seminar') %></h3>
2016-06-29 06:57:45 +00:00
</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|
2021-03-31 08:15:12 +00:00
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 )
2016-06-29 06:57:45 +00:00
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')
2021-03-31 08:15:12 +00:00
elsif (seminar.signup_start_date > @time_now rescue false)
2016-06-29 06:57:45 +00:00
sign_up = t('seminar.sign_up_not_yet')
else
sign_up = t('seminar.sign_up_overdue')
end
%>
<tr>
<td><%= seminar.category.title %></td>
2021-06-17 10:07:43 +00:00
<td>
<% if (seminar.enable_custom_template rescue false) %>
<%= ('<a href="'+ OrbitHelper.url_to_show(seminar.to_param) + '/home/introduction" target="_blank">' + seminar.title + '</a>').html_safe %>
<% else %>
<%= ('<a href="'+ OrbitHelper.url_to_show(seminar.to_param) + '?method=show_data" target="_blank">' + seminar.title + '</a>').html_safe %>
<% end %>
</td>
2016-06-29 06:57:45 +00:00
<td><%= SeminarMain.time_range(seminar.seminar_start_date, seminar.seminar_end_date) %></td>
<td><%= seminar.act_place %></td>
<td>
<%= sign_up %> <br />
<%=
2021-03-31 08:15:12 +00:00
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) )
2016-06-29 06:57:45 +00:00
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>
2021-03-31 08:15:12 +00:00
<% rescue => e
puts [e,e.backtrace]
end
%>
2016-06-29 06:57:45 +00:00
<%= create_pagination(@total_pages).html_safe if @total_pages > 1 %>