From 692d16fe75fc67aa00fab72d5258062e98b810b3 Mon Sep 17 00:00:00 2001 From: Carles Pina Estany Date: Wed, 17 Jun 2020 22:13:43 +0200 Subject: [PATCH] =?UTF-8?q?File=20field=20Bootstrap4:=20avoids=20long=20fi?= =?UTF-8?q?le=20names=20overflowing=20outside=20the=E2=80=A6=20(#1032)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * File field Bootstrap4: avoids long file names overflowing outside the label * Using h-auto to prevent vertical overflow, and text-break to prevent horizontal overflow * Fixing text-break. cf https://github.com/twbs/bootstrap/issues/30803 * Using text-truncate to prevent long file name overflow * refactor test to follow field_file.html evolution * compliance with Black * fixing regression, checkbox must float right partial rollback of 8aaed1ba31cc279444a8fa42e8c6ac473bd438a7 Co-authored-by: Bryan Brancotte --- .../templates/bootstrap4/layout/field_file.html | 6 +++--- crispy_forms/tests/test_layout.py | 15 +++++++-------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/crispy_forms/templates/bootstrap4/layout/field_file.html b/crispy_forms/templates/bootstrap4/layout/field_file.html index b56413413..34217140b 100644 --- a/crispy_forms/templates/bootstrap4/layout/field_file.html +++ b/crispy_forms/templates/bootstrap4/layout/field_file.html @@ -7,8 +7,8 @@
{{ widget.data.initial_text }}
-
- +
+ {{ field.value }} {% if not widget.data.required %} @@ -28,7 +28,7 @@ {% endif %}
- +