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

70 lines
2.5 KiB
Plaintext
Raw Normal View History

<% data = action_data("check_session") %>
<% if data["session"] == "true" %>
<% if data["type"] == "jobs" %>
<%= render_view %>
2018-01-15 12:26:18 +00:00
<% elsif data["type"] == "internships" %>
<%= render_view("internships") %>
2018-01-16 12:06:04 +00:00
<% elsif data["type"] == "exchanges" %>
<%= render_view("exchanges") %>
<% elsif data["type"] == "candidates" %>
<%= render_view("candidate_show") %>
<% end %>
2018-01-15 12:26:18 +00:00
<% case data["type"]
2018-01-16 12:06:04 +00:00
when "jobs", "internships", "exchanges" %>
2018-01-15 12:26:18 +00:00
<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>
<% 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 %>