SciPost Code Repository

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

Debug and improve

parent ad302ad3
No related branches found
No related tags found
No related merge requests found
...@@ -91,7 +91,8 @@ class ProfileMergeForm(forms.Form): ...@@ -91,7 +91,8 @@ class ProfileMergeForm(forms.Form):
# Model fields: # Model fields:
if profile_to_merge.expertises: if profile_to_merge.expertises:
for expertise in 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) profile_to_merge_into.expertises.append(expertise)
if profile_to_merge.orcid_id and (profile_to_merge_into.orcid_id is None): 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 profile_to_merge_into.orcid_id = profile_to_merge.orcid_id
......
...@@ -101,6 +101,21 @@ ...@@ -101,6 +101,21 @@
</div> </div>
</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">
<div class="card-header"> <div class="card-header">
Publications Publications
...@@ -116,7 +131,6 @@ ...@@ -116,7 +131,6 @@
</div> </div>
</div> </div>
<div class="card"> <div class="card">
<div class="card-header"> <div class="card-header">
Comments Comments
......
...@@ -134,42 +134,6 @@ $(document).ready(function($) { ...@@ -134,42 +134,6 @@ $(document).ready(function($) {
</tbody> </tbody>
</table> </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 %} {% if is_paginated %}
<div class="col-12"> <div class="col-12">
{% include 'partials/pagination.html' with page_obj=page_obj %} {% include 'partials/pagination.html' with page_obj=page_obj %}
......
...@@ -15,19 +15,15 @@ ...@@ -15,19 +15,15 @@
{% block content %} {% block content %}
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<h4>Merge Profiles</h4> <h3>Merge Profiles</h3>
<div class="row"> <h4 class="highlight">Profile {{ profile_to_merge.id }}</h4>
<div class="col-6">
Profile to merge:
{% include 'profiles/_profile_card.html' with profile=profile_to_merge %} {% include 'profiles/_profile_card.html' with profile=profile_to_merge %}
</div>
<div class="col-6"> <h4 class="highlight">Profile {{ profile_to_merge_into.id }}</h4>
Profile to merge into:
{% include 'profiles/_profile_card.html' with profile=profile_to_merge_into %} {% 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"> <form action="{% url 'profiles:merge' %}" method="post">
{% csrf_token %} {% csrf_token %}
{{ merge_form }} {{ merge_form }}
......
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