Skip to content

Commit 28532b9

Browse files
authored
Making interface widget closer to the one in Django Admin. (#120)
* Making interface widget closer to the one in Django Admin. * Adding after image with new style.
1 parent 6e3f47f commit 28532b9

File tree

4 files changed

+17
-20
lines changed

4 files changed

+17
-20
lines changed

django_better_admin_arrayfield/static/css/django_better_admin_arrayfield.css

-7
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,6 @@
33
align-items: center;
44
}
55

6-
.dynamic-array-widget .remove_sign {
7-
width: 10px;
8-
height: 2px;
9-
background: #a41515;
10-
border-radius: 1px;
11-
}
12-
136
.dynamic-array-widget .remove {
147
height: 15px;
158
display: flex;

django_better_admin_arrayfield/static/css/django_better_admin_arrayfield.min.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

django_better_admin_arrayfield/templates/django_better_admin_arrayfield/forms/widgets/dynamic_array.html

+16-12
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,21 @@
22
{% load i18n %}
33

44
{% spaceless %}
5-
<div class="dynamic-array-widget">
6-
<ul>
7-
{% for subwidget in widget.subwidgets %}
8-
<li class="array-item" {% if widget.is_none %}data-isNone="true" style="display: none"{% endif %}>
9-
{% with widget=subwidget %}
10-
{% include widget.template_name %}
11-
{% endwith %}
12-
<div class="remove"><div class="remove_sign"></div></div>
13-
</li>
14-
{% endfor %}
15-
</ul>
16-
<div><button type="button" class="add-array-item">{% trans "Add another" %}</button></div>
5+
<div class="related-widget-wrapper">
6+
<div class="dynamic-array-widget">
7+
<ul>
8+
{% for subwidget in widget.subwidgets %}
9+
<li class="array-item" {% if widget.is_none %}data-isNone="true" style="display: none"{% endif %}>
10+
{% with widget=subwidget %}
11+
{% include widget.template_name %}
12+
{% endwith %}
13+
<div class="remove">
14+
<div class="inline-deletelink"></div>
15+
</div>
16+
</li>
17+
{% endfor %}
18+
</ul>
19+
<div><input type="button" class="add-array-item" value="{% trans "Add another" %}"></div>
20+
</div>
1721
</div>
1822
{% endspaceless %}

readme_images/after.png

-1.93 KB
Loading

0 commit comments

Comments
 (0)