Skip to content

Commit

Permalink
feat: Implement news page template - EXO-65437 - Meeds-io/MIPs#68 (#890)
Browse files Browse the repository at this point in the history
  • Loading branch information
GouadriaHanen authored and exo-swf committed Jul 26, 2023
1 parent 6cc84ce commit 14d2a91
Show file tree
Hide file tree
Showing 6 changed files with 154 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -260,3 +260,6 @@ news.publishTargets.managementDrawer.sameNewsTargetWarning=A target with the sam

news.composer.alert.error.UpdateTargets=Error while updating news targets
news.composer.alert.success.UpdateTargets=News targets successfully updated

# For news page template
UIWizardPageSelectLayoutForm.label.newsPage.newsLayout=News
1 change: 1 addition & 0 deletions webapp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@
<include>newsDetails.less</include>
<include>newsExtensions.less</include>
<include>newsPublishTargetsManagement.less</include>
<include>newsPageTemplate.less</include>
</includes>
</configuration>
<goals>
Expand Down
36 changes: 36 additions & 0 deletions webapp/src/main/webapp/WEB-INF/conf/news/portal-configuration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,40 @@
</init-params>
</component-plugin>
</external-component-plugins>
<external-component-plugins>
<target-component>org.exoplatform.portal.page.PageTemplateService</target-component>
<component-plugin>
<name>newsPageConfigs</name>
<set-method>addPageTemplate</set-method>
<type>org.exoplatform.portal.page.PageTemplatePlugin</type>
<init-params>
<object-param>
<name>category</name>
<object type="org.exoplatform.webui.core.model.SelectItemCategory">
<field name="name">
<string>newsPageConfigs</string>
</field>
<field name="options">
<collection type="java.util.ArrayList" item-type="org.exoplatform.webui.core.model.SelectItemOption">
<value>
<object type="org.exoplatform.webui.core.model.SelectItemOption">
<field name="label">
<string>newsPage.newsLayout</string>
</field>
<field name="value">
<string>news</string>
</field>
<field name="icon">
<string>NewsLayout</string>
</field>
</object>
</value>
</collection>
</field>
</object>
</object-param>
</init-params>
</component-plugin>
</external-component-plugins>

</configuration>
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2023 eXo Platform SAS.
This is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
This software is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this software; if not, write to the Free
Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.exoplatform.org/xml/ns/gatein_objects_1_8 http://www.exoplatform.org/xml/ns/gatein_objects_1_8"
xmlns="http://www.exoplatform.org/xml/ns/gatein_objects_1_8">
<name></name>
<container id="newsPage"
template="system:/groovy/portal/webui/container/UIContainer.gtmpl"
cssClass="border-box-sizing">
<access-permissions>Everyone</access-permissions>
<container id="topNewsPage" template="system:/groovy/portal/webui/container/UIContainer.gtmpl">
<access-permissions>*:/platform/users</access-permissions>
</container>
<container id="newsBodyPage" template="system:/groovy/portal/webui/container/UIContainer.gtmpl">
<access-permissions>Everyone</access-permissions>
<container cssClass="newsBodyPageLeftColumn"
template="system:/groovy/portal/webui/container/UIContainer.gtmpl">
<access-permissions>*:/platform/users</access-permissions>
<portlet-application>
<portlet>
<application-ref>news</application-ref>
<portlet-ref>NewsListView</portlet-ref>
</portlet>
<access-permissions>Everyone</access-permissions>
<show-info-bar>false</show-info-bar>
</portlet-application>
<portlet-application>
<portlet>
<application-ref>news</application-ref>
<portlet-ref>NewsListView</portlet-ref>
</portlet>
<access-permissions>Everyone</access-permissions>
<show-info-bar>false</show-info-bar>
</portlet-application>
</container>
<container cssClass="newsBodyPageRightColumn"
template="system:/groovy/portal/webui/container/UIContainer.gtmpl">
<access-permissions>*:/platform/users</access-permissions>
<portlet-application>
<portlet>
<application-ref>news</application-ref>
<portlet-ref>NewsListView</portlet-ref>
</portlet>
<access-permissions>Everyone</access-permissions>
<show-info-bar>false</show-info-bar>
</portlet-application>
<portlet-application>
<portlet>
<application-ref>news</application-ref>
<portlet-ref>NewsListView</portlet-ref>
</portlet>
<access-permissions>Everyone</access-permissions>
<show-info-bar>false</show-info-bar>
</portlet-application>
</container>
</container>
</container>
</page>
7 changes: 7 additions & 0 deletions webapp/src/main/webapp/WEB-INF/gatein-resources.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@
<css-priority>11</css-priority>
</portal-skin>

<portal-skin>
<skin-name>Enterprise</skin-name>
<skin-module>newsPageTemplate</skin-module>
<css-path>/skin/css/newsPageTemplate.css</css-path>
<css-priority>11</css-priority>
</portal-skin>

<portlet-skin>
<application-name>news</application-name>
<portlet-name>News</portlet-name>
Expand Down
30 changes: 30 additions & 0 deletions webapp/src/main/webapp/skin/less/newsPageTemplate.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

#topNewsPage {
margin-bottom: 10px;
}

#newsBodyPageChildren {
display: flex;
.newsBodyPageLeftColumn {
width: 75%;
margin: 0 15px;
}
.newsBodyPageRightColumn {
width: 25%;
margin: 0 15px;
}
}

@media (max-width: 768px) {
#newsBodyPageChildren {
display: block;
.newsBodyPageLeftColumn {
width: auto;
margin: 0 15px;
}
.newsBodyPageRightColumn {
width: auto;
margin: 0 15px;
}
}
}

0 comments on commit 14d2a91

Please sign in to comment.