linkedin post content edit mode
This commit is contained in:
parent
99643eb08c
commit
f9aaaeb788
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -629,6 +629,10 @@ class JobPostingStatusForm(forms.ModelForm):
|
|||||||
widgets = {
|
widgets = {
|
||||||
'status': forms.Select(attrs={'class': 'form-select'}),
|
'status': forms.Select(attrs={'class': 'form-select'}),
|
||||||
}
|
}
|
||||||
|
class LinkedPostContentForm(forms.ModelForm):
|
||||||
|
class Meta:
|
||||||
|
model = JobPosting
|
||||||
|
fields = ['linkedin_post_formated_data']
|
||||||
|
|
||||||
class FormTemplateIsActiveForm(forms.ModelForm):
|
class FormTemplateIsActiveForm(forms.ModelForm):
|
||||||
class Meta:
|
class Meta:
|
||||||
|
|||||||
@ -509,7 +509,7 @@ def handle_zoom_webhook_event(payload):
|
|||||||
# We rely on the unique 'id' that maps to your ZoomMeeting.meeting_id field.
|
# We rely on the unique 'id' that maps to your ZoomMeeting.meeting_id field.
|
||||||
meeting_id_zoom = str(object_data.get('id'))
|
meeting_id_zoom = str(object_data.get('id'))
|
||||||
print(meeting_id_zoom)
|
print(meeting_id_zoom)
|
||||||
if not meeting_id_zoom:job_posting.application_url}"
|
if not meeting_id_zoom:
|
||||||
logger.warning(f"Webhook received without a valid Meeting ID: {event_type}")
|
logger.warning(f"Webhook received without a valid Meeting ID: {event_type}")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|||||||
@ -66,6 +66,7 @@ urlpatterns = [
|
|||||||
path('forms/', views.form_templates_list, name='form_templates_list'),
|
path('forms/', views.form_templates_list, name='form_templates_list'),
|
||||||
path('forms/create-template/', views.create_form_template, name='create_form_template'),
|
path('forms/create-template/', views.create_form_template, name='create_form_template'),
|
||||||
|
|
||||||
|
path('jobs/<slug:slug>/edit_linkedin_post_content/',views.edit_linkedin_post_content,name='edit_linkedin_post_content'),
|
||||||
path('jobs/<slug:slug>/candidate_screening_view/', views.candidate_screening_view, name='candidate_screening_view'),
|
path('jobs/<slug:slug>/candidate_screening_view/', views.candidate_screening_view, name='candidate_screening_view'),
|
||||||
path('jobs/<slug:slug>/candidate_exam_view/', views.candidate_exam_view, name='candidate_exam_view'),
|
path('jobs/<slug:slug>/candidate_exam_view/', views.candidate_exam_view, name='candidate_exam_view'),
|
||||||
path('jobs/<slug:slug>/candidate_interview_view/', views.candidate_interview_view, name='candidate_interview_view'),
|
path('jobs/<slug:slug>/candidate_interview_view/', views.candidate_interview_view, name='candidate_interview_view'),
|
||||||
|
|||||||
@ -33,6 +33,7 @@ from .forms import (
|
|||||||
StaffUserCreationForm,
|
StaffUserCreationForm,
|
||||||
MeetingCommentForm,
|
MeetingCommentForm,
|
||||||
ToggleAccountForm,
|
ToggleAccountForm,
|
||||||
|
LinkedPostContentForm
|
||||||
|
|
||||||
)
|
)
|
||||||
from easyaudit.models import CRUDEvent, LoginEvent, RequestEvent
|
from easyaudit.models import CRUDEvent, LoginEvent, RequestEvent
|
||||||
@ -343,6 +344,7 @@ def job_detail(request, slug):
|
|||||||
offer_count = applicants.filter(stage="Offer").count()
|
offer_count = applicants.filter(stage="Offer").count()
|
||||||
|
|
||||||
status_form = JobPostingStatusForm(instance=job)
|
status_form = JobPostingStatusForm(instance=job)
|
||||||
|
linkedin_content_form=LinkedPostContentForm(instance=job)
|
||||||
try:
|
try:
|
||||||
# If the related object exists, use its instance data
|
# If the related object exists, use its instance data
|
||||||
image_upload_form = JobPostingImageForm(instance=job.post_images)
|
image_upload_form = JobPostingImageForm(instance=job.post_images)
|
||||||
@ -471,6 +473,7 @@ def job_detail(request, slug):
|
|||||||
'high_potential_ratio': high_potential_ratio,
|
'high_potential_ratio': high_potential_ratio,
|
||||||
'avg_t2i_days': avg_t2i_days,
|
'avg_t2i_days': avg_t2i_days,
|
||||||
'avg_t_in_exam_days': avg_t_in_exam_days,
|
'avg_t_in_exam_days': avg_t_in_exam_days,
|
||||||
|
'linkedin_content_form':linkedin_content_form
|
||||||
}
|
}
|
||||||
return render(request, "jobs/job_detail.html", context)
|
return render(request, "jobs/job_detail.html", context)
|
||||||
|
|
||||||
@ -508,6 +511,30 @@ def job_image_upload(request, slug):
|
|||||||
return redirect('job_detail', slug=job.slug)
|
return redirect('job_detail', slug=job.slug)
|
||||||
|
|
||||||
|
|
||||||
|
@login_required
|
||||||
|
def edit_linkedin_post_content(request,slug):
|
||||||
|
|
||||||
|
job=get_object_or_404(JobPosting,slug=slug)
|
||||||
|
linkedin_content_form=LinkedPostContentForm(instance=job)
|
||||||
|
if request.method=='POST':
|
||||||
|
linkedin_content_form=LinkedPostContentForm(request.POST,instance=job)
|
||||||
|
if linkedin_content_form.is_valid():
|
||||||
|
linkedin_content_form.save()
|
||||||
|
messages.success(request,"Linked post content updated successfully!")
|
||||||
|
return redirect('job_detail',job.slug)
|
||||||
|
else:
|
||||||
|
messages.error(request,"Error update the Linkedin Post content")
|
||||||
|
return redirect('job_detail',job.slug)
|
||||||
|
|
||||||
|
else:
|
||||||
|
linkedin_content_form=LinkedPostContentForm()
|
||||||
|
return redirect('job_detail',job.slug)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def kaauh_career(request):
|
def kaauh_career(request):
|
||||||
active_jobs = JobPosting.objects.select_related(
|
active_jobs = JobPosting.objects.select_related(
|
||||||
'form_template'
|
'form_template'
|
||||||
|
|||||||
@ -356,6 +356,8 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -404,6 +406,11 @@
|
|||||||
<small>{% trans "Error:" %} {{ job.linkedin_post_status }}</small>
|
<small>{% trans "Error:" %} {{ job.linkedin_post_status }}</small>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if job.linkedin_post_formated_data %}
|
||||||
|
<button type="button" class="btn btn-main-action w-100" data-bs-toggle="modal" data-bs-target="#linkedinData">
|
||||||
|
<i class="fas fa-edit me-1"></i> {% trans "Update LinkedIn Content" %}
|
||||||
|
</button>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -499,6 +506,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% include "jobs/partials/image_upload.html" %}
|
{% include "jobs/partials/image_upload.html" %}
|
||||||
|
{% include "jobs/partials/linkedin_content_form.html"%}
|
||||||
|
|
||||||
<div class="modal fade" id="editStatusModal" tabindex="-1" aria-labelledby="editStatusModalLabel" aria-hidden="true">
|
<div class="modal fade" id="editStatusModal" tabindex="-1" aria-labelledby="editStatusModalLabel" aria-hidden="true">
|
||||||
<div class="modal-dialog">
|
<div class="modal-dialog">
|
||||||
|
|||||||
22
templates/jobs/partials/linkedin_content_form.html
Normal file
22
templates/jobs/partials/linkedin_content_form.html
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
{% load crispy_forms_tags %}
|
||||||
|
<div class="modal fade mt-4" id="linkedinData" tabindex="-1" aria-labelledby="myModalLabel" aria-hidden="true">
|
||||||
|
<div class="modal-dialog">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h5 class="modal-title" id="myModalLabel">Edit linkedin Post content</h5>
|
||||||
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<form method="post" action="{% url 'edit_linkedin_post_content' job.slug %}" enctype="multipart/form-data" >
|
||||||
|
{% csrf_token %}
|
||||||
|
{{ linkedin_content_form|crispy }}
|
||||||
|
<div class="modal-footer mt-2">
|
||||||
|
<button type="button" class="btn btn-lg btn-secondary" data-bs-dismiss="modal">Close</button>
|
||||||
|
<button type="submit" class="btn btn-main-action ">Save changes</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
Loading…
x
Reference in New Issue
Block a user