option to enable/disable item titles

This commit is contained in:
2026-05-25 09:55:53 +02:00
parent 1adc0f4ee2
commit fda2ed36bd
7 changed files with 17 additions and 13 deletions

View File

@@ -112,6 +112,7 @@
"user_alternative_infobox": false, "user_alternative_infobox": false,
"enable_swf": false, "enable_swf": false,
"swf_thumb": "/s/img/swf.png", "swf_thumb": "/s/img/swf.png",
"enable_item_title": true,
"open_registration": true, "open_registration": true,
"open_registration_web_toggle": false, "open_registration_web_toggle": false,
"open_registration_require_mail_andor_token": false, "open_registration_require_mail_andor_token": false,

View File

@@ -1013,11 +1013,13 @@ window.initUploadForm = (selector) => {
</div> </div>
`; `;
titleUI = ` if (window.f0ckEnableItemTitle !== false) {
<div class="item-title-container"> titleUI = `
<input type="text" class="item-title-input" placeholder="Add Title..." maxlength="500" value="${window.escapeHtmlUpload(item.title || '')}"> <div class="item-title-container">
</div> <input type="text" class="item-title-input" placeholder="Add Title..." maxlength="500" value="${window.escapeHtmlUpload(item.title || '')}">
`; </div>
`;
}
const commentPlaceholder = window.f0ckI18n?.upload_comment_placeholder || 'AddComment...'; const commentPlaceholder = window.f0ckI18n?.upload_comment_placeholder || 'AddComment...';
const maxLenHtml = (commentMaxLen !== null && !isNaN(commentMaxLen)) ? ` maxlength="${commentMaxLen}"` : ''; const maxLenHtml = (commentMaxLen !== null && !isNaN(commentMaxLen)) ? ` maxlength="${commentMaxLen}"` : '';

View File

@@ -1133,6 +1133,7 @@ process.on('uncaughtException', err => {
comment_max_length: cfg.main.comment_max_length ?? null, comment_max_length: cfg.main.comment_max_length ?? null,
enable_swf: !!cfg.websrv.enable_swf, enable_swf: !!cfg.websrv.enable_swf,
enable_danmaku: cfg.websrv.enable_danmaku !== false, enable_danmaku: cfg.websrv.enable_danmaku !== false,
enable_item_title: cfg.websrv.enable_item_title !== false,
enable_global_chat: !!cfg.websrv.enable_global_chat, enable_global_chat: !!cfg.websrv.enable_global_chat,
embed_youtube_in_comments: cfg.websrv.embed_youtube_in_comments !== false, embed_youtube_in_comments: cfg.websrv.embed_youtube_in_comments !== false,
koepfe_json: JSON.stringify(cfg.websrv.koepfe || []), koepfe_json: JSON.stringify(cfg.websrv.koepfe || []),

View File

@@ -9,7 +9,7 @@
<div class="location">{{ link.main }}{{ item.id }}{{ link.suffix }}</div> <div class="location">{{ link.main }}{{ item.id }}{{ link.suffix }}</div>
<div class="gapLeft"></div> <div class="gapLeft"></div>
</div> </div>
@if(item.title) @if(enable_item_title && item.title)
<div class="item_title">{!! item.title !!}</div> <div class="item_title">{!! item.title !!}</div>
@endif @endif
@@ -201,7 +201,7 @@
<div class="modal-content" style="max-width: 500px;"> <div class="modal-content" style="max-width: 500px;">
<div class="modal-body" style="padding: 20px 0; text-align: left;"> <div class="modal-body" style="padding: 20px 0; text-align: left;">
<table class="info-table"> <table class="info-table">
@if(can_manage_item) @if(enable_item_title && can_manage_item)
<tr class="info-title-row"> <tr class="info-title-row">
<th>Title</th> <th>Title</th>
<td> <td>
@@ -212,7 +212,7 @@
<span id="info-title-status" class="info-title-status" style="display:none"></span> <span id="info-title-status" class="info-title-status" style="display:none"></span>
</td> </td>
</tr> </tr>
@elseif(item.title) @elseif(enable_item_title && item.title)
<tr> <tr>
<th>Title</th> <th>Title</th>
<td>{!! item.title !!}</td> <td>{!! item.title !!}</td>

View File

@@ -60,7 +60,7 @@
<div class="location">{{ link.main }}{{ item.id }}{{ link.suffix }}</div> <div class="location">{{ link.main }}{{ item.id }}{{ link.suffix }}</div>
<div class="gapLeft"></div> <div class="gapLeft"></div>
</div> </div>
@if(item.title) @if(enable_item_title && item.title)
<div class="item_title">{!! item.title !!}</div> <div class="item_title">{!! item.title !!}</div>
@endif @endif
@@ -175,7 +175,7 @@
<div class="modal-content" style="max-width: 500px;"> <div class="modal-content" style="max-width: 500px;">
<div class="modal-body" style="padding: 20px 0; text-align: left;"> <div class="modal-body" style="padding: 20px 0; text-align: left;">
<table class="info-table"> <table class="info-table">
@if(can_manage_item) @if(enable_item_title && can_manage_item)
<tr class="info-title-row"> <tr class="info-title-row">
<th>Title</th> <th>Title</th>
<td> <td>
@@ -186,7 +186,7 @@
<span id="info-title-status" class="info-title-status" style="display:none"></span> <span id="info-title-status" class="info-title-status" style="display:none"></span>
</td> </td>
</tr> </tr>
@elseif(item.title) @elseif(enable_item_title && item.title)
<tr> <tr>
<th>Title</th> <th>Title</th>
<td>{!! item.title !!}</td> <td>{!! item.title !!}</td>

View File

@@ -46,7 +46,7 @@
@endif @endif
<link rel="stylesheet" href="/s/css/upload.css?v={{ ts }}"> <link rel="stylesheet" href="/s/css/upload.css?v={{ ts }}">
@endif @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 }}"; window.f0ckShitpostMode = {{ shitpost_mode ? 'true' : 'false' }}; window.f0ckShitpostRequireRating = {{ shitpost_require_rating ? 'true' : 'false' }}; window.f0ckShitpostMinTags = {{ shitpost_min_tags || 0 }};</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' }}; window.f0ckShitpostRequireRating = {{ shitpost_require_rating ? 'true' : 'false' }}; window.f0ckShitpostMinTags = {{ shitpost_min_tags || 0 }}; window.f0ckEnableItemTitle = {{ enable_item_title ? 'true' : 'false' }};</script>
@if(!private_society || session) @if(!private_society || session)
<script src="/s/js/marked.min.js" defer></script> <script src="/s/js/marked.min.js" defer></script>
<script src="/s/js/comments.js?v={{ ts }}" defer></script> <script src="/s/js/comments.js?v={{ ts }}" defer></script>

View File

@@ -58,7 +58,7 @@
</div> </div>
</div> </div>
@if(!shitpost_mode) @if(!shitpost_mode && enable_item_title)
<div class="form-section global-title-section"> <div class="form-section global-title-section">
<label>Title <span style="opacity: 0.5; font-weight: normal;">{{ t('upload.comment_optional') }}</span></label> <label>Title <span style="opacity: 0.5; font-weight: normal;">{{ t('upload.comment_optional') }}</span></label>
<input type="text" name="title" class="upload-title-input" placeholder="Add a title for this item…" maxlength="500" autocomplete="off"> <input type="text" name="title" class="upload-title-input" placeholder="Add a title for this item…" maxlength="500" autocomplete="off">