[ADD] HELPDESK: Summer note on description and comment

This commit is contained in:
Horilla
2025-05-01 17:39:47 +05:30
parent c6f4bdb0b6
commit 66354373b6
3 changed files with 23 additions and 10 deletions

View File

@@ -106,6 +106,12 @@ class TicketForm(ModelForm):
"raised_on": forms.Select(
attrs={"class": "oh-select oh-select-2", "required": "true"}
),
"description": forms.Textarea(
attrs={
"data-summernote": True,
"hidden": True,
}
),
}
def as_p(self, *args, **kwargs):

View File

@@ -160,7 +160,7 @@
>
</div>
<div class="oh-helpdesk__bubble-body">
<p>{{ticket.description}}</p>
<p>{{ticket.description|safe}}</p>
</div>
</div>
@@ -189,7 +189,7 @@
</div>
<div class="oh-helpdesk__bubble-body">
<span class="oh-helpdesk__comment">
{{item.comment.comment}}
{{item.comment.comment|safe}}
</span>
<div class="oh-scrollable-container">
<div class="oh-layout--grid-3 mt-2 mb-2 horizontal-scroll"
@@ -250,8 +250,10 @@
</div>
<div class="oh-helpdesk__bubble-body">
<div class="d-flex justify-content-between align-items-center comment_container">
<div>
<textarea class="bg-transparent border-0 w-100 comment_input" data-comment-id = "{{item.comment.id}}" >{{item.comment.comment}}</textarea>
<p class="">{{item.comment.comment}}</p>
{{item.comment.comment|safe}}
</div>
<div class="oh-btn-group" style="border:none">
{% if request.user.employee_get|is_department_manager:ticket or perms.helpdesk.change_comment or request.user.employee_get == item.comment.employee_id %}
<a
@@ -320,16 +322,16 @@
{% elif item.history.changes.0.is_fk == True %}
<div class="oh-helpdesk__chat-update">
<span
>{{item.history.updated_by}} {% trans "changed the ticket " %}{{item.history.changes.0.field}} {% trans " from" %}
<strong>{{item.history.pair.0|fk_history:item.history.changes.0}}</strong> {% trans "to" %} <strong>{{item.history.pair.1|fk_history:item.history.changes.0}}</strong></span
>{{item.history.updated_by}} {% trans "changed the ticket " %}{{item.history.changes.0.field|safe}} {% trans " from" %}
<strong>{{item.history.pair.0|fk_history:item.history.changes.0|safe}}</strong> {% trans "to" %} <strong>{{item.history.pair.1|fk_history:item.history.changes.0|safe}}</strong></span
>
<span>{{ item.history.pair.0.history_date}}</span>
</div>
{% else %}
<div class="oh-helpdesk__chat-update">
<span
>{{item.history.updated_by}} {% trans "changed the ticket " %}{{item.history.changes.0.field}} {% trans " from" %}
<strong>{{item.history.changes.0.old}}</strong> {% trans "to" %} <strong>{{item.history.changes.0.new}}</strong></span
>{{item.history.updated_by}} {% trans "changed the ticket " %}{{item.history.changes.0.field|safe}} {% trans " from" %}
<strong>{{item.history.changes.0.old|safe}}</strong> {% trans "to" %} <strong>{{item.history.changes.0.new|safe}}</strong></span
>
<span>{{ item.history.pair.0.history_date}}</span>
</div>
@@ -379,6 +381,11 @@
onclick="validateComment(event)"
aria-label="Send Message"></button>
</form>
<script>
$(document).ready(function () {
$(`[name=comment]`).summernote(noteProperties());
});
</script>
</div>
{% endif %}
<!-- end of comment box. -->

View File

@@ -109,7 +109,7 @@
<div class="oh-timeoff-modal__stat w-100">
<span class="oh-timeoff-modal__stat-title">{% trans "Description" %}</span>
<span class="oh-timeoff-modal__stat-count"
>{{ticket.description}}</span
>{{ticket.description|safe}}</span
>
</div>
</div>