Changes between Version 1 and Version 2 of Ticket #34383, comment 5


Ignore:
Timestamp:
Mar 23, 2023, 4:14:59 AM (20 months ago)
Author:
Mariusz Felisiak

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #34383, comment 5

    v1 v2  
    1 I tried to fix this, it's much better (but not perfect, you can see minor issues on the "Change user" view) with the following diff:
    2 {{{#!diff
    3 diff --git a/django/contrib/admin/static/admin/css/forms.css b/django/contrib/admin/static/admin/css/forms.css
    4 index 3cd87ef476..e73831a83f 100644
    5 --- a/django/contrib/admin/static/admin/css/forms.css
    6 +++ b/django/contrib/admin/static/admin/css/forms.css
    7 @@ -72,7 +72,7 @@ form ul.inline li {
    8  /* ALIGNED FIELDSETS */
    9  
    10  .aligned label {
    11 -    display: block;
    12 +    display: inline-block;
    13      padding: 4px 10px 0 0;
    14      width: 160px;
    15      word-wrap: break-word;
    16 @@ -114,7 +114,7 @@ form ul.inline li {
    17  }
    18  
    19  form .aligned ul {
    20 -    margin-left: 160px;
    21 +    margin-left: 166px;
    22      padding-left: 10px;
    23  }
    24  
    25 @@ -127,7 +127,7 @@ form .aligned div.radiolist {
    26  form .aligned p.help,
    27  form .aligned div.help {
    28      margin-top: 0;
    29 -    margin-left: 160px;
    30 +    margin-left: 166px;
    31      padding-left: 10px;
    32  }
    33  
    34 @@ -191,7 +191,6 @@ form .aligned table p {
    35  }
    36  
    37  fieldset .fieldBox {
    38 -    float: left;
    39      margin-right: 20px;
    40  }
    41  
    42 diff --git a/django/contrib/admin/static/admin/css/widgets.css b/django/contrib/admin/static/admin/css/widgets.css
    43 index 572dc0a500..c81bcf654d 100644
    44 --- a/django/contrib/admin/static/admin/css/widgets.css
    45 +++ b/django/contrib/admin/static/admin/css/widgets.css
    46 @@ -578,7 +578,6 @@ ul.timelist, .timelist li {
    47  
    48  /* RELATED WIDGET WRAPPER */
    49  .related-widget-wrapper {
    50 -    float: left;       /* display properly in form rows with multiple fields */
    51      overflow: hidden;  /* clear floated contents */
    52  }
    53  
    54 diff --git a/django/contrib/admin/templates/admin/includes/fieldset.html b/django/contrib/admin/templates/admin/includes/fieldset.html
    55 index 5953a5ad3d..0d398d1de1 100644
    56 --- a/django/contrib/admin/templates/admin/includes/fieldset.html
    57 +++ b/django/contrib/admin/templates/admin/includes/fieldset.html
    58 @@ -6,26 +6,30 @@
    59      {% for line in fieldset %}
    60          <div class="form-row{% if line.fields|length == 1 and line.errors %} errors{% endif %}{% if not line.has_visible_field %} hidden{% endif %}{% for field in line %}{% if field.field.name %} field-{{ field.field.name }}{% endif %}{% endfor %}">
    61              {% if line.fields|length == 1 %}{{ line.errors }}{% endif %}
    62 -            {% for field in line %}
    63 -                <div{% if not line.fields|length == 1 %} class="fieldBox{% if field.field.name %} field-{{ field.field.name }}{% endif %}{% if not field.is_readonly and field.errors %} errors{% endif %}{% if field.field.is_hidden %} hidden{% endif %}"{% elif field.is_checkbox %} class="checkbox-row"{% endif %}>
    64 -                    {% if not line.fields|length == 1 and not field.is_readonly %}{{ field.errors }}{% endif %}
    65 -                    {% if field.is_checkbox %}
    66 -                        {{ field.field }}{{ field.label_tag }}
    67 -                    {% else %}
    68 -                        {{ field.label_tag }}
    69 -                        {% if field.is_readonly %}
    70 -                            <div class="readonly">{{ field.contents }}</div>
    71 -                        {% else %}
    72 -                            {{ field.field }}
    73 -                        {% endif %}
    74 -                    {% endif %}
    75 -                </div>
    76 -                {% if field.field.help_text %}
    77 -                    <div class="help"{% if field.field.id_for_label %} id="{{ field.field.id_for_label }}_helptext"{% endif %}>
    78 -                        <div>{{ field.field.help_text|safe }}</div>
    79 -                    </div>
    80 -                {% endif %}
    81 -            {% endfor %}
    82 +            <div>
    83 +              {% for field in line %}
    84 +                <div>
    85 +                  <div{% if not line.fields|length == 1 %} class="fieldBox{% if field.field.name %} field-{{ field.field.name }}{% endif %}{% if not field.is_readonly and field.errors %} errors{% endif %}{% if field.field.is_hidden %} hidden{% endif %}"{% elif field.is_checkbox %} class="checkbox-row"{% endif %}>
    86 +                      {% if not line.fields|length == 1 and not field.is_readonly %}{{ field.errors }}{% endif %}
    87 +                      {% if field.is_checkbox %}
    88 +                          {{ field.field }}{{ field.label_tag }}
    89 +                      {% else %}
    90 +                          {{ field.label_tag }}
    91 +                          {% if field.is_readonly %}
    92 +                              <div class="readonly">{{ field.contents }}</div>
    93 +                          {% else %}
    94 +                              {{ field.field }}
    95 +                          {% endif %}
    96 +                      {% endif %}
    97 +                  </div>
    98 +                  {% if field.field.help_text %}
    99 +                      <div class="help"{% if field.field.id_for_label %} id="{{ field.field.id_for_label }}_helptext"{% endif %}>
    100 +                          <div>{{ field.field.help_text|safe }}</div>
    101 +                      </div>
    102 +                  {% endif %}
    103 +                  </div>
    104 +              {% endfor %}
    105 +            </div>
    106          </div>
    107      {% endfor %}
    108  </fieldset>
    109 diff --git a/django/contrib/auth/templates/auth/widgets/read_only_password_hash.html b/django/contrib/auth/templates/auth/widgets/read_only_password_hash.html
    110 index c73042b18f..447f55a99b 100644
    111 --- a/django/contrib/auth/templates/auth/widgets/read_only_password_hash.html
    112 +++ b/django/contrib/auth/templates/auth/widgets/read_only_password_hash.html
    113 @@ -1,5 +1,5 @@
    114 -<div{% include 'django/forms/widgets/attrs.html' %}>
    115 +<span{% include 'django/forms/widgets/attrs.html' %}>
    116  {% for entry in summary %}
    117  <strong>{{ entry.label }}</strong>{% if entry.value %}: <bdi>{{ entry.value }}</bdi>{% endif %}
    118  {% endfor %}
    119 -</div>
    120 +</span>
    121 }}}
     1I tried to fix this, it's much better (but not perfect, you can see minor issues on the "Change user" view) with the following diff.
     2
     3[REMOVED as can be confusing]
Back to Top