recruitment/app/views/recruitments/index.html.erb

46 lines
1.6 KiB
Plaintext
Raw Normal View History

<% thissession = action_data("check_session") %>
<% if thissession["session"] == "true" %>
<%= render_view %>
<!-- Modal -->
<div class="modal fade" id="advancedSearch" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="ajax-content"><div style="margin-top:15px; text-align: center;">Loading...</div></div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary" id="searchBtn"><i class="fa fa-search" aria-hidden="true"></i> Search</button>
</div>
</div>
</div>
</div>
<script type="text/javascript">
var searchBox = $("#advancedSearch");
$("#advancedSearchBtn").on("click",function(){
searchBox.modal("show");
if( searchBox.find(".ajax-content").data("loaded") != "false") {
$.ajax({
url : "/recruit/advancedform",
dataType : "html",
type : "get"
}).done(function(html){
searchBox.find(".ajax-content").html(html);
searchBox.find(".ajax-content").attr("data-loaded","true");
})
}
return false;
})
$("#searchBtn").on("click",function(){
$("#advancedSearchForm").find(":input").filter(function(){ return !this.value; }).attr("disabled", "disabled");
$("#advancedSearchForm").submit();
})
</script>
<% elsif thissession["session"] == "false" %>
<div>Please login to view this page. <a href="<%= thissession["url"] %>">Login</a></div>
<script type="text/javascript">
window.location.href = "<%= thissession["url"] %>";
</script>
<% end %>