venue_management/app/views/admin/venue_management_contracts/_index.html.erb

87 lines
3.6 KiB
Plaintext
Raw Normal View History

2020-07-30 17:30:14 +00:00
<script>
if(document.querySelectorAll("#orbit-bar").length==0) location.reload();
</script>
<% if 'venue_management_contracts' == params[:action] %>
<h4><%= @venue_management.title %></h4>
<% end %>
<table class="table main-list">
<thead>
<tr class="sort-header">
<% @table_fields.each do |f| %>
<%= thead(f) %>
<% end %>
</tr>
</thead>
<tbody>
<% @contracts.each do |contract| %>
<tr>
<% if 'venue_management_contracts' != params[:action] %>
<td><%= contract.venue_management_main.title %></td>
<% end %>
<td>
2020-08-11 09:12:31 +00:00
<% case_no = (contract.case_no.nil? ? t(:empty) : contract.case_no) %>
<%= link_to case_no, (@venue_management_page_url.blank? ? "#" : "/#{I18n.locale}"+@venue_management_page_url+"/#{case_no.to_s.strip}-#{contract.id}?method=show_contract"), :target => '_self' %>
2020-07-30 17:30:14 +00:00
<div class="quick-edit">
<ul class="nav nav-pills">
2020-11-12 13:28:01 +00:00
<% if can_edit_or_delete?(@venue_management || contract.venue_management_main) %>
2020-07-30 17:30:14 +00:00
<li><%= link_to t(:edit), edit_admin_venue_management_contract_path(contract.id) %></li>
<li><a href="#" class="delete text-error" rel="/admin/venue_management_contracts/<%=contract.id.to_s%>"><%= t(:delete_) %></a></li>
<% end %>
</ul>
</div>
</td>
<td><%= contract.display_tags %></td>
<td><%= contract.display_contractors %></td>
<td><%= "#{contract.early_rent} / #{contract.operation_rent}" %></td>
2020-09-22 15:19:59 +00:00
<td><%= contract.display_royalty %></td>
2020-07-30 17:30:14 +00:00
<td><%= "#{contract.contract_start_date} / #{contract.contract_end_date}" %></td>
<td><%= contract.deposit_amount_type_exp_date %></td>
<td><%= contract.renewal_permission.present? ? t("vm_contract.renewal.#{contract.renewal_permission}") : t("vm_contract.renewal.false") %></td>
<td><%= contract.display_other_commitment %></td>
<td><%= contract.display_note %></td>
2020-07-30 17:30:14 +00:00
</tr>
<% end %>
</tbody>
</table>
<% filter_url = request.fullpath.split("?")[1..-1].join("?") %>
2020-07-30 17:30:14 +00:00
<% if @venue_management.present? %>
<% filter_url.blank? ? (filter_url += "id=#{@venue_management.id}") : (filter_url += "&id=#{@venue_management.id}") %>
2020-07-30 17:30:14 +00:00
<!-- footer -->
<div class="bottomnav clearfix">
<%= content_tag :div, class: "pagination-centered" do %>
2020-10-05 16:09:17 +00:00
<%= paginate(@contracts) %>
<div class="action pull-right">
<%= link_to content_tag(:i, nil, class: "fa fa-download") + " " + t('venue_management.export'), export_admin_venue_management_contracts_path(:format=>'xlsx')+"#{(filter_url.blank? ? '' : ('?'+filter_url))}", class: "btn btn-primary", target: '_blank' %>
2020-11-12 13:28:01 +00:00
<% if can_edit_or_delete?(@venue_management) %>
<%= link_to content_tag(:i, nil, class: "icons-plus") + " " + t(:add), new_admin_venue_management_contract_path(id: @venue_management.id), class: "btn btn-primary" %>
<% end %>
2020-10-05 16:09:17 +00:00
</div>
<% end %>
2020-07-30 17:30:14 +00:00
</div>
<!-- footer:end -->
<% else %>
<%=
content_tag :div, class: "bottomnav clearfix" do
(content_tag(:div, class: "pagination-centered") do
paginate(@contracts)
end) +
('<div class="action pull-right">'.html_safe +
link_to(content_tag(:i, nil, class: "fa fa-download") + " " + t('venue_management.export'), export_admin_venue_management_contracts_path(:format=>'xlsx')+"#{(filter_url.blank? ? '' : ('?'+filter_url))}", class: "btn btn-primary", target: '_blank') +
'</div>'.html_safe)
end
%>
2020-07-30 17:30:14 +00:00
<% end %>
2020-10-05 16:09:17 +00:00
<style type="text/css">
.pagination-centered .pagination{
width: calc(100% - 6em);
float: left;
}
.main-list {
margin-bottom: 30px;
}
</style>