-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1723 from Princeton-CDH/feature/1709-pdrtype-merge
Person-Document Relation Type merge (#1709)
- Loading branch information
Showing
10 changed files
with
509 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
geniza/entities/templates/admin/entities/persondocumentrelationtype/merge.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
{% extends 'admin/base_site.html' %} | ||
|
||
{% load admin_urls static %} | ||
|
||
{% block extrastyle %} | ||
{{ block.super }} | ||
<link rel="stylesheet" href="{% static "admin/css/forms.css" %}"> | ||
<link rel="stylesheet" href="{% static "css/admin-local.css" %}"> | ||
{% endblock %} | ||
|
||
{% block title %} Merge selected person-document relationships {% endblock %} | ||
|
||
{% block breadcrumbs %} | ||
{% if not is_popup %} | ||
<div class="breadcrumbs"> | ||
<a href="{% url 'admin:index' %}">Home</a> | ||
› | ||
<a href="{% url 'admin:app_list' app_label='entities' %}">Entities</a> | ||
› | ||
<a href="{% url 'admin:entities_persondocumentrelationtype_changelist'%}">Person-Document relationships</a> | ||
› | ||
Merge selected person-document relationships | ||
</div> | ||
{% endif %} | ||
{% endblock %} | ||
|
||
|
||
{% block content_title %} | ||
<h1>Merge selected person-document relationships</h1> | ||
<h2>Note: there is no automated way to unmerge! Please review to make sure these relationships should be merged before submitting the form.</h2> | ||
{% endblock %} | ||
|
||
{% block content %} | ||
<form method="post" class="merge-document merge-relationtype"> | ||
{% csrf_token %} | ||
{% if form.errors|length > 0 %} | ||
<p class="errornote"> | ||
Please correct the error below. | ||
</p> | ||
{% endif %} | ||
<fieldset class="module aligned"> | ||
<div class="form-row"> | ||
{{ form.primary_relation_type.label_tag }} | ||
{{ form.primary_relation_type }} | ||
<p class="help">{{ form.primary_relation_type.help_text|safe }}</p> | ||
</div> | ||
|
||
<div class="submit-row"> | ||
<input type="submit" value="Submit"> | ||
</div> | ||
</field> | ||
</form> | ||
{% endblock %} |
33 changes: 33 additions & 0 deletions
33
geniza/entities/templates/entities/snippets/persondocumentrelationtype_option_label.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{# template snippet for displaying person-document relationship label on a form #} | ||
{# used on merge form to provide enough information to merge accurately #} | ||
|
||
<div class="merge-document-label"> | ||
<h2>{{ relation_type }} | ||
<a target="_blank" href="{% url 'admin:entities_persondocumentrelationtype_change' relation_type.pk %}" | ||
title="Go to this relationship's admin edit page"> | ||
<img src="/static/admin/img/icon-changelink.svg" alt="Change"></a> | ||
</h2> | ||
<details> | ||
<summary>View all {{ relation_type.persondocumentrelation_set.count }} {{ relation_type }} relations</summary> | ||
<ol> | ||
{% for rel in relation_type.persondocumentrelation_set.all %} | ||
<li> | ||
<div class="form-row"> | ||
<label>{{ rel.type }} relation:</label> | ||
<div> | ||
<a target="_blank" href="{% url 'admin:entities_person_change' rel.person.pk %}">{{ rel.person }}</a> | ||
and | ||
<a target="_blank" href="{% url 'admin:corpus_document_change' rel.document.pk %}">{{ rel.document }}</a> | ||
</div> | ||
</div> | ||
</li> | ||
{% empty %} | ||
<li> | ||
<div class="form-row"> | ||
<label>No relations</label><div></div> | ||
</div> | ||
</li> | ||
{% endfor %} | ||
</ol> | ||
</details> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.