diff --git a/osinaweb/customercore/__pycache__/views.cpython-310.pyc b/osinaweb/customercore/__pycache__/views.cpython-310.pyc index b9dffc11..5beff506 100644 Binary files a/osinaweb/customercore/__pycache__/views.cpython-310.pyc and b/osinaweb/customercore/__pycache__/views.cpython-310.pyc differ diff --git a/osinaweb/customercore/templates/details_templates/customer-ticket-message.html b/osinaweb/customercore/templates/details_templates/customer-ticket-message.html new file mode 100644 index 00000000..75155503 --- /dev/null +++ b/osinaweb/customercore/templates/details_templates/customer-ticket-message.html @@ -0,0 +1,106 @@ +{% load static %} +
+
+
+ {% if update.added_by.customerprofile %} + {% if update.added_by.customerprofile.image %} + + {% else %} +
+ {{ update.added_by.first_name.0 }}{{ update.added_by.last_name.0 }} +
+ {% endif %} + {% elif update.added_by.staffprofile %} + {% if update.added_by.staffprofile.image %} + + {% else %} +
+ {{ update.added_by.first_name.0 }}{{ update.added_by.last_name.0 }} +
+ {% endif %} + {% endif %} +
+
+ + +
+
+

{{update.added_by.first_name}} + replied {{update.date_added}}

+ + + + + + + +
+ +
+ {{update.description | safe }} + + + {% if update.ticketattachment_set.all %} +
+ {% for file in update.ticketattachment_set.all %} + + {% endfor %} +
+ {% endif %} + +
+ + {% if update.added_by.staffprofile %} + + {% endif %} +
+
\ No newline at end of file diff --git a/osinaweb/customercore/templates/details_templates/inner-customer-ticket.html b/osinaweb/customercore/templates/details_templates/inner-customer-ticket.html index 4e2a116f..339da787 100644 --- a/osinaweb/customercore/templates/details_templates/inner-customer-ticket.html +++ b/osinaweb/customercore/templates/details_templates/inner-customer-ticket.html @@ -69,120 +69,19 @@ -
- +
- {% for update in ticket_updates %} -
-
-
- {% if update.added_by.customerprofile %} - {% if update.added_by.customerprofile.image %} - - {% else %} -
- {{ update.added_by.first_name.0 }}{{ update.added_by.last_name.0 }} -
- {% endif %} - {% elif update.added_by.staffprofile %} - {% if update.added_by.staffprofile.image %} - - {% else %} -
- {{ update.added_by.first_name.0 }}{{ update.added_by.last_name.0 }} -
- {% endif %} - {% endif %} -
-
- - -
-
-

{{update.added_by.first_name}} - replied {{update.date_added}}

- - - - - - - -
- -
- {{update.description | safe }} - - - {% if update.ticketattachment_set.all %} -
- {% for file in update.ticketattachment_set.all %} - - {% endfor %} -
- {% endif %} - -
- - {% if update.added_by.staffprofile %} - - {% endif %} -
+
+ {% for update in ticket_updates %} + {% include 'details_templates/customer-ticket-message.html' %} + {% endfor %}
- {% endfor %} + +
-
{% csrf_token %}
@@ -213,103 +112,9 @@
-
-
-
- - - - - - - - - - - - - -
-
- -
-
-
@@ -338,6 +143,85 @@
+ +
diff --git a/osinaweb/customercore/views.py b/osinaweb/customercore/views.py index c5815939..fdb5e810 100644 --- a/osinaweb/customercore/views.py +++ b/osinaweb/customercore/views.py @@ -204,9 +204,7 @@ def customer_ticket_details(request, ticket_number): } return render(request, 'details_templates/inner-customer-ticket.html', context) - - - + # PRODUCTS @customer_login_required diff --git a/osinaweb/db.sqlite3 b/osinaweb/db.sqlite3 index 2b2aec04..10edc8b1 100644 Binary files a/osinaweb/db.sqlite3 and b/osinaweb/db.sqlite3 differ diff --git a/osinaweb/osinacore/__pycache__/consumers.cpython-310.pyc b/osinaweb/osinacore/__pycache__/consumers.cpython-310.pyc index fd3c9920..ec6f8b41 100644 Binary files a/osinaweb/osinacore/__pycache__/consumers.cpython-310.pyc and b/osinaweb/osinacore/__pycache__/consumers.cpython-310.pyc differ diff --git a/osinaweb/osinacore/consumers.py b/osinaweb/osinacore/consumers.py index f4d27f77..f2462b93 100644 --- a/osinaweb/osinacore/consumers.py +++ b/osinaweb/osinacore/consumers.py @@ -77,6 +77,8 @@ class TicketRoomConsumer(WebsocketConsumer): 'update': update, 'user': self.user } + + html = render_to_string("details_templates/new-ticket-message.html", context=context) self.send(text_data=json.dumps({ 'event_type': 'update', diff --git a/osinaweb/osinacore/templates/details_templates/ticket-details.html b/osinaweb/osinacore/templates/details_templates/ticket-details.html index 01b0a71c..491a7146 100644 --- a/osinaweb/osinacore/templates/details_templates/ticket-details.html +++ b/osinaweb/osinacore/templates/details_templates/ticket-details.html @@ -79,7 +79,7 @@
{% for update in ticket_updates %} - {% include 'details_templates/ticket-message.html' %} + {% include 'details_templates/ticket-message.html' %} {% endfor %}
@@ -158,7 +158,7 @@