diff --git a/organizations/management/commands/transfer_prospartner_data.py b/organizations/management/commands/transfer_prospartner_data.py index ed9fd80aa8046bcaf144319bee131f72f6e84228..46d8d18e46cb8b3f811f4a55641e2632a2c7b677 100644 --- a/organizations/management/commands/transfer_prospartner_data.py +++ b/organizations/management/commands/transfer_prospartner_data.py @@ -33,7 +33,7 @@ class Command(BaseCommand): event=prosevent.event, comments=prosevent.comments, noted_on=prosevent.noted_on, - noted_by=prosevent.noted_by) + noted_by=prosevent.noted_by.user) event.save() prosevent.delete() prospartner.delete() diff --git a/organizations/templates/organizations/_organization_card.html b/organizations/templates/organizations/_organization_card.html index ae66514629aa3616e254b024f48e427a9cd37177..8986814da202aba702763e6cc1a5582117b97f93 100644 --- a/organizations/templates/organizations/_organization_card.html +++ b/organizations/templates/organizations/_organization_card.html @@ -36,6 +36,12 @@ $(document).ready(function($) { <a class="nav-link" id="support-{{ org.id }}-tab" data-toggle="tab" href="#support-{{ org.id }}" role="tab" aria-controls="support-{{ org.id }}" aria-selected="true">Support history</a> </li> {% if perms.scipost.can_manage_organizations %} + <li class="nav-item"> + <a class="nav-link" id="contacts-{{ org.id }}-tab" data-toggle="tab" href="#contacts-{{ org.id }}" role="tab" aria-controls="contacts-{{ org.id }}" aria-selected="true">Contacts</a> + </li> + <li class="nav-item"> + <a class="nav-link" id="events-{{ org.id }}-tab" data-toggle="tab" href="#events-{{ org.id }}" role="tab" aria-controls="events-{{ org.id }}" aria-selected="true">Events</a> + </li> <li class="nav-item"> <a class="nav-link" id="manage-{{ org.id }}-tab" data-toggle="tab" href="#manage-{{ org.id }}" role="tab" aria-controls="manage-{{ org.id }}" aria-selected="true">Manage</a> </li> @@ -180,6 +186,50 @@ $(document).ready(function($) { </div> {% endif %} + <div class="tab-pane pt-4" id="contacts-{{ org.id }}" role="tabpanel" aria-labelledby="contacts-{{ org.id }}-tab"> + {% if perms.scipost.can_manage_organizations %} + <h3>Contacts (with explicit role)</h3> + <table class="table"> + {% for contactrole in org.contactrole_set.all %} + <tr> + <td>{{ contactrole.contact }}</td> + <td>{{ contactrole.get_kind_display }}</td> + <td>{{ contactrole.date_from|date:"Y-m-d" }}</td> + <td>{{ contactrole.date_until|date:"Y-m-d" }}</td> + </tr> + {% endfor %} + </table> + + <h3>Contact persons</h3> + <table class="table"> + {% for contact in org.contactperson_set.all %} + <tr> + <td>{{ contact }}</td> + <td>{{ contact.email }}</td> + <td>{{ contact.role }}</td> + </tr> + {% empty %} + <tr> + <td>>No contact person defined</td> + </tr> + {% endfor %} + </table> + {% endif %} + </div> + + <div class="tab-pane pt-4" id="events-{{ org.id }}" role="tabpanel" aria-labelledby="events-{{ org.id }}-tab"> + {% if perms.scipost.can_manage_organizations %} + <h3>Events</h3> + <ul> + {% for event in org.organizationevent_set.all %} + {% include 'organizations/_organization_event_li.html' with event=event %} + {% empty %} + <li>No event found</li> + {% endfor %} + </ul> + {% endif %} + </div> + <div class="tab-pane pt-4" id="manage-{{ org.id }}" role="tabpanel" aria-labelledby="manage-{{ org.id }}-tab"> {% if perms.scipost.can_manage_organizations %} <h3>Manage this organization:</h3> diff --git a/organizations/templates/organizations/_organization_event_li.html b/organizations/templates/organizations/_organization_event_li.html new file mode 100644 index 0000000000000000000000000000000000000000..ec28cba2e3ed16d6ed1d1c0e91bc52acb0fef019 --- /dev/null +++ b/organizations/templates/organizations/_organization_event_li.html @@ -0,0 +1,7 @@ +<li id="{{ event.id }}"> + <div class="font-weight-bold">{{ event.get_event_display }} <small class="text-muted">noted {{ event.noted_on }} {% if event.noted_by %}by {{ event.noted_by }}{% endif %}</small> + </div> + {% if event.comments %} + <div>{{ event.comments|linebreaks }}</div> + {% endif %} +</li>