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

64 lines
2.2 KiB
Plaintext
Raw Normal View History

<% data = action_data("check_session") %>
<% if data["session"] == "true" %>
<% if data["type"] == "jobs" %>
<%= render_view %>
<style type="text/css">
#applyForm .modal-dialog{
z-index: 1100;
}
#applicationform{
padding: 10px;
}
</style>
<!-- Modal -->
<div class="modal fade" id="applyForm" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="myModalLabel">{{job-title}}</h4>
</div>
<div class="modal-body">
<form id="applicationform" action="/recruit/applyjob" method="post" class="form-horizontal">
<div class="form-group adv-search-bar">
<label for="cover-letter">Please write a cover letter</label>
<textarea id="cover-letter" placeholder="Cover Letter" name="cover_letter" rows="5" class="form-control"></textarea>
<div class="alert alert-warning">Your CV and Rest of your profile will be sent along with it.</div>
</div>
<input type="hidden" name="job_id" id="jobid" value="">
<input type="hidden" name="authenticity_token" value="<%= form_authenticity_token %>">
</form>
</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="applyBtn">Apply</button>
</div>
</div>
</div>
</div>
<script type="text/javascript">
var formModal = $("#applyForm");
$("#jobApplicationBtn").on("click",function(){
var jobid = $(this).parent().data("jobid"),
title = $(this).parent().data("jobtitle")
formModal.find("#jobid").val(jobid);
formModal.find(".modal-title").text(title);
formModal.modal("show");
return false;
})
$("#applyBtn").on("click",function(){
formModal.find("form").submit();
})
</script>
<% elsif data["type"] == "candidates" %>
<%= render_view("candidate_show") %>
<% end %>
<% else %>
<div>Please login to view this page. <a href="<%= data["url"] %>">Login</a></div>
<script type="text/javascript">
window.location.href = "<%= data["url"] %>";
</script>
<% end %>