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

66 lines
2.3 KiB
Plaintext

<style type="text/css">
#cover_letter_box .modal-dialog{
z-index: 1100;
}
</style>
<div id="dashboard-wrapper">
<%= render :partial => "dashboard_header" %>
<table class="table table-striped jobs-table">
<thead>
<tr>
<th>Candidate Name</th>
<th>Application Date</th>
<th>Cover Letter</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<% @applications.each do |application| %>
<% profile = application.employee_profile %>
<tr>
<td><a target="_blank" href="/<%= I18n.locale.to_s %>/candidates/<%= profile.recruit_profile.to_param %>"><%= profile.recruit_profile.name %></a></td>
<td><%= application.created_at.strftime("%d %B %Y") %></td>
<td>
<% if !application.cover_letter.nil? && application.cover_letter != "" %>
<a href="" for="<%= profile.recruit_profile.name %>" class="cover-letter-btn">Cover Letter</a><div style="display: none;"><%= application.cover_letter %></div>
<% else %>
<a href="" disabled="disabled" class="">Cover Letter</a>
<% end %>
</td>
<td><a class="btn btn-danger archive-button" href="/recruit/<%= application.id.to_s %>/archive_application">Delete</a></td>
</tr>
<% end %>
</tbody>
</table>
<div class="modal fade" id="cover_letter_box" 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">Modal title</h4>
</div>
<div class="modal-body"></div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
var letterBox = $("#cover_letter_box");
$(".cover-letter-btn").on("click",function(){
var name = $(this).attr("for"),
letter = $(this).parent().find("div").html();
letterBox.find(".modal-body").html(letter);
letterBox.find(".modal-title").text(name + " ~ Cover Letter");
letterBox.modal("show");
return false;
})
$(".archive-button").on("click",function(){
if(!confirm("You can not undo once application is deleted. Are you sure?")){
return false;
}
})
</script>