@bettertogether/community-engine-vue 0.1.6 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +140 -1
- package/dist/assets/BBadge.vue_vue_type_script_setup_true_lang-IIZ8QpjG-Z9WDKHqT.js +1 -0
- package/dist/assets/BCardText.vue_vue_type_script_setup_true_lang-Be6CD36N-B5JCTdmm.js +3 -0
- package/dist/assets/BFormSelect.vue_vue_type_script_setup_true_lang-BigptVap-B_HbOOZR.js +1 -0
- package/dist/assets/BRow.vue_vue_type_script_setup_true_lang-69TY75-8-DJdEdyx7.js +1 -0
- package/dist/assets/Communities-Cx4tT-bx.js +1 -0
- package/dist/assets/Communities-n33ssuUH.css +1 -0
- package/dist/assets/CommunityConversation-bBkYBs2k.css +1 -0
- package/dist/assets/CommunityConversation-jHAnv_Ps.js +1 -0
- package/dist/assets/CommunityConversations-rEDGS7To.js +1 -0
- package/dist/assets/CommunityEvent-CUdT0aT4.js +1 -0
- package/dist/assets/CommunityEvents-rsOgcxQr.js +1 -0
- package/dist/assets/CommunityHome-ChuTE2Nz.js +1 -0
- package/dist/assets/CommunityJoaTu-CpLIY_83.js +1 -0
- package/dist/assets/CommunityMembers-C3UtzQGp.css +1 -0
- package/dist/assets/CommunityMembers-DKf74ltl.js +1 -0
- package/dist/assets/CommunityPage-C5x23iQl.css +1 -0
- package/dist/assets/CommunityPage-CRYg9-rW.js +1 -0
- package/dist/assets/CommunityPages-IsLTNFC3.js +1 -0
- package/dist/assets/CommunityPost-BOnqqxVs.js +1 -0
- package/dist/assets/CommunityPost-BRYtkDSY.css +1 -0
- package/dist/assets/CommunityPosts-DY1olmcU.js +1 -0
- package/dist/assets/Error404-D10VQARe.js +1 -0
- package/dist/assets/EventCard-vfutXTdg.js +1 -0
- package/dist/assets/EventList-ChtehYcJ.js +1 -0
- package/dist/assets/ExtensionSlot-DJKbrq4c.js +1 -0
- package/dist/assets/PostList-BuHrBBqX.css +1 -0
- package/dist/assets/PostList-DYFgxlE8.js +1 -0
- package/dist/assets/SyncBadge-B1JBsdUk.js +1 -0
- package/dist/assets/SyncBadge-FNO-QLuu.css +1 -0
- package/dist/assets/UserPasswordNew-D_Djldm9.css +1 -0
- package/dist/assets/UserPasswordNew-al9bNBTZ.js +1 -0
- package/dist/assets/UserPasswordReset-42zs98RW.js +1 -0
- package/dist/assets/UserPasswordReset-D_6OQDZY.css +1 -0
- package/dist/assets/UserResendConfirmation-CGavYB81.js +1 -0
- package/dist/assets/UserResendConfirmation-DNTHcaar.css +1 -0
- package/dist/assets/UserSignIn-BIRb0HkV.js +1 -0
- package/dist/assets/UserSignIn-C-Pol8OD.css +1 -0
- package/dist/assets/UserSignUp-ChkKQAd2.css +1 -0
- package/dist/assets/UserSignUp-Df6o3vlO.js +1 -0
- package/dist/assets/better-together-logo-61cxo5d5.png +0 -0
- package/dist/assets/index-BFt-JKVh.css +5 -0
- package/dist/assets/index-COo3Jb7v.js +1088 -0
- package/dist/assets/nodefs-Bfyh92qg.js +1 -0
- package/dist/assets/opfs-ahp-BLzlXf6u.js +3 -0
- package/dist/assets/pglite-BdRI_ZYT.wasm +0 -0
- package/dist/assets/pglite-COscPi1Y.data +0 -0
- package/dist/assets/usePages-DDjDQRCy.js +1 -0
- package/dist/assets/usePosts-Bf2Ccwr4.js +1 -0
- package/{public → dist}/index.html +9 -19
- package/package.json +57 -45
- package/src/BtApp.vue +34 -43
- package/src/components/BtBrandingLogo.vue +10 -18
- package/src/components/BtHeader.vue +34 -84
- package/src/components/BtMainContent.vue +12 -43
- package/src/components/BtNavBar.vue +25 -38
- package/src/components/BtNavItem.vue +25 -58
- package/src/components/BtNavUser.vue +65 -86
- package/src/components/BtProfileForm.vue +48 -39
- package/src/components/BtUserNewPasswordForm.vue +52 -74
- package/src/components/BtUserResendConfirmationForm.vue +45 -83
- package/src/components/BtUserResetPasswordForm.vue +45 -77
- package/src/components/BtUserSignInForm.vue +59 -75
- package/src/components/BtUserSignUpForm.vue +90 -103
- package/src/components/CommunityForm.vue +47 -39
- package/src/components/community/CommunityCard.vue +113 -0
- package/src/components/community/CommunityHeader.vue +91 -0
- package/src/components/community/CommunityList.vue +59 -0
- package/src/components/community/MemberRoleRow.vue +107 -0
- package/src/components/conversation/ConversationCard.vue +49 -0
- package/src/components/conversation/ConversationDetail.vue +53 -0
- package/src/components/conversation/ConversationList.vue +51 -0
- package/src/components/conversation/MessageForm.vue +45 -0
- package/src/components/conversation/MessageItem.vue +43 -0
- package/src/components/conversation/MessageList.vue +39 -0
- package/src/components/event/EventCard.vue +82 -0
- package/src/components/event/EventForm.vue +99 -0
- package/src/components/event/EventList.vue +47 -0
- package/src/components/invitation/InvitationCard.vue +56 -0
- package/src/components/invitation/InvitationForm.vue +70 -0
- package/src/components/invitation/InvitationList.vue +51 -0
- package/src/components/joatu/AgreementCard.vue +57 -0
- package/src/components/joatu/AgreementList.vue +51 -0
- package/src/components/joatu/OfferCard.vue +65 -0
- package/src/components/joatu/OfferForm.vue +82 -0
- package/src/components/joatu/OfferList.vue +51 -0
- package/src/components/joatu/RequestCard.vue +65 -0
- package/src/components/joatu/RequestForm.vue +82 -0
- package/src/components/joatu/RequestList.vue +51 -0
- package/src/components/page/PageCard.vue +55 -0
- package/src/components/page/PageDetail.vue +35 -0
- package/src/components/page/PageList.vue +51 -0
- package/src/components/person/MemberList.vue +61 -0
- package/src/components/person/PersonAvatar.vue +54 -0
- package/src/components/person/PersonCard.vue +47 -0
- package/src/components/post/PostCard.vue +105 -0
- package/src/components/post/PostDetail.vue +98 -0
- package/src/components/post/PostForm.vue +84 -0
- package/src/components/post/PostList.vue +53 -0
- package/src/components/role/BlockButton.vue +44 -0
- package/src/components/role/RoleBadge.vue +19 -0
- package/src/components/role/RoleGate.vue +62 -0
- package/src/components/role/RoleSelector.vue +29 -0
- package/src/components/shared/ExtensionSlot.vue +27 -0
- package/src/components/sync/OfflineBanner.vue +49 -0
- package/src/components/sync/SyncBadge.vue +108 -0
- package/src/components/sync/SyncStatusBar.vue +121 -0
- package/src/composables/useCommunities.js +19 -0
- package/src/composables/useConversations.js +5 -0
- package/src/composables/useEvents.js +28 -0
- package/src/composables/useInvitations.js +10 -0
- package/src/composables/useJoaTuAgreements.js +11 -0
- package/src/composables/useJoaTuOffers.js +10 -0
- package/src/composables/useJoaTuRequests.js +10 -0
- package/src/composables/useMembers.js +30 -0
- package/src/composables/useMessages.js +5 -0
- package/src/composables/useNotifications.js +5 -0
- package/src/composables/usePages.js +6 -0
- package/src/composables/usePersonBlocks.js +65 -0
- package/src/composables/usePosts.js +27 -0
- package/src/composables/useResource.js +137 -0
- package/src/composables/useRoles.js +94 -0
- package/src/composables/useSyncStatus.js +22 -0
- package/src/composables/useToaster.js +20 -0
- package/src/context.js +18 -0
- package/src/db/client.js +343 -0
- package/src/db/migrations/001_initial.sql +131 -0
- package/src/db/migrations/003_conversations_invitations_pages_joatu.sql +76 -0
- package/src/db/sync.js +276 -0
- package/src/endpoints/BtApiAuth.js +1 -1
- package/src/endpoints/BtApiV1.js +1 -1
- package/src/extension.js +45 -0
- package/src/i18n/index.js +103 -0
- package/src/i18n/locales/en.json +275 -0
- package/src/i18n/locales/es.json +275 -0
- package/src/i18n/locales/fr.json +223 -0
- package/src/i18n/locales/uk.json +275 -0
- package/src/index.js +168 -22
- package/src/layouts/CommunityLayout.vue +89 -0
- package/src/main.js +16 -12
- package/src/mixins/error-handling.js +6 -15
- package/src/mixins/toaster.js +15 -10
- package/src/pages/Communities.vue +59 -0
- package/src/pages/Error404.vue +10 -14
- package/src/pages/Home.vue +11 -18
- package/src/pages/Me.vue +39 -59
- package/src/pages/UserPasswordNew.vue +12 -68
- package/src/pages/UserPasswordReset.vue +15 -64
- package/src/pages/UserResendConfirmation.vue +39 -113
- package/src/pages/UserSignIn.vue +18 -67
- package/src/pages/UserSignUp.vue +15 -64
- package/src/pages/community/CommunityConversation.vue +31 -0
- package/src/pages/community/CommunityConversations.vue +18 -0
- package/src/pages/community/CommunityEvent.vue +39 -0
- package/src/pages/community/CommunityEvents.vue +58 -0
- package/src/pages/community/CommunityHome.vue +49 -0
- package/src/pages/community/CommunityJoaTu.vue +115 -0
- package/src/pages/community/CommunityMembers.vue +23 -0
- package/src/pages/community/CommunityPage.vue +31 -0
- package/src/pages/community/CommunityPages.vue +25 -0
- package/src/pages/community/CommunityPost.vue +28 -0
- package/src/pages/community/CommunityPosts.vue +58 -0
- package/src/pages/community/CommunitySettingsPage.vue +117 -0
- package/src/pages/community/RoleManagerPage.vue +93 -0
- package/src/plugins/bootstrap-vue.js +5 -5
- package/src/plugins/font-awesome.js +3 -2
- package/src/plugins/index.js +9 -4
- package/src/plugins/progress.js +16 -0
- package/src/pwa/index.js +156 -0
- package/src/pwa/sw-helpers.js +130 -0
- package/src/router/communityRoutes.js +78 -0
- package/src/router/index.js +30 -144
- package/src/slot-registry.js +15 -0
- package/src/stores/auth.js +134 -0
- package/src/stores/communities.js +59 -0
- package/src/stores/index.js +5 -0
- package/src/stores/menus.js +14 -0
- package/src/stores/people.js +48 -0
- package/src/stores/sync.js +93 -0
- package/src/stylesheets/sync-indicators.scss +34 -0
- package/.env.sample +0 -1
- package/.eslintrc.js +0 -51
- package/.gitlab-ci.yml +0 -14
- package/.travis/.rbenv-gemsets +0 -1
- package/.travis/.ruby-version +0 -1
- package/.travis.yml +0 -31
- package/babel.config.js +0 -5
- package/cypress.json +0 -3
- package/deploy/build.sh +0 -8
- package/eslint.config.js +0 -16
- package/postcss.config.js +0 -5
- package/src/eslint.config.js +0 -16
- package/src/forms/BtProfileFormSchema.js +0 -19
- package/src/forms/BtUserConfirmationFormSchema.js +0 -20
- package/src/forms/BtUserNewPasswordFormSchema.js +0 -29
- package/src/forms/BtUserResetPasswordFormSchema.js +0 -20
- package/src/forms/BtUserSignInFormSchema.js +0 -29
- package/src/forms/BtUserSignUpFormSchema.js +0 -63
- package/src/forms/CommunityFormSchema.js +0 -19
- package/src/plugins/vue-form-generator.js +0 -4
- package/src/plugins/vue-loading.js +0 -10
- package/src/registerServiceWorker.js +0 -32
- package/src/store/index.js +0 -32
- package/src/store/modules/authentication.js +0 -170
- package/src/store/modules/communities.js +0 -98
- package/src/store/modules/community-engine.js +0 -14
- package/src/store/modules/menus.js +0 -52
- package/src/store/modules/people.js +0 -88
- package/tests/e2e/.eslintrc.js +0 -12
- package/tests/e2e/plugins/index.js +0 -26
- package/tests/e2e/specs/home.js +0 -8
- package/tests/e2e/support/commands.js +0 -25
- package/tests/e2e/support/index.js +0 -20
- package/tests/unit/.eslintrc.js +0 -5
- package/tests/unit/example.spec.js +0 -13
- package/vue.config.js +0 -11
- package/webpack.config.js +0 -28
- /package/{public → dist}/_redirects +0 -0
- /package/{public → dist}/favicon.ico +0 -0
- /package/{public → dist}/img/favicon.ico +0 -0
- /package/{public → dist}/img/icons/android-chrome-192x192.png +0 -0
- /package/{public → dist}/img/icons/android-chrome-384x384.png +0 -0
- /package/{public → dist}/img/icons/apple-touch-icon.png +0 -0
- /package/{public → dist}/img/icons/favicon-16x16.png +0 -0
- /package/{public → dist}/img/icons/favicon-32x32.png +0 -0
- /package/{public → dist}/img/icons/favicon.ico +0 -0
- /package/{public → dist}/img/icons/mstile-150x150.png +0 -0
- /package/{public → dist}/img/icons/safari-pinned-tab.svg +0 -0
- /package/{public → dist}/robots.txt +0 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<BForm
|
|
3
|
+
class="bt-offer-form"
|
|
4
|
+
@submit.prevent="handleSubmit"
|
|
5
|
+
>
|
|
6
|
+
<BFormGroup
|
|
7
|
+
:label="t('bt.joatu.offers.title_label')"
|
|
8
|
+
label-for="offer-title"
|
|
9
|
+
>
|
|
10
|
+
<BFormInput
|
|
11
|
+
id="offer-title"
|
|
12
|
+
v-model="form.title"
|
|
13
|
+
required
|
|
14
|
+
:placeholder="t('bt.joatu.offers.title_placeholder')"
|
|
15
|
+
/>
|
|
16
|
+
</BFormGroup>
|
|
17
|
+
<BFormGroup
|
|
18
|
+
:label="t('bt.joatu.offers.description_label')"
|
|
19
|
+
label-for="offer-description"
|
|
20
|
+
>
|
|
21
|
+
<BFormTextarea
|
|
22
|
+
id="offer-description"
|
|
23
|
+
v-model="form.description"
|
|
24
|
+
rows="3"
|
|
25
|
+
:placeholder="t('bt.joatu.offers.description_placeholder')"
|
|
26
|
+
/>
|
|
27
|
+
</BFormGroup>
|
|
28
|
+
<BFormGroup
|
|
29
|
+
:label="t('bt.joatu.offers.category_label')"
|
|
30
|
+
label-for="offer-category"
|
|
31
|
+
>
|
|
32
|
+
<BFormInput
|
|
33
|
+
id="offer-category"
|
|
34
|
+
v-model="form.category"
|
|
35
|
+
:placeholder="t('bt.joatu.offers.category_placeholder')"
|
|
36
|
+
/>
|
|
37
|
+
</BFormGroup>
|
|
38
|
+
<BFormGroup
|
|
39
|
+
:label="t('bt.joatu.offers.credits_label')"
|
|
40
|
+
label-for="offer-credits"
|
|
41
|
+
>
|
|
42
|
+
<BFormInput
|
|
43
|
+
id="offer-credits"
|
|
44
|
+
v-model.number="form.time_credits"
|
|
45
|
+
type="number"
|
|
46
|
+
min="1"
|
|
47
|
+
max="100"
|
|
48
|
+
/>
|
|
49
|
+
<template #description>
|
|
50
|
+
{{ t('bt.joatu.offers.credits_hint') }}
|
|
51
|
+
</template>
|
|
52
|
+
</BFormGroup>
|
|
53
|
+
<div class="d-flex justify-content-end gap-2 mt-3">
|
|
54
|
+
<BButton
|
|
55
|
+
type="button"
|
|
56
|
+
variant="outline-secondary"
|
|
57
|
+
@click="$emit('cancel')"
|
|
58
|
+
>
|
|
59
|
+
{{ t('bt.actions.cancel') }}
|
|
60
|
+
</BButton>
|
|
61
|
+
<BButton
|
|
62
|
+
type="submit"
|
|
63
|
+
variant="success"
|
|
64
|
+
>
|
|
65
|
+
{{ t('bt.joatu.offers.submit') }}
|
|
66
|
+
</BButton>
|
|
67
|
+
</div>
|
|
68
|
+
</BForm>
|
|
69
|
+
</template>
|
|
70
|
+
<script setup>
|
|
71
|
+
import { reactive } from 'vue'
|
|
72
|
+
import { useI18n } from 'vue-i18n'
|
|
73
|
+
import { BForm, BFormGroup, BFormInput, BFormTextarea, BButton } from 'bootstrap-vue-next'
|
|
74
|
+
const { t } = useI18n()
|
|
75
|
+
const emit = defineEmits(['submit', 'cancel'])
|
|
76
|
+
const form = reactive({ title: '', description: '', category: '', time_credits: 1 })
|
|
77
|
+
function handleSubmit() {
|
|
78
|
+
if (!form.title) return
|
|
79
|
+
emit('submit', { ...form })
|
|
80
|
+
Object.assign(form, { title: '', description: '', category: '', time_credits: 1 })
|
|
81
|
+
}
|
|
82
|
+
</script>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="bt-offer-list">
|
|
3
|
+
<slot name="header" />
|
|
4
|
+
<div
|
|
5
|
+
v-if="loading"
|
|
6
|
+
class="bt-offer-list__loading"
|
|
7
|
+
>
|
|
8
|
+
<slot name="loading">
|
|
9
|
+
<div class="text-center p-4 text-muted">
|
|
10
|
+
{{ t('bt.joatu.offers.loading') }}
|
|
11
|
+
</div>
|
|
12
|
+
</slot>
|
|
13
|
+
</div>
|
|
14
|
+
<div
|
|
15
|
+
v-else-if="!offers.length"
|
|
16
|
+
class="bt-offer-list__empty"
|
|
17
|
+
>
|
|
18
|
+
<slot name="empty">
|
|
19
|
+
<div class="text-center p-4 text-muted">
|
|
20
|
+
{{ t('bt.joatu.offers.list_empty') }}
|
|
21
|
+
</div>
|
|
22
|
+
</slot>
|
|
23
|
+
</div>
|
|
24
|
+
<template v-else>
|
|
25
|
+
<slot
|
|
26
|
+
v-for="(offer, index) in offers"
|
|
27
|
+
:key="offer.id"
|
|
28
|
+
name="item"
|
|
29
|
+
:item="offer"
|
|
30
|
+
:index="index"
|
|
31
|
+
>
|
|
32
|
+
<OfferCard
|
|
33
|
+
:offer="offer"
|
|
34
|
+
class="mb-3"
|
|
35
|
+
@view="$emit('view', offer)"
|
|
36
|
+
/>
|
|
37
|
+
</slot>
|
|
38
|
+
</template>
|
|
39
|
+
<slot name="footer" />
|
|
40
|
+
</div>
|
|
41
|
+
</template>
|
|
42
|
+
<script setup>
|
|
43
|
+
import { useI18n } from 'vue-i18n'
|
|
44
|
+
import OfferCard from './OfferCard.vue'
|
|
45
|
+
const { t } = useI18n()
|
|
46
|
+
defineProps({
|
|
47
|
+
offers: { type: Array, default: () => [] },
|
|
48
|
+
loading: { type: Boolean, default: false },
|
|
49
|
+
})
|
|
50
|
+
defineEmits(['view'])
|
|
51
|
+
</script>
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<BCard class="bt-request-card">
|
|
3
|
+
<BCardBody>
|
|
4
|
+
<slot name="title">
|
|
5
|
+
<div class="d-flex align-items-start justify-content-between gap-2 mb-1">
|
|
6
|
+
<h5 class="bt-request-card__title mb-0">
|
|
7
|
+
<span class="text-muted me-1">{{ t('bt.joatu.requests.seeking') }}</span>{{ request.title }}
|
|
8
|
+
</h5>
|
|
9
|
+
<slot name="sync-badge">
|
|
10
|
+
<SyncBadge :item="request" />
|
|
11
|
+
</slot>
|
|
12
|
+
</div>
|
|
13
|
+
</slot>
|
|
14
|
+
<slot name="meta">
|
|
15
|
+
<div class="d-flex align-items-center gap-2 mb-2">
|
|
16
|
+
<BBadge :variant="statusVariant">
|
|
17
|
+
{{ request.status }}
|
|
18
|
+
</BBadge>
|
|
19
|
+
<span class="bt-request-card__credits">
|
|
20
|
+
{{ t('bt.joatu.offers.credits_display', request.time_credits) }}
|
|
21
|
+
</span>
|
|
22
|
+
<BBadge
|
|
23
|
+
v-if="request.category"
|
|
24
|
+
variant="outline-secondary"
|
|
25
|
+
>
|
|
26
|
+
{{ request.category }}
|
|
27
|
+
</BBadge>
|
|
28
|
+
</div>
|
|
29
|
+
</slot>
|
|
30
|
+
<slot name="body">
|
|
31
|
+
<BCardText>{{ truncatedDescription }}</BCardText>
|
|
32
|
+
</slot>
|
|
33
|
+
</BCardBody>
|
|
34
|
+
<template #footer>
|
|
35
|
+
<slot name="footer">
|
|
36
|
+
<div class="d-flex align-items-center gap-2">
|
|
37
|
+
<BButton
|
|
38
|
+
variant="outline-warning"
|
|
39
|
+
size="sm"
|
|
40
|
+
@click="$emit('view', request)"
|
|
41
|
+
>
|
|
42
|
+
{{ t('bt.joatu.requests.fulfill') }}
|
|
43
|
+
</BButton>
|
|
44
|
+
<ExtensionSlot
|
|
45
|
+
slot="footer"
|
|
46
|
+
target="RequestCard"
|
|
47
|
+
:context="{ item: request }"
|
|
48
|
+
/>
|
|
49
|
+
</div>
|
|
50
|
+
</slot>
|
|
51
|
+
</template>
|
|
52
|
+
</BCard>
|
|
53
|
+
</template>
|
|
54
|
+
<script setup>
|
|
55
|
+
import { computed } from 'vue'
|
|
56
|
+
import { useI18n } from 'vue-i18n'
|
|
57
|
+
import { BCard, BCardBody, BCardText, BBadge, BButton } from 'bootstrap-vue-next'
|
|
58
|
+
import SyncBadge from '../sync/SyncBadge.vue'
|
|
59
|
+
import ExtensionSlot from '../shared/ExtensionSlot.vue'
|
|
60
|
+
const { t } = useI18n()
|
|
61
|
+
const props = defineProps({ request: { type: Object, required: true } })
|
|
62
|
+
defineEmits(['view'])
|
|
63
|
+
const truncatedDescription = computed(() => { const d = props.request.description || ''; return d.length > 150 ? d.slice(0, 150) + '…' : d })
|
|
64
|
+
const statusVariant = computed(() => ({ open: 'success', fulfilled: 'info', withdrawn: 'secondary' }[props.request.status] ?? 'secondary'))
|
|
65
|
+
</script>
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<BForm
|
|
3
|
+
class="bt-request-form"
|
|
4
|
+
@submit.prevent="handleSubmit"
|
|
5
|
+
>
|
|
6
|
+
<BFormGroup
|
|
7
|
+
:label="t('bt.joatu.requests.title_label')"
|
|
8
|
+
label-for="request-title"
|
|
9
|
+
>
|
|
10
|
+
<BFormInput
|
|
11
|
+
id="request-title"
|
|
12
|
+
v-model="form.title"
|
|
13
|
+
required
|
|
14
|
+
:placeholder="t('bt.joatu.requests.title_placeholder')"
|
|
15
|
+
/>
|
|
16
|
+
</BFormGroup>
|
|
17
|
+
<BFormGroup
|
|
18
|
+
:label="t('bt.joatu.requests.description_label')"
|
|
19
|
+
label-for="request-description"
|
|
20
|
+
>
|
|
21
|
+
<BFormTextarea
|
|
22
|
+
id="request-description"
|
|
23
|
+
v-model="form.description"
|
|
24
|
+
rows="3"
|
|
25
|
+
:placeholder="t('bt.joatu.requests.description_placeholder')"
|
|
26
|
+
/>
|
|
27
|
+
</BFormGroup>
|
|
28
|
+
<BFormGroup
|
|
29
|
+
:label="t('bt.joatu.requests.category_label')"
|
|
30
|
+
label-for="request-category"
|
|
31
|
+
>
|
|
32
|
+
<BFormInput
|
|
33
|
+
id="request-category"
|
|
34
|
+
v-model="form.category"
|
|
35
|
+
:placeholder="t('bt.joatu.offers.category_placeholder')"
|
|
36
|
+
/>
|
|
37
|
+
</BFormGroup>
|
|
38
|
+
<BFormGroup
|
|
39
|
+
:label="t('bt.joatu.requests.credits_label')"
|
|
40
|
+
label-for="request-credits"
|
|
41
|
+
>
|
|
42
|
+
<BFormInput
|
|
43
|
+
id="request-credits"
|
|
44
|
+
v-model.number="form.time_credits"
|
|
45
|
+
type="number"
|
|
46
|
+
min="1"
|
|
47
|
+
max="100"
|
|
48
|
+
/>
|
|
49
|
+
<template #description>
|
|
50
|
+
{{ t('bt.joatu.requests.credits_hint') }}
|
|
51
|
+
</template>
|
|
52
|
+
</BFormGroup>
|
|
53
|
+
<div class="d-flex justify-content-end gap-2 mt-3">
|
|
54
|
+
<BButton
|
|
55
|
+
type="button"
|
|
56
|
+
variant="outline-secondary"
|
|
57
|
+
@click="$emit('cancel')"
|
|
58
|
+
>
|
|
59
|
+
{{ t('bt.actions.cancel') }}
|
|
60
|
+
</BButton>
|
|
61
|
+
<BButton
|
|
62
|
+
type="submit"
|
|
63
|
+
variant="warning"
|
|
64
|
+
>
|
|
65
|
+
{{ t('bt.joatu.requests.submit') }}
|
|
66
|
+
</BButton>
|
|
67
|
+
</div>
|
|
68
|
+
</BForm>
|
|
69
|
+
</template>
|
|
70
|
+
<script setup>
|
|
71
|
+
import { reactive } from 'vue'
|
|
72
|
+
import { useI18n } from 'vue-i18n'
|
|
73
|
+
import { BForm, BFormGroup, BFormInput, BFormTextarea, BButton } from 'bootstrap-vue-next'
|
|
74
|
+
const { t } = useI18n()
|
|
75
|
+
const emit = defineEmits(['submit', 'cancel'])
|
|
76
|
+
const form = reactive({ title: '', description: '', category: '', time_credits: 1 })
|
|
77
|
+
function handleSubmit() {
|
|
78
|
+
if (!form.title) return
|
|
79
|
+
emit('submit', { ...form })
|
|
80
|
+
Object.assign(form, { title: '', description: '', category: '', time_credits: 1 })
|
|
81
|
+
}
|
|
82
|
+
</script>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="bt-request-list">
|
|
3
|
+
<slot name="header" />
|
|
4
|
+
<div
|
|
5
|
+
v-if="loading"
|
|
6
|
+
class="bt-request-list__loading"
|
|
7
|
+
>
|
|
8
|
+
<slot name="loading">
|
|
9
|
+
<div class="text-center p-4 text-muted">
|
|
10
|
+
{{ t('bt.joatu.requests.loading') }}
|
|
11
|
+
</div>
|
|
12
|
+
</slot>
|
|
13
|
+
</div>
|
|
14
|
+
<div
|
|
15
|
+
v-else-if="!requests.length"
|
|
16
|
+
class="bt-request-list__empty"
|
|
17
|
+
>
|
|
18
|
+
<slot name="empty">
|
|
19
|
+
<div class="text-center p-4 text-muted">
|
|
20
|
+
{{ t('bt.joatu.requests.list_empty') }}
|
|
21
|
+
</div>
|
|
22
|
+
</slot>
|
|
23
|
+
</div>
|
|
24
|
+
<template v-else>
|
|
25
|
+
<slot
|
|
26
|
+
v-for="(request, index) in requests"
|
|
27
|
+
:key="request.id"
|
|
28
|
+
name="item"
|
|
29
|
+
:item="request"
|
|
30
|
+
:index="index"
|
|
31
|
+
>
|
|
32
|
+
<RequestCard
|
|
33
|
+
:request="request"
|
|
34
|
+
class="mb-3"
|
|
35
|
+
@view="$emit('view', request)"
|
|
36
|
+
/>
|
|
37
|
+
</slot>
|
|
38
|
+
</template>
|
|
39
|
+
<slot name="footer" />
|
|
40
|
+
</div>
|
|
41
|
+
</template>
|
|
42
|
+
<script setup>
|
|
43
|
+
import { useI18n } from 'vue-i18n'
|
|
44
|
+
import RequestCard from './RequestCard.vue'
|
|
45
|
+
const { t } = useI18n()
|
|
46
|
+
defineProps({
|
|
47
|
+
requests: { type: Array, default: () => [] },
|
|
48
|
+
loading: { type: Boolean, default: false },
|
|
49
|
+
})
|
|
50
|
+
defineEmits(['view'])
|
|
51
|
+
</script>
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<BCard class="bt-page-card">
|
|
3
|
+
<BCardBody>
|
|
4
|
+
<slot name="title">
|
|
5
|
+
<div class="d-flex align-items-start justify-content-between gap-2 mb-1">
|
|
6
|
+
<h5 class="bt-page-card__title mb-0">
|
|
7
|
+
{{ page.title }}
|
|
8
|
+
</h5>
|
|
9
|
+
<slot name="sync-badge">
|
|
10
|
+
<SyncBadge :item="page" />
|
|
11
|
+
</slot>
|
|
12
|
+
</div>
|
|
13
|
+
</slot>
|
|
14
|
+
<slot name="meta">
|
|
15
|
+
<small
|
|
16
|
+
v-if="page.published_at"
|
|
17
|
+
class="text-muted"
|
|
18
|
+
>{{ formattedDate }}</small>
|
|
19
|
+
</slot>
|
|
20
|
+
<slot name="body">
|
|
21
|
+
<BCardText>{{ excerpt }}</BCardText>
|
|
22
|
+
</slot>
|
|
23
|
+
</BCardBody>
|
|
24
|
+
<template #footer>
|
|
25
|
+
<slot name="footer">
|
|
26
|
+
<div class="d-flex align-items-center gap-2">
|
|
27
|
+
<BButton
|
|
28
|
+
variant="outline-primary"
|
|
29
|
+
size="sm"
|
|
30
|
+
@click="$emit('view', page)"
|
|
31
|
+
>
|
|
32
|
+
{{ t('bt.pages.read') }}
|
|
33
|
+
</BButton>
|
|
34
|
+
<ExtensionSlot
|
|
35
|
+
slot="footer"
|
|
36
|
+
target="PageCard"
|
|
37
|
+
:context="{ item: page }"
|
|
38
|
+
/>
|
|
39
|
+
</div>
|
|
40
|
+
</slot>
|
|
41
|
+
</template>
|
|
42
|
+
</BCard>
|
|
43
|
+
</template>
|
|
44
|
+
<script setup>
|
|
45
|
+
import { computed } from 'vue'
|
|
46
|
+
import { useI18n } from 'vue-i18n'
|
|
47
|
+
import { BCard, BCardBody, BCardText, BButton } from 'bootstrap-vue-next'
|
|
48
|
+
import SyncBadge from '../sync/SyncBadge.vue'
|
|
49
|
+
import ExtensionSlot from '../shared/ExtensionSlot.vue'
|
|
50
|
+
const { t } = useI18n()
|
|
51
|
+
const props = defineProps({ page: { type: Object, required: true } })
|
|
52
|
+
defineEmits(['view'])
|
|
53
|
+
const excerpt = computed(() => { const c = props.page.content || ''; return c.length > 200 ? c.slice(0, 200) + '…' : c })
|
|
54
|
+
const formattedDate = computed(() => new Date(props.page.published_at).toLocaleDateString(undefined, { year: 'numeric', month: 'short', day: 'numeric' }))
|
|
55
|
+
</script>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<article class="bt-page-detail">
|
|
3
|
+
<header class="bt-page-detail__header mb-4">
|
|
4
|
+
<h1 class="bt-page-detail__title">
|
|
5
|
+
{{ page.title }}
|
|
6
|
+
</h1>
|
|
7
|
+
<div class="d-flex align-items-center gap-2">
|
|
8
|
+
<small
|
|
9
|
+
v-if="page.published_at"
|
|
10
|
+
class="text-muted"
|
|
11
|
+
>{{ formattedDate }}</small>
|
|
12
|
+
<SyncBadge :item="page" />
|
|
13
|
+
</div>
|
|
14
|
+
</header>
|
|
15
|
+
<!-- eslint-disable-next-line vue/no-v-html -->
|
|
16
|
+
<div
|
|
17
|
+
class="bt-page-detail__content"
|
|
18
|
+
v-html="page.content"
|
|
19
|
+
/>
|
|
20
|
+
</article>
|
|
21
|
+
</template>
|
|
22
|
+
<script setup>
|
|
23
|
+
import { computed } from 'vue'
|
|
24
|
+
import SyncBadge from '../sync/SyncBadge.vue'
|
|
25
|
+
const props = defineProps({ page: { type: Object, required: true } })
|
|
26
|
+
const formattedDate = computed(() => {
|
|
27
|
+
if (!props.page.published_at) return ''
|
|
28
|
+
return new Date(props.page.published_at).toLocaleDateString(undefined, { year: 'numeric', month: 'short', day: 'numeric' })
|
|
29
|
+
})
|
|
30
|
+
</script>
|
|
31
|
+
<style scoped lang="scss">
|
|
32
|
+
.bt-page-detail__content { line-height: 1.7; }
|
|
33
|
+
.bt-page-detail__content :deep(img) { max-width: 100%; height: auto; }
|
|
34
|
+
.bt-page-detail__content :deep(h2) { margin-top: 2rem; }
|
|
35
|
+
</style>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="bt-page-list">
|
|
3
|
+
<slot name="header" />
|
|
4
|
+
<div
|
|
5
|
+
v-if="loading"
|
|
6
|
+
class="bt-page-list__loading"
|
|
7
|
+
>
|
|
8
|
+
<slot name="loading">
|
|
9
|
+
<div class="text-center p-4 text-muted">
|
|
10
|
+
{{ t('bt.pages.loading') }}
|
|
11
|
+
</div>
|
|
12
|
+
</slot>
|
|
13
|
+
</div>
|
|
14
|
+
<div
|
|
15
|
+
v-else-if="!pages.length"
|
|
16
|
+
class="bt-page-list__empty"
|
|
17
|
+
>
|
|
18
|
+
<slot name="empty">
|
|
19
|
+
<div class="text-center p-4 text-muted">
|
|
20
|
+
{{ t('bt.pages.list_empty') }}
|
|
21
|
+
</div>
|
|
22
|
+
</slot>
|
|
23
|
+
</div>
|
|
24
|
+
<template v-else>
|
|
25
|
+
<slot
|
|
26
|
+
v-for="(page, index) in pages"
|
|
27
|
+
:key="page.id"
|
|
28
|
+
name="item"
|
|
29
|
+
:item="page"
|
|
30
|
+
:index="index"
|
|
31
|
+
>
|
|
32
|
+
<PageCard
|
|
33
|
+
:page="page"
|
|
34
|
+
class="mb-3"
|
|
35
|
+
@view="$emit('view', page)"
|
|
36
|
+
/>
|
|
37
|
+
</slot>
|
|
38
|
+
</template>
|
|
39
|
+
<slot name="footer" />
|
|
40
|
+
</div>
|
|
41
|
+
</template>
|
|
42
|
+
<script setup>
|
|
43
|
+
import { useI18n } from 'vue-i18n'
|
|
44
|
+
import PageCard from './PageCard.vue'
|
|
45
|
+
const { t } = useI18n()
|
|
46
|
+
defineProps({
|
|
47
|
+
pages: { type: Array, default: () => [] },
|
|
48
|
+
loading: { type: Boolean, default: false },
|
|
49
|
+
})
|
|
50
|
+
defineEmits(['view'])
|
|
51
|
+
</script>
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="bt-member-list">
|
|
3
|
+
<slot name="header" />
|
|
4
|
+
<div v-if="loading">
|
|
5
|
+
<slot name="loading">
|
|
6
|
+
<BSpinner :label="t('bt.person.loading')" />
|
|
7
|
+
</slot>
|
|
8
|
+
</div>
|
|
9
|
+
<div v-else-if="!members.length">
|
|
10
|
+
<slot name="empty">
|
|
11
|
+
<p class="text-muted">
|
|
12
|
+
{{ t('bt.person.members_empty') }}
|
|
13
|
+
</p>
|
|
14
|
+
</slot>
|
|
15
|
+
</div>
|
|
16
|
+
<div
|
|
17
|
+
v-else
|
|
18
|
+
class="bt-member-list__items"
|
|
19
|
+
>
|
|
20
|
+
<div
|
|
21
|
+
v-for="(member, index) in members"
|
|
22
|
+
:key="member.id"
|
|
23
|
+
class="bt-member-list__item"
|
|
24
|
+
>
|
|
25
|
+
<slot
|
|
26
|
+
name="item"
|
|
27
|
+
:item="member"
|
|
28
|
+
:index="index"
|
|
29
|
+
>
|
|
30
|
+
<div class="d-flex align-items-center gap-2">
|
|
31
|
+
<PersonAvatar
|
|
32
|
+
:person="{ id: member.person_id, name: '' }"
|
|
33
|
+
:size="32"
|
|
34
|
+
/>
|
|
35
|
+
<span>{{ member.person_id }}</span>
|
|
36
|
+
<BBadge
|
|
37
|
+
v-if="member.role"
|
|
38
|
+
variant="secondary"
|
|
39
|
+
>
|
|
40
|
+
{{ member.role }}
|
|
41
|
+
</BBadge>
|
|
42
|
+
</div>
|
|
43
|
+
</slot>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
<slot name="footer" />
|
|
47
|
+
</div>
|
|
48
|
+
</template>
|
|
49
|
+
|
|
50
|
+
<script setup>
|
|
51
|
+
import { useI18n } from 'vue-i18n'
|
|
52
|
+
import { BBadge, BSpinner } from 'bootstrap-vue-next'
|
|
53
|
+
import PersonAvatar from './PersonAvatar.vue'
|
|
54
|
+
|
|
55
|
+
const { t } = useI18n()
|
|
56
|
+
|
|
57
|
+
defineProps({
|
|
58
|
+
members: { type: Array, default: () => [] },
|
|
59
|
+
loading: { type: Boolean, default: false },
|
|
60
|
+
})
|
|
61
|
+
</script>
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="bt-person-avatar"
|
|
4
|
+
:style="avatarStyle"
|
|
5
|
+
:title="person.name"
|
|
6
|
+
>
|
|
7
|
+
<img
|
|
8
|
+
v-if="person.profile_image_url"
|
|
9
|
+
:src="person.profile_image_url"
|
|
10
|
+
:alt="person.name"
|
|
11
|
+
class="bt-person-avatar__img"
|
|
12
|
+
>
|
|
13
|
+
<span
|
|
14
|
+
v-else
|
|
15
|
+
class="bt-person-avatar__initials"
|
|
16
|
+
>{{ initials }}</span>
|
|
17
|
+
</div>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<script setup>
|
|
21
|
+
import { computed } from 'vue'
|
|
22
|
+
|
|
23
|
+
const props = defineProps({
|
|
24
|
+
person: { type: Object, required: true },
|
|
25
|
+
size: { type: Number, default: 40 },
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
const initials = computed(() => {
|
|
29
|
+
const parts = (props.person.name || props.person.handle || '?').split(' ')
|
|
30
|
+
return parts.slice(0, 2).map((p) => p[0]?.toUpperCase() ?? '').join('')
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
const avatarStyle = computed(() => ({
|
|
34
|
+
width: `${props.size}px`,
|
|
35
|
+
height: `${props.size}px`,
|
|
36
|
+
fontSize: `${props.size * 0.4}px`,
|
|
37
|
+
}))
|
|
38
|
+
</script>
|
|
39
|
+
|
|
40
|
+
<style scoped lang="scss">
|
|
41
|
+
.bt-person-avatar {
|
|
42
|
+
border-radius: 50%;
|
|
43
|
+
background-color: var(--bt-primary, #4f46e5);
|
|
44
|
+
color: white;
|
|
45
|
+
display: inline-flex;
|
|
46
|
+
align-items: center;
|
|
47
|
+
justify-content: center;
|
|
48
|
+
overflow: hidden;
|
|
49
|
+
flex-shrink: 0;
|
|
50
|
+
|
|
51
|
+
&__img { width: 100%; height: 100%; object-fit: cover; }
|
|
52
|
+
&__initials { font-weight: 600; line-height: 1; }
|
|
53
|
+
}
|
|
54
|
+
</style>
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<BCard class="bt-person-card">
|
|
3
|
+
<BCardBody class="d-flex align-items-start gap-3">
|
|
4
|
+
<slot name="avatar">
|
|
5
|
+
<PersonAvatar
|
|
6
|
+
:person="person"
|
|
7
|
+
:size="48"
|
|
8
|
+
/>
|
|
9
|
+
</slot>
|
|
10
|
+
<div class="flex-grow-1">
|
|
11
|
+
<slot name="title">
|
|
12
|
+
<div class="d-flex align-items-center gap-2">
|
|
13
|
+
<strong class="bt-person-card__name">{{ person.name }}</strong>
|
|
14
|
+
<slot name="sync-badge">
|
|
15
|
+
<SyncBadge :item="person" />
|
|
16
|
+
</slot>
|
|
17
|
+
</div>
|
|
18
|
+
</slot>
|
|
19
|
+
<slot name="meta">
|
|
20
|
+
<!-- eslint-disable-next-line @intlify/vue-i18n/no-raw-text -->
|
|
21
|
+
<small class="text-muted">@{{ person.handle || person.slug }}</small>
|
|
22
|
+
</slot>
|
|
23
|
+
<slot name="body" />
|
|
24
|
+
</div>
|
|
25
|
+
</BCardBody>
|
|
26
|
+
<template #footer>
|
|
27
|
+
<slot name="footer">
|
|
28
|
+
<ExtensionSlot
|
|
29
|
+
slot="footer"
|
|
30
|
+
target="PersonCard"
|
|
31
|
+
:context="{ item: person }"
|
|
32
|
+
/>
|
|
33
|
+
</slot>
|
|
34
|
+
</template>
|
|
35
|
+
</BCard>
|
|
36
|
+
</template>
|
|
37
|
+
|
|
38
|
+
<script setup>
|
|
39
|
+
import { BCard, BCardBody } from 'bootstrap-vue-next'
|
|
40
|
+
import PersonAvatar from './PersonAvatar.vue'
|
|
41
|
+
import SyncBadge from '../sync/SyncBadge.vue'
|
|
42
|
+
import ExtensionSlot from '../shared/ExtensionSlot.vue'
|
|
43
|
+
|
|
44
|
+
defineProps({
|
|
45
|
+
person: { type: Object, required: true },
|
|
46
|
+
})
|
|
47
|
+
</script>
|