diff --git a/pms/models.py b/pms/models.py index 07a78e98e..7a0568415 100644 --- a/pms/models.py +++ b/pms/models.py @@ -552,7 +552,7 @@ class EmployeeObjective(HorillaModel): class Comment(models.Model): """comments for objectives""" - comment = models.CharField(max_length=150) + comment = models.TextField() employee_id = models.ForeignKey( Employee, on_delete=models.DO_NOTHING, @@ -572,6 +572,9 @@ class Comment(models.Model): objects = HorillaCompanyManager( related_company_field="employee_id__employee_work_info__company_id" ) + xss_exempt_fields = [ + "comment", + ] def __str__(self): return f"{self.employee_id.employee_first_name} - {self.comment} " diff --git a/pms/templates/okr/objective_detailed_view_activity.html b/pms/templates/okr/objective_detailed_view_activity.html index e67528875..73aa8b16f 100644 --- a/pms/templates/okr/objective_detailed_view_activity.html +++ b/pms/templates/okr/objective_detailed_view_activity.html @@ -1,177 +1,184 @@ {% load i18n %} {% load pmsfilters %} + + + {% if messages %} -
+
{% for message in messages %} -
-
- {{ message }} -
-
+
+
{{ message }}
+
{% endfor %} -
+
{% endif %}
- - - - {% trans "Activities" %} + + {% trans 'Activities' %}
-
- {% csrf_token %} + + {% csrf_token %} -
- - -
+
+ + +
- +
- + {% elif activity.type == 'key_result' %} + {% for history in activity.key_result.delta.changes %} + {% endfor %} - - {% endcomment %} - - {% for activity in activity_list %} - - {% comment %} {% for history in history_object.delta.changes %} {% endcomment %} - {% if activity.type == 'Changes' %} - - {% elif activity.type == 'key_result' %} - {% for history in activity.key_result.delta.changes %} - - {% endfor %} - {% elif activity.type == 'comment' %} - - {% else %} - - - {% endif %} - {% comment %} {% endfor %} {% endcomment %} - {% endfor %} + {% elif activity.type == 'comment' %} + + {% else %} + + {% endif %} + {% comment %} + {% endfor %} {% endcomment %} + {% endfor %} diff --git a/static/build/js/summernote-lite.min.js b/static/build/js/summernote-lite.min.js index f55c81d8f..7bc608eda 100644 --- a/static/build/js/summernote-lite.min.js +++ b/static/build/js/summernote-lite.min.js @@ -26,21 +26,34 @@ function handlePDFUploadMultiple(files, context) { const reader = new FileReader(); reader.onload = function(e) { - const base64 = e.target.result; + const base64 = e.target.result; // full base64 data URL like "data:application/pdf;base64,...." const fileName = file.name; const uniqueId = `pdfModal_${Date.now()}_${Math.random().toString(36).substring(2, 8)}`; + const base64Content = base64.split(',')[1]; + const binary = atob(base64Content); + const len = binary.length; + const buffer = new Uint8Array(len); + + for (let i = 0; i < len; i++) { + buffer[i] = binary.charCodeAt(i); + } + + const blob = new Blob([buffer], { type: 'application/pdf' }); + const blobUrl = URL.createObjectURL(blob); + + const cardHTML = `
- PDF + PDF ${fileName}
- -