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

61 lines
2.0 KiB
Plaintext
Raw Normal View History

<span id="index_table">
<table class="table main-list">
<thead>
<tr class="sort-header">
2018-01-19 09:08:40 +00:00
<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">
2018-01-19 09:08:40 +00:00
<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>
2018-01-19 09:08:40 +00:00
<h3 id="myModalLabel"><%= t("recruitment.job_category") %></h3>
</div>
<div class="modal-body"></div>
<div class="modal-footer">
2018-01-19 09:08:40 +00:00
<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>