fix(ui): fix button text wrapping, upload layout, and image placeholders
This commit is contained in:
@@ -38,17 +38,21 @@ a:hover { text-decoration: underline; }
|
|||||||
.auth-link { margin-top: 1rem; text-align: center; font-size: .9rem; }
|
.auth-link { margin-top: 1rem; text-align: center; font-size: .9rem; }
|
||||||
|
|
||||||
/* Forms */
|
/* Forms */
|
||||||
label { display: block; margin-top: .75rem; font-size: .85rem; font-weight: 500; color: var(--text-muted); }
|
label { display: block; margin-top: 1rem; font-size: .85rem; font-weight: 500; color: var(--text-muted); }
|
||||||
input[type="text"], input[type="password"], input[type="datetime-local"], select, textarea {
|
input[type="text"], input[type="password"], input[type="datetime-local"], select, textarea {
|
||||||
width: 100%; padding: .5rem .75rem; margin-top: .25rem; border: 1px solid var(--border); border-radius: 6px; font-size: .95rem; background: #fff;
|
width: 100%; padding: .5rem .75rem; margin-top: .25rem; border: 1px solid var(--border); border-radius: 6px; font-size: .95rem; background: #fff;
|
||||||
}
|
}
|
||||||
input:focus, select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
|
input:focus, select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
|
||||||
|
input[type="text"] + label, input[type="password"] + label, input[type="datetime-local"] + label, select + label { margin-top: 1.1rem; }
|
||||||
.form-card { background: var(--card-bg); padding: 1.5rem; border-radius: 8px; border: 1px solid var(--border); }
|
.form-card { background: var(--card-bg); padding: 1.5rem; border-radius: 8px; border: 1px solid var(--border); }
|
||||||
.form-actions { display: flex; gap: .75rem; margin-top: 1.25rem; }
|
.form-actions { display: flex; gap: .75rem; margin-top: 1.25rem; }
|
||||||
.form-row { display: flex; gap: .5rem; align-items: center; }
|
.form-row { display: flex; gap: .5rem; align-items: center; }
|
||||||
|
.form-row input[type="text"], .form-row select { flex: 1; width: auto; }
|
||||||
|
.form-row .btn { white-space: nowrap; flex-shrink: 0; }
|
||||||
.inline-form { margin-bottom: 1.25rem; }
|
.inline-form { margin-bottom: 1.25rem; }
|
||||||
|
|
||||||
/* Buttons */
|
/* Buttons */
|
||||||
|
button[type="submit"] { margin-top: 1.25rem; }
|
||||||
.btn { display: inline-block; padding: .5rem 1rem; border: 1px solid var(--border); border-radius: 6px; background: #fff; cursor: pointer; font-size: .9rem; text-align: center; }
|
.btn { display: inline-block; padding: .5rem 1rem; border: 1px solid var(--border); border-radius: 6px; background: #fff; cursor: pointer; font-size: .9rem; text-align: center; }
|
||||||
.btn:hover { background: var(--bg); text-decoration: none; }
|
.btn:hover { background: var(--bg); text-decoration: none; }
|
||||||
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
|
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
|
||||||
@@ -99,8 +103,10 @@ code { background: var(--bg); padding: .15rem .4rem; border-radius: 4px; font-si
|
|||||||
.detail-images { display: flex; flex-direction: column; gap: 1.5rem; }
|
.detail-images { display: flex; flex-direction: column; gap: 1.5rem; }
|
||||||
.image-block h3 { margin-bottom: .5rem; font-size: .95rem; }
|
.image-block h3 { margin-bottom: .5rem; font-size: .95rem; }
|
||||||
.detail-img { width: 100%; max-width: 400px; border-radius: 8px; border: 1px solid var(--border); }
|
.detail-img { width: 100%; max-width: 400px; border-radius: 8px; border: 1px solid var(--border); }
|
||||||
|
.detail-img.placeholder { display: flex; align-items: center; justify-content: center; height: 200px; background: var(--bg); color: var(--text-muted); font-size: .95rem; }
|
||||||
.upload-form { margin-top: .5rem; display: flex; gap: .5rem; align-items: center; }
|
.upload-form { margin-top: .5rem; display: flex; gap: .5rem; align-items: center; }
|
||||||
.upload-form input[type="file"] { flex: 1; font-size: .85rem; }
|
.upload-form input[type="file"] { font-size: .85rem; min-width: 0; max-width: 260px; }
|
||||||
|
.upload-form .btn { white-space: nowrap; flex-shrink: 0; }
|
||||||
.detail-meta dl { display: grid; grid-template-columns: auto 1fr; gap: .3rem 1rem; }
|
.detail-meta dl { display: grid; grid-template-columns: auto 1fr; gap: .3rem 1rem; }
|
||||||
.detail-meta dt { font-weight: 600; font-size: .85rem; color: var(--text-muted); }
|
.detail-meta dt { font-weight: 600; font-size: .85rem; color: var(--text-muted); }
|
||||||
.detail-meta dd { font-size: .95rem; }
|
.detail-meta dd { font-size: .95rem; }
|
||||||
|
|||||||
@@ -17,6 +17,8 @@
|
|||||||
<h3>正面</h3>
|
<h3>正面</h3>
|
||||||
{% if postcard.image_front %}
|
{% if postcard.image_front %}
|
||||||
<img src="{{ postcard.image_front }}" alt="正面" class="detail-img">
|
<img src="{{ postcard.image_front }}" alt="正面" class="detail-img">
|
||||||
|
{% else %}
|
||||||
|
<div class="detail-img placeholder">📷 未上传正面图片</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<form method="post" action="/postcards/{{ postcard.id }}/image/front" enctype="multipart/form-data" class="inline upload-form">
|
<form method="post" action="/postcards/{{ postcard.id }}/image/front" enctype="multipart/form-data" class="inline upload-form">
|
||||||
<input type="file" name="file" accept="image/*" required>
|
<input type="file" name="file" accept="image/*" required>
|
||||||
@@ -27,6 +29,8 @@
|
|||||||
<h3>反面</h3>
|
<h3>反面</h3>
|
||||||
{% if postcard.image_back %}
|
{% if postcard.image_back %}
|
||||||
<img src="{{ postcard.image_back }}" alt="反面" class="detail-img">
|
<img src="{{ postcard.image_back }}" alt="反面" class="detail-img">
|
||||||
|
{% else %}
|
||||||
|
<div class="detail-img placeholder">📷 未上传反面图片</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<form method="post" action="/postcards/{{ postcard.id }}/image/back" enctype="multipart/form-data" class="inline upload-form">
|
<form method="post" action="/postcards/{{ postcard.id }}/image/back" enctype="multipart/form-data" class="inline upload-form">
|
||||||
<input type="file" name="file" accept="image/*" required>
|
<input type="file" name="file" accept="image/*" required>
|
||||||
|
|||||||
Reference in New Issue
Block a user