diff --git a/profiles/forms.py b/profiles/forms.py index 10c3b586cad4563abc97f181a927f96d870b8b89..cfccd92fffb8824bafbbef728464cc631d7a4537 100644 --- a/profiles/forms.py +++ b/profiles/forms.py @@ -91,7 +91,8 @@ class ProfileMergeForm(forms.Form): # Model fields: if profile_to_merge.expertises: for expertise in profile_to_merge.expertises: - if expertise not in profile_to_merge_into.expertises: + if profile_to_merge_into.expertises and \ + expertise not in profile_to_merge_into.expertises: profile_to_merge_into.expertises.append(expertise) if profile_to_merge.orcid_id and (profile_to_merge_into.orcid_id is None): profile_to_merge_into.orcid_id = profile_to_merge.orcid_id diff --git a/profiles/templates/profiles/_profile_card.html b/profiles/templates/profiles/_profile_card.html index e7599098ef006d1e4b8b4c5d0bf6cc4c4cb52e18..e3ab12191c7488e5f3ccaa6ce4b9c943de1beb0a 100644 --- a/profiles/templates/profiles/_profile_card.html +++ b/profiles/templates/profiles/_profile_card.html @@ -101,6 +101,21 @@ </div> </div> + <div class="card"> + <div class="card-header"> + Registration invitations + </div> + <div class="card-body"> + <ul> + {% for reginv in profile.registrationinvitation_set.all %} + <li>{{ reginv }}</li> + {% empty %} + <li>No invitation found</li> + {% endfor %} + </ul> + </div> + </div> + <div class="card"> <div class="card-header"> Publications @@ -116,7 +131,6 @@ </div> </div> - <div class="card"> <div class="card-header"> Comments diff --git a/profiles/templates/profiles/profile_list.html b/profiles/templates/profiles/profile_list.html index 0239e6dc7026929099dd52261c88a969bd68daf2..b0539904e8a23e4d9db4146097ef799f654a0c74 100644 --- a/profiles/templates/profiles/profile_list.html +++ b/profiles/templates/profiles/profile_list.html @@ -134,42 +134,6 @@ $(document).ready(function($) { </tbody> </table> - - - <table class="table table-hover mb-5"> - <thead class="thead-default"> - <tr> - <th>Name</th> - <th>Discipline</th> - <th>Expertises</th> - <th>Contributor?</th> - </tr> - </thead> - <tbody id="accordion" role="tablist" aria-multiselectable="true"> - {% for profile in object_list %} - <tr data-toggle="collapse" data-parent="#accordion" href="#collapse{{ profile.id }}" aria-expanded="false" aria-controls="collapse{{ profile.id }}" style="cursor: pointer;"> - <td>{{ profile.last_name }}, {{ profile.get_title_display }} {{ profile.first_name }}</td> - <td>{{ profile.get_discipline_display }}</td> - <td> - {% for expertise in profile.expertises %} - <div class="single d-inline" data-specialization="{{expertise|lower}}" data-toggle="tooltip" data-placement="bottom" title="{{expertise|get_specialization_display}}">{{expertise|get_specialization_code}}</div> - {% endfor %} - </td> - <td>{% if profile.contributor %}<i class="fa fa-check-circle text-success"></i>{% else %}<i class="fa fa-times-circle text-danger"></i>{% endif %}</td> - </tr> - <tr id="collapse{{ profile.id }}" class="collapse" role="tabpanel" aria-labelledby="heading{{ profile.id }}" style="background-color: #fff;"> - <td colspan="4"> - {% include 'profiles/_profile_card.html' with profile=profile %} - </td> - </tr> - {% empty %} - <tr> - <td colspan="4">No Profiles found</td> - </tr> - {% endfor %} - </tbody> - </table> - {% if is_paginated %} <div class="col-12"> {% include 'partials/pagination.html' with page_obj=page_obj %} diff --git a/profiles/templates/profiles/profile_merge.html b/profiles/templates/profiles/profile_merge.html index d9fd5ea6e20d9bee24ab1106b8c8531b9bea97e2..5f7bb741d5b91155e0300098d835337562b65aa7 100644 --- a/profiles/templates/profiles/profile_merge.html +++ b/profiles/templates/profiles/profile_merge.html @@ -15,19 +15,15 @@ {% block content %} <div class="row"> <div class="col-12"> - <h4>Merge Profiles</h4> + <h3>Merge Profiles</h3> - <div class="row"> - <div class="col-6"> - Profile to merge: + <h4 class="highlight">Profile {{ profile_to_merge.id }}</h4> {% include 'profiles/_profile_card.html' with profile=profile_to_merge %} - </div> - <div class="col-6"> - Profile to merge into: + + <h4 class="highlight">Profile {{ profile_to_merge_into.id }}</h4> {% include 'profiles/_profile_card.html' with profile=profile_to_merge_into %} - </div> - </div> + <h4 class="highlight">Merge:</h4> <form action="{% url 'profiles:merge' %}" method="post"> {% csrf_token %} {{ merge_form }}