recruitment/app/views/admin/recruitments/industries.html.erb

61 lines
1.9 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<span id="index_table">
<table class="table main-list">
<thead>
<tr class="sort-header">
<th>Title</th>
</tr>
</thead>
<tbody>
<% @industries.each do |industry| %>
<tr>
<td>
<%= industry.industry_title_translations["en"] %> / <%= industry.industry_title_translations["zh_tw"] %>
<div class="quick-edit">
<ul class="nav nav-pills">
<li><a href="<%= editindustry_admin_recruitment_path(industry) %>" class="industryBtn"><%= t(:edit) %></a></li>
<li><a href="<%= deleteindustry_admin_recruitment_path(industry) %>" class="delete text-error" data-method="delete" data-confirm="Are you sure?"><%= t(:delete_) %></a></li>
</ul>
</div>
</td>
</tr>
<% end %>
</tbody>
</table>
</span>
<div class="bottomnav clearfix">
<div class="pull-right">
<a href="<%= addindustry_admin_recruitments_path %>" id="addIndustryBtn" class="btn btn-primary industryBtn">Add Industry</a>
</div>
</div>
<!-- Modal -->
<div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="myModalLabel">Industry</h3>
</div>
<div class="modal-body"></div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
<button class="btn btn-primary" id="save-btn">Save</button>
</div>
</div>
<script type="text/javascript">
var modal = $("#myModal");
$(".industryBtn").on("click",function(){
var url = $(this).attr("href");
$.ajax({
url : url,
type : "get",
dataType : "html"
}).done(function(html){
modal.find(".modal-body").html(html);
modal.modal("show");
})
return false;
})
$("#save-btn").on("click",function(){
$("#industry_form").submit();
})
</script>