[UPDT] HORILLA_THEME: Note tab and sweetalert update
This commit is contained in:
@@ -3449,3 +3449,13 @@ input[type=range]::-ms-fill-upper {
|
||||
font-size: 10pt;
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
.swal2-actions {
|
||||
direction: rtl;
|
||||
}
|
||||
.swal2-styled.swal2-confirm{
|
||||
background-color: rgb(0, 128, 0);
|
||||
}
|
||||
.swal2-styled.swal2-cancel{
|
||||
background-color : rgb(221, 51, 51);
|
||||
}
|
||||
|
||||
@@ -49,169 +49,97 @@
|
||||
</style>
|
||||
|
||||
{% if notes %}
|
||||
<div class="bg-white rounded-md shadow-card p-3 mb-5 lg:mb-0">
|
||||
<!-- Title -->
|
||||
<div class="flex items-center justify-between mb-3">
|
||||
<h5 class="font-semibold text-sm">{{ employee }}'s {% trans "Notes" %}</h5>
|
||||
</div>
|
||||
|
||||
<!-- Add Note Form -->
|
||||
{% if perms.employee.add_employeenote or request.user|is_reportingmanager %}
|
||||
<form hx-target="#note_target" hx-post="{% url 'add-employee-note' employee.id %}" id="commentForm">
|
||||
{% csrf_token %}
|
||||
<input type="text" name="description" id="commentInput"
|
||||
class="oh-input w-full mt-2" placeholder="{% trans 'Add notes' %}" hx-on:keyup="toggleCommentButton(this);">
|
||||
<button type="submit" id="commentButton"
|
||||
class="oh-btn oh-btn--secondary mt-2"
|
||||
style="display: none;">
|
||||
<i class="fa-regular fa-square-plus"></i>
|
||||
{% trans "Add" %}
|
||||
</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
|
||||
<!-- Notes List -->
|
||||
<div class="h-[calc(100vh_-_480px)] overflow-hidden overflow-y-auto mt-4" id="note_target">
|
||||
{% for note in notes %}
|
||||
<div class="border border-dark-50 p-3 rounded-md mb-2" id="employeeNote{{note.id}}">
|
||||
<div class="flex justify-between">
|
||||
<h3 class="font-semibold text-sm">{{ note.description }}</h3>
|
||||
{% if perms.employee.delete_employeenote or request.user|is_reportingmanager %}
|
||||
<span class="cursor-pointer" hx-get="{% url 'employee-note-delete' note.id %}"
|
||||
hx-on:click="setTimeout(() => {reloadMessage(this);},100);"
|
||||
hx-target="#employeeNote{{note.id}}" hx-swap="delete" title='{% trans "Delete" %}'>
|
||||
<ion-icon name="trash-outline" style="color: #e54f38;"></ion-icon>
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% if perms.employee.view_notefiles or request.user|is_reportingmanager %}
|
||||
<div class="flex flex-wrap gap-2 mt-2 mb-2">
|
||||
{% for file in note.note_files.all %}
|
||||
<a href="{{ file.files.url }}" target="_blank" rel="noopener noreferrer">
|
||||
<span class="oh-file-icon oh-file-icon--pdf" id="noteFile{{file.id}}"
|
||||
onmouseover="enlargeDoc('{{ file.files.url }}',$(this))"
|
||||
onmouseout="hideEnlargeDoc()" style="width: 40px; height: 40px;">
|
||||
{% if perms.employee.delete_notefiles or request.user|is_reportingmanager %}
|
||||
<img src="{% static 'images/ui/minus-icon.png' %}"
|
||||
style="display: block; width: 50%; height: 50%;"
|
||||
hx-get="{% url 'delete-employee-note-file' file.id %}" hx-target="#noteFile{{file.id}}"
|
||||
hx-swap="delete" onclick="event.stopPropagation();event.preventDefault()" />
|
||||
{% endif %}
|
||||
</span>
|
||||
</a>
|
||||
{% endfor %}
|
||||
{% if perms.employee.add_notefiles or request.user|is_reportingmanager %}
|
||||
<form hx-post="{% url 'add-more-files-employee' note.id %}" class="add-files-form"
|
||||
hx-encoding="multipart/form-data" hx-swap="innerHTML" hx-target="#note_target">
|
||||
{% csrf_token %}
|
||||
<label for="addFile_{{note.id}}" title="{% trans "Add Files" %}">
|
||||
<ion-icon name="add-outline" style="font-size: 12px;border: 1px solid #818791; border-radius: 5px;"
|
||||
class="text-gray-700"></ion-icon>
|
||||
</label>
|
||||
<input type="file" name="files" class="d-none" multiple id="addFile_{{note.id}}"
|
||||
onchange="submitForm(this)">
|
||||
<input type="submit" class="d-none add_more_submit" value="save" />
|
||||
</form>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<p class="text-xs text-[#565E6C] mt-1">
|
||||
{% trans "By" %} <span class="text-primary-600">{{ note.updated_by }}</span>
|
||||
</p>
|
||||
<p class="text-xs text-[#565E6C] mt-1">
|
||||
{% trans "At" %} {{ note.created_at|date:"d/m/Y" }} {{ note.created_at|time:"H:i A" }}
|
||||
</p>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% comment %} <span id="addnote" style="cursor: pointer">
|
||||
<div class="mt-4">
|
||||
<form hx-target="#note_target" hx-post="{% url 'add-employee-note' employee.id %}" id="commentForm">
|
||||
{% csrf_token %}
|
||||
<div>
|
||||
<div class="mt-4">
|
||||
<span class="text-md font-semibold">{{employee}}'s {% trans "Notes" %}</span>
|
||||
{% if perms.employee.add_employeenote or request.user|is_reportingmanager %}
|
||||
<input type="text" hx-on:keyup="toggleCommentButton(this);" name="description" id="commentInput"
|
||||
class="oh-input w-100 mt-2" placeholder="{% trans 'Add notes' %}">
|
||||
{% endif %}
|
||||
</div>
|
||||
<button type="submit" id="commentButton" class="oh-btn oh-btn--secondary mt-2 mr-0 oh-btn--w-100-resp"
|
||||
style="display: none;">
|
||||
{% trans "Add" %}
|
||||
</button>
|
||||
</div>
|
||||
<div class="oh-inner-sidebar-content__footer"></div>
|
||||
</form>
|
||||
<div class="bg-white rounded-md shadow-card p-3 mb-5 lg:mb-0">
|
||||
<!-- Title -->
|
||||
<div class="flex items-center justify-between mb-3">
|
||||
<h5 class="font-semibold text-sm">{{ employee }}'s {% trans "Notes" %}</h5>
|
||||
</div>
|
||||
</span>
|
||||
<ol class="oh-activity-sidebar__qa-list" role="list">
|
||||
{% for note in notes %}
|
||||
<div id="employeeNote{{note.id}}">
|
||||
<li class="oh-activity-sidebar__qa-item">
|
||||
<span class="oh-activity-sidebar__q">{{note.description}}
|
||||
|
||||
<!-- Add Note Form -->
|
||||
{% if perms.employee.add_employeenote or request.user|is_reportingmanager %}
|
||||
<form hx-target="#note_target" hx-post="{% url 'add-employee-note' employee.id %}" id="commentForm">
|
||||
{% csrf_token %}
|
||||
<input type="text" name="description" id="commentInput"
|
||||
class="oh-input w-full mt-2" placeholder="{% trans 'Add notes' %}" hx-on:keyup="toggleCommentButton(this);">
|
||||
<button type="submit" id="commentButton"
|
||||
class="oh-btn oh-btn--secondary mt-2"
|
||||
style="display: none;">
|
||||
<i class="fa-regular fa-square-plus"></i>
|
||||
{% trans "Add" %}
|
||||
</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
|
||||
<!-- Notes List -->
|
||||
<div class="h-[calc(100vh_-_480px)] overflow-hidden overflow-y-auto mt-4" id="note_target">
|
||||
{% for note in notes %}
|
||||
<div class="border border-dark-50 p-3 rounded-md mb-2" id="employeeNote{{note.id}}">
|
||||
<div class="flex justify-between">
|
||||
<h3 class="font-semibold text-sm">{{ note.description }}</h3>
|
||||
{% if perms.employee.delete_employeenote or request.user|is_reportingmanager %}
|
||||
<span class="float-end" hx-get="{% url 'employee-note-delete' note.id %}"
|
||||
hx-on:click="setTimeout(() => {reloadMessage(this);},100);" hx-target="#employeeNote{{note.id}}"
|
||||
hx-swap="delete" id="deleteNote">
|
||||
<ion-icon name="close-outline" style="font-size: 24px" role="img" class="md hydrated" aria-label="close outline"></ion-icon></span>
|
||||
</span>
|
||||
{% comment %} <span class="cursor-pointer" hx-get="{% url 'employee-note-delete' note.id %}"
|
||||
hx-on:click="setTimeout(() => {reloadMessage(this);},100);"
|
||||
hx-target="#employeeNote{{note.id}}" hx-swap="delete" title='{% trans "Delete" %}'>
|
||||
<ion-icon name="trash-outline" style="color: #e54f38;"></ion-icon>
|
||||
</span> {% endcomment %}
|
||||
<form method="POST"
|
||||
hx-post="{% url 'employee-note-delete' note.id %}"
|
||||
hx-confirm="{% trans 'Are you sure you want to delete this note?' %}"
|
||||
hx-target="#note_target"
|
||||
hx-swap="outerHTML"
|
||||
class="inline-block">
|
||||
{% csrf_token %}
|
||||
<button type="submit" class="cursor-pointer bg-transparent border-0 p-0" title="{% trans 'Delete' %}">
|
||||
<ion-icon name="trash-outline" style="color: #e54f38;"></ion-icon>
|
||||
</button>
|
||||
</form>
|
||||
|
||||
|
||||
{% endif %}
|
||||
</span>
|
||||
{% if perms.employee.view_notefiles or request.user|is_reportingmanager %}
|
||||
<div class="d-flex mt-2 mb-2">
|
||||
{% for file in note.note_files.all %}
|
||||
<a href="{{ file.files.url }}" rel="noopener noreferrer" target="_blank">
|
||||
<span class="oh-file-icon oh-file-icon--pdf" id="noteFile{{file.id}}"
|
||||
onmouseover="enlargeDoc('{{ file.files.url }}',$(this))" onmouseout="hideEnlargeDoc()"
|
||||
style="width: 40px; height: 40px">
|
||||
{% if perms.employee.delete_notefiles or request.user|is_reportingmanager %}
|
||||
<img src="{% static 'images/ui/minus-icon.png' %}"
|
||||
style="display: block; width: 50%; height: 50%" hx-swap="delete"
|
||||
hx-get="{% url 'delete-employee-note-file' file.id %}" hx-target="#noteFile{{file.id}}"
|
||||
onclick="event.stopPropagation();event.preventDefault()" />
|
||||
{% endif %}
|
||||
</span>
|
||||
</a>
|
||||
{% endfor %}
|
||||
{% if perms.employee.add_notefiles or request.user|is_reportingmanager %}
|
||||
<form hx-post="{% url 'add-more-files-employee' note.id %}" class="add-files-form"
|
||||
hx-encoding="multipart/form-data" data-target="#activitySidebar" hx-swap="innerHTML"
|
||||
hx-target="#note_target">
|
||||
{% csrf_token %}
|
||||
<label for="addFile_{{note.id}}" title="Add Files"><ion-icon name="add-outline"
|
||||
style="font-size: 24px" role="img" class="md hydrated"
|
||||
aria-label="add outline"></ion-icon></label>
|
||||
<input type="file" name="files" class="d-none" multiple="true" id="addFile_{{note.id}}"
|
||||
onchange="submitForm(this)" />
|
||||
<input type="submit" class="d-none add_more_submit" value="save" />
|
||||
</form>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
<span class="oh-activity-sidebar__a">
|
||||
{% trans "by" %}
|
||||
<img src="https://ui-avatars.com/api/?name={{note.updated_by.get_full_name}}&background=random"
|
||||
style="width: 1.5em; border-radius: 100%" alt="User" />
|
||||
{{note.updated_by}}
|
||||
</span>
|
||||
<span class="oh-activity-sidebar__a">
|
||||
{% trans "at" %}  
|
||||
<span class="dateformat_changer">{{ note.created_at|date:"Y-m-d" }}</span>
|
||||
 
|
||||
<span class="timeformat_changer">{{ note.created_at|time:"H:i" }}</span>
|
||||
</span>
|
||||
<div style="width: 30%">
|
||||
<div id="enlargeDocContainer" class="enlargeDocContainer"></div>
|
||||
</div>
|
||||
</li>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</ol> {% endcomment %}
|
||||
|
||||
{% if perms.employee.view_notefiles or request.user|is_reportingmanager %}
|
||||
<div class="flex flex-wrap gap-2 mt-2 mb-2">
|
||||
{% for file in note.note_files.all %}
|
||||
<a href="{{ file.files.url }}" target="_blank" rel="noopener noreferrer">
|
||||
<span class="oh-file-icon oh-file-icon--pdf" id="noteFile{{file.id}}"
|
||||
onmouseover="enlargeDoc('{{ file.files.url }}',$(this))"
|
||||
onmouseout="hideEnlargeDoc()" style="width: 40px; height: 40px;">
|
||||
{% if perms.employee.delete_notefiles or request.user|is_reportingmanager %}
|
||||
<img src="{% static 'images/ui/minus-icon.png' %}"
|
||||
style="display: block; width: 50%; height: 50%;"
|
||||
hx-get="{% url 'delete-employee-note-file' file.id %}" hx-target="#noteFile{{file.id}}"
|
||||
hx-swap="delete" onclick="event.stopPropagation();event.preventDefault()" />
|
||||
{% endif %}
|
||||
</span>
|
||||
</a>
|
||||
{% endfor %}
|
||||
{% if perms.employee.add_notefiles or request.user|is_reportingmanager %}
|
||||
<form hx-post="{% url 'add-more-files-employee' note.id %}" class="add-files-form"
|
||||
hx-encoding="multipart/form-data" hx-swap="innerHTML" hx-target="#note_target">
|
||||
{% csrf_token %}
|
||||
<label for="addFile_{{note.id}}" title="{% trans "Add Files" %}">
|
||||
<ion-icon name="add-outline" style="font-size: 12px;border: 1px solid #818791; border-radius: 5px;"
|
||||
class="text-gray-700"></ion-icon>
|
||||
</label>
|
||||
<input type="file" name="files" class="d-none" multiple id="addFile_{{note.id}}"
|
||||
onchange="submitForm(this)">
|
||||
<input type="submit" class="d-none add_more_submit" value="save" />
|
||||
</form>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<p class="text-xs text-[#565E6C] mt-1">
|
||||
{% trans "By" %} <span class="text-primary-600">{{ note.updated_by }}</span>
|
||||
</p>
|
||||
<p class="text-xs text-[#565E6C] mt-1">
|
||||
{% trans "At" %} {{ note.created_at|date:"d/m/Y" }} {{ note.created_at|time:"H:i A" }}
|
||||
</p>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="mt-4">
|
||||
<form hx-target="#note_target" hx-post="{% url 'add-employee-note' employee.id %}"
|
||||
|
||||
@@ -550,7 +550,7 @@ class SkillZoneFilter(FilterSet):
|
||||
]
|
||||
|
||||
|
||||
class SkillZoneCandFilter(FilterSet):
|
||||
class SkillZoneCandFilter(HorillaFilterSet):
|
||||
"""
|
||||
Skillzone Candidate FIlter
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user