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

61 lines
2.0 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><%= t("recruitment.categories") %></th>
</tr>
</thead>
<tbody>
<% @categories.each do |category| %>
<tr>
<td>
<%= category.job_category_translations["en"] %> / <%= category.job_category_translations["zh_tw"] %>
<div class="quick-edit">
<ul class="nav nav-pills">
<li><a href="<%= editcategory_admin_recruitment_path(category) %>" class="categoryBtn"><%= t(:edit) %></a></li>
<li><a href="<%= deletecategory_admin_recruitment_path(category) %>" 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="<%= addcategory_admin_recruitments_path %>" id="addIndustryBtn" class="btn btn-primary categoryBtn"><%= t("recruitment.add_category") %></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"><%= t("recruitment.job_category") %></h3>
</div>
<div class="modal-body"></div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true"><%= t("close") %></button>
<button class="btn btn-primary" id="save-btn"><%= t("save") %></button>
</div>
</div>
<script type="text/javascript">
var modal = $("#myModal");
$(".categoryBtn").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(){
$("#category_form").submit();
})
</script>