2021-03-15 17:04:20 +00:00
|
|
|
/**
|
|
|
|
* Group tags
|
|
|
|
*
|
|
|
|
* @author Pierre Hubert
|
|
|
|
*/
|
|
|
|
|
|
|
|
const GroupTabs = {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {AdvancedGroupInfo} group Group information
|
|
|
|
* @param {HTMLElement} target Target
|
|
|
|
* @param {String} activePage Current active page
|
2021-04-05 13:49:21 +00:00
|
|
|
* @param {String} firstArg First argument passed after page (if any)
|
2021-03-15 17:04:20 +00:00
|
|
|
*/
|
2021-04-05 13:49:21 +00:00
|
|
|
show: async function(group, target, activePage, firstArgument) {
|
2021-03-15 17:04:20 +00:00
|
|
|
// Load template
|
|
|
|
const tpl = await Page.loadHTMLTemplate("pages/groups/sections/GroupTabs.html");
|
|
|
|
const el = document.createElement("div")
|
|
|
|
el.innerHTML = tpl;
|
|
|
|
target.appendChild(el);
|
|
|
|
|
|
|
|
Vue.createApp({
|
|
|
|
|
|
|
|
data: () => {
|
|
|
|
return {
|
|
|
|
isAdmin: group.membership == "administrator",
|
2021-03-17 17:40:11 +00:00
|
|
|
canSeeMembers: group.is_members_list_public || group.membership == "administrator" || group.membership == "moderator",
|
2021-04-05 13:49:21 +00:00
|
|
|
activePage: activePage,
|
|
|
|
firstArgument: firstArgument,
|
|
|
|
conversations: group.conversations,
|
2021-03-15 17:04:20 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
openPage: (uri) => openPage("groups/" + group.id + "/" + uri)
|
|
|
|
}
|
|
|
|
|
|
|
|
}).mount(el);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|