refactor: more refactoring to topics as the top-level organization
This commit is contained in:
parent
11ecd86bb9
commit
4347d20263
18 changed files with 730 additions and 317 deletions
3
public/tabs/blurbs/README.md
Normal file
3
public/tabs/blurbs/README.md
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# Blurbs
|
||||
|
||||
Blurbs are going to be short (128? 256? character thoughts)
|
||||
16
public/tabs/blurbs/blurbs.html
Normal file
16
public/tabs/blurbs/blurbs.html
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<div id="blurb" class="tab">
|
||||
<input
|
||||
type="radio"
|
||||
name="top-level-tabs"
|
||||
id="blurb-tab-input"
|
||||
class="tab-switch"
|
||||
data-view="blurb"
|
||||
/>
|
||||
<label for="blurb-tab-input" class="tab-label mockup"
|
||||
><div class="icon blurb"></div>
|
||||
<div class="label">Blurbs</div></label
|
||||
>
|
||||
<div class="tab-content">
|
||||
<!-- #include file="./README.md" -->
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1,3 +1,3 @@
|
|||
# calendar
|
||||
# Calendar
|
||||
|
||||
The calendar should help people coordinate events.
|
||||
The calendar should help people coordinate events around a topic.
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
class="tab-switch"
|
||||
data-view="calendar"
|
||||
/>
|
||||
<label for="calendar-tab-input" class="tab-label"
|
||||
<label for="calendar-tab-input" class="tab-label mockup"
|
||||
><div class="icon calendar"></div>
|
||||
<div class="label">Calendar</div></label
|
||||
>
|
||||
|
|
|
|||
|
|
@ -11,7 +11,12 @@
|
|||
left: 0;
|
||||
right: 0;
|
||||
bottom: 5rem;
|
||||
padding: 0.5rem;
|
||||
padding: 1.5rem 1.5rem 0.75rem 1.5rem;
|
||||
}
|
||||
@media screen and (max-width: 1200px) {
|
||||
#chat #topic-chat-content {
|
||||
padding: 0.75rem;
|
||||
}
|
||||
}
|
||||
|
||||
#chat #topic-chat-entry-container {
|
||||
|
|
@ -51,7 +56,7 @@
|
|||
cursor: pointer;
|
||||
align-content: center;
|
||||
border-radius: var(--border-radius);
|
||||
border: 1px solid var(--text);
|
||||
border: 1px solid rgba(128, 128, 128, 0.2);
|
||||
}
|
||||
|
||||
#chat #topic-chat-entry-container form textarea {
|
||||
|
|
@ -60,6 +65,10 @@
|
|||
background: inherit;
|
||||
color: inherit;
|
||||
border-radius: var(--border-radius);
|
||||
border: 1px solid rgba(128, 128, 128, 0.2);
|
||||
resize: none;
|
||||
background: rgba(0, 0, 0, 0.1);
|
||||
padding: 0.4rem;
|
||||
}
|
||||
|
||||
#chat .message-container {
|
||||
|
|
@ -67,7 +76,7 @@
|
|||
transition: all 0.33s;
|
||||
background: rgba(255, 255, 255, 0.03);
|
||||
margin-top: 0.75rem;
|
||||
padding: 2px;
|
||||
padding: 0.5rem;
|
||||
border-radius: var(--border-radius);
|
||||
}
|
||||
|
||||
|
|
@ -137,6 +146,7 @@
|
|||
padding: 0.25rem 0 0 0;
|
||||
text-align: center;
|
||||
text-wrap: nowrap;
|
||||
background: none;
|
||||
}
|
||||
|
||||
#chat .message-container .message-actions-container label {
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@
|
|||
id="file-upload-and-share-input"
|
||||
aria-label="Upload and share file"
|
||||
type="file"
|
||||
name="file-upload-and-share"
|
||||
multiple
|
||||
/>
|
||||
<label for="file-upload-and-share-input">
|
||||
|
|
@ -36,7 +35,7 @@
|
|||
id="topic-chat-input"
|
||||
class="topic-chat-input"
|
||||
rows="1"
|
||||
name="data.message"
|
||||
name="data.content"
|
||||
></textarea>
|
||||
<button id="topic-chat-send" class="primary" aria-label="Send a message">
|
||||
<i class="icon send"></i>
|
||||
|
|
@ -44,9 +43,7 @@
|
|||
<script>
|
||||
{
|
||||
const form = document.currentScript.closest("form");
|
||||
const file_input = document.querySelector(
|
||||
'input[name="file-upload-and-share"]',
|
||||
);
|
||||
const file_input = document.querySelector('input[type="file"]');
|
||||
const chat_input = document.getElementById("topic-chat-input");
|
||||
const parent_id_input = document.getElementById("parent-id");
|
||||
const topic_chat_container =
|
||||
|
|
@ -64,7 +61,7 @@
|
|||
|
||||
form.on_submit = async (event) => {
|
||||
const user = JSON.parse(document.body.dataset.user);
|
||||
const topic_id = topic_chat_container.dataset.topic_id;
|
||||
const topic_id = document.body.dataset.topic;
|
||||
if (!topic_id) {
|
||||
alert("Failed to get topic_id!");
|
||||
return false;
|
||||
|
|
@ -123,10 +120,10 @@
|
|||
|
||||
if (form.uploaded_urls.length) {
|
||||
json.data = json.data ?? {};
|
||||
json.data.message =
|
||||
(typeof json.data.message === "string" &&
|
||||
json.data.message.trim().length
|
||||
? json.data.message.trim() + "\n"
|
||||
json.data.content =
|
||||
(typeof json.data.content === "string" &&
|
||||
json.data.content.trim().length
|
||||
? json.data.content.trim() + "\n"
|
||||
: "") + form.uploaded_urls.join("\n");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -282,10 +282,10 @@ function render_text_event(topic_chat_content, event, creator, existing_element)
|
|||
<div class="icon more-borderless"></div>
|
||||
</label>
|
||||
|
||||
<button class="message-action" data-action="react"><i class="icon more-circle"></i><span class="action-name">React</span></button>
|
||||
<button class="message-action mockup" data-action="react"><i class="icon circle"></i><span class="action-name">React</span></button>
|
||||
<button class="message-action" data-action="reply" onclick="document.getElementById( 'parent-id' ).value = '${message_id}';"><i class="icon reply"></i><span class="action-name">Reply</span></button>
|
||||
<button class="message-action" data-action="forward_copy"><i class="icon forward-copy"></i><span class="action-name">Copy Link</span></button>
|
||||
<button class="message-action" data-action="delete"><i class="icon trash"></i><span class="action-name">Delete</span></button>
|
||||
<button class="message-action mockup" data-action="forward_copy"><i class="icon forward-copy"></i><span class="action-name">Copy Link</span></button>
|
||||
<button class="message-action mockup" data-action="delete"><i class="icon trash"></i><span class="action-name">Delete</span></button>
|
||||
</div>
|
||||
<div class="info-container">
|
||||
<div class="avatar-container">
|
||||
|
|
@ -299,7 +299,7 @@ function render_text_event(topic_chat_content, event, creator, existing_element)
|
|||
<span class="short">${event_datetime.short}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="message-content-container">${message_text_to_html(event.data.message)}</div>
|
||||
<div class="message-content-container">${message_text_to_html(event.data.content)}</div>
|
||||
</div>`;
|
||||
|
||||
if (existing_element) {
|
||||
|
|
|
|||
3
public/tabs/essays/README.md
Normal file
3
public/tabs/essays/README.md
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# Essays
|
||||
|
||||
Essays are long-form, authored posts intended to be effectively, a broadcast.
|
||||
16
public/tabs/essays/essays.html
Normal file
16
public/tabs/essays/essays.html
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<div id="essays" class="tab">
|
||||
<input
|
||||
type="radio"
|
||||
name="top-level-tabs"
|
||||
id="essays-tab-input"
|
||||
class="tab-switch"
|
||||
data-view="essays"
|
||||
/>
|
||||
<label for="essays-tab-input" class="tab-label mockup"
|
||||
><div class="icon essay"></div>
|
||||
<div class="label">Essays</div></label
|
||||
>
|
||||
<div class="tab-content">
|
||||
<!-- #include file="./README.md" -->
|
||||
</div>
|
||||
</div>
|
||||
3
public/tabs/forum/README.md
Normal file
3
public/tabs/forum/README.md
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# Forum
|
||||
|
||||
Forums are for more thoughtful and long form discussion.
|
||||
23
public/tabs/forum/forum.html
Normal file
23
public/tabs/forum/forum.html
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
<style>
|
||||
.forum-container {
|
||||
padding: 2rem;
|
||||
}
|
||||
</style>
|
||||
<div id="forum" class="tab">
|
||||
<input
|
||||
type="radio"
|
||||
name="top-level-tabs"
|
||||
id="forum-tab-input"
|
||||
class="tab-switch"
|
||||
data-view="forum"
|
||||
/>
|
||||
<label for="forum-tab-input" class="tab-label mockup"
|
||||
><div class="icon forum"></div>
|
||||
<div class="label">Forum</div></label
|
||||
>
|
||||
<div class="tab-content forum-container">
|
||||
<button>
|
||||
<i class="icon plus" style="display: inline-block; margin-right: 1rem"></i>New Thread
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
class="tab-switch"
|
||||
data-view="resources"
|
||||
/>
|
||||
<label for="resources-tab-input" class="tab-label"
|
||||
<label for="resources-tab-input" class="tab-label mockup"
|
||||
><div class="icon resources"></div>
|
||||
<div class="label">Resources</div></label
|
||||
>
|
||||
|
|
|
|||
|
|
@ -122,7 +122,9 @@
|
|||
|
||||
<div class="tabs">
|
||||
<!-- #include file="./chat/chat.html" -->
|
||||
<!-- #include file="./blurbs/blurbs.html" -->
|
||||
<!-- #include file="./forum/forum.html" -->
|
||||
<!-- #include file="./essays/essays.html" -->
|
||||
<!-- #include file="./resources/resources.html" -->
|
||||
<!-- #include file="./calendar/calendar.html" -->
|
||||
<!-- #include file="./profile/profile.html" -->
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue