Contact Person
Contact Phone
@@ -323,6 +528,7 @@ export function renderVenuePage({ state = 'ok', user = null, csrf = '' } = {}) {
Private Address (Gate / Exact Entry for Confirmed Guests)
Venue Description & Ambiance
House Rules & Entry Guidelines
+
Photo URLs (one per line)
Facilities & Equipment
diff --git a/migrations/031_venue_self_service_onboarding.sql b/migrations/031_venue_self_service_onboarding.sql
new file mode 100644
index 0000000..547bf4a
--- /dev/null
+++ b/migrations/031_venue_self_service_onboarding.sql
@@ -0,0 +1,42 @@
+-- migrations/031_venue_self_service_onboarding.sql
+-- NIGHTLIFEZ Full Self-Service Venue Onboarding & Direct Management.
+-- Additive columns on venues for self-service categorization, neighbourhood, and progress tracking.
+-- Fully safe, idempotent, non-destructive, and backward compatible.
+
+-- 1. Extend venue_status enum to include 'draft' for isolated uncompleted drafts
+ALTER TYPE venue_status ADD VALUE IF NOT EXISTS 'draft';
+
+-- 2. Extend venues table with self-service metadata
+ALTER TABLE venues ADD COLUMN IF NOT EXISTS category TEXT;
+ALTER TABLE venues ADD COLUMN IF NOT EXISTS neighbourhood TEXT;
+ALTER TABLE venues ADD COLUMN IF NOT EXISTS onboarding_completed BOOLEAN NOT NULL DEFAULT true;
+ALTER TABLE venues ADD COLUMN IF NOT EXISTS onboarding_step INTEGER NOT NULL DEFAULT 1;
+
+-- 3. Indexes for discovery, filtering, and onboarding lookups
+CREATE INDEX IF NOT EXISTS idx_venues_category ON venues (category) WHERE category IS NOT NULL;
+CREATE INDEX IF NOT EXISTS idx_venues_neighbourhood ON venues (neighbourhood) WHERE neighbourhood IS NOT NULL;
+CREATE INDEX IF NOT EXISTS idx_venues_onboarding_completed ON venues (org_id, onboarding_completed);
+CREATE INDEX IF NOT EXISTS idx_venues_active_discovery ON venues (id, org_id) WHERE status = 'active' AND onboarding_completed = true;
+
+-- 4. Self-service ownership claims & recovery for duplicate/unclaimed venues
+CREATE TABLE IF NOT EXISTS venue_claims (
+ id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
+ venue_id UUID NOT NULL REFERENCES venues(id) ON DELETE CASCADE,
+ claimant_user_id UUID NOT NULL REFERENCES users(id) ON DELETE CASCADE,
+ claimant_org_id UUID REFERENCES organisations(id) ON DELETE SET NULL,
+ claimant_role TEXT NOT NULL,
+ business_proof_type TEXT NOT NULL,
+ business_proof_ref TEXT NOT NULL,
+ contact_name TEXT NOT NULL,
+ contact_email TEXT NOT NULL,
+ contact_phone TEXT,
+ notes TEXT,
+ status TEXT NOT NULL DEFAULT 'pending_verification',
+ resolution_notes TEXT,
+ resolved_at TIMESTAMPTZ,
+ created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
+ updated_at TIMESTAMPTZ NOT NULL DEFAULT now()
+);
+
+CREATE INDEX IF NOT EXISTS idx_venue_claims_venue ON venue_claims (venue_id, status);
+CREATE INDEX IF NOT EXISTS idx_venue_claims_user ON venue_claims (claimant_user_id, status);
diff --git a/public/css/venue.css b/public/css/venue.css
index a3baf21..cbc3972 100644
--- a/public/css/venue.css
+++ b/public/css/venue.css
@@ -589,3 +589,188 @@ button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-
outline: 2px solid var(--neon-cyan, #00D9FF);
outline-offset: 2px;
}
+
+/* Self-Service Onboarding Wizard Styles */
+.venue-onboarding-container {
+ max-width: 860px;
+ margin: 0 auto;
+ padding: 10px 0 60px;
+}
+.venue-onboard-title {
+ font-size: clamp(1.8rem, 4vw, 2.6rem);
+ margin: 12px 0 10px;
+ font-weight: 800;
+ letter-spacing: -0.02em;
+}
+.venue-onboard-lede {
+ max-width: 620px;
+ margin: 0 auto 28px;
+ color: var(--muted, #8a8a9a);
+ font-size: 1.05rem;
+}
+.venue-strength-card {
+ background: var(--surface, #121218);
+ border: 1px solid var(--line, #242432);
+ border-radius: var(--radius, 12px);
+ padding: 18px 24px;
+ margin-bottom: 24px;
+}
+.venue-strength-header {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ flex-wrap: wrap;
+ gap: 12px;
+ margin-bottom: 12px;
+}
+.venue-strength-info {
+ display: flex;
+ align-items: center;
+ gap: 10px;
+ flex-wrap: wrap;
+}
+.strength-label {
+ font-weight: 600;
+ font-size: 0.95rem;
+}
+.strength-percent {
+ font-weight: 800;
+ color: var(--neon-cyan, #00D9FF);
+ font-size: 1.15rem;
+}
+.strength-hint {
+ color: var(--muted, #8a8a9a);
+}
+.venue-progress-track {
+ width: 100%;
+ height: 8px;
+ background: rgba(255, 255, 255, 0.08);
+ border-radius: 999px;
+ overflow: hidden;
+}
+.venue-progress-fill {
+ height: 100%;
+ background: linear-gradient(90deg, #00D9FF 0%, #38ef7d 100%);
+ border-radius: 999px;
+ transition: width 0.3s ease;
+}
+.venue-onboarding-card {
+ background: var(--surface, #121218);
+ border: 1px solid var(--line, #242432);
+ border-radius: var(--radius, 12px);
+ padding: 32px 28px;
+}
+.venue-form-section {
+ border: 0;
+ padding: 0;
+ margin: 0 0 32px;
+}
+.venue-form-section:last-of-type {
+ margin-bottom: 24px;
+}
+.venue-section-title {
+ font-size: 1.15rem;
+ font-weight: 700;
+ color: #fff;
+ padding: 0;
+ margin-bottom: 16px;
+ border-bottom: 1px solid var(--line, #242432);
+ width: 100%;
+ padding-bottom: 8px;
+}
+.field-hint {
+ display: block;
+ margin-top: 4px;
+ color: var(--muted, #8a8a9a);
+ font-size: 0.82rem;
+}
+.facilities-checkbox-grid {
+ display: grid;
+ grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
+ gap: 10px;
+}
+.venue-checkbox-item {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+ background: rgba(255, 255, 255, 0.03);
+ border: 1px solid var(--line, #242432);
+ border-radius: 8px;
+ padding: 10px 14px;
+ cursor: pointer;
+ font-size: 0.9rem;
+ transition: background 0.15s, border-color 0.15s;
+}
+.venue-checkbox-item:hover {
+ background: rgba(0, 217, 255, 0.06);
+ border-color: rgba(0, 217, 255, 0.3);
+}
+.venue-checkbox-item input[type="checkbox"] {
+ accent-color: var(--neon-cyan, #00D9FF);
+ width: 16px;
+ height: 16px;
+}
+.venue-onboard-actions-row {
+ display: flex;
+ gap: 16px;
+ align-items: center;
+ flex-wrap: wrap;
+ margin-top: 28px;
+}
+
+/* Gallery & Thumbnails */
+.venue-gallery-grid {
+ display: grid;
+ grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
+ gap: 14px;
+ margin-top: 14px;
+}
+.venue-gallery-item {
+ position: relative;
+ aspect-ratio: 4 / 3;
+ border-radius: 8px;
+ overflow: hidden;
+ border: 1px solid var(--line, #242432);
+ background: #000;
+}
+.venue-gallery-thumb {
+ width: 100%;
+ height: 100%;
+ object-fit: cover;
+ display: block;
+}
+.venue-gallery-remove {
+ position: absolute;
+ top: 6px;
+ right: 6px;
+ background: rgba(0, 0, 0, 0.75);
+ color: #ff6b6b;
+ border: 1px solid rgba(255, 107, 107, 0.4);
+ border-radius: 50%;
+ width: 24px;
+ height: 24px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ font-size: 16px;
+ line-height: 1;
+ cursor: pointer;
+ padding: 0;
+ transition: background 0.15s, color 0.15s;
+}
+.venue-gallery-remove:hover {
+ background: #ff6b6b;
+ color: #fff;
+}
+.event-action-cell {
+ display: inline-flex;
+ gap: 6px;
+}
+
+/* Accessible and Subtle :user-invalid Styling */
+.lead-form input:user-invalid,
+.lead-form select:user-invalid,
+.lead-form textarea:user-invalid {
+ border-color: #ff6b6b;
+ box-shadow: 0 0 0 1px rgba(255, 107, 107, 0.25);
+}
diff --git a/public/js/venue.js b/public/js/venue.js
index 2c29f51..cc9992e 100644
--- a/public/js/venue.js
+++ b/public/js/venue.js
@@ -79,6 +79,17 @@
{ id: 'wifi_highspeed', label: 'High-Speed Wi-Fi', icon: '📶' }
];
+ var ALL_CATEGORIES = [
+ { id: 'rooftop_lounge', label: 'Rooftop Lounge & Skybar' },
+ { id: 'cocktail_speakeasy', label: 'Cocktail Bar & Speakeasy' },
+ { id: 'nightclub', label: 'Nightclub & Dance Venue' },
+ { id: 'cafe_bistro', label: 'Café & Intimate Bistro' },
+ { id: 'studio_loft', label: 'Art Studio & Creative Loft' },
+ { id: 'resort_farmhouse', label: 'Resort, Villa & Farmhouse' },
+ { id: 'brewery_pub', label: 'Microbrewery & Social Pub' },
+ { id: 'event_space', label: 'Boutique Event Space' }
+ ];
+
var DAYS = ['monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday'];
// ---------- Initialization ----------
@@ -89,9 +100,9 @@
state.csrf = appRoot.getAttribute('data-csrf') || '';
// If onboarding form exists
- var applyForm = $('#venueApplyForm');
- if (applyForm) {
- initOnboarding(applyForm);
+ var onboardForm = $('#venueOnboardForm') || $('#venueApplyForm');
+ if (onboardForm) {
+ initSelfServiceOnboarding(onboardForm);
return;
}
@@ -117,51 +128,301 @@
});
}
- // ---------- Onboarding Flow ----------
- function initOnboarding(form) {
- // Check if user has past applications
+ // ---------- Self-Service Direct Onboarding Flow ----------
+ function initSelfServiceOnboarding(form) {
+ var updateStrength = function () {
+ var fd = new FormData(form);
+ var name = (fd.get('name') || fd.get('venue_name') || '').toString().trim();
+ var category = (fd.get('category') || '').toString().trim();
+ var city = (fd.get('city') || '').toString().trim();
+ var desc = (fd.get('description') || fd.get('message') || '').toString().trim();
+ var cap = Number(fd.get('capacity')) || 0;
+ var facs = $$('input[name="facilities"]:checked', form);
+ var photo1 = (fd.get('photo_url_1') || '').toString().trim();
+ var photo2 = (fd.get('photo_url_2') || '').toString().trim();
+ var hoursNote = (fd.get('operating_hours_note') || '').toString().trim();
+ var rules = (fd.get('rules') || '').toString().trim();
+
+ var score = 0;
+ if (name) score += 15;
+ if (category) score += 15;
+ if (city) score += 20;
+ if (desc) score += 10;
+ if (cap > 0) score += 10;
+ if (facs.length > 0) score += 10;
+ if (photo1 || photo2) score += 10;
+ if (hoursNote || rules) score += 10;
+
+ var percentEl = $('#strengthPercent');
+ var barEl = $('#strengthProgressBar');
+ var pillEl = $('#onboardStatusPill');
+ var hintEl = $('#strengthHint');
+
+ if (percentEl) percentEl.textContent = score + '%';
+ if (barEl) {
+ barEl.style.width = score + '%';
+ if (barEl.parentElement) barEl.parentElement.setAttribute('aria-valuenow', score);
+ }
+ if (pillEl) {
+ if (score >= 70) {
+ pillEl.textContent = 'Ready to Launch';
+ pillEl.className = 'venue-pill venue-pill-status';
+ } else if (score >= 40) {
+ pillEl.textContent = 'In Progress';
+ pillEl.className = 'venue-pill venue-pill-pending';
+ } else {
+ pillEl.textContent = 'Incomplete (Draft)';
+ pillEl.className = 'venue-pill venue-pill-pending';
+ }
+ }
+ if (hintEl) {
+ if (!name) hintEl.textContent = 'Add venue name to begin';
+ else if (!category) hintEl.textContent = 'Choose space category';
+ else if (!city) hintEl.textContent = 'Specify city and address';
+ else if (score < 70) hintEl.textContent = 'Add capacity, description and amenities';
+ else hintEl.textContent = 'Profile ready! Click Launch to activate immediately';
+ }
+ return score;
+ };
+
+ // Live strength calculation on input changes
+ form.addEventListener('input', updateStrength);
+ form.addEventListener('change', updateStrength);
+ updateStrength();
+
+ // Check if user has an existing draft venue to prefill
api('GET', '/api/venue/context').then(function (res) {
- if (res.ok && res.context && res.context.applications && res.context.applications.length > 0) {
- var box = $('#applicationStatusBox');
- if (box) {
- var app = res.context.applications[0];
- box.hidden = false;
- box.innerHTML = '
Recent Application: ' + esc(app.venueName) + ' ' +
- '
Status: ' + esc(app.status.toUpperCase()) + ' — Submitted on ' +
- new Date(app.submittedAt).toLocaleDateString('en-IN', { day: 'numeric', month: 'short', year: 'numeric' }) + '
' +
- '
Our venue team is reviewing your space details. You will receive an update once verified.
';
+ if (res.ok && res.context) {
+ var existing = res.context.draftVenue || (res.context.venues && res.context.venues[0]);
+ if (existing) {
+ var setVal = function (name, val) {
+ var inp = form.elements[name];
+ if (inp && val != null) inp.value = val;
+ };
+ setVal('venue_id', existing.id);
+ setVal('name', existing.name);
+ setVal('category', existing.category);
+ setVal('city', existing.cityName || existing.city);
+ setVal('neighbourhood', existing.neighbourhood);
+ setVal('address_public', existing.addressPublic);
+ setVal('address_private', existing.addressPrivate);
+ setVal('capacity', existing.capacity);
+ setVal('contact_name', existing.contactName);
+ setVal('contact_phone', existing.contactPhone);
+ setVal('contact_email', existing.contactEmail);
+ setVal('description', existing.description);
+ setVal('rules', existing.rules);
+ if (existing.facilities && Array.isArray(existing.facilities)) {
+ existing.facilities.forEach(function (f) {
+ var cb = $('input[name="facilities"][value="' + f + '"]', form);
+ if (cb) cb.checked = true;
+ });
+ }
+ if (existing.photos && Array.isArray(existing.photos)) {
+ if (existing.photos[0]) setVal('photo_url_1', typeof existing.photos[0] === 'string' ? existing.photos[0] : existing.photos[0].url);
+ if (existing.photos[1]) setVal('photo_url_2', typeof existing.photos[1] === 'string' ? existing.photos[1] : existing.photos[1].url);
+ }
+ if (existing.operatingHours) {
+ if (typeof existing.operatingHours === 'string') setVal('operating_hours_note', existing.operatingHours);
+ else if (existing.operatingHours.general) setVal('operating_hours_note', existing.operatingHours.general);
+ else if (existing.operatingHours.friday) setVal('operating_hours_note', existing.operatingHours.friday);
+ }
+ updateStrength();
}
}
}).catch(function () {});
+ var collectData = function (isDraft) {
+ var fd = new FormData(form);
+ var facs = $$('input[name="facilities"]:checked', form).map(function (cb) { return cb.value; });
+ var photos = [];
+ var p1 = (fd.get('photo_url_1') || '').toString().trim();
+ var p2 = (fd.get('photo_url_2') || '').toString().trim();
+ if (p1) photos.push(p1);
+ if (p2) photos.push(p2);
+
+ var operatingHours = {};
+ var hoursNote = (fd.get('operating_hours_note') || '').toString().trim();
+ if (hoursNote) {
+ DAYS.forEach(function (d) { operatingHours[d] = hoursNote; });
+ }
+
+ var venueIdVal = (fd.get('venue_id') || '').toString().trim() || undefined;
+
+ return {
+ venue_id: venueIdVal,
+ name: (fd.get('name') || fd.get('venue_name') || '').toString().trim(),
+ category: (fd.get('category') || undefined),
+ description: (fd.get('description') || fd.get('message') || undefined),
+ city: (fd.get('city') || '').toString().trim(),
+ neighbourhood: (fd.get('neighbourhood') || fd.get('area') || undefined),
+ address_public: (fd.get('address_public') || undefined),
+ address_private: (fd.get('address_private') || undefined),
+ capacity: fd.get('capacity') ? Number(fd.get('capacity')) : 50,
+ contact_name: (fd.get('contact_name') || undefined),
+ contact_phone: (fd.get('contact_phone') || undefined),
+ contact_email: (fd.get('contact_email') || fd.get('email') || undefined),
+ facilities: facs,
+ operating_hours: Object.keys(operatingHours).length > 0 ? operatingHours : undefined,
+ rules: (fd.get('rules') || undefined),
+ photos: photos,
+ is_draft: Boolean(isDraft)
+ };
+ };
+
+ // Save Progress (Draft) button
+ var btnDraft = $('#btnSaveVenueDraft');
+ if (btnDraft) {
+ btnDraft.addEventListener('click', async function (e) {
+ e.preventDefault();
+ var msg = $('#onboardMsg') || $('#applyMsg');
+ if (msg) {
+ msg.textContent = 'Saving progress…';
+ msg.className = 'form-msg';
+ }
+
+ var payload = collectData(true);
+ if (!payload.name) {
+ if (msg) {
+ msg.textContent = 'Please enter a venue name to save your draft.';
+ msg.className = 'form-msg error';
+ }
+ return;
+ }
+
+ try {
+ var res = await api('POST', '/api/venue/onboard', payload);
+ if (msg) {
+ msg.textContent = 'Progress saved! Profile is at ' + (res.completionPercentage || 0) + '%. You can resume anytime.';
+ msg.className = 'form-msg ok';
+ }
+ if (res.venue && res.venue.id) {
+ var vInp = form.elements['venue_id'];
+ if (vInp) vInp.value = res.venue.id;
+ }
+ updateStrength();
+ } catch (err) {
+ if (msg) {
+ if (err.data && err.data.error === 'duplicate_venue') {
+ msg.innerHTML = esc(err.message) + '
Submit Ownership Claim ';
+ var btnClaim = $('#btnTriggerClaimDraft');
+ if (btnClaim) {
+ btnClaim.addEventListener('click', function () {
+ var modalClaim = $('#modalClaimVenue');
+ if (modalClaim && err.data.existingVenueId) {
+ var vInp = $('#claimVenueId');
+ if (vInp) vInp.value = err.data.existingVenueId;
+ modalClaim.showModal();
+ }
+ });
+ }
+ } else {
+ msg.textContent = err.message || 'Error saving progress.';
+ }
+ msg.className = 'form-msg error';
+ }
+ }
+ });
+ }
+
+ // Submit / Launch form
form.addEventListener('submit', async function (ev) {
ev.preventDefault();
- var msg = $('#applyMsg');
- msg.textContent = 'Submitting application…';
- msg.className = 'form-msg';
+ var msg = $('#onboardMsg') || $('#applyMsg');
+ if (msg) {
+ msg.textContent = 'Launching venue profile…';
+ msg.className = 'form-msg';
+ }
- var fd = new FormData(form);
- var payload = {
- name: fd.get('name'),
- venue_name: fd.get('venue_name'),
- email: fd.get('email'),
- phone: fd.get('phone') || undefined,
- city: fd.get('city'),
- area: fd.get('area') || undefined,
- capacity: fd.get('capacity') ? Number(fd.get('capacity')) : undefined,
- message: fd.get('message') || undefined
- };
+ var payload = collectData(false);
+
+ if (!payload.name || !payload.category || !payload.city) {
+ if (msg) {
+ msg.textContent = 'Please fill in required fields: Venue Name, Category, and City.';
+ msg.className = 'form-msg error';
+ }
+ return;
+ }
try {
- var res = await api('POST', '/api/venue/apply', payload);
- msg.textContent = 'Application submitted successfully! Our team will contact you shortly.';
- msg.className = 'form-msg ok';
- form.reset();
+ var res = await api('POST', '/api/venue/onboard', payload);
+ if (msg) {
+ msg.textContent = 'Venue profile activated successfully! Redirecting to command centre…';
+ msg.className = 'form-msg ok';
+ }
+ setTimeout(function () {
+ window.location.href = res.redirect || '/venue';
+ }, 500);
} catch (err) {
- msg.textContent = err.message || 'Could not submit application.';
- msg.className = 'form-msg error';
+ if (msg) {
+ if (err.data && err.data.error === 'duplicate_venue') {
+ msg.innerHTML = esc(err.message) + '
Submit Ownership Claim ';
+ var btnClaim = $('#btnTriggerClaim');
+ if (btnClaim) {
+ btnClaim.addEventListener('click', function () {
+ var modalClaim = $('#modalClaimVenue');
+ if (modalClaim && err.data.existingVenueId) {
+ var vInp = $('#claimVenueId');
+ if (vInp) vInp.value = err.data.existingVenueId;
+ modalClaim.showModal();
+ }
+ });
+ }
+ } else {
+ msg.textContent = err.message || 'Error launching venue profile.';
+ }
+ msg.className = 'form-msg error';
+ }
}
});
+
+ // Wire up dialog close handlers inside onboarding state
+ $$('[data-close-dialog]', form.parentElement).forEach(function (btn) {
+ btn.addEventListener('click', function () {
+ var dlg = btn.closest('dialog');
+ if (dlg) dlg.close();
+ });
+ });
+
+ // Wire up ownership claim submission
+ var formClaim = $('#formClaimVenue');
+ if (formClaim) {
+ formClaim.addEventListener('submit', async function (e) {
+ e.preventDefault();
+ var cMsg = $('#claimMsg');
+ if (cMsg) {
+ cMsg.textContent = 'Submitting ownership claim…';
+ cMsg.className = 'form-msg';
+ }
+ var fd = new FormData(formClaim);
+ try {
+ var payload = {
+ venue_id: fd.get('venue_id'),
+ claimant_role: fd.get('claimant_role'),
+ business_proof_type: fd.get('business_proof_type'),
+ business_proof_ref: fd.get('business_proof_ref'),
+ contact_name: fd.get('contact_name'),
+ contact_email: fd.get('contact_email'),
+ contact_phone: fd.get('contact_phone') || undefined,
+ notes: fd.get('notes') || undefined
+ };
+ var res = await api('POST', '/api/venue/claim', payload);
+ if (cMsg) {
+ cMsg.textContent = res.message || 'Ownership claim submitted. Verification challenge recorded.';
+ cMsg.className = 'form-msg success';
+ }
+ setTimeout(function () {
+ var modal = $('#modalClaimVenue');
+ if (modal) modal.close();
+ }, 3000);
+ } catch (err) {
+ if (cMsg) {
+ cMsg.textContent = err.message || 'Failed to submit ownership claim';
+ cMsg.className = 'form-msg error';
+ }
+ }
+ });
+ }
}
// ---------- Tab Navigation ----------
@@ -672,16 +933,21 @@
var el = $('#profileDetailsView');
if (!el) return;
+ var catObj = ALL_CATEGORIES.find(function (c) { return c.id === p.category; });
+ var catLabel = catObj ? catObj.label : (p.category ? esc(p.category) : 'Not specified');
+
el.innerHTML = [
'
Venue Display Name ' + esc(p.name) + ' ',
+ '
Space Category ' + catLabel + ' ',
'
Operating Organisation ' + esc(p.orgName) + (p.orgVerified ? ' (Verified)' : '') + ' ',
'
Maximum Capacity ' + esc(p.capacity || 'Not specified') + ' guests ',
- '
City & Locality ' + esc((p.cityName || '') + (p.localityName ? ', ' + p.localityName : '')) + ' ',
- '
Public Area ' + esc(p.addressPublic || 'Not specified') + ' ',
+ '
City & Locality ' + esc((p.cityName || '') + (p.localityName ? ', ' + p.localityName : '')) + ' ',
+ '
Neighbourhood / Area ' + esc(p.neighbourhood || p.localityName || 'Not specified') + ' ',
+ '
Public Street Address ' + esc(p.addressPublic || 'Not specified') + ' ',
'
Private Gate / Exact Entry ' + esc(p.addressPrivate || 'Private address shared only with confirmed attendees') + ' ',
'
Primary Contact ' + esc((p.contactName || '') + (p.contactPhone ? ' (' + p.contactPhone + ')' : '') + (p.contactEmail ? ' · ' + p.contactEmail : '')) + ' ',
- '
About & Ambiance ' + esc(p.description || 'No description provided yet.') + ' ',
- '
House Rules & Entry Policy ' + esc(p.rules || 'Standard NIGHTLIFEZ community and safety guidelines apply.') + ' '
+ '
About & Ambiance ' + esc(p.description || 'No description provided yet.') + ' ',
+ '
House Rules & Entry Policy ' + esc(p.rules || 'Standard NIGHTLIFEZ community and safety guidelines apply.') + ' '
].join('');
// Facilities
@@ -707,11 +973,51 @@
return '
' + d + ' ' + esc(val) + '
';
}).join('');
}
+
+ // Photo Gallery
+ renderGalleryView(p);
+ }
+
+ function renderGalleryView(p) {
+ var gEl = $('#profileGalleryView');
+ if (!gEl) return;
+ var photos = Array.isArray(p.photos) ? p.photos : [];
+ if (photos.length === 0) {
+ gEl.innerHTML = '
No photos uploaded yet. Add photos showcasing your interior, seating, bar, and rooftop.
';
+ return;
+ }
+ gEl.innerHTML = photos.map(function (item, idx) {
+ var url = typeof item === 'string' ? item : (item && item.url ? item.url : '');
+ if (!url) return '';
+ return '
' +
+ '
' +
+ '
× ' +
+ '
';
+ }).join('');
+
+ $$('[data-remove-photo]', gEl).forEach(function (btn) {
+ btn.addEventListener('click', async function () {
+ var idx = Number(btn.getAttribute('data-remove-photo'));
+ var updated = photos.slice();
+ updated.splice(idx, 1);
+ try {
+ await api('PATCH', '/api/venue/profile?venueId=' + state.venueId, { photos: updated });
+ p.photos = updated;
+ renderGalleryView(p);
+ showAlert('Photo removed.');
+ } catch (err) {
+ showAlert(err.message || 'Error removing photo', true);
+ }
+ });
+ });
}
function renderEventsList(events, container) {
if (!events || events.length === 0) {
- container.innerHTML = '
No events matching this filter.
';
+ container.innerHTML = '
';
return;
}
@@ -738,12 +1044,13 @@
'
' +
'' +
'