Add upload type chooser and redesign upload modal
Clicking Create now opens a card-based chooser (Generic / Music / Sports) before the upload modal; the chosen type is applied and its Content Type dropdown is hidden as redundant. Per type: - Generic/Match show their fields inline in the modal (no card/popup); Music keeps the track-card + Track Editor popup for multi-language tracks. - "Language Track" wording stays music-only; a single Language field is now available for generic/match too (mirrored on the mobile create page with name-swapping so only the active picker submits). Also unifies all modal controls (dropdowns, selects, inputs) to one larger, red-accented dark style scoped to #uploadModal. Co-Authored-By: Claude Opus 4.7 <[email protected]>
This commit is contained in:
1 parent
d9959c4452
commit
6aae6f86b6
5 files changed
+343
-13
No files matched your search
@@ -190,6 +190,14 @@
|
||||
|
||||
<!-- Title + Description (video mode) -->
|
||||
<div id="basic-fields-create">
|
||||
<div class="form-group">
|
||||
<x-language-select
|
||||
name="primary_language"
|
||||
id="video_language_create"
|
||||
label="Language"
|
||||
placeholder="Select language"
|
||||
/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-label">Title *</label>
|
||||
<input type="text" name="title" id="video-title" class="form-input" placeholder="Enter video title">
|
||||
@@ -496,6 +504,18 @@
|
||||
innerTitle.removeAttribute('name'); innerDesc.removeAttribute('name');
|
||||
}
|
||||
|
||||
// Language: video mode submits the basic-fields picker; music mode submits the track-1 picker.
|
||||
// Only one carries name="primary_language" at a time so the value never collides.
|
||||
const audioLang = document.getElementById('primary_language_create');
|
||||
const videoLang = document.getElementById('video_language_create');
|
||||
if (audio) {
|
||||
if (videoLang) videoLang.removeAttribute('name');
|
||||
if (audioLang) audioLang.setAttribute('name', 'primary_language');
|
||||
} else {
|
||||
if (audioLang) audioLang.removeAttribute('name');
|
||||
if (videoLang) videoLang.setAttribute('name', 'primary_language');
|
||||
}
|
||||
|
||||
if (audio) {
|
||||
document.querySelectorAll('#type-options .option-item').forEach(o => o.classList.remove('active'));
|
||||
const musicOpt = document.querySelector('#type-options .option-item[data-type="music"]');
|
||||
@@ -1038,6 +1058,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
// Default mode is generic (video): only the video-mode language picker submits primary_language
|
||||
;(function() {
|
||||
const audioLang = document.getElementById('primary_language_create');
|
||||
if (audioLang) audioLang.removeAttribute('name');
|
||||
})();
|
||||
|
||||
// Wire primary language select → update track 1 header
|
||||
;(function() {
|
||||
const plInput = document.getElementById('primary_language_create');
|
||||
|
||||
Reference in new issue
Block a user