2026-01-08 13:16:06 -03:00
|
|
|
<div class="social-app">
|
|
|
|
|
<div class="social-header">
|
|
|
|
|
<div class="social-tabs">
|
2026-01-12 00:21:28 -03:00
|
|
|
<button
|
|
|
|
|
class="social-tab active"
|
|
|
|
|
data-tab="feed"
|
|
|
|
|
hx-get="/api/ui/social/feed"
|
|
|
|
|
hx-target="#social-content"
|
|
|
|
|
hx-swap="innerHTML"
|
|
|
|
|
>
|
|
|
|
|
<svg
|
|
|
|
|
width="18"
|
|
|
|
|
height="18"
|
|
|
|
|
viewBox="0 0 24 24"
|
|
|
|
|
fill="none"
|
|
|
|
|
stroke="currentColor"
|
|
|
|
|
stroke-width="2"
|
|
|
|
|
>
|
|
|
|
|
<path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" />
|
|
|
|
|
<polyline points="9 22 9 12 15 12 15 22" />
|
2026-01-08 13:16:06 -03:00
|
|
|
</svg>
|
|
|
|
|
<span data-i18n="social-feed">Feed</span>
|
|
|
|
|
</button>
|
2026-01-12 00:21:28 -03:00
|
|
|
<button
|
|
|
|
|
class="social-tab"
|
|
|
|
|
data-tab="communities"
|
|
|
|
|
hx-get="/api/ui/social/communities"
|
|
|
|
|
hx-target="#social-content"
|
|
|
|
|
hx-swap="innerHTML"
|
|
|
|
|
>
|
|
|
|
|
<svg
|
|
|
|
|
width="18"
|
|
|
|
|
height="18"
|
|
|
|
|
viewBox="0 0 24 24"
|
|
|
|
|
fill="none"
|
|
|
|
|
stroke="currentColor"
|
|
|
|
|
stroke-width="2"
|
|
|
|
|
>
|
|
|
|
|
<path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2" />
|
|
|
|
|
<circle cx="9" cy="7" r="4" />
|
|
|
|
|
<path d="M23 21v-2a4 4 0 0 0-3-3.87" />
|
|
|
|
|
<path d="M16 3.13a4 4 0 0 1 0 7.75" />
|
2026-01-08 13:16:06 -03:00
|
|
|
</svg>
|
|
|
|
|
<span data-i18n="social-communities">Communities</span>
|
|
|
|
|
</button>
|
2026-01-12 00:21:28 -03:00
|
|
|
<button
|
|
|
|
|
class="social-tab"
|
|
|
|
|
data-tab="announcements"
|
|
|
|
|
hx-get="/api/ui/social/announcements"
|
|
|
|
|
hx-target="#social-content"
|
|
|
|
|
hx-swap="innerHTML"
|
|
|
|
|
>
|
|
|
|
|
<svg
|
|
|
|
|
width="18"
|
|
|
|
|
height="18"
|
|
|
|
|
viewBox="0 0 24 24"
|
|
|
|
|
fill="none"
|
|
|
|
|
stroke="currentColor"
|
|
|
|
|
stroke-width="2"
|
|
|
|
|
>
|
|
|
|
|
<path
|
|
|
|
|
d="M22 17H2a3 3 0 0 0 3-3V9a7 7 0 0 1 14 0v5a3 3 0 0 0 3 3zm-8.27 4a2 2 0 0 1-3.46 0"
|
|
|
|
|
/>
|
2026-01-08 13:16:06 -03:00
|
|
|
</svg>
|
|
|
|
|
<span data-i18n="social-announcements">Announcements</span>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="social-actions">
|
|
|
|
|
<button class="btn-new-post" onclick="showNewPostModal()">
|
2026-01-12 00:21:28 -03:00
|
|
|
<svg
|
|
|
|
|
width="18"
|
|
|
|
|
height="18"
|
|
|
|
|
viewBox="0 0 24 24"
|
|
|
|
|
fill="none"
|
|
|
|
|
stroke="currentColor"
|
|
|
|
|
stroke-width="2"
|
|
|
|
|
>
|
|
|
|
|
<line x1="12" y1="5" x2="12" y2="19" />
|
|
|
|
|
<line x1="5" y1="12" x2="19" y2="12" />
|
2026-01-08 13:16:06 -03:00
|
|
|
</svg>
|
|
|
|
|
<span data-i18n="social-new-post">New Post</span>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="social-layout">
|
|
|
|
|
<aside class="social-sidebar">
|
|
|
|
|
<div class="sidebar-section">
|
|
|
|
|
<h3 data-i18n="social-my-communities">My Communities</h3>
|
2026-01-12 00:21:28 -03:00
|
|
|
<div
|
|
|
|
|
id="my-communities"
|
|
|
|
|
hx-get="/api/ui/social/my-communities"
|
|
|
|
|
hx-trigger="load"
|
|
|
|
|
hx-swap="innerHTML"
|
|
|
|
|
>
|
2026-01-08 13:16:06 -03:00
|
|
|
<div class="loading-placeholder"></div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="sidebar-section">
|
|
|
|
|
<h3 data-i18n="social-trending">Trending</h3>
|
2026-01-12 00:21:28 -03:00
|
|
|
<div
|
|
|
|
|
id="trending-topics"
|
|
|
|
|
hx-get="/api/ui/social/trending"
|
|
|
|
|
hx-trigger="load"
|
|
|
|
|
hx-swap="innerHTML"
|
|
|
|
|
>
|
2026-01-08 13:16:06 -03:00
|
|
|
<div class="loading-placeholder"></div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="sidebar-section">
|
|
|
|
|
<h3 data-i18n="social-suggested">Suggested Communities</h3>
|
2026-01-12 00:21:28 -03:00
|
|
|
<div
|
|
|
|
|
id="suggested-communities"
|
|
|
|
|
hx-get="/api/ui/social/suggested"
|
|
|
|
|
hx-trigger="load"
|
|
|
|
|
hx-swap="innerHTML"
|
|
|
|
|
>
|
2026-01-08 13:16:06 -03:00
|
|
|
<div class="loading-placeholder"></div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</aside>
|
|
|
|
|
|
|
|
|
|
<main class="social-main">
|
|
|
|
|
<div class="post-composer">
|
|
|
|
|
<div class="composer-avatar">
|
|
|
|
|
<div class="avatar-placeholder"></div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="composer-input" onclick="showNewPostModal()">
|
2026-01-12 00:21:28 -03:00
|
|
|
<span data-i18n="social-whats-on-mind"
|
|
|
|
|
>What's on your mind?</span
|
|
|
|
|
>
|
2026-01-08 13:16:06 -03:00
|
|
|
</div>
|
|
|
|
|
<div class="composer-actions">
|
|
|
|
|
<button class="composer-btn" title="Add image">
|
2026-01-12 00:21:28 -03:00
|
|
|
<svg
|
|
|
|
|
width="20"
|
|
|
|
|
height="20"
|
|
|
|
|
viewBox="0 0 24 24"
|
|
|
|
|
fill="none"
|
|
|
|
|
stroke="currentColor"
|
|
|
|
|
stroke-width="2"
|
|
|
|
|
>
|
|
|
|
|
<rect
|
|
|
|
|
x="3"
|
|
|
|
|
y="3"
|
|
|
|
|
width="18"
|
|
|
|
|
height="18"
|
|
|
|
|
rx="2"
|
|
|
|
|
ry="2"
|
|
|
|
|
/>
|
|
|
|
|
<circle cx="8.5" cy="8.5" r="1.5" />
|
|
|
|
|
<polyline points="21 15 16 10 5 21" />
|
2026-01-08 13:16:06 -03:00
|
|
|
</svg>
|
|
|
|
|
</button>
|
|
|
|
|
<button class="composer-btn" title="Add poll">
|
2026-01-12 00:21:28 -03:00
|
|
|
<svg
|
|
|
|
|
width="20"
|
|
|
|
|
height="20"
|
|
|
|
|
viewBox="0 0 24 24"
|
|
|
|
|
fill="none"
|
|
|
|
|
stroke="currentColor"
|
|
|
|
|
stroke-width="2"
|
|
|
|
|
>
|
|
|
|
|
<line x1="18" y1="20" x2="18" y2="10" />
|
|
|
|
|
<line x1="12" y1="20" x2="12" y2="4" />
|
|
|
|
|
<line x1="6" y1="20" x2="6" y2="14" />
|
2026-01-08 13:16:06 -03:00
|
|
|
</svg>
|
|
|
|
|
</button>
|
|
|
|
|
<button class="composer-btn" title="Send praise">
|
2026-01-12 00:21:28 -03:00
|
|
|
<svg
|
|
|
|
|
width="20"
|
|
|
|
|
height="20"
|
|
|
|
|
viewBox="0 0 24 24"
|
|
|
|
|
fill="none"
|
|
|
|
|
stroke="currentColor"
|
|
|
|
|
stroke-width="2"
|
|
|
|
|
>
|
|
|
|
|
<path
|
|
|
|
|
d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"
|
|
|
|
|
/>
|
2026-01-08 13:16:06 -03:00
|
|
|
</svg>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
2026-01-12 00:21:28 -03:00
|
|
|
<div
|
|
|
|
|
id="social-content"
|
|
|
|
|
hx-get="/api/ui/social/feed"
|
|
|
|
|
hx-trigger="load"
|
|
|
|
|
hx-swap="innerHTML"
|
|
|
|
|
>
|
2026-01-08 13:16:06 -03:00
|
|
|
<div class="loading-state">
|
|
|
|
|
<div class="spinner"></div>
|
|
|
|
|
<span data-i18n="loading">Loading...</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</main>
|
|
|
|
|
|
|
|
|
|
<aside class="social-right-sidebar">
|
|
|
|
|
<div class="sidebar-section">
|
|
|
|
|
<h3 data-i18n="social-recent-activity">Recent Activity</h3>
|
2026-01-12 00:21:28 -03:00
|
|
|
<div
|
|
|
|
|
id="recent-activity"
|
|
|
|
|
hx-get="/api/ui/social/activity"
|
|
|
|
|
hx-trigger="load"
|
|
|
|
|
hx-swap="innerHTML"
|
|
|
|
|
>
|
2026-01-08 13:16:06 -03:00
|
|
|
<div class="loading-placeholder"></div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="sidebar-section">
|
|
|
|
|
<h3 data-i18n="social-people">People to Follow</h3>
|
2026-01-12 00:21:28 -03:00
|
|
|
<div
|
|
|
|
|
id="people-suggestions"
|
|
|
|
|
hx-get="/api/ui/social/people"
|
|
|
|
|
hx-trigger="load"
|
|
|
|
|
hx-swap="innerHTML"
|
|
|
|
|
>
|
2026-01-08 13:16:06 -03:00
|
|
|
<div class="loading-placeholder"></div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</aside>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="modal" id="newPostModal">
|
|
|
|
|
<div class="modal-backdrop" onclick="closeNewPostModal()"></div>
|
|
|
|
|
<div class="modal-content">
|
|
|
|
|
<div class="modal-header">
|
|
|
|
|
<h3 data-i18n="social-create-post">Create Post</h3>
|
2026-01-12 00:21:28 -03:00
|
|
|
<button class="btn-close" onclick="closeNewPostModal()">
|
|
|
|
|
×
|
|
|
|
|
</button>
|
2026-01-08 13:16:06 -03:00
|
|
|
</div>
|
2026-01-12 00:21:28 -03:00
|
|
|
<form
|
|
|
|
|
id="newPostForm"
|
|
|
|
|
hx-post="/api/social/posts"
|
|
|
|
|
hx-swap="none"
|
|
|
|
|
hx-on::after-request="handlePostCreated(event)"
|
|
|
|
|
>
|
2026-01-08 13:16:06 -03:00
|
|
|
<div class="modal-body">
|
|
|
|
|
<div class="post-author-row">
|
|
|
|
|
<div class="avatar-placeholder"></div>
|
|
|
|
|
<div class="author-info">
|
2026-01-12 00:21:28 -03:00
|
|
|
<span class="author-name" id="currentUserName"
|
|
|
|
|
>User</span
|
|
|
|
|
>
|
2026-01-08 13:16:06 -03:00
|
|
|
<select name="visibility" class="visibility-select">
|
2026-01-12 00:21:28 -03:00
|
|
|
<option
|
|
|
|
|
value="organization"
|
|
|
|
|
data-i18n="social-org-only"
|
|
|
|
|
>
|
|
|
|
|
Organization
|
|
|
|
|
</option>
|
|
|
|
|
<option
|
|
|
|
|
value="community"
|
|
|
|
|
data-i18n="social-community-only"
|
|
|
|
|
>
|
|
|
|
|
Community Only
|
|
|
|
|
</option>
|
|
|
|
|
<option value="public" data-i18n="social-public">
|
|
|
|
|
Public
|
|
|
|
|
</option>
|
2026-01-08 13:16:06 -03:00
|
|
|
</select>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2026-01-12 00:21:28 -03:00
|
|
|
<textarea
|
|
|
|
|
name="content"
|
|
|
|
|
class="post-textarea"
|
|
|
|
|
placeholder="What's on your mind?"
|
|
|
|
|
rows="5"
|
|
|
|
|
required
|
|
|
|
|
></textarea>
|
2026-01-08 13:16:06 -03:00
|
|
|
<div class="post-attachments" id="postAttachments"></div>
|
|
|
|
|
<div class="post-options">
|
|
|
|
|
<select name="community_id" class="community-select">
|
2026-01-12 00:21:28 -03:00
|
|
|
<option value="" data-i18n="social-no-community">
|
|
|
|
|
No Community
|
|
|
|
|
</option>
|
2026-01-08 13:16:06 -03:00
|
|
|
</select>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="modal-footer">
|
|
|
|
|
<div class="post-tools">
|
|
|
|
|
<button type="button" class="tool-btn" title="Add image">
|
2026-01-12 00:21:28 -03:00
|
|
|
<svg
|
|
|
|
|
width="20"
|
|
|
|
|
height="20"
|
|
|
|
|
viewBox="0 0 24 24"
|
|
|
|
|
fill="none"
|
|
|
|
|
stroke="currentColor"
|
|
|
|
|
stroke-width="2"
|
|
|
|
|
>
|
|
|
|
|
<rect
|
|
|
|
|
x="3"
|
|
|
|
|
y="3"
|
|
|
|
|
width="18"
|
|
|
|
|
height="18"
|
|
|
|
|
rx="2"
|
|
|
|
|
ry="2"
|
|
|
|
|
/>
|
|
|
|
|
<circle cx="8.5" cy="8.5" r="1.5" />
|
|
|
|
|
<polyline points="21 15 16 10 5 21" />
|
2026-01-08 13:16:06 -03:00
|
|
|
</svg>
|
|
|
|
|
</button>
|
2026-01-12 00:21:28 -03:00
|
|
|
<button
|
|
|
|
|
type="button"
|
|
|
|
|
class="tool-btn"
|
|
|
|
|
title="Add poll"
|
|
|
|
|
onclick="togglePollCreator()"
|
|
|
|
|
>
|
|
|
|
|
<svg
|
|
|
|
|
width="20"
|
|
|
|
|
height="20"
|
|
|
|
|
viewBox="0 0 24 24"
|
|
|
|
|
fill="none"
|
|
|
|
|
stroke="currentColor"
|
|
|
|
|
stroke-width="2"
|
|
|
|
|
>
|
|
|
|
|
<line x1="18" y1="20" x2="18" y2="10" />
|
|
|
|
|
<line x1="12" y1="20" x2="12" y2="4" />
|
|
|
|
|
<line x1="6" y1="20" x2="6" y2="14" />
|
2026-01-08 13:16:06 -03:00
|
|
|
</svg>
|
|
|
|
|
</button>
|
2026-01-12 00:21:28 -03:00
|
|
|
<button
|
|
|
|
|
type="button"
|
|
|
|
|
class="tool-btn"
|
|
|
|
|
title="Mention someone"
|
|
|
|
|
>
|
|
|
|
|
<svg
|
|
|
|
|
width="20"
|
|
|
|
|
height="20"
|
|
|
|
|
viewBox="0 0 24 24"
|
|
|
|
|
fill="none"
|
|
|
|
|
stroke="currentColor"
|
|
|
|
|
stroke-width="2"
|
|
|
|
|
>
|
|
|
|
|
<circle cx="12" cy="12" r="4" />
|
|
|
|
|
<path
|
|
|
|
|
d="M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-3.92 7.94"
|
|
|
|
|
/>
|
2026-01-08 13:16:06 -03:00
|
|
|
</svg>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
<button type="submit" class="btn-post">
|
|
|
|
|
<span data-i18n="social-post">Post</span>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</form>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<script>
|
2026-01-12 00:21:28 -03:00
|
|
|
(function () {
|
|
|
|
|
"use strict";
|
2026-01-08 13:16:06 -03:00
|
|
|
|
2026-01-12 00:21:28 -03:00
|
|
|
function showNewPostModal() {
|
|
|
|
|
document.getElementById("newPostModal").classList.add("active");
|
|
|
|
|
document.querySelector(".post-textarea").focus();
|
|
|
|
|
}
|
2026-01-08 13:16:06 -03:00
|
|
|
|
2026-01-12 00:21:28 -03:00
|
|
|
function closeNewPostModal() {
|
|
|
|
|
document.getElementById("newPostModal").classList.remove("active");
|
|
|
|
|
document.getElementById("newPostForm").reset();
|
|
|
|
|
}
|
2026-01-08 13:16:06 -03:00
|
|
|
|
2026-01-12 00:21:28 -03:00
|
|
|
function handlePostCreated(event) {
|
|
|
|
|
if (event.detail.successful) {
|
|
|
|
|
closeNewPostModal();
|
|
|
|
|
htmx.trigger("#social-content", "refresh");
|
|
|
|
|
if (window.GBAlerts) {
|
|
|
|
|
window.GBAlerts.info(
|
|
|
|
|
"Social",
|
|
|
|
|
"Post created successfully!",
|
|
|
|
|
);
|
|
|
|
|
}
|
2026-01-08 13:16:06 -03:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-01-12 00:21:28 -03:00
|
|
|
function togglePollCreator() {
|
|
|
|
|
var attachments = document.getElementById("postAttachments");
|
|
|
|
|
var existing = attachments.querySelector(".poll-creator");
|
|
|
|
|
if (existing) {
|
|
|
|
|
existing.remove();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
var pollHtml =
|
|
|
|
|
'<div class="poll-creator">' +
|
|
|
|
|
'<input type="text" name="poll_question" placeholder="Ask a question..." class="poll-question" />' +
|
|
|
|
|
'<div class="poll-options">' +
|
|
|
|
|
'<input type="text" name="poll_option_1" placeholder="Option 1" />' +
|
|
|
|
|
'<input type="text" name="poll_option_2" placeholder="Option 2" />' +
|
|
|
|
|
'<button type="button" class="btn-add-option" onclick="addPollOption()">+ Add option</button>' +
|
|
|
|
|
"</div>" +
|
|
|
|
|
"</div>";
|
|
|
|
|
attachments.innerHTML = pollHtml;
|
2026-01-08 13:16:06 -03:00
|
|
|
}
|
|
|
|
|
|
2026-01-12 00:21:28 -03:00
|
|
|
function addPollOption() {
|
|
|
|
|
var options = document.querySelector(".poll-options");
|
|
|
|
|
var count = options.querySelectorAll("input").length + 1;
|
|
|
|
|
var input = document.createElement("input");
|
|
|
|
|
input.type = "text";
|
|
|
|
|
input.name = "poll_option_" + count;
|
|
|
|
|
input.placeholder = "Option " + count;
|
|
|
|
|
options.insertBefore(
|
|
|
|
|
input,
|
|
|
|
|
options.querySelector(".btn-add-option"),
|
|
|
|
|
);
|
|
|
|
|
}
|
2026-01-08 13:16:06 -03:00
|
|
|
|
2026-01-12 00:21:28 -03:00
|
|
|
document.querySelectorAll(".social-tab").forEach(function (tab) {
|
|
|
|
|
tab.addEventListener("click", function () {
|
|
|
|
|
document.querySelectorAll(".social-tab").forEach(function (t) {
|
|
|
|
|
t.classList.remove("active");
|
|
|
|
|
});
|
|
|
|
|
this.classList.add("active");
|
2026-01-08 13:16:06 -03:00
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
2026-01-12 00:21:28 -03:00
|
|
|
window.showNewPostModal = showNewPostModal;
|
|
|
|
|
window.closeNewPostModal = closeNewPostModal;
|
|
|
|
|
window.handlePostCreated = handlePostCreated;
|
|
|
|
|
window.togglePollCreator = togglePollCreator;
|
|
|
|
|
window.addPollOption = addPollOption;
|
|
|
|
|
})();
|
2026-01-08 13:16:06 -03:00
|
|
|
</script>
|