diff --git a/documents/prince_ar_document_styles.css b/documents/prince_ar_document_styles.css index ada553b..5db8313 100644 --- a/documents/prince_ar_document_styles.css +++ b/documents/prince_ar_document_styles.css @@ -1002,6 +1002,7 @@ ul { .academic_td { width: 20%; padding: 5px 10px 5px; + white-space: nowrap; } * { diff --git a/documents/templates/annual_report.html b/documents/templates/annual_report.html index a8f6e53..42e5a4a 100644 --- a/documents/templates/annual_report.html +++ b/documents/templates/annual_report.html @@ -824,63 +824,63 @@

{% comment %}
{% endcomment %} -

spacer

-

spacer

+ {% comment %}

spacer

+

spacer

{% endcomment %} {% comment %}
{% endcomment %} -
-
-
-
-

Context

-
-
- {{report.context | safe }} -
+
+
+
+
+

Context

+
+
+ {{report.context | safe }}
-
-
-
-

Aims

-
-
- {{report.aims | safe }} -
+
+
+
+
+

Aims

+
+
+ {{report.aims | safe }}
-
-
-
-

Progress

-
-
- {{report.progress | safe }} -
+
+
+
+
+

Progress

+
+
+ {{report.progress | safe }}
-
-
-
-

Management Implications

-
-
- {{report.implications | safe }} -
+
+
+
+
+

Management Implications

+
+
+ {{report.implications | safe }}
-
-
-
-

Future Directions

-
-
- {{report.future | safe }} -
+
+
+
+
+

Future Directions

+
+
+ {{report.future | safe }}
+
{% endfor %}
@@ -981,22 +981,7 @@

Student Projects

{% with students=report.team_members|filter_by_role:"student" %}{% for student in students %}{% if not forloop.first %}, {% endif %}{{ student.user.display_first_name }} {{ student.user.display_last_name }} ({{report.document.project.student_level|get_student_level_text}}){% endfor %}{% endwith %} {{report.document.project.start_date|year_only}} - {{report.document.project.end_date|year_only}} {% comment %} Abbrev. and add organisation {% endcomment %} - - {% with sorted_academics=report.team_members|filter_by_role:"academicsuper"|sort_by_affiliation_and_name %} - {% with grouped_academics=sorted_academics|group_by_affiliation %} - {% for affiliation, academics in grouped_academics %} - {% for academic in academics %} - {{ academic.user|abbreviated_name }}{% if not forloop.last %}, {% endif %} - {% endfor %} - {% if affiliation %} - ({{ affiliation }}){% if not forloop.last %}, {% endif %} - {% else %} - {% if not forloop.last %}, {% endif %} - {% endif %} - {% endfor %} - {% endwith %} - {% endwith %} - + {% spaceless %}{% with sorted_academics=report.team_members|filter_by_role:"academicsuper"|sort_by_affiliation_and_name %}{% with grouped_academics=sorted_academics|group_by_affiliation %}{% for affiliation, academics in grouped_academics %}{% for academic in academics %}{{ academic.user|abbreviated_name }}{% if not forloop.last %}, {% endif %}{% endfor %}{% if affiliation %}({{ affiliation }}){% if not forloop.last %}, {% endif %}{% else %}{% if not forloop.last %}, {% endif %}{% endif %}{% endfor %}{% endwith %}{% endwith %}{% endspaceless %} {% with scientists=report.team_members|get_scientists %}{% for scientist in scientists %}{% if not forloop.first %}, {% endif %}{{ scientist.user.display_first_name|slice:":1" }} {{ scientist.user.display_last_name }}{% endfor %}{% endwith %} @@ -1066,8 +1051,8 @@

{% comment %}
{% endcomment %} -

spacer

-

spacer

+ {% comment %}

spacer

+

spacer

{% endcomment %} {% comment %}
{% endcomment %}
diff --git a/documents/templatetags/custom_filters.py b/documents/templatetags/custom_filters.py index 24f2486..5e674ec 100644 --- a/documents/templatetags/custom_filters.py +++ b/documents/templatetags/custom_filters.py @@ -147,8 +147,10 @@ def get_title_rep(string): # print(user_obj) if user_obj["title"]: - return f"{get_title_rep(user_obj['title'])} {user_obj['display_first_name'][0]} {user_obj['display_last_name']}" - return f"{user_obj['display_first_name'][0]} {user_obj['display_last_name']}" + return f"{get_title_rep(user_obj['title'])} {user_obj['display_first_name'][0]} {user_obj['display_last_name']}".strip() + return ( + f"{user_obj['display_first_name'][0]} {user_obj['display_last_name']}".strip() + ) # Changed as requested diff --git a/documents/views.py b/documents/views.py index bc4e213..ac7d1bc 100644 --- a/documents/views.py +++ b/documents/views.py @@ -7080,7 +7080,7 @@ def get_formatted_datetime(now): # Delete the previous file pdfs_file_path = doc_pdf.file.path default_storage.delete(pdfs_file_path) - os.remove(html_file_path) + # os.remove(html_file_path) doc_pdf = ser.save() set_report_generation_status(report, False) return Response(