Feature: Shitpost Mode -> upload multiple files at once

This commit is contained in:
2026-05-13 05:49:11 +02:00
parent d85d8276ed
commit f613ae309e
21 changed files with 1463 additions and 539 deletions

View File

@@ -59,6 +59,7 @@
</div>
@endif
<div class="settings-item" style="background: rgba(0,0,0,0.2); padding: 15px; border-radius: 4px; display: flex; align-items: center; justify-content: space-between; margin-top: 10px;">
<div>
<label style="display: block; font-weight: bold; color: var(--accent);">Minimum Tags</label>

View File

@@ -411,6 +411,10 @@
uploading: "{{ t('upload.uploading') }}",
processing: "{{ t('toast.processing') }}",
upload_await_approval: "{{ t('upload.pending_approval_patient') }}",
upload_shitpost_success: "{{ t('upload.shitpost_success') || 'Successfully shitposted {n} items!' }}",
upload_shitposting_status: "{{ t('upload.shitposting_status') || 'Shitposting' }}",
upload_comment_placeholder: "{{ t('upload.item_comment_placeholder') || 'Comment (optional)...' }}",
upload_tags_placeholder: "{{ t('upload.item_tags_placeholder') || 'Tags...' }}",
// timeago
timeago_just_now: "{{ t('timeago.just_now') }}",
timeago_year: "{{ t('timeago.year') }}",

View File

@@ -46,7 +46,7 @@
@endif
<link rel="stylesheet" href="/s/css/upload.css?v={{ ts }}">
@endif
<script>window.f0ckThemes = {{ themes_json }}; window.f0ckDefaultTheme = "{{ default_theme }}"; window.f0ckDomain = "{{ domain }}"; window.f0ckGitHash = "{{ git_hash }}"; window.f0ckAllowedImages = {{ allowed_comment_images_json }}; window.f0ckEmbedYoutubeInComments = {{ embed_youtube_in_comments ? 'true' : 'false' }}; window.f0ckEnableYoutubeUpload = {{ enable_youtube_upload ? 'true' : 'false' }}; window.f0ckBrandImages = {{ custom_brand_images_json }}; window.f0ckMediaBase = "{{ paths_images }}";</script>
<script>window.f0ckThemes = {{ themes_json }}; window.f0ckDefaultTheme = "{{ default_theme }}"; window.f0ckDomain = "{{ domain }}"; window.f0ckGitHash = "{{ git_hash }}"; window.f0ckAllowedImages = {{ allowed_comment_images_json }}; window.f0ckEmbedYoutubeInComments = {{ embed_youtube_in_comments ? 'true' : 'false' }}; window.f0ckEnableYoutubeUpload = {{ enable_youtube_upload ? 'true' : 'false' }}; window.f0ckBrandImages = {{ custom_brand_images_json }}; window.f0ckMediaBase = "{{ paths_images }}"; window.f0ckShitpostMode = {{ shitpost_mode ? 'true' : 'false' }};</script>
@if(!private_society || session)
<script src="/s/js/marked.min.js" defer></script>
<script src="/s/js/comments.js?v={{ ts }}" defer></script>

View File

@@ -1,4 +1,4 @@
<form id="upload-form" class="upload-form" enctype="multipart/form-data" data-mimes='{!! mimes_json !!}' data-max-bytes="{{ max_file_size_bytes }}" data-min-tags="{{ min_tags }}">
<form id="upload-form" class="upload-form {{ shitpost_mode ? 'shitpost-mode-active' : '' }}" enctype="multipart/form-data" data-mimes='{!! mimes_json !!}' data-max-bytes="{{ max_file_size_bytes }}" data-min-tags="{{ min_tags }}">
<div class="form-section">
@if(web_url_upload)
<div class="upload-mode-tabs">
@@ -16,7 +16,7 @@
<!-- File input area -->
<div class="upload-mode-content" id="mode-file">
<div class="drop-zone" id="upload-form-drop-zone">
<input type="file" class="file-input" name="file" accept="{{ allowed_mimes }}">
<input type="file" class="file-input" name="file" accept="{{ allowed_mimes }}" {{ shitpost_mode ? 'multiple' : '' }}>
<div class="drop-zone-prompt">
<p style="font-size: 1.1rem; font-weight: 500;">{{ t('upload.drop_here') }}</p>
<p style="font-size: 0.9rem; opacity: 0.6;">(max {{ max_file_size }})@if(session.admin) <span style="color: var(--accent);">{{ t('upload.admin_boost') }}</span>@endif</p>
@@ -39,7 +39,16 @@
<!-- URL input area -->
<div class="upload-mode-content" id="mode-url" style="display: none;">
<div class="url-input-container">
@if(shitpost_mode)
<div class="url-shitpost-container">
<textarea id="url-upload-input" name="url" placeholder="{{ t('upload.url_placeholder_shitpost') || 'Paste multiple URLs here (one per line)...' }}" autocomplete="off" style="width: 100%; min-height: 100px; background: rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.1); color: #fff; padding: 10px; border-radius: 4px; resize: vertical;"></textarea>
<button type="button" class="btn-add-urls">
<i class="fa-solid fa-plus-circle"></i> {{ t('upload.btn_add_urls') }}
</button>
</div>
@else
<input type="url" id="url-upload-input" name="url" placeholder="@if(enable_youtube_upload){{ t('upload.url_placeholder_yt') }}@else {{ t('upload.url_placeholder') }}@endif" autocomplete="off">
@endif
</div>
<div class="url-type-badge" id="url-type-badge" style="display: none;"></div>
</div>
@@ -55,7 +64,7 @@
</div>
</div>
<div class="form-section">
<div class="form-section global-rating-section">
<label>{{ t('upload.rating') }} <span class="required">*</span></label>
<div class="rating-options">
<label class="rating-option">
@@ -75,14 +84,8 @@
</div>
</div>
<div class="form-section">
<div class="oc-option">
<input type="checkbox" name="is_oc" id="upload-oc-checkbox">
<span class="oc-label">{{ t('upload.original_content') }}</span>
</div>
</div>
<div class="form-section">
<div class="form-section global-tag-section">
<label>
{{ t('upload.tags') }}
@if(min_tags > 0)
@@ -109,7 +112,7 @@
</div>
</div>
<div class="form-section">
<div class="form-section global-comment-section">
<label>{{ t('upload.comment') }} <span style="opacity: 0.5; font-weight: normal;">{{ t('upload.comment_optional') }}</span></label>
<div class="upload-comment-input comment-input">
<textarea class="upload-comment" placeholder="{{ t('upload.comment_placeholder') }}" maxlength="2000"></textarea>