From 1525579b23d81b3dd22e0f72591cb1069d35eb11 Mon Sep 17 00:00:00 2001
From: "J.-S. Caux" <J.S.Caux@uva.nl>
Date: Tue, 26 Feb 2019 11:30:40 +0100
Subject: [PATCH] Add link to children in Org detail, tab support history

---
 .../templates/organizations/_organization_card.html   | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/organizations/templates/organizations/_organization_card.html b/organizations/templates/organizations/_organization_card.html
index dc6b13c35..3aa4008e9 100644
--- a/organizations/templates/organizations/_organization_card.html
+++ b/organizations/templates/organizations/_organization_card.html
@@ -135,7 +135,7 @@ $(document).ready(function($) {
 
 	<div class="tab-pane pt-4" id="support-{{ org.id }}" role="tabpanel" aria-labelledby="support-{{ org.id }}-tab">
 	  <h3>Support history</h3>
-	  {% if org.subsidy_set.all|length > 0 %}
+	  {% if org.subsidy_set.all|length > 0 or org.children.all|length > 0 %}
 	  <p>List of the subsidies (in one form or another) which SciPost has received from this Organization. Click on a row to see more details.</p>
 	  <table class="table table-hover mb-5">
 	    <thead class="thead-default">
@@ -160,6 +160,15 @@ $(document).ready(function($) {
 	      </tr>
 	    </tbody>
 	  </table>
+	  {% if org.children.all|length > 0 %}
+	  <p>See subsidies obtained from related organizations
+	    <ul>
+	      {% for child in org.children.all %}
+	      <li><a href="{{ child.get_absolute_url }}">{{ child }}</a></li>
+	      {% endfor %}
+	    </ul>
+	  </p>
+	  {% endif %}
 	  {% else %}
 	  <p><strong>This Organization has <span class="text-danger">not yet</span> supported SciPost.</strong></p>
 	  {% endif %}
-- 
GitLab