2018-01-02 18:30:32 +00:00
|
|
|
<% data = action_data("check_session") %>
|
2018-06-23 14:37:01 +00:00
|
|
|
<% if data["session"] == true %>
|
2018-01-02 18:30:32 +00:00
|
|
|
<% 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") %>
|
2018-01-02 18:30:32 +00:00
|
|
|
<% 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">
|
2018-01-19 13:31:41 +00:00
|
|
|
#applyForm .modal-dialog{
|
|
|
|
z-index: 1100;
|
|
|
|
}
|
|
|
|
#applicationform{
|
|
|
|
padding: 10px;
|
|
|
|
}
|
|
|
|
</style>
|
2018-01-15 12:26:18 +00:00
|
|
|
|
|
|
|
<!-- 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">
|
2018-01-19 13:31:41 +00:00
|
|
|
<label for="cover-letter"><%= t("recruitment.please_write_cover_letter") %></label>
|
2018-01-15 12:26:18 +00:00
|
|
|
<textarea id="cover-letter" placeholder="Cover Letter" name="cover_letter" rows="5" class="form-control"></textarea>
|
2018-01-19 13:31:41 +00:00
|
|
|
<div class="alert alert-warning"><%= t("recruitment.cv_sent_along") %></div>
|
2018-01-15 12:26:18 +00:00
|
|
|
</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">
|
2018-01-19 13:31:41 +00:00
|
|
|
<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>
|
2018-01-15 12:26:18 +00:00
|
|
|
</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 %>
|
2018-01-02 18:30:32 +00:00
|
|
|
<% 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 %>
|