[UPDT] GENERAL: Context processors
This commit is contained in:
@@ -7,6 +7,7 @@ from django.urls import path
|
|||||||
from django.http import HttpResponse
|
from django.http import HttpResponse
|
||||||
from base.models import Company
|
from base.models import Company
|
||||||
from base.urls import urlpatterns
|
from base.urls import urlpatterns
|
||||||
|
from offboarding.models import OffboardingGeneralSetting
|
||||||
|
|
||||||
|
|
||||||
class AllCompany:
|
class AllCompany:
|
||||||
@@ -90,3 +91,14 @@ urlpatterns.append(
|
|||||||
name="update-selected-company",
|
name="update-selected-company",
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def resignation_request_enabled(request):
|
||||||
|
"""
|
||||||
|
Check weather resignation_request enabled of not in offboarding
|
||||||
|
"""
|
||||||
|
first = OffboardingGeneralSetting.objects.first()
|
||||||
|
enabled_resignation_request = True
|
||||||
|
if first:
|
||||||
|
enabled_resignation_request = first.resignation_request
|
||||||
|
return {"enabled_resignation_request": enabled_resignation_request}
|
||||||
|
|||||||
@@ -2,5 +2,6 @@
|
|||||||
|
|
||||||
|
|
||||||
{% include "announcement/expiry_day.html" %}
|
{% include "announcement/expiry_day.html" %}
|
||||||
|
{% include "offboarding/settings/settings.html" %}
|
||||||
|
|
||||||
{% endblock settings %}
|
{% endblock settings %}
|
||||||
@@ -8,3 +8,6 @@ from horilla.settings import TEMPLATES
|
|||||||
TEMPLATES[0]["OPTIONS"]["context_processors"].append(
|
TEMPLATES[0]["OPTIONS"]["context_processors"].append(
|
||||||
"base.context_processors.get_companies",
|
"base.context_processors.get_companies",
|
||||||
)
|
)
|
||||||
|
TEMPLATES[0]["OPTIONS"]["context_processors"].append(
|
||||||
|
"base.context_processors.resignation_request_enabled",
|
||||||
|
)
|
||||||
|
|||||||
@@ -788,7 +788,7 @@
|
|||||||
>{% trans "Pipeline" %}</a
|
>{% trans "Pipeline" %}</a
|
||||||
>
|
>
|
||||||
</li>
|
</li>
|
||||||
{% if perms.offboarding.view_resignationletter %}
|
{% if perms.offboarding.view_resignationletter and enabled_resignation_request %}
|
||||||
<li class="oh-sidebar__submenu-item">
|
<li class="oh-sidebar__submenu-item">
|
||||||
<a
|
<a
|
||||||
href="{% url 'resignation-request-view' %}"
|
href="{% url 'resignation-request-view' %}"
|
||||||
|
|||||||
Reference in New Issue
Block a user