This is an automated email from the ASF dual-hosted git repository. mraible pushed a commit to branch fix-admin-form-spacing in repository https://gitbox.apache.org/repos/asf/roller.git
commit 3d888097c17dbe47b223419aef486bd2d438ee82 Author: Matt Raible <[email protected]> AuthorDate: Sat Nov 14 16:51:02 2026 -0700 Put form labels above their fields and line up the entry editor's status row The admin forms put each label in a column beside its field. A short label such as Title sat a long way from its input, and long ones such as "Email address of weblog owner" wrapped onto two lines and made their rows taller than the rest. Labels now sit above their fields at every width, as they already did on narrow screens: every label fits on one line, fields use the full width, and rows whose first column was an empty label, there only to indent a checkbox, lose the indent. On the entry editor, the Permalink and Status rows were hand-written and out of step with the generated rows around them. Their labels lacked col-form-label, so they were regular weight; the values were wrapped in a paragraph that added a top margin; and the status used Bootstrap 3's label class, which Bootstrap 5 renders as plain coloured text with no padding. They now use the same label classes as the other rows, a div for the value, and Bootstrap 5's badge. The Status label also po [...] Checked on 22 admin pages with 115 form rows: none is left side by side and none overflows. --- CHANGES.md | 7 ++++++ .../main/webapp/WEB-INF/jsps/editor/EntryEdit.jsp | 26 +++++++++++----------- app/src/main/webapp/roller-ui/styles/roller.css | 24 ++++++++++++++++++++ 3 files changed, 44 insertions(+), 13 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 314412959..36a9ec535 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -45,6 +45,13 @@ - The default blogroll can't be renamed, since themes find it by its name, and the page works on phones. +- **Form labels sit above their fields.** In the admin forms a label used to + sit in a column beside its field, so short labels were a long way from + their inputs and long ones wrapped onto two lines. Labels are now above + their fields at every width, as they already were on phones. On the entry + editor, the Permalink and Status rows line up with the rest and the status + is shown as a badge. + ### Bug fixes - **A bad date pattern in a theme no longer blanks the page.** diff --git a/app/src/main/webapp/WEB-INF/jsps/editor/EntryEdit.jsp b/app/src/main/webapp/WEB-INF/jsps/editor/EntryEdit.jsp index e93b76ded..cdefe9108 100644 --- a/app/src/main/webapp/WEB-INF/jsps/editor/EntryEdit.jsp +++ b/app/src/main/webapp/WEB-INF/jsps/editor/EntryEdit.jsp @@ -67,12 +67,12 @@ <s:if test="actionName == 'entryEdit'"> <div class="row mb-3"> - <label class="col-md-3" for="entry_bean_permalink"> + <label class="col-sm-3 col-form-label" for="entry_bean_permalink"> <s:text name="weblogEdit.permaLink"/> </label> - <div class="controls col-md-9"> - <p class="form-control-plaintext"> + <div class="controls col-sm-9"> + <div class="form-control-plaintext"> <s:if test="bean.published"> <a id="entry_bean_permalink" href='<s:property value="entry.permalink" />'> <s:property value="entry.permalink"/> @@ -82,7 +82,7 @@ <s:else> <s:property value="entry.permalink"/> </s:else> - </p> + </div> </div> </div> @@ -107,43 +107,43 @@ <%-- status --%> <div class="row mb-3"> - <label class="col-md-3" for="weblogEdit.status"><s:text name="weblogEdit.status"/></label> + <label class="col-sm-3 col-form-label"><s:text name="weblogEdit.status"/></label> - <div class="controls col-md-9"> + <div class="controls col-sm-9"> - <p class="form-control-plaintext"> + <div class="form-control-plaintext"> <s:if test="bean.published"> - <span class="label text-bg-success"> + <span class="badge text-bg-success"> <s:text name="weblogEdit.published"/> (<s:text name="weblogEdit.updateTime"/> <s:date name="entry.updateTime"/>) </span> </s:if> <s:elseif test="bean.draft"> - <span class="label text-bg-info"> + <span class="badge text-bg-info"> <s:text name="weblogEdit.draft"/> (<s:text name="weblogEdit.updateTime"/> <s:date name="entry.updateTime"/>) </span> </s:elseif> <s:elseif test="bean.pending"> - <span class="label text-bg-warning"> + <span class="badge text-bg-warning"> <s:text name="weblogEdit.pending"/> (<s:text name="weblogEdit.updateTime"/> <s:date name="entry.updateTime"/>) </span> </s:elseif> <s:elseif test="bean.scheduled"> - <span class="label text-bg-info"> + <span class="badge text-bg-info"> <s:text name="weblogEdit.scheduled"/> (<s:text name="weblogEdit.updateTime"/> <s:date name="entry.updateTime"/>) </span> </s:elseif> <s:else> - <span class="label text-bg-danger"><s:text name="weblogEdit.unsaved"/></span> + <span class="badge text-bg-danger"><s:text name="weblogEdit.unsaved"/></span> </s:else> - </p> + </div> </div> diff --git a/app/src/main/webapp/roller-ui/styles/roller.css b/app/src/main/webapp/roller-ui/styles/roller.css index 7d3e23520..c7e346e19 100644 --- a/app/src/main/webapp/roller-ui/styles/roller.css +++ b/app/src/main/webapp/roller-ui/styles/roller.css @@ -1336,6 +1336,30 @@ tr.rollertable_pending { font-weight: 700; } +/* Forms put each label above its field at every width, as they already did on + narrow screens. Beside the field, a short label such as "Title" sat a long way + from its input, and long labels wrapped onto two lines. The label and field + columns the forms are written with (3 and 9 of 12) become full-width rows. */ +.form-horizontal .row > .col-sm-3, +.form-horizontal .row > .col-md-3, +.form-horizontal .row > .col-sm-9, +.form-horizontal .row > .col-md-9 { + flex: 0 0 100%; + width: 100%; + max-width: 100%; + margin-left: 0; +} + +.form-horizontal .row > .col-form-label { + padding-top: 0; + padding-bottom: 0.25rem; +} + +/* An empty label only held the field in the second column. */ +.form-horizontal .row > label:empty { + display: none; +} + /* Bootstrap 5 leaves readonly inputs looking editable; shade them like disabled ones so fields the user cannot change read as such. */ .form-control[readonly],
