This is an automated email from the ASF dual-hosted git repository.

dklco pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-whiteboard.git


The following commit(s) were added to refs/heads/master by this push:
     new 9502d56  Fixed a spelling mistake with the pagination on lists and 
added a new component to allow for displaying text based on the suffix.
     new 3f3e5e8  Merge branch 'master' of github.com:apache/sling-whiteboard
9502d56 is described below

commit 9502d5629904506fdb55754e32e21df64daf11ae
Author: Dan Klco <[email protected]>
AuthorDate: Sun Feb 25 23:13:00 2018 -0500

    Fixed a spelling mistake with the pagination on lists and added a new
    component to allow for displaying text based on the suffix.
---
 .../reference/components/general/list/list.jsp     |  2 +-
 .../reference/components/general/suffixheader.json |  5 ++
 .../components/general/suffixheader/edit.json      | 55 ++++++++++++++++++++++
 .../general/suffixheader/suffixheader.jsp          | 30 ++++++++++++
 4 files changed, 91 insertions(+), 1 deletion(-)

diff --git 
a/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/list/list.jsp
 
b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/list/list.jsp
index 6fb59ab..a206720 100644
--- 
a/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/list/list.jsp
+++ 
b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/list/list.jsp
@@ -27,7 +27,7 @@
                <c:forEach var="item" items="${list.items}">
                        <sling:include path="${item.path}" 
resourceType="${properties.itemType}" />
                </c:forEach>
-               <c:if test="${properties.includePagitation}">
+               <c:if test="${properties.includePagination}">
                        <sling:call script="pagination.jsp" />
                </c:if>
        </${tag}>
diff --git 
a/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/suffixheader.json
 
b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/suffixheader.json
new file mode 100644
index 0000000..2125121
--- /dev/null
+++ 
b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/suffixheader.json
@@ -0,0 +1,5 @@
+{
+       "jcr:primaryType": "sling:Component",
+    "componentType": "General",
+    "jcr:title": "Suffix Header"
+}
\ No newline at end of file
diff --git 
a/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/suffixheader/edit.json
 
b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/suffixheader/edit.json
new file mode 100644
index 0000000..d6cad4f
--- /dev/null
+++ 
b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/suffixheader/edit.json
@@ -0,0 +1,55 @@
+ {
+       "jcr:primaryType": "nt:unstructured",
+       "sling:resourceType": "sling-cms/components/editor/slingform",
+       "button": "Save",
+       "fields": {
+               "jcr:primaryType": "nt:unstructured",
+               "sling:resourceType": "sling-cms/components/general/container",
+               "subString": {
+                       "jcr:primaryType": "nt:unstructured",
+                       "sling:resourceType": 
"sling-cms/components/editor/fields/text",
+                       "label": "Subsitution String",
+                       "name": "subString",
+                       "required": true
+               },
+               "property": {
+                       "jcr:primaryType": "nt:unstructured",
+                       "sling:resourceType": 
"sling-cms/components/editor/fields/text",
+                       "label": "Suffix Resource Property",
+                       "name": "property"
+               },
+               "tag": {
+                       "jcr:primaryType": "nt:unstructured",
+                       "sling:resourceType": 
"sling-cms/components/editor/fields/select",
+                       "label": "Tag",
+                       "name": "tag",
+                       "required": true,
+                       "options": {
+                               "h1": {
+                                       "label": "Header 1",
+                                       "value": "h1"
+                               },
+                               "h2": {
+                                       "label": "Header 2",
+                                       "value": "h2"
+                               },
+                               "h3": {
+                                       "label": "Header 3",
+                                       "value": "h3"
+                               },
+                               "h4": {
+                                       "label": "Header 4",
+                                       "value": "h4"
+                               },
+                               "h5": {
+                                       "label": "Header 5",
+                                       "value": "h5"
+                               },
+                               "p": {
+                                       "label": "Paragraph",
+                                       "value": "p"
+                               }
+                       }
+               }
+       }
+}
\ No newline at end of file
diff --git 
a/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/suffixheader/suffixheader.jsp
 
b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/suffixheader/suffixheader.jsp
new file mode 100644
index 0000000..d5285ce
--- /dev/null
+++ 
b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/suffixheader/suffixheader.jsp
@@ -0,0 +1,30 @@
+<%-- /*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */ --%>
+ <%@include file="/libs/sling-cms/global.jsp"%>
+<c:choose>
+       <c:when test="${not empty properties.property}">
+               <c:set var="value" 
value="${slingRequest.requestPathInfo.suffixResource.valueMap[properties.property]}"
 />
+       </c:when>
+       <c:otherwise>
+               <c:set var="value" 
value="${slingRequest.requestPathInfo.suffixResource.name}" />
+       </c:otherwise>
+</c:choose>
+<${properties.tag}>
+       <sling:encode 
value="${fn:replace(properties.subString,'{SUFFIX}',value)}" mode="HTML" />
+</${properties.tag}>

-- 
To stop receiving notification emails like this one, please contact
[email protected].

Reply via email to