This commit is contained in:
@@ -9,13 +9,17 @@
|
||||
</div>
|
||||
|
||||
<!-- Add form -->
|
||||
<div class="form-card" style="margin-bottom:1.5rem;">
|
||||
<h2 style="font-size:1.1rem;font-weight:700;margin-bottom:0.75rem;">{{ t.testimonials_add_title }}</h2>
|
||||
<form method="post" action="/admin/testimonials/add" enctype="multipart/form-data">
|
||||
<div class="field">
|
||||
<section class="admin-section mb-5">
|
||||
<header class="admin-section-head">
|
||||
<span class="admin-section-icon" aria-hidden="true">💬</span>
|
||||
<div><h2>{{ t.testimonials_add_title }}</h2></div>
|
||||
</header>
|
||||
<div class="admin-section-body">
|
||||
<form method="post" action="/admin/testimonials/add" enctype="multipart/form-data" class="form-grid">
|
||||
<div class="field admin-field-wide">
|
||||
<label class="label">{{ t.testimonials_text }} *</label>
|
||||
<div class="control">
|
||||
<textarea class="input" name="text" rows="3" required style="min-height:80px;resize:vertical;"></textarea>
|
||||
<textarea class="textarea" name="text" rows="3" required></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
@@ -30,27 +34,28 @@
|
||||
<input class="input" type="file" name="image" accept="image/*">
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" class="button is-primary">{{ t.testimonials_add_button }}</button>
|
||||
<div class="admin-field-wide"><button type="submit" class="button is-primary">{{ t.testimonials_add_button }}</button></div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- List -->
|
||||
{% if testimonials.is_empty() %}
|
||||
<p style="color:#888;">{{ t.testimonials_empty }}</p>
|
||||
<p class="empty-state">{{ t.testimonials_empty }}</p>
|
||||
{% else %}
|
||||
{% for item in &testimonials %}
|
||||
<div class="item-card" id="card-{{ item.id.unwrap() }}">
|
||||
<!-- View mode -->
|
||||
<div class="tm-view" id="view-{{ item.id.unwrap() }}">
|
||||
<div class="item-card-header">
|
||||
<div style="display:flex;align-items:center;gap:0.75rem;">
|
||||
<div class="testimonial-content">
|
||||
{% if let Some(image_url) = item.image_url.as_deref() %}
|
||||
<img src="{{ image_url }}" alt="" style="width:48px;height:48px;border-radius:50%;object-fit:cover;">
|
||||
<img src="{{ image_url }}" alt="" class="testimonial-avatar">
|
||||
{% endif %}
|
||||
<div>
|
||||
<div style="font-size:0.95rem;line-height:1.5;">{{ item.text }}</div>
|
||||
<div class="testimonial-text">{{ item.text }}</div>
|
||||
{% if let Some(note) = item.author_note.as_deref() %}
|
||||
<div style="font-size:0.8rem;color:#888;margin-top:0.2rem;">{{ note }}</div>
|
||||
<div class="testimonial-note">{{ note }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
@@ -79,7 +84,7 @@
|
||||
<div class="field">
|
||||
<label class="label">{{ t.testimonials_text }}</label>
|
||||
<div class="control">
|
||||
<textarea class="input" name="text" rows="3" style="min-height:70px;resize:vertical;">{{ item.text }}</textarea>
|
||||
<textarea class="textarea" name="text" rows="3">{{ item.text }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
@@ -90,10 +95,12 @@
|
||||
</div>
|
||||
{% if item.image_path.is_some() %}
|
||||
<div class="field">
|
||||
<div style="display:flex;align-items:center;gap:0.75rem;margin-bottom:0.5rem;">
|
||||
{% if let Some(image_url) = item.image_url.as_deref() %}<img src="{{ image_url }}" alt="" style="width:48px;height:48px;border-radius:50%;object-fit:cover;">{% endif %}
|
||||
<label style="font-size:0.85rem;cursor:pointer;color:#888;">
|
||||
<input type="checkbox" name="remove_image" value="1"> {{ t.testimonials_remove_image }}
|
||||
<div class="testimonial-content mb-2">
|
||||
{% if let Some(image_url) = item.image_url.as_deref() %}<img src="{{ image_url }}" alt="" class="testimonial-avatar">{% endif %}
|
||||
<label class="admin-check admin-check-danger">
|
||||
<input type="checkbox" name="remove_image" value="1">
|
||||
<span class="admin-check-box">✓</span>
|
||||
<span>{{ t.testimonials_remove_image }}</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
@@ -104,7 +111,7 @@
|
||||
<input class="input" type="file" name="image" accept="image/*">
|
||||
</div>
|
||||
</div>
|
||||
<div style="display:flex;gap:0.5rem;">
|
||||
<div class="action-row">
|
||||
<button type="submit" class="button btn-sm is-primary">{{ t.testimonials_save }}</button>
|
||||
<button type="button" class="button btn-sm is-light" onclick="toggleEdit({{ item.id.unwrap() }})">✕</button>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user