feat(board): redesign classifieds + Slack channel creation
Adds AdminGhost bot token for admin-only Slack channel creation, refreshes BoardPostCard/Form layouts, and expands admin board-channels management.
This commit is contained in:
parent
6f3d088763
commit
9a560f2a3b
14 changed files with 544 additions and 158 deletions
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<article class="board-post">
|
||||
<header class="post-header">
|
||||
<span class="type-indicator" :class="typeClass">{{ typeLabel }}</span>
|
||||
<span class="post-meta">{{ typeLabel }}</span>
|
||||
<div v-if="editable" class="post-actions">
|
||||
<button type="button" class="action-btn" @click="$emit('edit', post)">Edit</button>
|
||||
<button type="button" class="action-btn danger" @click="$emit('delete', post)">Delete</button>
|
||||
|
|
@ -23,31 +23,49 @@
|
|||
<p v-if="post.note" class="post-note">{{ post.note }}</p>
|
||||
|
||||
<div v-if="post.tags && post.tags.length" class="post-tags">
|
||||
<span v-for="tag in post.tags" :key="tag" class="tag-pill">{{ tag }}</span>
|
||||
<span v-for="slug in post.tags" :key="slug" class="tag-pill">{{ tagLabel(slug) }}</span>
|
||||
</div>
|
||||
|
||||
<footer class="post-footer">
|
||||
<div class="author">
|
||||
<img
|
||||
v-if="post.author && post.author.avatar"
|
||||
:src="post.author.avatar"
|
||||
v-if="authorAvatar"
|
||||
:src="authorAvatar"
|
||||
:alt="post.author.name"
|
||||
class="author-avatar"
|
||||
>
|
||||
<span v-else class="author-avatar avatar-placeholder" />
|
||||
<span class="author-name">{{ post.author ? post.author.name : 'Unknown' }}</span>
|
||||
<CircleBadge
|
||||
v-if="post.author && post.author.circle"
|
||||
:circle="post.author.circle"
|
||||
/>
|
||||
<span v-if="slackHandle" class="slack-handle-wrap">
|
||||
<button
|
||||
type="button"
|
||||
class="slack-handle"
|
||||
:title="copied ? 'Copied!' : 'Click to copy Slack handle'"
|
||||
@click="copySlackHandle"
|
||||
>@{{ slackHandle }}</button>
|
||||
<button
|
||||
type="button"
|
||||
class="copy-link"
|
||||
:class="{ copied }"
|
||||
@click="copySlackHandle"
|
||||
>{{ copied ? 'Copied!' : 'Copy' }}</button>
|
||||
</span>
|
||||
</div>
|
||||
<a
|
||||
v-if="slackLink"
|
||||
:href="slackLink"
|
||||
v-if="slackLinks.length === 1"
|
||||
:href="slackLinks[0].url"
|
||||
target="_blank"
|
||||
rel="noopener"
|
||||
class="slack-link"
|
||||
>Discuss on Slack →</a>
|
||||
>Discuss in #{{ slackLinks[0].name }} →</a>
|
||||
<details v-else-if="slackLinks.length > 1" class="slack-menu">
|
||||
<summary class="slack-link">Discuss on Slack ▾</summary>
|
||||
<ul class="slack-menu-list">
|
||||
<li v-for="link in slackLinks" :key="link.id">
|
||||
<a :href="link.url" target="_blank" rel="noopener" class="slack-link">#{{ link.name }}</a>
|
||||
</li>
|
||||
</ul>
|
||||
</details>
|
||||
</footer>
|
||||
</article>
|
||||
</template>
|
||||
|
|
@ -56,11 +74,47 @@
|
|||
const props = defineProps({
|
||||
post: { type: Object, required: true },
|
||||
channels: { type: Array, default: () => [] },
|
||||
tags: { type: Array, default: () => [] },
|
||||
editable: { type: Boolean, default: false },
|
||||
})
|
||||
|
||||
defineEmits(['edit', 'delete'])
|
||||
|
||||
const capitalizeAvatar = (str) => {
|
||||
if (str.toLowerCase() === 'wtf') return 'WTF'
|
||||
return str
|
||||
.split('-')
|
||||
.map((w) => w.charAt(0).toUpperCase() + w.slice(1).toLowerCase())
|
||||
.join('-')
|
||||
}
|
||||
|
||||
const authorAvatar = computed(() => {
|
||||
const a = props.post.author?.avatar
|
||||
if (!a) return null
|
||||
return `/ghosties/Ghost-${capitalizeAvatar(a)}.png`
|
||||
})
|
||||
|
||||
const slackHandle = computed(() => props.post.author?.board?.slackHandle || '')
|
||||
|
||||
const copied = ref(false)
|
||||
const copySlackHandle = async () => {
|
||||
if (!slackHandle.value) return
|
||||
try {
|
||||
await navigator.clipboard.writeText(`@${slackHandle.value}`)
|
||||
copied.value = true
|
||||
setTimeout(() => { copied.value = false }, 1500)
|
||||
} catch {
|
||||
// clipboard unavailable
|
||||
}
|
||||
}
|
||||
|
||||
const tagLabelMap = computed(() => {
|
||||
const map = {}
|
||||
for (const t of props.tags) map[t.slug] = t.label || t.name || t.slug
|
||||
return map
|
||||
})
|
||||
const tagLabel = (slug) => tagLabelMap.value[slug] || slug
|
||||
|
||||
const hasSeeking = computed(() => !!(props.post.seeking && props.post.seeking.trim()))
|
||||
const hasOffering = computed(() => !!(props.post.offering && props.post.offering.trim()))
|
||||
|
||||
|
|
@ -71,22 +125,20 @@ const typeLabel = computed(() => {
|
|||
return ''
|
||||
})
|
||||
|
||||
const typeClass = computed(() => {
|
||||
if (hasSeeking.value && hasOffering.value) return 'type-both'
|
||||
if (hasSeeking.value) return 'type-seeking'
|
||||
if (hasOffering.value) return 'type-offering'
|
||||
return ''
|
||||
})
|
||||
|
||||
const slackLink = computed(() => {
|
||||
const slackLinks = computed(() => {
|
||||
const postTags = props.post.tags || []
|
||||
if (!postTags.length) return null
|
||||
const channel = props.channels.find(c => {
|
||||
const slugs = c.tagSlugs || []
|
||||
return slugs.some(s => postTags.includes(s))
|
||||
})
|
||||
if (!channel || !channel.slackChannelId) return null
|
||||
return `https://gammaspace.slack.com/archives/${channel.slackChannelId}`
|
||||
if (!postTags.length) return []
|
||||
return props.channels
|
||||
.filter((c) => {
|
||||
if (!c.slackChannelId) return false
|
||||
const slugs = c.tagSlugs || []
|
||||
return slugs.some((s) => postTags.includes(s))
|
||||
})
|
||||
.map((c) => ({
|
||||
id: c.slackChannelId,
|
||||
name: c.slackChannelName || c.name || c.slackChannelId,
|
||||
url: `https://gammaspace.slack.com/archives/${c.slackChannelId}`,
|
||||
}))
|
||||
})
|
||||
</script>
|
||||
|
||||
|
|
@ -94,41 +146,26 @@ const slackLink = computed(() => {
|
|||
.board-post {
|
||||
border: 1px dashed var(--border);
|
||||
padding: 18px 22px;
|
||||
transition: background 0.15s, border-color 0.15s;
|
||||
}
|
||||
.board-post:hover {
|
||||
background: var(--surface);
|
||||
border-color: var(--border-d);
|
||||
break-inside: avoid;
|
||||
-webkit-column-break-inside: avoid;
|
||||
page-break-inside: avoid;
|
||||
}
|
||||
|
||||
.post-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
align-items: baseline;
|
||||
gap: 12px;
|
||||
margin-bottom: 10px;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
.type-indicator {
|
||||
display: inline-block;
|
||||
font-size: 10px;
|
||||
letter-spacing: 0.08em;
|
||||
text-transform: uppercase;
|
||||
padding: 2px 8px;
|
||||
border: 1px dashed;
|
||||
.post-meta {
|
||||
font-family: "Commit Mono", monospace;
|
||||
}
|
||||
.type-indicator.type-seeking {
|
||||
color: var(--candle);
|
||||
border-color: var(--candle-faint);
|
||||
}
|
||||
.type-indicator.type-offering {
|
||||
color: var(--green);
|
||||
border-color: var(--green);
|
||||
}
|
||||
.type-indicator.type-both {
|
||||
color: var(--ember);
|
||||
border-color: var(--ember);
|
||||
font-size: 10px;
|
||||
letter-spacing: 0.1em;
|
||||
text-transform: uppercase;
|
||||
color: var(--text-faint);
|
||||
}
|
||||
|
||||
.post-actions {
|
||||
|
|
@ -157,11 +194,11 @@ const slackLink = computed(() => {
|
|||
|
||||
.post-title {
|
||||
font-family: "Brygada 1918", serif;
|
||||
font-size: 20px;
|
||||
font-size: 19px;
|
||||
font-weight: 500;
|
||||
color: var(--text-bright);
|
||||
margin-bottom: 10px;
|
||||
line-height: 1.25;
|
||||
margin: 0 0 12px;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.post-block {
|
||||
|
|
@ -205,9 +242,9 @@ const slackLink = computed(() => {
|
|||
|
||||
.post-footer {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
gap: 8px;
|
||||
margin-top: 14px;
|
||||
padding-top: 10px;
|
||||
border-top: 1px dashed var(--border);
|
||||
|
|
@ -216,13 +253,13 @@ const slackLink = computed(() => {
|
|||
.author {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
flex-wrap: wrap;
|
||||
gap: 6px 8px;
|
||||
}
|
||||
.author-avatar {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
object-fit: cover;
|
||||
border: 1px dashed var(--border);
|
||||
}
|
||||
.avatar-placeholder {
|
||||
background: var(--surface);
|
||||
|
|
@ -232,7 +269,66 @@ const slackLink = computed(() => {
|
|||
color: var(--text-dim);
|
||||
font-family: "Commit Mono", monospace;
|
||||
}
|
||||
.slack-handle-wrap {
|
||||
display: inline-flex;
|
||||
align-items: baseline;
|
||||
gap: 6px;
|
||||
}
|
||||
.slack-handle {
|
||||
font-size: 11px;
|
||||
color: var(--text-faint);
|
||||
font-family: "Commit Mono", monospace;
|
||||
background: transparent;
|
||||
border: none;
|
||||
padding: 0;
|
||||
cursor: pointer;
|
||||
}
|
||||
.slack-handle:hover {
|
||||
color: var(--candle);
|
||||
}
|
||||
.copy-link {
|
||||
font-size: 11px;
|
||||
font-family: "Commit Mono", monospace;
|
||||
color: var(--candle);
|
||||
background: transparent;
|
||||
border: none;
|
||||
padding: 0;
|
||||
cursor: pointer;
|
||||
text-decoration: underline;
|
||||
}
|
||||
.copy-link:hover {
|
||||
color: var(--candle-dim);
|
||||
}
|
||||
.copy-link.copied {
|
||||
color: var(--candle);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.slack-menu {
|
||||
position: relative;
|
||||
}
|
||||
.slack-menu > summary {
|
||||
list-style: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
.slack-menu > summary::-webkit-details-marker {
|
||||
display: none;
|
||||
}
|
||||
.slack-menu-list {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 100%;
|
||||
margin-top: 6px;
|
||||
padding: 6px 10px;
|
||||
list-style: none;
|
||||
background: var(--surface);
|
||||
border: 1px dashed var(--border);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4px;
|
||||
white-space: nowrap;
|
||||
z-index: 10;
|
||||
}
|
||||
.slack-link {
|
||||
font-size: 11px;
|
||||
font-family: "Commit Mono", monospace;
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
<form class="post-form" @submit.prevent="handleSubmit">
|
||||
<div class="form-header">
|
||||
<h3 class="form-title">{{ isEdit ? 'Edit post' : 'New post' }}</h3>
|
||||
<p class="form-hint">Fill in <em>Seeking</em> or <em>Offering</em> (or both).</p>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
|
|
@ -13,35 +14,34 @@
|
|||
maxlength="120"
|
||||
placeholder="Short summary"
|
||||
>
|
||||
<div class="char-count">{{ form.title.length }}/120</div>
|
||||
</div>
|
||||
|
||||
<div class="field-row">
|
||||
<div class="field">
|
||||
<label for="post-seeking">Seeking <span class="opt">(optional)</span></label>
|
||||
<textarea
|
||||
id="post-seeking"
|
||||
v-model="form.seeking"
|
||||
rows="2"
|
||||
maxlength="500"
|
||||
placeholder="What are you looking for?"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label for="post-offering">Offering <span class="opt">(optional)</span></label>
|
||||
<textarea
|
||||
id="post-offering"
|
||||
v-model="form.offering"
|
||||
rows="2"
|
||||
maxlength="500"
|
||||
placeholder="What can you offer?"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label for="post-seeking">Seeking</label>
|
||||
<textarea
|
||||
id="post-seeking"
|
||||
v-model="form.seeking"
|
||||
rows="3"
|
||||
maxlength="500"
|
||||
placeholder="What are you looking for?"
|
||||
/>
|
||||
<div class="char-count">{{ form.seeking.length }}/500</div>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label for="post-offering">Offering</label>
|
||||
<textarea
|
||||
id="post-offering"
|
||||
v-model="form.offering"
|
||||
rows="3"
|
||||
maxlength="500"
|
||||
placeholder="What can you offer?"
|
||||
/>
|
||||
<div class="char-count">{{ form.offering.length }}/500</div>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label for="post-note">Note (optional)</label>
|
||||
<label for="post-note">Note <span class="opt">(optional)</span></label>
|
||||
<textarea
|
||||
id="post-note"
|
||||
v-model="form.note"
|
||||
|
|
@ -49,7 +49,6 @@
|
|||
maxlength="300"
|
||||
placeholder="Anything else to add?"
|
||||
/>
|
||||
<div class="char-count">{{ form.note.length }}/300</div>
|
||||
</div>
|
||||
|
||||
<div v-if="tags.length" class="field">
|
||||
|
|
@ -139,22 +138,38 @@ function handleSubmit() {
|
|||
<style scoped>
|
||||
.post-form {
|
||||
border: 1px dashed var(--border);
|
||||
padding: 20px 24px;
|
||||
padding: 14px 16px;
|
||||
background: var(--bg);
|
||||
}
|
||||
|
||||
.form-header {
|
||||
margin-bottom: 14px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.form-title {
|
||||
font-family: "Brygada 1918", serif;
|
||||
font-size: 18px;
|
||||
font-size: 15px;
|
||||
font-weight: 500;
|
||||
color: var(--text-bright);
|
||||
}
|
||||
.form-hint {
|
||||
font-size: 11px;
|
||||
color: var(--text-faint);
|
||||
font-family: "Commit Mono", monospace;
|
||||
margin-top: 2px;
|
||||
}
|
||||
.form-hint em {
|
||||
color: var(--text-dim);
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
.field {
|
||||
margin-bottom: 12px;
|
||||
margin-bottom: 8px;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
.field-row {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
}
|
||||
.field label {
|
||||
display: block;
|
||||
|
|
@ -164,12 +179,20 @@ function handleSubmit() {
|
|||
color: var(--text-faint);
|
||||
margin-bottom: 3px;
|
||||
}
|
||||
.field label .opt {
|
||||
color: var(--text-faint);
|
||||
text-transform: none;
|
||||
letter-spacing: 0;
|
||||
font-size: 9px;
|
||||
margin-left: 4px;
|
||||
opacity: 0.7;
|
||||
}
|
||||
.field input,
|
||||
.field textarea {
|
||||
width: 100%;
|
||||
padding: 5px 8px;
|
||||
padding: 4px 8px;
|
||||
font-family: "Commit Mono", monospace;
|
||||
font-size: 13px;
|
||||
font-size: 12px;
|
||||
color: var(--text-bright);
|
||||
background: var(--input-bg);
|
||||
border: 1px solid var(--border);
|
||||
|
|
@ -232,8 +255,15 @@ function handleSubmit() {
|
|||
display: flex;
|
||||
justify-content: flex-end;
|
||||
gap: 8px;
|
||||
margin-top: 14px;
|
||||
padding-top: 12px;
|
||||
margin-top: 10px;
|
||||
padding-top: 8px;
|
||||
border-top: 1px dashed var(--border);
|
||||
}
|
||||
|
||||
@media (max-width: 640px) {
|
||||
.field-row {
|
||||
flex-direction: column;
|
||||
gap: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<div class="header-row">
|
||||
<div>
|
||||
<h1>Board Channels</h1>
|
||||
<p>Map cooperative tags to Slack channels for board cross-posting</p>
|
||||
<p>Create Slack channels for cooperative tags. New channels are created in Slack when you click Create Channel.</p>
|
||||
</div>
|
||||
<div class="header-actions">
|
||||
<button class="btn btn-primary" @click="openCreateModal">+ New Channel</button>
|
||||
|
|
@ -28,22 +28,23 @@
|
|||
<div class="channels-list">
|
||||
<div v-if="!channels.length" class="empty-state">
|
||||
<p>No board channels configured yet.</p>
|
||||
<p class="empty-hint">Click "+ New Channel" to map your first tag to a Slack channel.</p>
|
||||
<p class="empty-hint">Click "+ New Channel" to create your first board channel in Slack.</p>
|
||||
</div>
|
||||
|
||||
<table v-else class="channels-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Slack Channel ID</th>
|
||||
<th>Channel</th>
|
||||
<th>Mapped Tags</th>
|
||||
<th class="actions-col">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="channel in channels" :key="channel._id">
|
||||
<td class="name-cell">{{ channel.name }}</td>
|
||||
<td class="mono">{{ channel.slackChannelId }}</td>
|
||||
<td class="name-cell">
|
||||
<div class="channel-name">{{ channel.name }}</div>
|
||||
<div class="channel-id">{{ channel.slackChannelId }}</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="tag-pills">
|
||||
<span
|
||||
|
|
@ -75,32 +76,39 @@
|
|||
<div class="modal-body">
|
||||
<div class="field">
|
||||
<label>Name</label>
|
||||
<input v-model="formData.name" type="text" placeholder="e.g., #coop-formation" />
|
||||
<input v-model="formData.name" type="text" placeholder="e.g., coop-formation" />
|
||||
<p v-if="!editingId" class="help-text">A new Slack channel will be created with this name. Lowercase, letters/numbers/dashes only.</p>
|
||||
</div>
|
||||
<div class="field">
|
||||
<div v-if="editingId" class="field">
|
||||
<label>Slack Channel ID</label>
|
||||
<input v-model="formData.slackChannelId" type="text" placeholder="C0123456789" />
|
||||
<p class="help-text">The Slack channel ID (starts with C). Find it in channel settings.</p>
|
||||
<p class="help-text">The Slack channel ID (starts with C).</p>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>Mapped Tags</label>
|
||||
<p class="help-text">Cooperative tags that route posts to this channel.</p>
|
||||
<div class="tag-select">
|
||||
<label
|
||||
<div class="pill-grid">
|
||||
<button
|
||||
v-for="tag in cooperativeTags"
|
||||
:key="tag.slug"
|
||||
class="tag-checkbox"
|
||||
>
|
||||
<input
|
||||
type="checkbox"
|
||||
:value="tag.slug"
|
||||
:checked="formData.tagSlugs.includes(tag.slug)"
|
||||
@change="toggleTag(tag.slug)"
|
||||
/>
|
||||
<span>{{ tag.label }}</span>
|
||||
</label>
|
||||
type="button"
|
||||
class="pill"
|
||||
:class="{
|
||||
selected: formData.tagSlugs.includes(tag.slug),
|
||||
disabled: tagOwner(tag.slug) && !formData.tagSlugs.includes(tag.slug),
|
||||
}"
|
||||
:disabled="!!(tagOwner(tag.slug) && !formData.tagSlugs.includes(tag.slug))"
|
||||
:title="tagOwner(tag.slug) && !formData.tagSlugs.includes(tag.slug)
|
||||
? `Already mapped to ${tagOwner(tag.slug)}`
|
||||
: ''"
|
||||
@click="toggleTag(tag.slug)"
|
||||
>{{ tag.label }}<span
|
||||
v-if="tagOwner(tag.slug) && !formData.tagSlugs.includes(tag.slug)"
|
||||
class="pill-owner"
|
||||
> · {{ tagOwner(tag.slug) }}</span></button>
|
||||
<p v-if="!cooperativeTags.length" class="help-text">No cooperative tags available.</p>
|
||||
</div>
|
||||
<p class="help-text">Each tag can only be mapped to one channel.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-actions">
|
||||
|
|
@ -148,6 +156,18 @@ const mappedSlugs = computed(() => {
|
|||
return set
|
||||
})
|
||||
|
||||
// Map of slug -> channel name, EXCLUDING the channel currently being edited.
|
||||
const otherChannelTagMap = computed(() => {
|
||||
const map = {}
|
||||
for (const ch of channels.value) {
|
||||
if (editingId.value && String(ch._id) === String(editingId.value)) continue
|
||||
for (const slug of ch.tagSlugs || []) map[slug] = ch.name
|
||||
}
|
||||
return map
|
||||
})
|
||||
|
||||
const tagOwner = (slug) => otherChannelTagMap.value[slug] || ''
|
||||
|
||||
const unmappedTags = computed(() =>
|
||||
cooperativeTags.value.filter((t) => !mappedSlugs.value.has(t.slug)),
|
||||
)
|
||||
|
|
@ -195,10 +215,18 @@ const toggleTag = (slug) => {
|
|||
}
|
||||
|
||||
const saveChannel = async () => {
|
||||
if (!formData.name.trim() || !formData.slackChannelId.trim()) {
|
||||
if (!formData.name.trim()) {
|
||||
toast.add({
|
||||
title: 'Missing fields',
|
||||
description: 'Name and Slack channel ID are required.',
|
||||
description: 'Name is required.',
|
||||
color: 'red',
|
||||
})
|
||||
return
|
||||
}
|
||||
if (editingId.value && !formData.slackChannelId.trim()) {
|
||||
toast.add({
|
||||
title: 'Missing fields',
|
||||
description: 'Slack channel ID is required.',
|
||||
color: 'red',
|
||||
})
|
||||
return
|
||||
|
|
@ -208,9 +236,11 @@ const saveChannel = async () => {
|
|||
try {
|
||||
const body = {
|
||||
name: formData.name.trim(),
|
||||
slackChannelId: formData.slackChannelId.trim(),
|
||||
tagSlugs: formData.tagSlugs,
|
||||
}
|
||||
if (formData.slackChannelId.trim()) {
|
||||
body.slackChannelId = formData.slackChannelId.trim()
|
||||
}
|
||||
if (editingId.value) {
|
||||
await $fetch(`/api/admin/board-channels/${editingId.value}`, {
|
||||
method: 'PATCH',
|
||||
|
|
@ -323,11 +353,12 @@ onMounted(() => {
|
|||
|
||||
.tag-pill {
|
||||
display: inline-block;
|
||||
padding: 2px 8px;
|
||||
padding: 2px 9px;
|
||||
font-size: 11px;
|
||||
background: var(--bg);
|
||||
border: 1px solid var(--border);
|
||||
color: var(--text);
|
||||
font-family: "Commit Mono", monospace;
|
||||
background: transparent;
|
||||
border: 1px dashed var(--border);
|
||||
color: var(--text-dim);
|
||||
}
|
||||
|
||||
.tag-pill-warning {
|
||||
|
|
@ -373,14 +404,14 @@ onMounted(() => {
|
|||
border-bottom: none;
|
||||
}
|
||||
|
||||
.name-cell {
|
||||
.channel-name {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.mono {
|
||||
.channel-id {
|
||||
font-family: 'Commit Mono', monospace;
|
||||
font-size: 12px;
|
||||
color: var(--text-dim);
|
||||
font-size: 11px;
|
||||
color: var(--text-faint);
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
.actions-col {
|
||||
|
|
@ -517,24 +548,49 @@ onMounted(() => {
|
|||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.tag-select {
|
||||
border: 1px dashed var(--border);
|
||||
padding: 10px;
|
||||
max-height: 200px;
|
||||
overflow-y: auto;
|
||||
background: var(--input-bg);
|
||||
}
|
||||
|
||||
.tag-checkbox {
|
||||
.pill-grid {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
padding: 4px 0;
|
||||
font-size: 13px;
|
||||
cursor: pointer;
|
||||
flex-wrap: wrap;
|
||||
gap: 4px;
|
||||
max-height: 240px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.tag-checkbox input {
|
||||
margin: 0;
|
||||
.pill {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
padding: 2px 9px;
|
||||
border: 1px dashed var(--border);
|
||||
background: transparent;
|
||||
color: var(--text-faint);
|
||||
font-size: 11px;
|
||||
font-family: "Commit Mono", monospace;
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
transition: all 0.12s;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.pill:hover {
|
||||
color: var(--text-dim);
|
||||
border-color: var(--border-d);
|
||||
}
|
||||
.pill.selected {
|
||||
background: var(--surface);
|
||||
color: var(--text-bright);
|
||||
border-color: var(--candle);
|
||||
border-style: solid;
|
||||
}
|
||||
.pill.disabled,
|
||||
.pill:disabled {
|
||||
opacity: 0.45;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
.pill.disabled:hover {
|
||||
color: var(--text-faint);
|
||||
border-color: var(--border);
|
||||
}
|
||||
.pill-owner {
|
||||
font-size: 10px;
|
||||
color: var(--text-faint);
|
||||
margin-left: 2px;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<PageShell title="Board" :subtitle="pageSubtitle">
|
||||
<PageShell title="Bulletin Board" :subtitle="pageSubtitle">
|
||||
<!-- Action bar -->
|
||||
<div class="action-bar">
|
||||
<button type="button" class="new-post-btn" @click="openNewForm">
|
||||
|
|
@ -71,6 +71,7 @@
|
|||
:key="post._id"
|
||||
:post="post"
|
||||
:channels="channels"
|
||||
:tags="cooperativeTags"
|
||||
:editable="isAuthor(post)"
|
||||
@edit="handleEdit"
|
||||
@delete="handleDelete"
|
||||
|
|
@ -302,17 +303,27 @@ onMounted(async () => {
|
|||
|
||||
/* ---- FORM WRAPPER ---- */
|
||||
.form-wrapper {
|
||||
padding: 20px 24px;
|
||||
padding: 16px 24px;
|
||||
border-bottom: 1px dashed var(--border);
|
||||
max-width: 640px;
|
||||
}
|
||||
|
||||
/* ---- POST GRID ---- */
|
||||
/* ---- POST GRID (masonry via CSS columns) ---- */
|
||||
.post-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
gap: 16px;
|
||||
column-count: 2;
|
||||
column-gap: 16px;
|
||||
padding: 20px 24px;
|
||||
}
|
||||
.post-grid > * {
|
||||
display: block;
|
||||
width: 100%;
|
||||
margin: 0 0 16px;
|
||||
}
|
||||
@media (min-width: 1400px) {
|
||||
.post-grid {
|
||||
column-count: 3;
|
||||
}
|
||||
}
|
||||
|
||||
/* ---- LOADING / EMPTY ---- */
|
||||
.loading-state {
|
||||
|
|
@ -340,7 +351,7 @@ onMounted(async () => {
|
|||
/* ---- RESPONSIVE ---- */
|
||||
@media (max-width: 1024px) {
|
||||
.post-grid {
|
||||
grid-template-columns: 1fr;
|
||||
column-count: 1;
|
||||
}
|
||||
}
|
||||
@media (max-width: 768px) {
|
||||
|
|
|
|||
|
|
@ -528,7 +528,6 @@ useHead({
|
|||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border: 1px dashed var(--border);
|
||||
background: var(--bg);
|
||||
cursor: pointer;
|
||||
padding: 3px;
|
||||
|
|
|
|||
|
|
@ -348,7 +348,6 @@ useHead({
|
|||
width: 96px;
|
||||
height: 96px;
|
||||
background: var(--surface);
|
||||
border: 1px dashed var(--border);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
|
|
|||
|
|
@ -580,7 +580,6 @@ onMounted(async () => {
|
|||
width: 32px;
|
||||
height: 32px;
|
||||
background: var(--surface);
|
||||
border: 1px dashed var(--border);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue