Ready to implement about page

This commit is contained in:
Pierre HUBERT 2021-03-15 19:19:58 +01:00
parent c4aced5ed2
commit abed0b7513
7 changed files with 70 additions and 21 deletions

View File

@ -0,0 +1,5 @@
/**
* About group page
*
* @author Pierre Hubert
*/

View File

@ -97,9 +97,13 @@ const GroupsPage = {
return; return;
case "members": case "members":
GroupMembersSection.display(group, target) GroupMembersPage.display(group, target)
return; return;
case "about":
await GroupAboutPage.display(group, target);
return;
case "settings": case "settings":
await GroupSettingsPage.display(group.id, target); await GroupSettingsPage.display(group.id, target);
return; return;
@ -116,22 +120,6 @@ const GroupsPage = {
"danger" "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);*/
} }
}; };

View File

@ -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);
}
};

View File

@ -4,7 +4,7 @@
* @author Pierre HubERT * @author Pierre HubERT
*/ */
const GroupMembersSection = { const GroupMembersPage = {
/** /**
* Apply group information * Apply group information
@ -43,8 +43,8 @@ const GroupMembersSection = {
* Load the page components * Load the page components
*/ */
var loadComponents = () => { var loadComponents = () => {
GroupMembersSection.addInviteForm(info, inviteFormTarget, inviteFormCallback); GroupMembersPage.addInviteForm(info, inviteFormTarget, inviteFormCallback);
GroupMembersSection.refreshMembersList(info.id, info, membersList); GroupMembersPage.refreshMembersList(info.id, info, membersList);
} }
/** /**
@ -474,4 +474,4 @@ const GroupMembersSection = {
} }
} }
ComunicWeb.pages.groups.pages.members = GroupMembersSection; ComunicWeb.pages.groups.pages.members = GroupMembersPage;

View File

@ -97,6 +97,17 @@ const GroupSectionHeader = {
if(signed_in() && ComunicWeb.components.groups.utils.isGroupMember(info)) if(signed_in() && ComunicWeb.components.groups.utils.isGroupMember(info))
ComunicWeb.pages.groups.sections.followBlock.display(info, thirdColumn); 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"
})
);
}, },
}; };

View File

@ -0,0 +1,11 @@
<!-- Groups about page -->
<div class="row group-page about-page">
<div class="col-md-6">
<div class="box">
<div class="box-header">
<h3 class="box-title">tr("About") <i>{{group.name}}</i></h3>
</div>
<div class="box-body"></div>
</div>
</div>
</div>

View File

@ -270,6 +270,7 @@ class Dev {
"css/pages/groups/pages/settings.css", "css/pages/groups/pages/settings.css",
"css/pages/groups/pages/members.css", "css/pages/groups/pages/members.css",
"css/pages/groups/pages/forbidden.css", "css/pages/groups/pages/forbidden.css",
"css/pages/groups/pages/about.css",
//Groups sections //Groups sections
"css/pages/groups/sections/header.css", "css/pages/groups/sections/header.css",
@ -534,6 +535,7 @@ class Dev {
"js/pages/groups/pages/settings.js", "js/pages/groups/pages/settings.js",
"js/pages/groups/pages/members.js", "js/pages/groups/pages/members.js",
"js/pages/groups/pages/forbidden.js", "js/pages/groups/pages/forbidden.js",
"js/pages/groups/pages/about.js",
//Groups sections //Groups sections
"js/pages/groups/sections/header.js", "js/pages/groups/sections/header.js",