[UPDT] PMS: Icon for answer button is updated, and filtering for answer button is added
This commit is contained in:
@@ -142,7 +142,7 @@
|
||||
onclick="event.stopPropagation()"
|
||||
>
|
||||
<div class="oh-btn-group">
|
||||
<a class="oh-btn w-100" href="{% url 'feedback-answer-get' id=feedback.id %}" title="{% trans 'Answer' %}"><ion-icon name="create-outline"></ion-icon></a>
|
||||
<a class="oh-btn w-100" style="height:10px" href="{% url 'feedback-answer-get' id=feedback.id %}" title="{% trans 'Answer' %}"><img width="80%" src="{% static 'images/ui/writing.png' %}"></a>
|
||||
<a class="oh-btn w-100" href="{% url 'feedback-answer-view' id=feedback.id %}" title="{% trans 'Answer view' %}"><ion-icon name="eye"></ion-icon></ion-icon></a>
|
||||
<form action="{% url 'feedback-archive' id=feedback.id %}" method="post" style="display: contents">
|
||||
{% if feedback.archive == True %}
|
||||
@@ -285,7 +285,7 @@
|
||||
<div class="oh-sticky-table__td">{{ current_date|timesince:feedback.end_date }}</div>
|
||||
<div class="oh-sticky-table__td" onclick="event.stopPropagation()">
|
||||
<div class="oh-btn-group">
|
||||
<a class="oh-btn w-100" href="{% url 'feedback-answer-get' id=feedback.id %}" title="{% trans 'Answer' %}"><ion-icon name="create-outline"></ion-icon></a>
|
||||
<a class="oh-btn w-100" style="height:10px" href="{% url 'feedback-answer-get' id=feedback.id %}" title="{% trans 'Answer' %}"><img width="80%" src="{% static 'images/ui/writing.png' %}"></a>
|
||||
<a class="oh-btn w-100" href="{% url 'feedback-answer-view' id=feedback.id %}" title="{% trans 'Answer view' %}"><ion-icon name="eye"></ion-icon></ion-icon></a>
|
||||
<form action="{% url 'feedback-archive' id=feedback.id %}" method="post" style="display: contents">
|
||||
{% if feedback.archive == True %}
|
||||
@@ -429,8 +429,11 @@
|
||||
<div class="oh-sticky-table__td">{{ current_date|timesince:feedback.end_date }}</div>
|
||||
<div class="oh-sticky-table__td" onclick="event.stopPropagation()">
|
||||
<div class="oh-btn-group">
|
||||
|
||||
<a class="oh-btn w-100" href="{% url 'feedback-answer-get' id=feedback.id %}" title="{% trans 'Answer' %}"><ion-icon name="create-outline"></ion-icon></a>
|
||||
{% if feedback|is_feedback_answer:request.user %}
|
||||
<a class="oh-btn w-100" style="height:10px" href="{% url 'feedback-answer-get' id=feedback.id %}" title="{% trans 'Answer' %}"><img width="80%" src="{% static 'images/ui/writing.png' %}"></a>
|
||||
{% else %}
|
||||
<a class="oh-btn w-100" style="height:10px;background-color: #cccccc;" disabled title="{% trans 'Answer' %}"><img width="80%" src="{% static 'images/ui/writing.png' %}"></a>
|
||||
{% endif %}
|
||||
<a class="oh-btn w-100" href="{% url 'feedback-answer-view' id=feedback.id %}" title="{% trans 'Answer view' %}"><ion-icon name="eye"></ion-icon></ion-icon></a>
|
||||
<form action="{% url 'feedback-archive' id=feedback.id %}" method="post" style="display: contents">
|
||||
{% if feedback.archive == True %}
|
||||
|
||||
@@ -66,3 +66,18 @@ def is_feedback_manager_or_owner(feedback, user):
|
||||
elif Feedback.objects.filter(id=feedback.id, employee_id=employee).exists():
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
@register.filter(name="is_feedback_answer")
|
||||
def is_feedback_answer(feedback, user):
|
||||
"""
|
||||
This method will return true, if the user is manger or owner of the feedback,
|
||||
"""
|
||||
employee = Employee.objects.filter(employee_user_id=user).first()
|
||||
if Feedback.objects.filter(id=feedback.id, manager_id=employee).exists():
|
||||
return True
|
||||
elif Feedback.objects.filter(id=feedback.id, employee_id=employee).exists():
|
||||
return True
|
||||
elif Feedback.objects.filter(id=feedback.id, subordinate_id=employee).exists():
|
||||
return True
|
||||
return False
|
||||
|
||||
BIN
static/images/ui/writing.png
Normal file
BIN
static/images/ui/writing.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
Reference in New Issue
Block a user