Skip to content

Commit 7b217f8

Browse files
committed
1 parent 0233d9c commit 7b217f8

File tree

2 files changed

+110
-8
lines changed

2 files changed

+110
-8
lines changed

src/pages/OtherOrganizations.vue

Lines changed: 109 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,31 @@
1414
</div>
1515
</div>
1616

17-
<base-input
18-
v-model="organizations.search"
19-
data-testid="testOrganizationsSearchTextInput"
20-
icon="search"
21-
class="sm:w-84 my-2"
22-
:placeholder="$t('actions.search')"
23-
@update:modelValue="onSearchInput"
24-
></base-input>
17+
<div class="flex">
18+
<base-input
19+
v-model="organizations.search"
20+
data-testid="testOrganizationsSearchTextInput"
21+
icon="search"
22+
class="sm:w-84 my-2"
23+
:placeholder="$t('actions.search')"
24+
@update:modelValue="onSearchInput"
25+
></base-input>
26+
27+
<base-button
28+
v-if="table"
29+
:action="table.exportTableCSV"
30+
type="primary"
31+
:text="$t('actions.download')"
32+
:alt="$t('actions.download')"
33+
class="table-action-button my-2 ml-2 p-2"
34+
ccu-icon="download"
35+
icon-size="small"
36+
/>
37+
</div>
2538

2639
<Table
2740
:columns="columns"
41+
ref="table"
2842
:data="organizations.data"
2943
:body-style="{ height: '300px' }"
3044
data-testid="testOrganizationsDataTable"
@@ -95,6 +109,67 @@
95109
</div>
96110
</div>
97111
</template>
112+
<template #url="slotProps">
113+
<base-button
114+
class="text-primary-dark underline sm:ml-0 ml-1"
115+
:icon-classes="$mq === 'sm' ? 'fa-2x' : 'fa-lg'"
116+
icon="globe"
117+
:style="slotProps.item.url === '' ? 'opacity: .5' : ''"
118+
:action="
119+
() => {
120+
if (slotProps.item.url != '') {
121+
open(slotProps.item.url, `_blank`);
122+
}
123+
}
124+
"
125+
/>
126+
<a
127+
v-if="$mq === 'sm'"
128+
class="text-primary-dark underline ml-2"
129+
:href="slotProps.item.url"
130+
>{{ slotProps.item.url }}</a
131+
>
132+
</template>
133+
<template #facebook="slotProps">
134+
<img
135+
src="@/assets/facebook.svg"
136+
class="sm:ml-1 sm:w-16 w-12"
137+
:style="slotProps.item.facebook === '' ? 'opacity: .5' : ''"
138+
alt="facebook"
139+
@click="
140+
() => {
141+
if (slotProps.item.facebook != '')
142+
open(slotProps.item.facebook, `_blank`);
143+
}
144+
"
145+
/>
146+
<a
147+
v-if="$mq === 'sm'"
148+
class="text-primary-dark underline ml-1"
149+
:href="slotProps.item.facebook"
150+
>{{ slotProps.item.facebook }}</a
151+
>
152+
</template>
153+
<template #twitter="slotProps">
154+
<img
155+
src="@/assets/twitter.svg"
156+
class="sm:w-6 w-10 sm:ml-0 ml-1"
157+
:style="slotProps.item.twitter === '' ? 'opacity: .5' : ''"
158+
alt="twitter"
159+
@click="
160+
() => {
161+
if (slotProps.item.twitter != '')
162+
open(slotProps.item.twitter, `_blank`);
163+
}
164+
"
165+
/>
166+
<a
167+
v-if="$mq === 'sm'"
168+
class="text-primary-dark underline ml-2"
169+
:href="slotProps.item.twitter"
170+
>{{ slotProps.item.twitter }}</a
171+
>
172+
</template>
98173
<template #approved_roles="slotProps">
99174
<v-popover popper-class="w-80">
100175
<base-text
@@ -185,6 +260,7 @@ export default defineComponent({
185260
const { t, locale } = useI18n();
186261
187262
const loading = ref(false);
263+
const table = ref(null);
188264
const organizations = reactive({
189265
data: [] as Organization[],
190266
meta: {
@@ -211,6 +287,27 @@ export default defineComponent({
211287
sortable: true,
212288
width: isLandscape() ? '2fr' : '350px',
213289
},
290+
{
291+
// TODO: change title to show url within the $t()
292+
title: t('Links'),
293+
dataIndex: 'url',
294+
key: 'url',
295+
width: '30px',
296+
},
297+
{
298+
// TODO: change title to show url within the $t()
299+
title: '',
300+
dataIndex: 'facebook',
301+
key: 'facebook',
302+
width: '50px',
303+
},
304+
{
305+
// TODO: change title to show url within the $t()
306+
title: '',
307+
dataIndex: 'twitter',
308+
key: 'twitter',
309+
width: '50px',
310+
},
214311
{
215312
title: t('otherOrganizations.access_level'),
216313
dataIndex: 'approved_roles',
@@ -412,6 +509,10 @@ export default defineComponent({
412509
getHighestRole,
413510
onSearchInput,
414511
handleOtherOrgTableChange,
512+
table,
513+
open: (location, target) => {
514+
window.open(location, target);
515+
},
415516
};
416517
},
417518
});

src/pages/unauthenticated/BlogPost.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export default defineComponent({
2828
onMounted(async () => {
2929
await fetchPost();
3030
await getUser();
31+
document.title = post.value?.title || document.title;
3132
});
3233
3334
return {

0 commit comments

Comments
 (0)