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 %}
-
+
{% endfor %}
-
+
{% endif %}
-
-
- {% comment %}
+ -
+
+ {{ activity.pair.0.history_date|date:'M. d, Y' }} , 
+ {{ activity.pair.0.history_date|date:'g:i a' }}
+
+
+
+ {% elif activity.type == 'key_result' %}
+ {% for history in activity.key_result.delta.changes %}
+
+ -
+
+

+
+
+ {{ activity.key_result.changed_user }}
+ {% trans 'updated' %}
+ {{ history.field|replace|title }} {% trans 'field of ' %}
+ {{ activity.key_result.k_r }} {% trans 'key result' %},{% trans 'from' %}
+ {{ history.old }} {% trans 'to' %} {{ history.new }}
+ {% comment %} {{ activity.changes.0.field|title|cut:'_' }} {% trans 'from' %}
+ {{ activity.changes.0.old }} to {{ activity.changes.0.new }} {% endcomment %}
+
+
+ -
+
+ {{ activity.date|date:'M. d, Y' }} , 
+ {{ activity.date|date:'g:i a' }}
+
+
+
{% endfor %}
-
- {% endcomment %}
-
- {% for activity in activity_list %}
-
- {% comment %} {% for history in history_object.delta.changes %} {% endcomment %}
- {% if activity.type == 'Changes' %}
-
- -
-
-

-
- {{activity.updated_by}}
- {% trans "updated" %}
- {{activity.changes.0.field |title|cut:'_'}} {% trans "from" %}
- {{activity.changes.0.old}} to {{activity.changes.0.new}}
-
-
- -
-
- {{ activity.pair.0.history_date|date:"M. d, Y" }} , 
- {{ activity.pair.0.history_date|date:"g:i a" }}
-
-
-
- {% elif activity.type == 'key_result' %}
- {% for history in activity.key_result.delta.changes %}
-
- -
-
-

-
- {{activity.key_result.changed_user}}
- {% trans "updated" %}
- {{history.field|replace|title}} {% trans "field of " %}
- {{activity.key_result.k_r}} {% trans "key result" %},
- {% trans "from" %}
- {{history.old}} {% trans "to" %} {{history.new}}
- {% comment %} {{activity.changes.0.field |title|cut:'_'}} {% trans "from" %}
- {{activity.changes.0.old}} to {{activity.changes.0.new}} {% endcomment %}
-
-
- -
-
- {{ activity.date|date:"M. d, Y" }} , 
- {{ activity.date|date:"g:i a" }}
-
-
-
- {% endfor %}
- {% elif activity.type == 'comment' %}
-
- {% else %}
-
-
- -
-
-

-
- {{activity.updated_by}}
- {% trans "Created Objective" %}
-
-
- -
-
- {{ activity.pair.0.history_date|date:"M. d, Y" }} , 
- {{ activity.pair.0.history_date|date:"g:i a" }}
-
-
-
- {% endif %}
- {% comment %} {% endfor %} {% endcomment %}
- {% endfor %}
+ {% elif activity.type == 'comment' %}
+
+ {% else %}
+
+ -
+
+

+
+
+ {{ activity.updated_by }}
+ {% trans 'Created Objective' %}
+
+
+ -
+
+ {{ activity.pair.0.history_date|date:'M. d, Y' }} , 
+ {{ activity.pair.0.history_date|date:'g:i a' }}
+
+
+
+ {% 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 = `
-
+
`;
@@ -80,16 +93,16 @@ function handlePDFUpload(file, context) {
max-width:100%;
white-space:nowrap;
">
-

+
${fileName}
-
+
diff --git a/static/images/ui/document-icon.png b/static/images/ui/document-icon.png
new file mode 100644
index 000000000..5196ca468
Binary files /dev/null and b/static/images/ui/document-icon.png differ
+ {% comment %}-
+
+ {% for comment in comments %}
+
+
+
+
+
+ {{ comment.employee_id }} {% trans 'added a comment' %}
+
+ {{ comment.created_at|date:'M. d, Y' }} , 
+ {{ comment.created_at|date:'g:i a' }}
+
+
+
+
+
+ {% endfor %}
+
+ {% endcomment %}
+
+ {% for activity in activity_list %}
+ {% comment %} {% for history in history_object.delta.changes %}
+ {% endcomment %}
+ {% if activity.type == 'Changes' %}
+
{{ comment.comment }}
++-
-
+
- {{comment.employee_id}} {% trans "added a comment" %}
-
- {{ comment.created_at|date:"M. d, Y" }} , 
- {{ comment.created_at|date:"g:i a" }}
-
+ {{ activity.updated_by }}
+ {% trans 'updated' %}
+ {{ activity.changes.0.field|title|cut:'_' }} {% trans 'from' %}
+ {{ activity.changes.0.old }} to {{ activity.changes.0.new }}
-