[FIX] BASE: Fixed shift request detail view not showing for employees without work info
This commit is contained in:
@@ -1672,8 +1672,11 @@ class ShiftRequest(HorillaModel):
|
||||
Detail view subtitle
|
||||
"""
|
||||
|
||||
return f"""{self.employee_id.employee_work_info.department_id } /
|
||||
{ self.employee_id.employee_work_info.job_position_id}"""
|
||||
try:
|
||||
return f"""{self.employee_id.employee_work_info.department_id } /
|
||||
{ self.employee_id.employee_work_info.job_position_id}"""
|
||||
except:
|
||||
return None
|
||||
|
||||
def clean(self):
|
||||
|
||||
|
||||
@@ -1,50 +1,29 @@
|
||||
{% extends 'index.html' %}
|
||||
{% load static i18n %}
|
||||
{% block content %}
|
||||
|
||||
<section class="oh-wrapper oh-main__topbar">
|
||||
<div
|
||||
class="oh-main__titlebar oh-main__titlebar--left oh-d-flex-column--resp oh-mb-3--small"
|
||||
>
|
||||
<div class="oh-main__titlebar oh-main__titlebar--left oh-d-flex-column--resp oh-mb-3--small">
|
||||
<h1 class="oh-main__titlebar-title fw-bold">
|
||||
{% trans "Mail Templates" %}
|
||||
</h1>
|
||||
</div>
|
||||
{% if perms.base.add_horillamailtemplate %}
|
||||
<div
|
||||
class="oh-main__titlebar oh-main__titlebar--right oh-d-flex-column--resp oh-mb-3--small"
|
||||
>
|
||||
<a
|
||||
hx-get="{% url 'create-mail-template' %}"
|
||||
data-toggle="oh-modal-toggle"
|
||||
data-target="#objectCreateModal"
|
||||
hx-target="#objectCreateModalTarget"
|
||||
class="oh-btn oh-btn--secondary ml-2"
|
||||
><ion-icon
|
||||
name="add"
|
||||
class="mr-1 md hydrated"
|
||||
role="img"
|
||||
aria-label="add"
|
||||
></ion-icon
|
||||
>{% trans "Create" %}</a
|
||||
>
|
||||
</div>
|
||||
<div class="oh-main__titlebar oh-main__titlebar--right oh-d-flex-column--resp oh-mb-3--small">
|
||||
<a hx-get="{% url 'create-mail-template' %}" data-toggle="oh-modal-toggle" data-target="#objectCreateModal"
|
||||
hx-target="#objectCreateModalTarget" class="oh-btn oh-btn--secondary ml-2"
|
||||
>
|
||||
<ion-icon name="add" class="mr-1 md hydrated" role="img" aria-label="add"></ion-icon>
|
||||
{% trans "Create" %}
|
||||
</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
</section>
|
||||
<main :class="sidebarOpen ? 'oh-main__sidebar-visible' : ''">
|
||||
<div class="oh-wrapper">
|
||||
<div class="oh-404">
|
||||
<img
|
||||
style="width: 150px; height: 150px"
|
||||
src="{% static 'images/ui/email.png' %}"
|
||||
class="oh-404__image mb-4"
|
||||
alt="Page not found. 404."
|
||||
/>
|
||||
<h5 class="oh-404__subtitle">
|
||||
{% trans "There are currently no email templates." %}
|
||||
</h5>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<div class="oh-wrapper">
|
||||
<div class="oh-empty">
|
||||
<img src="{% static 'images/ui/search.svg' %}" class="oh-404__image" alt="Page not found. 404." />
|
||||
<h1 class="oh-empty__title">{% trans "No Records found." %}</h1>
|
||||
<p class="oh-empty__subtitle">{% trans "There are currently no email templates available." %}</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock content %}
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
class="text-danger"
|
||||
style="cursor: pointer"
|
||||
onclick="return confirm('Do you want to delete this template?')"
|
||||
title="{% trans 'Edit' %}"
|
||||
title="{% trans 'Delete' %}"
|
||||
>
|
||||
<ion-icon name="trash-outline"></ion-icon>
|
||||
</a>
|
||||
|
||||
Reference in New Issue
Block a user