venue_management/app/views/venue_managements/index.html.erb

63 lines
2.8 KiB
Plaintext

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