[UPDT] RECRUITMENT: Stage button alignment stage delete confirm modal change

This commit is contained in:
Horilla
2024-04-09 13:18:48 +05:30
parent 7eea917916
commit 0c62939153
3 changed files with 11 additions and 21 deletions

View File

@@ -16,10 +16,12 @@
<!-- Tab Content -->
<div class="oh-tabs__content oh-tabs__content" id="tab_rec_{{ rec.id }}">
{% if request.user|recruitment_manages:rec or perms.recruitment.add_stage %}
<button class="oh-btn oh-btn--secondary" data-target="#addStageModal" data-toggle="oh-modal-toggle" hx-get="{% url 'rec-stage-create' %}?recruitment_id={{ rec.id }}" hx-target="#addStageModalBody">
<ion-icon class="me-1" name="add-outline"></ion-icon>
{% trans 'Stage' %}
</button>
<div class="d-flex" style="flex-direction: row-reverse;">
<button class="oh-btn oh-btn--secondary" data-target="#addStageModal" data-toggle="oh-modal-toggle" hx-get="{% url 'rec-stage-create' %}?recruitment_id={{ rec.id }}" hx-target="#addStageModalBody">
<ion-icon class="me-1" name="add-outline"></ion-icon>
{% trans 'Stage' %}
</button>
</div>
{% endif %}
{% comment %}ordered_stages method in Recruitment model{% endcomment %}
<div class="pt-3 stage-badges" id="stageContainer{{ rec.id }}" hx-trigger="load" hx-get="{% url 'pipeline-stages-component' %}?rec_id={{ rec.id }}">

View File

@@ -62,22 +62,10 @@
{% endif %}
{% if perms.recruitment.delete_stage %}
<li class="oh-dropdown__item">
<form method="post" action="{% url 'rec-stage-delete' stage.id %}">
<form method="post" action="{% url 'rec-stage-delete' stage.id %}"
onsubmit="return confirm('{% trans "Are you sure you want to delete this stage?" %}');">
{% csrf_token %}
<button onclick="
Swal.fire({
title: '{% trans "Are you sure you want to delete this stage?" %}',
showCancelButton: true,
confirmButtonText: 'Delete',
confirmButtonColor: '#008000',
cancelButtonColor: '#d33',
confirmButtonText:'Confirm',
}).then((result) => {
if (result.isConfirmed) {
$(this).closest('form').submit();
}
});
" type="button" class="oh-dropdown__link oh-dropdown__link--danger">
<button type="submit" class="oh-dropdown__link oh-dropdown__link--danger">
{% trans "Delete" %}
</button>
</form>

View File

@@ -663,13 +663,13 @@ def recruitment_close_pipeline(request, rec_id):
@recruitment_manager_can_enter(perm="recruitment.change_recruitment")
def recruitment_reopen_pipeline(request, rec_id):
"""
This method is used to re-open recruitment from pipeline view
This method is used to reopen recruitment from pipeline view
"""
recruitment_obj = Recruitment.objects.get(id=rec_id)
recruitment_obj.closed = False
recruitment_obj.save()
messages.success(request, "Recruitment re-opend successfully")
messages.success(request, "Recruitment reopend successfully")
return HttpResponseRedirect(request.META.get("HTTP_REFERER", "/"))