Code

Ticket #2612: ticket2612-r8860.diff

File ticket2612-r8860.diff, 4.2 KB (added by jezdez, 6 years ago)

Fix that doesn't patch float-left class and is rtl compatible.

Line 
1diff --git a/django/contrib/admin/media/css/forms.css b/django/contrib/admin/media/css/forms.css
2index 234a21b..21aadc9 100644
3--- a/django/contrib/admin/media/css/forms.css
4+++ b/django/contrib/admin/media/css/forms.css
5@@ -9,7 +9,6 @@ form .form-row p { padding-left:0; font-size:11px; }
6 /* FORM LABELS */
7 form h4 { margin:0 !important; padding:0 !important; border:none !important; }
8 label { font-weight:normal !important; color:#666; font-size:12px; }
9-label.inline { margin-left:20px; }
10 .required label, label.required { font-weight:bold !important; color:#333 !important; }
11 
12 /* RADIO BUTTONS */
13@@ -19,8 +18,7 @@ form ul.inline { margin-left:0; padding:0; }
14 form ul.inline li { float:left; padding-right:7px; }
15 
16 /* ALIGNED FIELDSETS */
17-.aligned label { display:block; padding:0 1em 3px 0; float:left; width:8em; }
18-.aligned label.inline { display:inline; float:none; }
19+.aligned label { display:block; padding:3px 10px 0 0; float:left; width:8em; }
20 .colMS .aligned .vLargeTextField, .colMS .aligned .vXMLLargeTextField { width:350px; }
21 form .aligned p, form .aligned ul { margin-left:7em; padding-left:30px; }
22 form .aligned table p { margin-left:0; padding-left:0; }
23@@ -28,6 +26,7 @@ form .aligned p.help { padding-left:38px; }
24 .aligned .vCheckboxLabel { float:none !important; display:inline; padding-left:4px; }
25 .colM .aligned .vLargeTextField, .colM .aligned .vXMLLargeTextField { width:610px; }
26 .checkbox-row p.help { margin-left:0; padding-left:0 !important; }
27+fieldset .field-box { float:left; margin-right: 20px; }
28 
29 /* WIDE FIELDSETS */
30 .wide label { width:15em !important; }
31@@ -60,10 +59,11 @@ fieldset.monospace textarea { font-family:"Bitstream Vera Sans Mono",Monaco,"Cou
32 .module table .vPositiveSmallIntegerField { width:2.2em; }
33 .vTextField { width:20em; }
34 .vIntegerField { width:5em; }
35+.vForeignKeyRawIdAdminField { width: 5em; }
36 
37-/* x unsorted */
38+/* INLINES */
39 .inline-group {padding:0; border:1px solid #ccc; margin:10px 0;}
40-.inline-group .aligned label { width: 7em; }
41+.inline-group .aligned label { width: 8em; }
42 
43 .inline-related {position:relative;}
44 .inline-related h3 {margin: 0; color:#666; padding:3px 5px; font-size:11px; background:#e1e1e1 url(../img/admin/nav-bg.gif) top left repeat-x; border-bottom:1px solid #ddd;}
45diff --git a/django/contrib/admin/media/css/rtl.css b/django/contrib/admin/media/css/rtl.css
46index 900ddbd..91053fa 100644
47--- a/django/contrib/admin/media/css/rtl.css
48+++ b/django/contrib/admin/media/css/rtl.css
49@@ -38,6 +38,7 @@ div.breadcrumbs { text-align:right; }
50 .vDateField, .vTimeField { margin-left:2px; }
51 form ul.inline li { float:right; padding-right:0; padding-left:7px; }
52 input[type=submit].default, .submit-row input.default { float:left; }
53+fieldset .field-box { float:right; margin-left: 20px; }
54 
55 /* widget styles */
56 .calendarnav-previous { top:0; left:auto; right:0; }
57diff --git a/django/contrib/admin/media/css/widgets.css b/django/contrib/admin/media/css/widgets.css
58index 67d9662..3686d1b 100644
59--- a/django/contrib/admin/media/css/widgets.css
60+++ b/django/contrib/admin/media/css/widgets.css
61@@ -33,7 +33,6 @@ a.selector-clearall { background:url(../img/admin/selector-removeall.gif) left c
62 /* DATE AND TIME */
63 p.datetime { line-height:20px; margin:0; padding:0; color:#666; font-size:11px; font-weight:bold; }
64 .datetime span { font-size:11px; color:#ccc; font-weight:normal; white-space:nowrap; }
65-.vDateField { margin-left:4px; }
66 table p.datetime { font-size:10px; margin-left:0; padding-left:0; }
67 
68 /* FILE UPLOADS */
69diff --git a/django/contrib/admin/templates/admin/includes/fieldset.html b/django/contrib/admin/templates/admin/includes/fieldset.html
70index 26c918c..8ee24b1 100644
71--- a/django/contrib/admin/templates/admin/includes/fieldset.html
72+++ b/django/contrib/admin/templates/admin/includes/fieldset.html
73@@ -5,7 +5,7 @@
74       <div class="form-row{% if line.errors %} errors{% endif %} {% for field in line %}{{ field.field.name }} {% endfor %} ">
75       {{ line.errors }}
76       {% for field in line %}
77-      <div class="float-left">
78+      <div{% if not line.fields|length_is:"1" %} class="field-box"{% endif %}>
79           {% if field.is_checkbox %}
80               {{ field.field }}{{ field.label_tag }}
81           {% else %}