Files
project-managment/templates/pages/tickets/ticket_form.html
T
sankalp c5ed358d35 feat(templates/pages/tickets): increase textarea container height and extend rich text toolbar options
Increase container height from 300px to 400px for better visibility; add numerous formatting options to the dropdown (color, background, script sub/super, extended headers, check list, indent controls, direction, etc.) to improve editing experience.

New Features:
- Added new dropdown items: color, background, script sub, script super, extended header levels, check list, indent controls, direction.
- Expanded list options with bullet check and additional utilities.

Enhancements:
- Enlarged description field container to accommodate taller content.

Bug Fixes:
- None
2026-05-28 00:31:25 +05:45

56 lines
2.4 KiB
HTML

{% extends "base_authenticated.html" %}
{% block title %}{% if object %}Edit{% else %}New{% endif %} Ticket{% endblock %}
{% block content_inner %}
<div class="max-w-2xl mx-auto">
<div class="bg-white rounded-2xl shadow-sm border border-gray-100 p-6">
<h1 class="text-xl font-bold text-gray-900 mb-1">{% if object %}Edit{% else %}New{% endif %} Ticket</h1>
<p class="text-sm text-gray-500 mb-6">{% if object %}Update the ticket.{% else %}Submit a new support ticket or feature request.{% endif %}</p>
<form method="post">
{% csrf_token %}
{% for field in form %}
{% include "partials/form_field.html" %}
{% endfor %}
<div class="flex gap-3 pt-2">
<button type="submit" class="btn bg-blue-600 text-white hover:bg-blue-700 border-0">Save</button>
<a href="{% url 'ticket_list' %}" class="btn btn-ghost">Cancel</a>
</div>
</form>
</div>
</div>
{% endblock %}
{% block extra_scripts %}
<script>
document.addEventListener('DOMContentLoaded', function() {
const descField = document.querySelector('textarea[name="description"]');
if (descField) {
const container = document.createElement('div');
container.style.height = '400px';
container.className = 'mb-4 rounded-xl';
descField.parentNode.insertBefore(container, descField);
descField.style.display = 'none';
const quill = new Quill(container, {
theme: 'snow',
modules: {
toolbar: [
['bold', 'italic', 'underline', 'strike'],
[{ 'color': [] }, { 'background': [] }],
[{ 'script': 'sub'}, { 'script': 'super' }],
[{ 'header': [1, 2, 3, 4, 5, 6, false] }],
[{ 'list': 'ordered'}, { 'list': 'bullet' }, { 'list': 'check' }],
[{ 'indent': '-1'}, { 'indent': '+1' }],
[{ 'direction': 'rtl' }],
[{ 'align': [] }],
['link', 'image', 'video'],
['blockquote', 'code-block'],
['clean']
]
}
});
quill.root.innerHTML = descField.value;
document.querySelector('form').addEventListener('submit', function() {
descField.value = quill.root.innerHTML;
});
}
});
</script>
{% endblock %}