From abed0b7513724c36cf4678f9cae917e3f133be30 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Mon, 15 Mar 2021 19:19:58 +0100 Subject: [PATCH] Ready to implement about page --- assets/css/pages/groups/pages/about.css | 5 +++ assets/js/pages/groups/main.js | 22 +++---------- assets/js/pages/groups/pages/about.js | 32 +++++++++++++++++++ assets/js/pages/groups/pages/members.js | 8 ++--- assets/js/pages/groups/sections/header.js | 11 +++++++ .../templates/pages/groups/pages/about.html | 11 +++++++ system/config/dev.config.php | 2 ++ 7 files changed, 70 insertions(+), 21 deletions(-) create mode 100644 assets/css/pages/groups/pages/about.css create mode 100644 assets/js/pages/groups/pages/about.js create mode 100644 assets/templates/pages/groups/pages/about.html 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 @@ + +
+
+
+
+

tr("About") {{group.name}}

+
+
+
+
+
\ No newline at end of file diff --git a/system/config/dev.config.php b/system/config/dev.config.php index c6f61a77..c9ad467f 100644 --- a/system/config/dev.config.php +++ b/system/config/dev.config.php @@ -270,6 +270,7 @@ class Dev { "css/pages/groups/pages/settings.css", "css/pages/groups/pages/members.css", "css/pages/groups/pages/forbidden.css", + "css/pages/groups/pages/about.css", //Groups sections "css/pages/groups/sections/header.css", @@ -534,6 +535,7 @@ class Dev { "js/pages/groups/pages/settings.js", "js/pages/groups/pages/members.js", "js/pages/groups/pages/forbidden.js", + "js/pages/groups/pages/about.js", //Groups sections "js/pages/groups/sections/header.js",