Adding config bool for userhall image upload

This commit is contained in:
2026-05-11 05:59:37 +02:00
parent 1f4cbfcec7
commit 9d4d3fbdcb
7 changed files with 101 additions and 60 deletions

View File

@@ -1,6 +1,6 @@
@each(hallsList as hall)
<div class="hall-manager-card" id="uh-card-{{ hall.slug }}" data-slug="{{ hall.slug }}" data-owner-id="{{ ownerUser.id }}">
<div class="hall-manager-image" style="position:relative;height:140px;overflow:hidden;background:#111;cursor:pointer;" title="Click to upload a custom image">
<div class="hall-manager-image" style="position:relative;height:140px;overflow:hidden;background:#111;cursor:pointer;" title="{{ enable_userhall_image_upload ? 'Click to upload a custom image' : 'View hall' }}">
@if(hall.user_id)
<img src="/user_hall_image/{{ hall.user_id }}/{{ hall.slug }}" alt="{!! hall.name !!}" style="width:100%;height:100%;object-fit:cover;opacity:0.8;">
@else
@@ -14,11 +14,13 @@
@endif
</span>
@if(isOwner || (session && session.admin))
@if(hall.custom_image)
<button class="uh-btn-del-img" title="Remove custom image" style="position:absolute;top:6px;right:6px;width:24px;height:24px;display:flex;align-items:center;justify-content:center;background:rgba(0,0,0,0.7);color:#fff;border:1px solid rgba(255,255,255,0.3);border-radius:50%;cursor:pointer;font-size:0.75em;line-height:1;z-index:2;padding:0;"></button>
@if(enable_userhall_image_upload)
@if(isOwner || (session && session.admin))
@if(hall.custom_image)
<button class="uh-btn-del-img" title="Remove custom image" style="position:absolute;top:6px;right:6px;width:24px;height:24px;display:flex;align-items:center;justify-content:center;background:rgba(0,0,0,0.7);color:#fff;border:1px solid rgba(255,255,255,0.3);border-radius:50%;cursor:pointer;font-size:0.75em;line-height:1;z-index:2;padding:0;"></button>
@endif
<input type="file" class="uh-img-upload" accept="image/*" style="display:none;">
@endif
<input type="file" class="uh-img-upload" accept="image/*" style="display:none;">
@endif
</div>
@@ -42,7 +44,7 @@
<button class="uh-btn-save hm-btn" style="background:var(--accent);color:#000;border:none;font-weight:bold;">{{ t('common.save') }}</button>
<a href="/user/{{ ownerUser.user }}/hall/{{ hall.slug }}" class="hm-btn" style="background:rgba(255,255,255,0.05);color:#aaa;border:1px solid rgba(255,255,255,0.1);">{{ t('common.view') }} →</a>
<span style="margin-left:4px;font-size:0.8em;color:#666;">
{{ t('hall.posts', { count: hall.total_items }) }}
{{ t('hall.posts').replace('{count}', hall.total_items) }}
</span>
<button class="uh-btn-delete hm-btn" style="margin-left:auto;background:rgba(200,0,0,0.25);color:#f55;border:1px solid rgba(200,0,0,0.4);">🗑 {{ t('common.delete') }}</button>
</div>
@@ -58,7 +60,7 @@
@endif
<a href="/user/{{ ownerUser.user }}/hall/{{ hall.slug }}" class="hm-btn" style="background:rgba(255,255,255,0.05);color:#aaa;border:1px solid rgba(255,255,255,0.1);">{{ t('common.view') }} →</a>
<span style="margin-left:6px;font-size:0.8em;color:#666;">
{{ t('hall.posts', { count: hall.total_items }) }}
{{ t('hall.posts').replace('{count}', hall.total_items) }}
</span>
@endif
<div class="uh-card-status" style="margin-top:6px;font-size:0.8em;color:#888;min-height:1.2em;"></div>