SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit 1f43bef8 authored by Jean-Sébastien Caux's avatar Jean-Sébastien Caux
Browse files

Clean pubfractions form, add tooltip

parent 82aacaf8
No related branches found
No related tags found
No related merge requests found
......@@ -713,8 +713,6 @@ class SetOrgPubFractionForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super(SetOrgPubFractionForm, self).__init__(*args, **kwargs)
if self.instance.id:
#self.fields['organization'].widget.attrs['readonly'] = True
#self.fields['organization'].widget = forms.HiddenInput()
self.fields['organization'].disabled = True
self.fields['publication'].widget = forms.HiddenInput()
......@@ -725,8 +723,7 @@ class BaseOrgPubFractionsFormSet(BaseModelFormSet):
"""
Checks that the fractions add up to one.
"""
if any(self.errors):
return
cleaned_data = super().clean()
norm = 0
for form in self.forms:
norm += 1000 * form.cleaned_data['fraction']
......
......@@ -41,9 +41,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:</h3>
<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>
{% for pubyear in pubyears %}
<h4>{{ pubyear }} <span class="text-muted">(total pubfractions: {{ org|pubfractions_in_year:pubyear }})</span></h4>
<h4>{{ pubyear }} <span class="text-muted small">(total pubfractions: {{ org|pubfractions_in_year:pubyear }})</span></h4>
<ul>
{% for publication in org.get_publications %}
{% if publication.publication_date|date:'Y'|add:"0" == pubyear %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment