diff --git a/assets/css/pages/groups/pages/about.css b/assets/css/pages/groups/pages/about.css new file mode 100644 index 00000000..37a348a8 --- /dev/null +++ b/assets/css/pages/groups/pages/about.css @@ -0,0 +1,5 @@ +/** + * About group page + * + * @author Pierre Hubert + */ \ No newline at end of file diff --git a/assets/js/pages/groups/main.js b/assets/js/pages/groups/main.js index 3cf805fa..6dbc4c61 100644 --- a/assets/js/pages/groups/main.js +++ b/assets/js/pages/groups/main.js @@ -97,9 +97,13 @@ const GroupsPage = { return; case "members": - GroupMembersSection.display(group, target) + GroupMembersPage.display(group, target) return; + case "about": + await GroupAboutPage.display(group, target); + return; + case "settings": await GroupSettingsPage.display(group.id, target); return; @@ -116,22 +120,6 @@ const GroupsPage = { "danger" )) } - - - /*//Check which page to open - if(page == "group") - ComunicWeb.pages.groups.pages.group.open(groupID, target); - - else if(page == "settings") - ComunicWeb.pages.groups.pages.settings.open(groupID, target); - - else if(page == "members") - ComunicWeb.pages.groups.pages.members.open(groupID, target); - - - //Unrecognized page - else - ComunicWeb.common.error.pageNotFound(args, target);*/ } }; diff --git a/assets/js/pages/groups/pages/about.js b/assets/js/pages/groups/pages/about.js new file mode 100644 index 00000000..a9457008 --- /dev/null +++ b/assets/js/pages/groups/pages/about.js @@ -0,0 +1,32 @@ +/** + * Groups about page + * + * @author Pierre Huber + */ + +const GroupAboutPage = { + /** + * @param {AdvancedGroupInfo} group + * @param {HTMLElement} target + */ + display: async function(group, target) { + // Load template + const tpl = await Page.loadHTMLTemplate("pages/groups/pages/about.html"); + const el = document.createElement("div") + el.innerHTML = tpl; + target.appendChild(el); + + Vue.createApp({ + + data: () => { + return { + group: group + } + }, + + methods: { + } + + }).mount(el); + } +}; \ No newline at end of file diff --git a/assets/js/pages/groups/pages/members.js b/assets/js/pages/groups/pages/members.js index 95f0d12d..fe1e7d31 100644 --- a/assets/js/pages/groups/pages/members.js +++ b/assets/js/pages/groups/pages/members.js @@ -4,7 +4,7 @@ * @author Pierre HubERT */ -const GroupMembersSection = { +const GroupMembersPage = { /** * Apply group information @@ -43,8 +43,8 @@ const GroupMembersSection = { * Load the page components */ var loadComponents = () => { - GroupMembersSection.addInviteForm(info, inviteFormTarget, inviteFormCallback); - GroupMembersSection.refreshMembersList(info.id, info, membersList); + GroupMembersPage.addInviteForm(info, inviteFormTarget, inviteFormCallback); + GroupMembersPage.refreshMembersList(info.id, info, membersList); } /** @@ -474,4 +474,4 @@ const GroupMembersSection = { } } -ComunicWeb.pages.groups.pages.members = GroupMembersSection; \ No newline at end of file +ComunicWeb.pages.groups.pages.members = GroupMembersPage; \ No newline at end of file diff --git a/assets/js/pages/groups/sections/header.js b/assets/js/pages/groups/sections/header.js index c0b5c15d..7bba5471 100644 --- a/assets/js/pages/groups/sections/header.js +++ b/assets/js/pages/groups/sections/header.js @@ -97,6 +97,17 @@ const GroupSectionHeader = { if(signed_in() && ComunicWeb.components.groups.utils.isGroupMember(info)) ComunicWeb.pages.groups.sections.followBlock.display(info, thirdColumn); + ComunicWeb.components.like.button.display( + "group", + info.id, + info.number_likes, + info.is_liking, + createElem2({ + appendTo: thirdColumn, + type: "div" + }) + ); + }, }; diff --git a/assets/templates/pages/groups/pages/about.html b/assets/templates/pages/groups/pages/about.html new file mode 100644 index 00000000..2d6c8101 --- /dev/null +++ b/assets/templates/pages/groups/pages/about.html @@ -0,0 +1,11 @@ + +