/
merge.html
72 lines (67 loc) · 3.38 KB
/
merge.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
{% extends "admin/change_form.html" %}
{% load i18n actions static merge %}
{% block breadcrumbs %}{% if not is_popup %}
<div class="breadcrumbs">
<a href="../../">{% trans "Home" %}</a> ›
<a href="../">{{ app_label|capfirst|escape }}</a> ›
<a href=".">{{ opts.verbose_name_plural|capfirst }}</a> ›
{{ action_short_description|capfirst }}
</div>
{% endif %}{% endblock %}
{% block content %}
{% if not transaction_supported %}
<div>Warning: your database does not support transactios. Merge cannot be validated and/or undone</div>
{% else %}
{% if adminform.form.errors %}
<ol>
{% for error in form.errors %}
<li><strong>{{ error|escape }}</strong></li>
{% endfor %}
</ol>
{% endif %}
{{ adminform.form.non_field_errors }}
<form method="post">{% csrf_token %}
{% for f in adminform.form.hidden_fields %}{{ f }}{% endfor %}
<table>
<tr>
<td>{{ adminform.form.dependencies.label }}</td>
<td>{{ adminform.form.dependencies }}</td>
</tr>
</table>
<table class="mergetable" style="width:100%; overflow: hidden">
<tr class="header">
<th>{% trans "Field" %}</th>
<th class="master">{% trans "Master" %} #<span id='master_pk'>{{ master.pk }}</span> ({% trans "This will be preserved" %})
</th>
<th><a class="swap" id="swap_cols" href="#">{% trans "swap" %}</a></th>
<th class="result">{% trans "Result" %}</th>
<th></th>
<th class="other">{% trans "Other" %} #<span id='other_pk'>{{ other.pk }}</span> ({% trans "This will be removed" %})
{# {{ adminform.form.other_pk.value }}#}
</th>
</tr>
{% for field in fields %}
<tr class="{% cycle "row1" "row2" %} merge-row">
<td class="column label" data-content="{{ field.name }}">{{ master|verbose_name:field.name }}</td>
<td class="column origin master_{{ field.name }}">
{{ formset.0|widget:field.name }}
<p class="display">{{ master|field_display:field}}</p>
</td>
<td><a class="origin" id="master_{{ field.name }}" href="#"> >> </a></td>
<td class="column result result_{{ field.name }}">
{{ adminform.form|widget:field.name }}
<p class="display" id="result_{{field.name}}"></p>
{{ adminform.form|errors:field.name }}
</td>
<td><a class="other" id="other_{{ field.name }}" href="#"> << </a></td>
<td class="column other other_{{ field.name }}">
{{ formset.1|widget:field.name }}
<p class="display">{{ other|field_display:field }}</p>
</td>
</tr>
{% endfor %}
</table>
<input type="submit" value="{% trans 'Preview' %}" name="preview">
</form>
{% endif %}
{% endblock %}