fix retention input layout: inline label, override full-width

This commit is contained in:
lichenblankie 2026-06-05 02:33:28 +00:00
parent a69a7a9c01
commit 5e1e42fc86

View file

@ -21,9 +21,11 @@ FORUM_CSS = """
.forum-form { max-width: 500px; } .forum-form { max-width: 500px; }
.forum-form input:not([type=checkbox]):not([type=radio]), .forum-form textarea { width: 100%; box-sizing: border-box; padding: 6px; margin-bottom: 8px; } .forum-form input:not([type=checkbox]):not([type=radio]), .forum-form textarea { width: 100%; box-sizing: border-box; padding: 6px; margin-bottom: 8px; }
.forum-form input[type=checkbox] { width: auto; margin: 0; } .forum-form input[type=checkbox] { width: auto; margin: 0; }
.forum-form label.inline-label input { width: auto; display: inline; }
.forum-form button { padding: 6px 16px; } .forum-form button { padding: 6px 16px; }
.forum-form label:not(.checkbox-label) { display: block; margin-bottom: 8px; } .forum-form label:not(.checkbox-label):not(.inline-label) { display: block; margin-bottom: 8px; }
.forum-form label.checkbox-label { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; } .forum-form label.checkbox-label { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.forum-form label.inline-label { display: inline; margin-bottom: 8px; }
.forum-form small { display: block; margin-bottom: 8px; } .forum-form small { display: block; margin-bottom: 8px; }
</style> </style>
""" """
@ -549,8 +551,8 @@ class ForumHandlers:
f"<h2>storage</h2>" f"<h2>storage</h2>"
f'<form class="forum-form" method="post" action="/forum/storage">' f'<form class="forum-form" method="post" action="/forum/storage">'
f'{self._csrf_field()}' f'{self._csrf_field()}'
f'<label>Keep threads for ' f'<label class="inline-label">Keep threads for '
f'<input name="retention_days" value="{esc(retention_days)}" size="4"> days</label>' f'<input name="retention_days" value="{esc(retention_days)}" size="5"> days</label>'
f"<small>Older threads are pruned automatically (default: 30). Set to 0 to keep everything.</small>" f"<small>Older threads are pruned automatically (default: 30). Set to 0 to keep everything.</small>"
f'<button>save</button>' f'<button>save</button>'
f"</form>" f"</form>"