Skip to content

Commit

Permalink
fix: image issue and trailing whitespace issue
Browse files Browse the repository at this point in the history
  • Loading branch information
idabblewith committed Oct 18, 2024
1 parent 432765b commit cfaf476
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 64 deletions.
1 change: 1 addition & 0 deletions documents/prince_ar_document_styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -1002,6 +1002,7 @@ ul {
.academic_td {
width: 20%;
padding: 5px 10px 5px;
white-space: nowrap;
}

* {
Expand Down
107 changes: 46 additions & 61 deletions documents/templates/annual_report.html
Original file line number Diff line number Diff line change
Expand Up @@ -824,63 +824,63 @@ <h2 id="{{ report.document.project.title | safe | extract_text_content }}" class
</div>
</div>
{% comment %} <div class="pr_top_filler"> {% endcomment %}
<p class="small_text">spacer</p>
<p class="small_text">spacer</p>
{% comment %} <p class="small_text">spacer</p>
<p class="small_text">spacer</p> {% endcomment %}
{% comment %} </div> {% endcomment %}
</div>
</div>
<div class="progress_report_bottom_container">
<div class="pr_subsection">
<div class="pr_subsection_content_container">
<div class="pr_subsection_title">
<h3>Context</h3>
</div>
<div class="orphanage_widow">
{{report.context | safe }}
</div>
<div class="progress_report_bottom_container">
<div class="pr_subsection">
<div class="pr_subsection_content_container">
<div class="pr_subsection_title">
<h3>Context</h3>
</div>
<div class="orphanage_widow">
{{report.context | safe }}
</div>
</div>
<div class="pr_subsection">
<div class="pr_subsection_content_container">
<div class="pr_subsection_title">
<h3>Aims</h3>
</div>
<div class="orphanage_widow">
{{report.aims | safe }}
</div>
</div>
<div class="pr_subsection">
<div class="pr_subsection_content_container">
<div class="pr_subsection_title">
<h3>Aims</h3>
</div>
<div class="orphanage_widow">
{{report.aims | safe }}
</div>
</div>
<div class="pr_subsection">
<div class="pr_subsection_content_container">
<div class="pr_subsection_title">
<h3>Progress</h3>
</div>
<div class="orphanage_widow">
{{report.progress | safe }}
</div>
</div>
<div class="pr_subsection">
<div class="pr_subsection_content_container">
<div class="pr_subsection_title">
<h3>Progress</h3>
</div>
<div class="orphanage_widow">
{{report.progress | safe }}
</div>
</div>
<div class="pr_subsection">
<div class="pr_subsection_content_container">
<div class="pr_subsection_title">
<h3>Management Implications</h3>
</div>
<div class="orphanage_widow">
{{report.implications | safe }}
</div>
</div>
<div class="pr_subsection">
<div class="pr_subsection_content_container">
<div class="pr_subsection_title">
<h3>Management Implications</h3>
</div>
<div class="orphanage_widow">
{{report.implications | safe }}
</div>
</div>
<div class="pr_subsection pr_last_section">
<div class="pr_subsection_content_container">
<div class="pr_subsection_title">
<h3>Future Directions</h3>
</div>
<div class="orphanage_widow">
{{report.future | safe }}
</div>
</div>
<div class="pr_subsection pr_last_section">
<div class="pr_subsection_content_container">
<div class="pr_subsection_title">
<h3>Future Directions</h3>
</div>
<div class="orphanage_widow">
{{report.future | safe }}
</div>
</div>
</div>
</div>
{% endfor %}
</div>
</div>
Expand Down Expand Up @@ -981,22 +981,7 @@ <h1 id="studentprojects" class="chapter_title_text">Student Projects</h1>
<td class="student_td sr_table_td">{% 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 %}</td>
<td class="duration_td sr_table_td">{{report.document.project.start_date|year_only}} - {{report.document.project.end_date|year_only}}</td>
{% comment %} Abbrev. and add organisation {% endcomment %}
<td class="academic_td sr_table_td">
{% 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 %}
</td>
{% spaceless %}<td class="academic_td sr_table_td">{% 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 %}</td>{% endspaceless %}
<td class="dbca_officer_td sr_table_td">{% 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 %}</td>
<td class="page_td sr_table_td"></td>
</tr>
Expand Down Expand Up @@ -1066,8 +1051,8 @@ <h2 id="{{ report.document.project.title | safe | extract_text_content }}" class
</div>
</div>
{% comment %} <div class="pr_top_filler"> {% endcomment %}
<p class="small_text">spacer</p>
<p class="small_text">spacer</p>
{% comment %} <p class="small_text">spacer</p>
<p class="small_text">spacer</p> {% endcomment %}
{% comment %} </div> {% endcomment %}
</div>

Expand Down
6 changes: 4 additions & 2 deletions documents/templatetags/custom_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion documents/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit cfaf476

Please sign in to comment.