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

46 lines
1.7 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>
2018-01-07 18:22:57 +00:00
<button type="button" class="btn btn-primary" id="searchBtn"><i class="fa fa-search" aria-hidden="true"></i> <%= t("recruitment.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" %>
2018-01-07 18:22:57 +00:00
<div><%= t("recruitment.login_to_view") %> <a href="<%= thissession["url"] %>"><%= t("recruitment.login") %></a></div>
<script type="text/javascript">
window.location.href = "<%= thissession["url"] %>";
</script>
<% end %>