From 2fd8120701fb5ebe570a7cfcb939bb1a98636310 Mon Sep 17 00:00:00 2001 From: "J.-S. Caux" <J.S.Caux@uva.nl> Date: Sun, 7 Apr 2019 14:41:24 +0200 Subject: [PATCH] Add authors of child orgs to org detail page --- .../organizations/_organization_card.html | 46 +++++++++++++++---- 1 file changed, 36 insertions(+), 10 deletions(-) diff --git a/organizations/templates/organizations/_organization_card.html b/organizations/templates/organizations/_organization_card.html index 5a22edb0e..e4faa6fd3 100644 --- a/organizations/templates/organizations/_organization_card.html +++ b/organizations/templates/organizations/_organization_card.html @@ -104,16 +104,42 @@ $(document).ready(function($) { </div> <div class="tab-pane pt-4" id="authors-{{ org.id }}" role="tabpanel" aria-labelledby="authors-{{ org.id }}-tab"> - <h3>Associated Authors:</h3> - {% for profile in org.get_author_profiles %} - {% if profile.contributor %} - <li><a href="{{ profile.contributor.get_absolute_url }}">{{ profile }}</a></li> - {% else %} - <li>{{ profile }}</li> - {% endif %} - {% empty %} - <li>No Profile found</li> - {% endfor %} + <div class="row"> + <div class="col-lg-6"> + <h3>Associated Authors:</h3> + {% for profile in org.get_author_profiles %} + {% if profile.contributor %} + <li><a href="{{ profile.contributor.get_absolute_url }}">{{ profile }}</a></li> + {% else %} + <li>{{ profile }}</li> + {% endif %} + {% empty %} + <li>No Profile found</li> + {% endfor %} + </div> + {% if org.children.all|length > 0 %} + <div class="col-lg-6"> + <h3>Associated authors from sub-organizations:</h3> + <ul> + {% for child in org.children.all %} + <li>{{ child }}: + <ul> + {% for profile in child.get_author_profiles %} + {% if profile.contributor %} + <li><a href="{{ profile.contributor.get_absolute_url }}">{{ profile }}</a></li> + {% else %} + <li>{{ profile }}</li> + {% endif %} + {% empty %} + <li>No Profile found</li> + {% endfor %} + </ul> + </li> + {% endfor %} + </ul> + </div> + {% endif %} + </div> </div> -- GitLab