From 344aa83fc083ef3b033516218dcc63c564d55113 Mon Sep 17 00:00:00 2001 From: "J.-S. Caux" <J.S.Caux@uva.nl> Date: Tue, 2 Oct 2018 20:36:43 +0200 Subject: [PATCH] Make organization pubfraction data visible to scipost admin only --- .../templates/organizations/_organization_card.html | 7 ++++--- .../templates/organizations/organization_list.html | 3 +++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/organizations/templates/organizations/_organization_card.html b/organizations/templates/organizations/_organization_card.html index 502d34559..cb08fc053 100644 --- a/organizations/templates/organizations/_organization_card.html +++ b/organizations/templates/organizations/_organization_card.html @@ -1,5 +1,6 @@ {% load bootstrap %} +{% load user_groups %} {% load organizations_extras %} <div class="card-body"> @@ -13,7 +14,7 @@ </li> {% endif %} <li class="nav-item"> - <a class="nav-link active" id="publications-{{ org.id }}-tab" data-toggle="tab" href="#publications-{{ org.id }}" role="tab" aria-controls="publications-{{ org.id }}" aria-selected="true">Publications & PubFractions</a> + <a class="nav-link active" id="publications-{{ org.id }}-tab" data-toggle="tab" href="#publications-{{ org.id }}" role="tab" aria-controls="publications-{{ org.id }}" aria-selected="true">Publications{% if is_scipost_admin %} & PubFractions{% endif %}</a> </li> <li class="nav-item"> <a class="nav-link" id="authors-{{ org.id }}-tab" data-toggle="tab" href="#authors-{{ org.id }}" role="tab" aria-controls="authors-{{ org.id }}" aria-selected="true">Associated Authors</a> @@ -41,9 +42,9 @@ {% endif %} <div class="tab-pane show active pt-4" id="publications-{{ org.id }}" role="tabpanel" aria-labelledby="publications-{{ org.id }}-tab"> - <h3>Publications associated to this Organization <span class="text-muted small">(with total PubFractions <i class="fa fa-info-circle" data-toggle="tooltip" data-html="true" title="" data-original-title="Fraction of a publication's funding/institutional support associated to a given Organization"></i>)</span>:</h3> + <h3>Publications associated to this Organization{% if is_scipost_admin %} <span class="text-muted small">(with total PubFractions <i class="fa fa-info-circle" data-toggle="tooltip" data-html="true" title="" data-original-title="Fraction of a publication's funding/institutional support associated to a given Organization"></i>)</span>{% endif %}:</h3> {% for pubyear in pubyears %} - <h4>{{ pubyear }} <span class="text-muted small">(total pubfractions: {{ org|pubfractions_in_year:pubyear }})</span></h4> + <h4>{{ pubyear }}{% if is_scipost_admin %} <span class="text-muted small">(total pubfractions: {{ org|pubfractions_in_year:pubyear }})</span>{% endif %}</h4> <ul> {% for publication in org.get_publications %} {% if publication.publication_date|date:'Y'|add:"0" == pubyear %} diff --git a/organizations/templates/organizations/organization_list.html b/organizations/templates/organizations/organization_list.html index 75503090f..0c175b557 100644 --- a/organizations/templates/organizations/organization_list.html +++ b/organizations/templates/organizations/organization_list.html @@ -3,6 +3,7 @@ {% block pagetitle %}: Organizations{% endblock pagetitle %} {% load staticfiles %} +{% load user_groups %} {% load organizations_extras %} {% block headsup %} @@ -52,7 +53,9 @@ $(document).ready(function($) { <p>Click on a row to see more details about the Organization, including per-year breakdowns of:</p> <ul> <li>associated publications</li> + {% if is_scipost_admin %} <li>associated support fractions</li> + {% endif %} <li>associated authors</li> <li>partnership history</li> </ul> -- GitLab