Commit 6926ac03 authored by Ludovic Dubost's avatar Ludovic Dubost
Browse files

Initial commit of public web site macros

parent e9556d5b
<?xml version="1.0" encoding="UTF-8"?>
<!--
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.xwiki.contrib</groupId>
<artifactId>parent-platform</artifactId>
<version>8.4</version>
</parent>
<groupId>org.xwiki.contrib.application-publicwebsite</groupId>
<artifactId>application-application-publicwebsite</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>xar</packaging>
<name>application-publicwebsite Application</name>
<description>Public Web Site macros and skin</description>
<properties>
<platform.version>${commons.version}</platform.version>
<!-- Enable auto release on jira -->
<xwiki.release.jira.skip>false</xwiki.release.jira.skip>
<xwiki.issueManagement.jira.id></xwiki.issueManagement.jira.id>
</properties>
<developers>
<developer>
<id></id>
<name></name>
<organization>XWiki SAS</organization>
</developer>
</developers>
<build>
<!-- Needed to add support for the XAR packaging -->
<extensions>
<extension>
<groupId>org.xwiki.commons</groupId>
<artifactId>xwiki-commons-tool-xar-handlers</artifactId>
<version>${commons.version}</version>
</extension>
</extensions>
</build>
<scm>
<connection>scm:git:git://git.xwikisas.com/ludovic/application-publicwebsite.git</connection>
<developerConnection>scm:git:git@git.xwikisas.com:ludovic/application-publicwebsite.git</developerConnection>
<url>https://git.xwikisas.com/ludovic/application-publicwebsite</url>
<tag>HEAD</tag>
</scm>
<distributionManagement>
<repository>
<id>xwiki-staging</id>
<name>XWiki Staging Repository</name>
<url>http://nexus.xwiki.org/nexus/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!--
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* 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.
-->
<xwikidoc version="1.3" reference="PublicWebSite.Code.BlockColumnsMacro" locale="">
<web>PublicWebSite.Code</web>
<name>BlockColumnsMacro</name>
<language/>
<defaultLanguage/>
<translation>0</translation>
<creator>xwiki:XWiki.Admin</creator>
<creationDate>1514761200000</creationDate>
<parent>xwiki:PublicWebSite.Code.WebHome</parent>
<author>xwiki:XWiki.Admin</author>
<contentAuthor>xwiki:XWiki.Admin</contentAuthor>
<date>1514761200000</date>
<contentUpdateDate>1514761200000</contentUpdateDate>
<version>1.1</version>
<title>BlockColumnsMacro</title>
<comment/>
<minorEdit>false</minorEdit>
<syntaxId>xwiki/2.1</syntaxId>
<hidden>false</hidden>
<content/>
<object>
<name>PublicWebSite.Code.BlockColumnsMacro</name>
<number>0</number>
<className>XWiki.StyleSheetExtension</className>
<guid>513555d5-2ce5-46bc-9443-ef7ad35b2ce9</guid>
<class>
<name>XWiki.StyleSheetExtension</name>
<customClass/>
<customMapping/>
<defaultViewSheet/>
<defaultEditSheet/>
<defaultWeb/>
<nameField/>
<validationScript/>
<cache>
<cache>0</cache>
<disabled>0</disabled>
<displayType>select</displayType>
<multiSelect>0</multiSelect>
<name>cache</name>
<number>5</number>
<prettyName>Caching policy</prettyName>
<relationalStorage>0</relationalStorage>
<separator> </separator>
<separators>|, </separators>
<size>1</size>
<unmodifiable>0</unmodifiable>
<values>long|short|default|forbid</values>
<classType>com.xpn.xwiki.objects.classes.StaticListClass</classType>
</cache>
<code>
<contenttype>PureText</contenttype>
<disabled>0</disabled>
<editor>PureText</editor>
<name>code</name>
<number>2</number>
<prettyName>Code</prettyName>
<rows>20</rows>
<size>50</size>
<unmodifiable>0</unmodifiable>
<classType>com.xpn.xwiki.objects.classes.TextAreaClass</classType>
</code>
<contentType>
<cache>0</cache>
<disabled>0</disabled>
<displayType>select</displayType>
<multiSelect>0</multiSelect>
<name>contentType</name>
<number>6</number>
<prettyName>Content Type</prettyName>
<relationalStorage>0</relationalStorage>
<separator> </separator>
<separators>|, </separators>
<size>1</size>
<unmodifiable>0</unmodifiable>
<values>CSS|LESS</values>
<classType>com.xpn.xwiki.objects.classes.StaticListClass</classType>
</contentType>
<name>
<disabled>0</disabled>
<name>name</name>
<number>1</number>
<prettyName>Name</prettyName>
<size>30</size>
<unmodifiable>0</unmodifiable>
<classType>com.xpn.xwiki.objects.classes.StringClass</classType>
</name>
<parse>
<disabled>0</disabled>
<displayFormType>select</displayFormType>
<displayType>yesno</displayType>
<name>parse</name>
<number>4</number>
<prettyName>Parse content</prettyName>
<unmodifiable>0</unmodifiable>
<classType>com.xpn.xwiki.objects.classes.BooleanClass</classType>
</parse>
<use>
<cache>0</cache>
<disabled>0</disabled>
<displayType>select</displayType>
<multiSelect>0</multiSelect>
<name>use</name>
<number>3</number>
<prettyName>Use this extension</prettyName>
<relationalStorage>0</relationalStorage>
<separator> </separator>
<separators>|, </separators>
<size>1</size>
<unmodifiable>0</unmodifiable>
<values>currentPage|onDemand|always</values>
<classType>com.xpn.xwiki.objects.classes.StaticListClass</classType>
</use>
</class>
<property>
<cache>long</cache>
</property>
<property>
<code>@import url('https://fonts.googleapis.com/css?family=Roboto:300,400,500,700');
@dark-blue: #002133;
@light-blue: #00aaff;
@white-op7: rgba(255,255,255,.7);
@bk-blue-op1: #f9fbfd;
@text-col-op8: rgba(1,1,1, 0.8);
@first-grad-color: #37499f;
@first-grad-color-op3 : rgba(55,73,159,.3);
@browser-color: #505052;
@blue-shadow-op2: rgba(69, 165, 214, 0.25);
@grid-float-breakpoint: @screen-md-min;
@grey-d6: #D6D6D6;
.blockcolumns {
padding-top: 5rem;
padding-bottom: 5rem;
h2 {
font-family: Roboto;
margin-top: 2.5rem;
margin-bottom: 2.5rem;
min-height: 5rem;
}
h4 {
font-family: Roboto;
margin-top: 2.5rem;
margin-bottom: 2.5rem;
min-height: 5rem;
}
p {
font-family: Roboto;
margin-bottom: 2.5rem;
@media (max-width: 991px) {
margin-bottom: 2.5rem;
}
}
}
.sect-header {
font-size: 3.2rem;
font-weight: 300;
}
.image-holder {
border-radius: 50%;
box-shadow: 0px 13px 29px 0px rgba(69, 165, 214, 0.25);
background-color: #fff;
width: 12rem;
height: 12rem;
display: block;
margin: 0 auto;
padding: 2rem;
}
.shadow-column {
border-radius: 1rem;
box-shadow: 0px 13px 29px 0px rgba(69, 165, 214, 0.25);
background-color: #FFFFFF;
padding: 3rem;
height: 100%;
}
.row-eq-height {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
}</code>
</property>
<property>
<contentType>LESS</contentType>
</property>
<property>
<name/>
</property>
<property>
<parse/>
</property>
<property>
<use>currentPage</use>
</property>
</object>
<object>
<name>PublicWebSite.Code.BlockColumnsMacro</name>
<number>0</number>
<className>XWiki.WikiMacroClass</className>
<guid>fa4549c2-fd9b-442a-af3c-de4c12fe0c7c</guid>
<class>
<name>XWiki.WikiMacroClass</name>
<customClass/>
<customMapping/>
<defaultViewSheet/>
<defaultEditSheet/>
<defaultWeb/>
<nameField/>
<validationScript/>
<code>
<disabled>0</disabled>
<editor>Text</editor>
<name>code</name>
<number>9</number>
<prettyName>Macro code</prettyName>
<rows>20</rows>
<size>40</size>
<unmodifiable>0</unmodifiable>
<classType>com.xpn.xwiki.objects.classes.TextAreaClass</classType>
</code>
<contentDescription>
<contenttype>PureText</contenttype>
<disabled>0</disabled>
<editor>PureText</editor>
<name>contentDescription</name>
<number>8</number>
<prettyName>Content description (Not applicable for "No content" type)</prettyName>
<rows>5</rows>
<size>40</size>
<unmodifiable>0</unmodifiable>
<classType>com.xpn.xwiki.objects.classes.TextAreaClass</classType>
</contentDescription>
<contentType>
<cache>0</cache>
<disabled>0</disabled>
<displayType>select</displayType>
<multiSelect>0</multiSelect>
<name>contentType</name>
<number>7</number>
<prettyName>Macro content type</prettyName>
<relationalStorage>0</relationalStorage>
<separator>|</separator>
<separators>|</separators>
<size>1</size>
<unmodifiable>0</unmodifiable>
<values>Optional|Mandatory|No content</values>
<classType>com.xpn.xwiki.objects.classes.StaticListClass</classType>
</contentType>
<defaultCategory>
<disabled>0</disabled>
<name>defaultCategory</name>
<number>4</number>
<prettyName>Default category</prettyName>
<size>30</size>
<unmodifiable>0</unmodifiable>
<classType>com.xpn.xwiki.objects.classes.StringClass</classType>
</defaultCategory>
<description>
<contenttype>PureText</contenttype>
<disabled>0</disabled>
<editor>PureText</editor>
<name>description</name>
<number>3</number>
<prettyName>Macro description</prettyName>
<rows>5</rows>
<size>40</size>
<unmodifiable>0</unmodifiable>
<classType>com.xpn.xwiki.objects.classes.TextAreaClass</classType>
</description>
<id>
<disabled>0</disabled>
<name>id</name>
<number>1</number>
<prettyName>Macro id</prettyName>
<size>30</size>
<unmodifiable>0</unmodifiable>
<classType>com.xpn.xwiki.objects.classes.StringClass</classType>
</id>
<name>
<disabled>0</disabled>
<name>name</name>
<number>2</number>
<prettyName>Macro name</prettyName>
<size>30</size>
<unmodifiable>0</unmodifiable>
<classType>com.xpn.xwiki.objects.classes.StringClass</classType>
</name>
<supportsInlineMode>
<disabled>0</disabled>
<displayFormType>select</displayFormType>
<displayType>yesno</displayType>
<name>supportsInlineMode</name>
<number>5</number>
<prettyName>Supports inline mode</prettyName>
<unmodifiable>0</unmodifiable>
<classType>com.xpn.xwiki.objects.classes.BooleanClass</classType>
</supportsInlineMode>
<visibility>
<cache>0</cache>
<disabled>0</disabled>
<displayType>select</displayType>
<multiSelect>0</multiSelect>
<name>visibility</name>
<number>6</number>
<prettyName>Macro visibility</prettyName>
<relationalStorage>0</relationalStorage>
<separator>|</separator>
<separators>|</separators>
<size>1</size>
<unmodifiable>0</unmodifiable>
<values>Current User|Current Wiki|Global</values>
<classType>com.xpn.xwiki.objects.classes.StaticListClass</classType>
</visibility>
</class>
<property>
<code>{{velocity}}
#set($ok = $xwiki.ssx.use("PublicWebSite.Code.BlockColumnsMacro"))
{{html clean="false"}}
#set($blockName = $xcontext.macro.params.name)
#set($blockTitle = $xcontext.macro.params.title)
#set($blockDesc = $xcontext.macro.params.desc)
#set($image = $xcontext.macro.params.image)
#set($color = $xcontext.macro.params.color)
#set($height = $xcontext.macro.params.height)
#set($shadow = $xcontext.macro.params.shadow)
#set($content = $xcontext.macro.content)
#set($style="")
#if($image&amp;&amp;$image!="")
#set($imageURL = $doc.getAttachmentURL($image))
#set($style="${style} background-image: url('${imageURL}');")
#end
#if($color&amp;&amp;$color!="")
#set($style="${style} background-color: ${color};")
#end
#if($height&amp;&amp;$height!="")
#set($style="${style} height: ${height};")
#end
&lt;div class="${blockName} blockcolumns row" style="${style}"&gt;
&lt;div class="col-xs-12"&gt;
&lt;div class="container"&gt;
&lt;div class="row"&gt;
&lt;div class="col-xs-12"&gt;
#if($blockTitle &amp;&amp; $blockTitle!="")
&lt;h2 class="text-center sect-header"&gt;${blockTitle}&lt;/h1&gt;
#end
#if($blockDesc &amp;&amp; $blockDesc!="")
&lt;h4 class="text-center"&gt;${blockDesc}&lt;/h4&gt;
#end
&lt;div class="row row-eq-height"&gt;
#set($items = $content.split("(\r\n|\n)"))
#if($items.size()&lt;=1)
#set($cols="col-xs-12 col-sm-12 col-md-12")
#elseif($items.size()&lt;=2)
#set($cols="col-xs-12 col-sm-6 col-md-6")
#elseif($items.size()&lt;=3)
#set($cols="col-xs-12 col-md-4 col-md-4")
#elseif($items.size()&lt;=4)
#set($cols="col-xs-12 col-sm-6 col-md-3")
#else
#set($cols="col-xs-12 col-sm-2 col-md-2")
#end
#foreach($item in $items)
#set($itemData = $item.split("[|]"))
#set($image = $listtool.get($itemData, 0))
#set($imageURL = $doc.getAttachmentURL($image))
#set($backColor = $listtool.get($itemData, 1))
#set($blockTitle = $listtool.get($itemData, 2))
#set($blockText = $listtool.get($itemData, 3))
&lt;div class="${cols}"&gt;
#if($shadow=="true")
&lt;div class="shadow-column"&gt;
#end
&lt;div class="features-image text-center"&gt;
&lt;div class="image-holder text-center" style="background: $!{backColor};"&gt;
&lt;img src="${imageURL}" alt="${blockTitle}" class="img-responsive"&gt;
&lt;/div&gt;
&lt;h4 class="text-center"&gt;${blockTitle}&lt;/h4&gt;
&lt;p&gt;${blockText}&lt;/p&gt;
#if($itemData.size()&gt;3)
#set($max = $itemData.size())
#foreach($i in [4..$max])
#set($blockText2 = $listtool.get($itemData, $i))
#if($blockText2)
&lt;p&gt;${blockText2}&lt;/p&gt;
#end
#end
#end
&lt;/div&gt;
#if($shadow=="true")
&lt;/div&gt;
#end
&lt;/div&gt;
#end
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
{{/html}}
{{/velocity}}</code>
</property>
<property>
<contentDescription/>
</property>
<property>
<contentType>Optional</contentType>
</property>
<property>
<defaultCategory/>
</property>
<property>
<description>Block Columns Macro</description>
</property>
<property>
<id>blockcolumns</id>
</property>
<property>
<name>Block Columns</name>
</property>
<property>
<supportsInlineMode>1</supportsInlineMode>
</property>
<property>
<visibility>Current Wiki</visibility>
</property>
</object>
</xwikidoc>
<?xml version="1.0" encoding="UTF-8"?>
<!--
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* 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.
-->
<xwikidoc version="1.3" reference="PublicWebSite.Code.BlockHeaderMacro" locale="">
<web>PublicWebSite.Code</web>
<name>BlockHeaderMacro</name>
<language/>
<defaultLanguage/>
<translation>0</translation>
<creator>xwiki:XWiki.Admin</creator>
<creationDate>1514761200000</creationDate>
<parent>xwiki:PublicWebSite.Code.WebHome</parent>
<author>xwiki:XWiki.Admin</author>
<contentAuthor>xwiki:XWiki.Admin</contentAuthor>
<date>1514761200000</date>
<contentUpdateDate>1514761200000</contentUpdateDate>
<version>1.1</version>
<title/>
<comment/>
<minorEdit>false</minorEdit>
<syntaxId>xwiki/2.1</syntaxId>
<hidden>false</hidden>
<content/>
<object>
<name>PublicWebSite.Code.BlockHeaderMacro</name>
<number>0</number>
<className>XWiki.StyleSheetExtension</className>
<guid>84d852fc-f545-48e0-a48b-a81004980558</guid>
<class>
<name>XWiki.StyleSheetExtension</name>
<customClass/>
<customMapping/>
<defaultViewSheet/>
<defaultEditSheet/>
<defaultWeb/>
<nameField/>
<validationScript/>
<cache>
<cache>0</cache>
<disabled>0</disabled>
<displayType>select</displayType>
<multiSelect>0</multiSelect>
<name>cache</name>
<number>5</number>
<prettyName>Caching policy</prettyName>
<relationalStorage>0</relationalStorage>
<separator> </separator>
<separators>|, </separators>
<size>1</size>
<unmodifiable>0</unmodifiable>
<values>long|short|default|forbid</values>
<classType>com.xpn.xwiki.objects.classes.StaticListClass</classType>
</cache>
<code>
<contenttype>PureText</contenttype>
<disabled>0</disabled>
<editor>PureText</editor>
<name>code</name>
<number>2</number>
<prettyName>Code</prettyName>
<rows>20</rows>
<size>50</size>
<unmodifiable>0</unmodifiable>
<classType>com.xpn.xwiki.objects.classes.TextAreaClass</classType>