[ADD] GENERAL: White labelling

This commit is contained in:
Horilla
2024-05-23 14:29:29 +05:30
parent 948209f692
commit df03cdc54e
19 changed files with 88 additions and 26 deletions

View File

@@ -11,6 +11,7 @@ from attendance.models import AttendanceGeneralSetting
from base.models import Company
from base.urls import urlpatterns
from employee.models import EmployeeGeneralSetting
from horilla import horilla_apps
from offboarding.models import OffboardingGeneralSetting
from payroll.models.models import PayrollGeneralSetting
from recruitment.models import RecruitmentGeneralSetting
@@ -99,6 +100,30 @@ urlpatterns.append(
)
def white_labelling_company(request):
white_labelling = getattr(horilla_apps, "WHITE_LABELLING", False)
if white_labelling:
hq = Company.objects.filter(hq=True).last()
try:
company = (
request.user.employee_get.get_company()
if request.user.employee_get.get_company()
else hq
)
except:
company = hq
return {
"white_label_company_name": company.company if company else "Horilla",
"white_label_company": company,
}
else:
return {
"white_label_company_name": "Horilla",
"white_label_company": None,
}
def resignation_request_enabled(request):
"""
Check weather resignation_request enabled of not in offboarding

View File

@@ -101,9 +101,7 @@
</form>
</div>
<img
src="{% static 'images/ui/auth-logo.png' %}"
width="150"
height="41"
src={% if white_label_company.icon %}"{{white_label_company.icon.url}}" {% else %} "{% static 'images/ui/auth-logo.png' %}" {% endif %}
alt="Horilla"
/>
</main>

View File

@@ -49,3 +49,5 @@ SIDEBARS = [
"asset",
"helpdesk",
]
WHITE_LABELLING = False

View File

@@ -12,6 +12,9 @@ TEMPLATES[0]["OPTIONS"]["context_processors"].append(
TEMPLATES[0]["OPTIONS"]["context_processors"].append(
"base.context_processors.get_companies",
)
TEMPLATES[0]["OPTIONS"]["context_processors"].append(
"base.context_processors.white_labelling_company",
)
TEMPLATES[0]["OPTIONS"]["context_processors"].append(
"base.context_processors.resignation_request_enabled",
)

View File

@@ -7,7 +7,10 @@
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Employee Onboarding - Horilla Dashboard</title>
<title>Employee Onboarding - {{white_label_company_name}} Dashboard</title>
<link rel="apple-touch-icon" sizes="180x180" href="{% if white_label_company.icon %}{{white_label_company.icon.url}} {% else %}{% static 'favicons/apple-touch-icon.png' %}{% endif %}">
<link rel="icon" type="image/png" sizes="32x32" href="{% if white_label_company.icon %}{{white_label_company.icon.url}} {% else %}{% static 'favicons/favicon-32x32.png' %}{% endif %}">
<link rel="icon" type="image/png" sizes="16x16" href="{% if white_label_company.icon %}{{white_label_company.icon.url}} {% else %}{% static 'favicons/favicon-16x16.png' %}{% endif %}">
<link rel="stylesheet" href="{% static 'build/css/style.min.css' %}" />
</head>

View File

@@ -6,7 +6,10 @@
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Employee Onboarding - Horilla Dashboard</title>
<title>Employee Onboarding - {{white_label_company_name}} Dashboard</title>
<link rel="apple-touch-icon" sizes="180x180" href="{% if white_label_company.icon %}{{white_label_company.icon.url}} {% else %}{% static 'favicons/apple-touch-icon.png' %}{% endif %}">
<link rel="icon" type="image/png" sizes="32x32" href="{% if white_label_company.icon %}{{white_label_company.icon.url}} {% else %}{% static 'favicons/favicon-32x32.png' %}{% endif %}">
<link rel="icon" type="image/png" sizes="16x16" href="{% if white_label_company.icon %}{{white_label_company.icon.url}} {% else %}{% static 'favicons/favicon-16x16.png' %}{% endif %}">
<link rel="stylesheet" href="{% static 'build/css/style.min.css' %}" />
</head>

View File

@@ -6,7 +6,10 @@
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Employee Onboarding - Horilla Dashboard</title>
<title>Employee Onboarding - {{white_label_company_name}} Dashboard</title>
<link rel="apple-touch-icon" sizes="180x180" href="{% if white_label_company.icon %}{{white_label_company.icon.url}} {% else %}{% static 'favicons/apple-touch-icon.png' %}{% endif %}">
<link rel="icon" type="image/png" sizes="32x32" href="{% if white_label_company.icon %}{{white_label_company.icon.url}} {% else %}{% static 'favicons/favicon-32x32.png' %}{% endif %}">
<link rel="icon" type="image/png" sizes="16x16" href="{% if white_label_company.icon %}{{white_label_company.icon.url}} {% else %}{% static 'favicons/favicon-16x16.png' %}{% endif %}">
<link rel="stylesheet" href="{% static 'build/css/style.min.css' %}" />
</head>

View File

@@ -7,7 +7,10 @@
<meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Employee Onboarding - Horilla Dashboard</title>
<title>Employee Onboarding - {{white_label_company_name}} Dashboard</title>
<link rel="apple-touch-icon" sizes="180x180" href="{% if white_label_company.icon %}{{white_label_company.icon.url}} {% else %}{% static 'favicons/apple-touch-icon.png' %}{% endif %}">
<link rel="icon" type="image/png" sizes="32x32" href="{% if white_label_company.icon %}{{white_label_company.icon.url}} {% else %}{% static 'favicons/favicon-32x32.png' %}{% endif %}">
<link rel="icon" type="image/png" sizes="16x16" href="{% if white_label_company.icon %}{{white_label_company.icon.url}} {% else %}{% static 'favicons/favicon-16x16.png' %}{% endif %}">
<link rel="stylesheet" href="{% static 'build/css/style.min.css' %}" />
<style>
ul.errorlist {

View File

@@ -6,7 +6,10 @@
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Employee Onboarding - Horilla Dashboard</title>
<title>Employee Onboarding - {{white_label_company_name}} Dashboard</title>
<link rel="apple-touch-icon" sizes="180x180" href="{% if white_label_company.icon %}{{white_label_company.icon.url}} {% else %}{% static 'favicons/apple-touch-icon.png' %}{% endif %}">
<link rel="icon" type="image/png" sizes="32x32" href="{% if white_label_company.icon %}{{white_label_company.icon.url}} {% else %}{% static 'favicons/favicon-32x32.png' %}{% endif %}">
<link rel="icon" type="image/png" sizes="16x16" href="{% if white_label_company.icon %}{{white_label_company.icon.url}} {% else %}{% static 'favicons/favicon-16x16.png' %}{% endif %}">
<link rel="stylesheet" href="{% static 'build/css/style.min.css' %}" />
</head>

View File

@@ -314,7 +314,7 @@
<div class="col-sm-12 col-md-12 col-lg-12">
<p class="small text-muted text-center">
&copy; 2023 Horilla. All rights resevered.
&copy; 2023 {{white_label_company_name}}. All rights resevered.
</p>
</div>
</div>

View File

@@ -8,7 +8,10 @@
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>{% trans "Horilla - Open Recruitments" %}</title>
<title>{% trans "{{white_label_company_name}} - Open Recruitments" %}</title>
<link rel="apple-touch-icon" sizes="180x180" href="{% if white_label_company.icon %}{{white_label_company.icon.url}} {% else %}{% static 'favicons/apple-touch-icon.png' %}{% endif %}">
<link rel="icon" type="image/png" sizes="32x32" href="{% if white_label_company.icon %}{{white_label_company.icon.url}} {% else %}{% static 'favicons/favicon-32x32.png' %}{% endif %}">
<link rel="icon" type="image/png" sizes="16x16" href="{% if white_label_company.icon %}{{white_label_company.icon.url}} {% else %}{% static 'favicons/favicon-16x16.png' %}{% endif %}">
<link rel="stylesheet" href="{% static "/build/css/style.min.css" %}" />
</head>

View File

@@ -114,7 +114,7 @@ def dashboard(request):
managers = []
for manager in rec.recruitment_managers.all():
name = manager.employee_first_name + " " + manager.employee_last_name
name = manager.get_full_name()
managers.append(name)
recruitment_manager_mapping[recruitment_title] = managers

View File

@@ -5,7 +5,10 @@
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Page Not Found - Horilla</title>
<title>Page Not Found - {{white_label_company_name}}</title>
<link rel="apple-touch-icon" sizes="180x180" href="{% if white_label_company.icon %}{{white_label_company.icon.url}} {% else %}{% static 'favicons/apple-touch-icon.png' %}{% endif %}">
<link rel="icon" type="image/png" sizes="32x32" href="{% if white_label_company.icon %}{{white_label_company.icon.url}} {% else %}{% static 'favicons/favicon-32x32.png' %}{% endif %}">
<link rel="icon" type="image/png" sizes="16x16" href="{% if white_label_company.icon %}{{white_label_company.icon.url}} {% else %}{% static 'favicons/favicon-16x16.png' %}{% endif %}">
<link rel="stylesheet" href="/static/build/css/style.min.css" />
</head>

View File

@@ -5,7 +5,10 @@
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Login - Horilla Dashboard</title>
<title>Login - {{white_label_company_name}} Dashboard</title>
<link rel="apple-touch-icon" sizes="180x180" href="{% if white_label_company.icon %}{{white_label_company.icon.url}} {% else %}{% static 'favicons/apple-touch-icon.png' %}{% endif %}">
<link rel="icon" type="image/png" sizes="32x32" href="{% if white_label_company.icon %}{{white_label_company.icon.url}} {% else %}{% static 'favicons/favicon-32x32.png' %}{% endif %}">
<link rel="icon" type="image/png" sizes="16x16" href="{% if white_label_company.icon %}{{white_label_company.icon.url}} {% else %}{% static 'favicons/favicon-16x16.png' %}{% endif %}">
<link rel="stylesheet" href="{% static 'build/css/style.min.css' %}" />
</head>
<body>

View File

@@ -15,13 +15,13 @@
var at_work_seconds = {{ request.user.employee_get.get_forecasted_at_work.forecasted_at_work_seconds }}
var run = 0
</script>
<title class="time-runner stop-runner">Horilla</title>
<link rel="apple-touch-icon" sizes="180x180" href="{% static 'favicons/apple-touch-icon.png' %}">
<title class="time-runner stop-runner">{{white_label_company_name}}</title>
<link rel="stylesheet" href="{% static 'build/css/driver.min.css' %}"/>
<meta name="theme-color" content="orangered">
<link rel="manifest" href="{% static 'build/manifest.json' %}">
<link rel="icon" type="image/png" sizes="32x32" href="{% static 'favicons/favicon-32x32.png' %}">
<link rel="icon" type="image/png" sizes="16x16" href="{% static 'favicons/favicon-16x16.png' %}">
<link rel="apple-touch-icon" sizes="180x180" href="{% if white_label_company.icon %}{{white_label_company.icon.url}} {% else %}{% static 'favicons/apple-touch-icon.png' %}{% endif %}">
<link rel="icon" type="image/png" sizes="32x32" href="{% if white_label_company.icon %}{{white_label_company.icon.url}} {% else %}{% static 'favicons/favicon-32x32.png' %}{% endif %}">
<link rel="icon" type="image/png" sizes="16x16" href="{% if white_label_company.icon %}{{white_label_company.icon.url}} {% else %}{% static 'favicons/favicon-16x16.png' %}{% endif %}">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@11.0.20/dist/sweetalert2.min.css">
<meta name="msapplication-TileColor" content="#da532c">
@@ -517,12 +517,12 @@
}
// accessing initial worked hours from the user
$(".time-runner").not("title").html(secondsToDuration(at_work_seconds));
$("title.time-runner").html("Horilla | "+secondsToDuration(at_work_seconds));
$("title.time-runner").html("{{white_label_company_name}} | "+secondsToDuration(at_work_seconds));
setInterval(() => {
if (run) {
at_work_seconds = at_work_seconds + 1
$("div.time-runner").html(secondsToDuration(at_work_seconds));
$("title").html("Horilla | "+secondsToDuration(at_work_seconds));
$("title").html("{{white_label_company_name}} | "+secondsToDuration(at_work_seconds));
}
}, 1000);
</script>

View File

@@ -5,7 +5,10 @@
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Login - Horilla Dashboard</title>
<title>Login - {{white_label_company_name}} Dashboard</title>
<link rel="apple-touch-icon" sizes="180x180" href="{% if white_label_company.icon %}{{white_label_company.icon.url}} {% else %}{% static 'favicons/apple-touch-icon.png' %}{% endif %}">
<link rel="icon" type="image/png" sizes="32x32" href="{% if white_label_company.icon %}{{white_label_company.icon.url}} {% else %}{% static 'favicons/favicon-32x32.png' %}{% endif %}">
<link rel="icon" type="image/png" sizes="16x16" href="{% if white_label_company.icon %}{{white_label_company.icon.url}} {% else %}{% static 'favicons/favicon-16x16.png' %}{% endif %}">
<link rel="stylesheet" href="{% static '/build/css/style.min.css' %}" />
<link rel="manifest" href="{% static 'build/manifest.json' %}" />
</head>
@@ -89,9 +92,7 @@
</form>
</div>
<img
src="{% static 'images/ui/auth-logo.png' %}"
width="150"
height="41"
src={% if white_label_company.icon %}"{{white_label_company.icon.url}}" {% else %} "{% static 'images/ui/auth-logo.png' %}" {% endif %}
alt="Horilla"
/>
</main>

View File

@@ -5,7 +5,10 @@
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Page Not Found - Horilla</title>
<title>Page Not Found - {{white_label_company_name}}</title>
<link rel="apple-touch-icon" sizes="180x180" href="{% if white_label_company.icon %}{{white_label_company.icon.url}} {% else %}{% static 'favicons/apple-touch-icon.png' %}{% endif %}">
<link rel="icon" type="image/png" sizes="32x32" href="{% if white_label_company.icon %}{{white_label_company.icon.url}} {% else %}{% static 'favicons/favicon-32x32.png' %}{% endif %}">
<link rel="icon" type="image/png" sizes="16x16" href="{% if white_label_company.icon %}{{white_label_company.icon.url}} {% else %}{% static 'favicons/favicon-16x16.png' %}{% endif %}">
<link rel="stylesheet" href="/static/build/css/style.min.css" />
</head>

View File

@@ -6,7 +6,10 @@
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Reset Password - Horilla Dashboard</title>
<title>Reset Password - {{white_label_company_name}} Dashboard</title>
<link rel="apple-touch-icon" sizes="180x180" href="{% if white_label_company.icon %}{{white_label_company.icon.url}} {% else %}{% static 'favicons/apple-touch-icon.png' %}{% endif %}">
<link rel="icon" type="image/png" sizes="32x32" href="{% if white_label_company.icon %}{{white_label_company.icon.url}} {% else %}{% static 'favicons/favicon-32x32.png' %}{% endif %}">
<link rel="icon" type="image/png" sizes="16x16" href="{% if white_label_company.icon %}{{white_label_company.icon.url}} {% else %}{% static 'favicons/favicon-16x16.png' %}{% endif %}">
<link rel="stylesheet" href="{% static 'build/css/style.min.css' %}" />
<style>
ul.errorlist {

View File

@@ -5,7 +5,10 @@
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Page Not Found - Horilla</title>
<title>Page Not Found - {{white_label_company_name}}</title>
<link rel="apple-touch-icon" sizes="180x180" href="{% if white_label_company.icon %}{{white_label_company.icon.url}} {% else %}{% static 'favicons/apple-touch-icon.png' %}{% endif %}">
<link rel="icon" type="image/png" sizes="32x32" href="{% if white_label_company.icon %}{{white_label_company.icon.url}} {% else %}{% static 'favicons/favicon-32x32.png' %}{% endif %}">
<link rel="icon" type="image/png" sizes="16x16" href="{% if white_label_company.icon %}{{white_label_company.icon.url}} {% else %}{% static 'favicons/favicon-16x16.png' %}{% endif %}">
<link rel="stylesheet" href="/static/build/css/style.min.css" />
</head>