Skip to content

Commit

Permalink
feat: Add No Public Program Container - MEED-2804 - Meeds-io/MIPs#100 (
Browse files Browse the repository at this point in the history
…#1233)

This change will introduce a new Behavior container that will display
its content only when there is no public programs. Besides, this change
will move another Behavior Container from Gatein-portal.
  • Loading branch information
boubaker authored and exo-swf committed Nov 9, 2023
1 parent 80340c2 commit 4c364fc
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-->
<page-set xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<page-set
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.exoplatform.org/xml/ns/gatein_objects_1_10 http://www.exoplatform.org/xml/ns/gatein_objects_1_10"
xmlns="http://www.exoplatform.org/xml/ns/gatein_objects_1_10">

Expand Down Expand Up @@ -101,14 +102,33 @@
<show-application-state>false</show-application-state>
</portlet-application>
</container>
<container template="system:/groovy/portal/webui/container/UIOpenRegistrationContainer.gtmpl">
<container template="system:/groovy/webui/container/UIOpenRegistrationContainer.gtmpl">
<access-permissions>Everyone</access-permissions>
<container
id="gamificationWidgets"
template="system:/groovy/portal/webui/container/UIVRowContainer.gtmpl"
cssClass="mb-5"
profiles="gamification">
<access-permissions>Everyone</access-permissions>
<container template="system:/groovy/webui/container/UINoPublicProgramContainer.gtmpl">
<access-permissions>Everyone</access-permissions>
<container
id="CreateProgramButtonContainer"
template="system:/groovy/portal/webui/container/UIVColContainer.gtmpl"
cssClass="col-12"
profiles="gamification">
<access-permissions>*:/platform/rewarding</access-permissions>
<portlet-application>
<portlet>
<application-ref>gamification-portlets</application-ref>
<portlet-ref>CreateProgramButton</portlet-ref>
</portlet>
<title>Create Program Button</title>
<access-permissions>Everyone</access-permissions>
<show-info-bar>false</show-info-bar>
</portlet-application>
</container>
</container>
<container
id="TopChallengersContainer"
template="system:/groovy/portal/webui/container/UIVColContainer.gtmpl"
Expand Down Expand Up @@ -169,7 +189,7 @@
<access-permissions>Everyone</access-permissions>
<edit-permission>*:/platform/administrators</edit-permission>
<hide-shared-layout>true</hide-shared-layout>
<container template="system:/groovy/portal/webui/container/UIOpenRegistrationContainer.gtmpl">
<container template="system:/groovy/webui/container/UIOpenRegistrationContainer.gtmpl">
<access-permissions>Everyone</access-permissions>
<container template="system:/groovy/portal/webui/container/UIContainer.gtmpl">
<access-permissions>Everyone</access-permissions>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<%
import io.meeds.gamification.service.ProgramService;

if(_ctx.getRequestContext().getUIApplication().isEditing()
|| uicomponent.getApplicationComponent(ProgramService.class).countPublicPrograms() == 0) {
uicomponent.renderChildren();
}
%>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<%
import io.meeds.portal.security.service.SecuritySettingService;
import io.meeds.portal.security.constant.UserRegistrationType;

if(_ctx.getRequestContext().getUIApplication().isEditing()
|| UserRegistrationType.OPEN == uicomponent.getApplicationComponent(SecuritySettingService.class).getRegistrationType()) {
uicomponent.renderChildren();
}
%>

0 comments on commit 4c364fc

Please sign in to comment.