70 lines
2.6 KiB
Plaintext
70 lines
2.6 KiB
Plaintext
<% data = action_data("check_session") %>
|
|
<% if data["session"] == "true" %>
|
|
<% if data["type"] == "jobs" %>
|
|
<%= render_view %>
|
|
<% elsif data["type"] == "internships" %>
|
|
<%= render_view("internships") %>
|
|
<% elsif data["type"] == "exchanges" %>
|
|
<%= render_view("exchanges") %>
|
|
<% elsif data["type"] == "candidates" %>
|
|
<%= render_view("candidate_show") %>
|
|
<% end %>
|
|
<% case data["type"]
|
|
when "jobs", "internships", "exchanges" %>
|
|
<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">×</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"><%= t("recruitment.please_write_cover_letter") %></label>
|
|
<textarea id="cover-letter" placeholder="Cover Letter" name="cover_letter" rows="5" class="form-control"></textarea>
|
|
<div class="alert alert-warning"><%= t("recruitment.cv_sent_along") %></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"><%= t("close") %></button>
|
|
<button type="button" class="btn btn-primary" id="applyBtn"><%= t("recruitment.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 %>
|