Commit 021051fb authored by Pantiru Paul's avatar Pantiru Paul
Browse files

XWEB-1949: Organise and commit the code

parent b26f039f
Loading
Loading
Loading
Loading
+478 −0
Original line number Diff line number Diff line
<?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.BlockDescriptionTableMacro" locale="">
  <web>PublicWebSite.Code</web>
  <name>BlockDescriptionTableMacro</name>
  <language/>
  <defaultLanguage>en</defaultLanguage>
  <translation>0</translation>
  <creator>xwiki:XWiki.Admin</creator>
  <creationDate>1514761200000</creationDate>
  <parent>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>Block Description Table Macro</title>
  <comment/>
  <minorEdit>false</minorEdit>
  <syntaxId>xwiki/2.1</syntaxId>
  <hidden>true</hidden>
  <content>= Samples =

== Sample 1 ==


{{code}}
{{blockdescriptiontable}}
{
  "header": [
    "hello",
    "{{blockvignette title=\"My cool vignette\" image=\"Facilitate_XWiki.svg\" /}}",
    "{{blockvignette title=\"My cool vignette\" image=\"Facilitate_XWiki.svg\" /}}",
    "{{blockvignette title=\"My cool vignette\" image=\"Facilitate_XWiki.svg\" /}}",
    "{{blockvignette title=\"My cool vignette\" image=\"Facilitate_XWiki.svg\" /}}",
  ],
  "content": [
    [
      "Default services",
      "",
      "Every service included in the Bronze support",
      "Every service included in the Silver support",
      "Every service included in the Gold support"
    ],
    [
      "Support level",
      "Core features",
      "Recommended extensions",
      "Community extensions",
      "-"
    ]
  ]
}
{{/blockdescriptiontable}}
{{/code}}


{{blockdescriptiontable}}
{
  "header": [
    "",
    "{{blockvignette title=\"My cool vignette\" image=\"Facilitate_XWiki.svg\" /}}",
    "{{blockvignette title=\"My cool vignette\" image=\"Facilitate_XWiki.svg\" /}}",
    "{{blockvignette title=\"My cool vignette\" image=\"Facilitate_XWiki.svg\" /}}",
    "{{blockvignette title=\"My cool vignette\" image=\"Facilitate_XWiki.svg\" /}}",
  ],
  "content": [
    [
      "Default services",
      "",
      "Every service included in the Bronze support",
      "Every service included in the Silver support",
      "Every service included in the Gold support"
    ],
    [
      "Support level",
      "Core features",
      "Recommended extensions",
      "Community extensions",
      "-"
    ]
  ]
}
{{/blockdescriptiontable}}</content>
  <object>
    <name>PublicWebSite.Code.BlockDescriptionTableMacro</name>
    <number>0</number>
    <className>XWiki.StyleSheetExtension</className>
    <guid>dc5e753f-ed09-4d7d-b184-9608866ae0fc</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;

.block-description-table {
  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;
  }

  .block-description-table-header,.block-description-table-contents {
    font-family: Roboto;
    margin-bottom: 2.5rem;
    @media (max-width: 991px) {
      margin-bottom: 2.5rem;
    }
  }

  .block-header {
    font-size: 3.2rem;
    font-weight: 300;  
  }
}




.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;
 }

/* Resetting rules for mobile view */
@media (max-width: @screen-xs-max) {
 .row-eq-height {
    display: block;
    .shadow-column {
      margin-bottom: 10px;
    }
 }
}</code>
    </property>
    <property>
      <contentType>CSS</contentType>
    </property>
    <property>
      <name/>
    </property>
    <property>
      <parse/>
    </property>
    <property>
      <use>currentPage</use>
    </property>
  </object>
  <object>
    <name>PublicWebSite.Code.BlockDescriptionTableMacro</name>
    <number>0</number>
    <className>XWiki.WikiMacroClass</className>
    <guid>c5da7663-fb09-4946-9a83-fd475f22f7ec</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($discard = $xwiki.ssx.use("PublicWebSite.Code.BlockDescriptionTableMacro"))

#set($title = $xcontext.macro.params.title)
#set($description = $xcontext.macro.params.description)

#set($blockId = $xcontext.macro.params.blockId)
#set($JSONContent = $xcontext.macro.content)
#set($content = $jsontool.parse($JSONContent))

#set($colsCount = $content.header.size())

{{html clean="false" wiki="true"}}
&lt;div data-blockId="$!blockId" class="row block-description-table"&gt;
  &lt;div class="col-md-12"&gt;
    #if($title &amp;&amp; $description != "")
      &lt;h2 class="text-center block-header"&gt;$!title&lt;/h1&gt;
    #end
    #if($description &amp;&amp; $description != "")
      &lt;h4 class="text-center block-header"&gt;$!description&lt;/h4&gt;
    #end
  &lt;/div&gt;
  &lt;table class="col-md-10 col-md-offset-1"&gt;
    &lt;thead&gt;
      &lt;tr&gt;
      #foreach($headerElement in $content.header)
        &lt;td&gt;$headerElement&lt;/td&gt;
      #end
      &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
      #foreach($contentLine in $content.content)
      &lt;tr&gt;
          #foreach($element in $contentLine)
          &lt;td&gt;$element&lt;/td&gt;
          #end
      &lt;/tr&gt;
      #end
    &lt;/tbody&gt;
  &lt;/table&gt;
&lt;/div&gt;
{{/html}}
{{/velocity}}</code>
    </property>
    <property>
      <contentDescription/>
    </property>
    <property>
      <contentType>Mandatory</contentType>
    </property>
    <property>
      <defaultCategory/>
    </property>
    <property>
      <description>This macro allows the creation of a bi-directional table presenting a description of multiple elements in a structured manner.</description>
    </property>
    <property>
      <id>blockdescriptiontable</id>
    </property>
    <property>
      <name>Description Table Block</name>
    </property>
    <property>
      <supportsInlineMode>1</supportsInlineMode>
    </property>
    <property>
      <visibility>Current Wiki</visibility>
    </property>
  </object>
</xwikidoc>
+8 −7

File changed.

Preview size limit exceeded, changes collapsed.

+2 −2

File changed.

Preview size limit exceeded, changes collapsed.

+202 −0
Original line number Diff line number Diff line
<?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.BlockImageMacro" locale="">
  <web>PublicWebSite.Code</web>
  <name>BlockImageMacro</name>
  <language/>
  <defaultLanguage>en</defaultLanguage>
  <translation>0</translation>
  <creator>xwiki:XWiki.Admin</creator>
  <creationDate>1514761200000</creationDate>
  <parent>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>BlockImageMacro</title>
  <comment/>
  <minorEdit>false</minorEdit>
  <syntaxId>xwiki/2.1</syntaxId>
  <hidden>true</hidden>
  <content/>
  <object>
    <name>PublicWebSite.Code.BlockImageMacro</name>
    <number>0</number>
    <className>XWiki.WikiMacroClass</className>
    <guid>7655bb1e-262a-4bf4-b57f-c130295fc7a2</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}}
## First, get the parameters of the macro
#set($title = $xcontext.macro.params.title)
#set($image = $xcontext.macro.params.image)

#set($blockExtraClasses = "col-xs-12 col-sm-6")
{{html clean="false" wiki="true"}}
&lt;div class="blockimage $!blockExtraClasses"&gt;
  &lt;h2&gt;$title&lt;/h2&gt;
  [[image:$!image]]
&lt;/div&gt;
{{/html}}
{{/velocity}}</code>
    </property>
    <property>
      <contentDescription/>
    </property>
    <property>
      <contentType>No content</contentType>
    </property>
    <property>
      <defaultCategory/>
    </property>
    <property>
      <description>This macro aims to ease the display of a single image in a page, along with an optional title.</description>
    </property>
    <property>
      <id>blockImageMacro</id>
    </property>
    <property>
      <name>Image block macro</name>
    </property>
    <property>
      <supportsInlineMode>1</supportsInlineMode>
    </property>
    <property>
      <visibility>Current Wiki</visibility>
    </property>
  </object>
</xwikidoc>
+43 −0
Original line number Diff line number Diff line
<?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.BlockParagraphMacro" locale="">
  <web>PublicWebSite.Code</web>
  <name>BlockParagraphMacro</name>
  <language/>
  <defaultLanguage>en</defaultLanguage>
  <translation>0</translation>
  <creator>xwiki:XWiki.Admin</creator>
  <creationDate>1514761200000</creationDate>
  <parent>PublicWebSite.Code.BlockImageMacro</parent>
  <author>xwiki:XWiki.Admin</author>
  <contentAuthor>xwiki:XWiki.Admin</contentAuthor>
  <date>1514761200000</date>
  <contentUpdateDate>1514761200000</contentUpdateDate>
  <version>1.1</version>
  <title>BlockParagraphMacro</title>
  <comment/>
  <minorEdit>false</minorEdit>
  <syntaxId>xwiki/2.1</syntaxId>
  <hidden>true</hidden>
  <content/>
</xwikidoc>
Loading