Skip to content

Commit ab462c0

Browse files
authored
Improve layout if djangocms-admin-style is NOT present (#45)
1 parent ec543c6 commit ab462c0

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

CHANGELOG.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
Changelog
33
=========
44

5+
unreleased
6+
==========
7+
8+
* Fix add / delete buttons if djangocms-admin-style is not installed
9+
510

611
2.0.0 (2020-09-02)
712
==================

djangocms_attributes_field/widgets.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,16 @@ def render(self, name, value, attrs=None, renderer=None):
9494
# INSTALLED_APPS. By inlining the JS and CSS here, we avoid this.
9595
output += """
9696
<style>
97-
.delete-attributes-pair,
98-
.add-attributes-pair {
97+
body.djangocms-admin-style .delete-attributes-pair,
98+
body.djangocms-admin-style .add-attributes-pair {
9999
border: 1px solid #ddd;
100100
border-radius: 3px;
101101
display: inline-block;
102102
padding: 6px 5px 8px 10px;
103+
line-height: inherit;
104+
}
105+
.delete-attributes-pair, .add-attributes-pair {
106+
line-height: 2;
103107
}
104108
.attributes-pair {
105109
display: table;
@@ -115,7 +119,7 @@ def render(self, name, value, attrs=None, renderer=None):
115119
.attributes-pair .field-box:last-child {
116120
display: table-cell !important;
117121
vertical-align: top !important;
118-
width: 100% !important;
122+
width: 75% !important;
119123
float: none !important;
120124
}
121125
.djangocms-attributes-field .attributes-pair .attributes-value {

0 commit comments

Comments
 (0)