18# added list of applied candidates

This commit is contained in:
Eligiusz Kurzawa 2021-01-15 08:24:37 +01:00
parent fcac708cc8
commit 815c86a07c
2 changed files with 23 additions and 0 deletions

View File

@ -48,6 +48,10 @@ class SingleJobView(SuccessMessageMixin, UpdateView):
context = super(SingleJobView, self).get_context_data(**kwargs)
context['categories'] = Category.objects.all()
context['employee_applied'] = Job.objects.get(pk=self.kwargs['pk']).employee.all().filter(id=self.request.user.id)
try:
context['applied_employees'] = Job.objects.get(pk=self.kwargs['pk'], employer_id=self.request.user.id).employee.all()
except:
pass
return context
def form_valid(self, form):

View File

@ -36,6 +36,25 @@
{% endif %}
</form>
{% if user.is_employer %}
{% if applied_employees %}
<div class="list-group">
<button type="button" class="list-group-item list-group-item-action active" aria-current="true" style="text-align: center">
Applied candidates
</button>
{% for employee in applied_employees %}
<button type="button" class="list-group-item list-group-item-action">{{ employee.first_name }} {{ employee.last_name }}</button>
{% endfor %}
</div>
{% else %}
<div class="list-group">
<button type="button" class="list-group-item list-group-item-danger" aria-current="true" style="text-align: center">
No applied candidates
</button>
</div>
{% endif %}
{% endif %}
</div> <!-- .col-md-8 -->
<div class="col-md-4 sidebar ftco-animate">
<div class="sidebar-box">