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 d63c56c  Made templates a full page editor because it was getting 
really hard to manage them
d63c56c is described below

commit d63c56cf58359ab94c30ef9b67de843a4a252323
Author: Dan Klco <[email protected]>
AuthorDate: Fri Feb 23 16:17:06 2018 -0500

    Made templates a full page editor because it was getting really hard to 
manage them
---
 .../components/cms/contenttable/contenttable.jsp   |  5 +-
 .../sling-cms/components/cms/pagetemplate.json     |  5 --
 .../components/cms/siteconfig/siteconfig.jsp       |  6 --
 .../templateeditor.jsp}                            | 14 +---
 .../libs/sling-cms/content/config/edit.json        | 90 ++++++++++++++++++++++
 .../libs/sling-cms/content/template/create.json    | 54 +++++++++++++
 .../content/{config => template}/edit.json         |  4 +-
 7 files changed, 150 insertions(+), 28 deletions(-)

diff --git 
a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/contenttable/contenttable.jsp
 
b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/contenttable/contenttable.jsp
index a94786f..5e8554c 100644
--- 
a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/contenttable/contenttable.jsp
+++ 
b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/contenttable/contenttable.jsp
@@ -28,8 +28,9 @@
                </tr>
        </thead>
        <tbody>
-               <c:forEach var="child" 
items="${sling:listChildren(slingRequest.requestPathInfo.suffixResource)}">
-                       <sling:getResource var="typeConfig" base="${resource}" 
path="types/${child.resourceType}" />
+               <c:set var="parentPath" 
value="${slingRequest.requestPathInfo.suffix}${not empty 
properties.appendSuffix ? properties.appendSuffix : ''}" />
+               <c:forEach var="child" 
items="${sling:listChildren(sling:getResource(resourceResolver, parentPath))}">
+                       <sling:getResource var="typeConfig" base="${resource}" 
path="types/${child.valueMap['jcr:primaryType']}" />
                        <c:if test="${typeConfig != null && 
!fn:contains(child.name,':')}">
                                <tr data-resource="${child.path}" 
data-type="${typeConfig.path}">
                                        <c:forEach var="column" 
items="${sling:listChildren(sling:getRelativeResource(typeConfig,'columns'))}">
diff --git 
a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/pagetemplate.json
 
b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/pagetemplate.json
deleted file mode 100644
index ce340ea..0000000
--- 
a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/pagetemplate.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
-       "jcr:primaryType": "sling:Component",
-    "componentType": "SlingCMS-PageTemplate",
-    "jcr:title": "Sling CMS - Page Template"
-}
\ No newline at end of file
diff --git 
a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/siteconfig/siteconfig.jsp
 
b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/siteconfig/siteconfig.jsp
index 60fe54d..9fbb1c5 100644
--- 
a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/siteconfig/siteconfig.jsp
+++ 
b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/siteconfig/siteconfig.jsp
@@ -28,11 +28,5 @@
 <sling:include path="${slingRequest.requestPathInfo.suffix}/parameters" 
resourceType="sling-cms/components/general/container" />
 <c:set var="availableTypes" value="${oldAvailableTypes}" scope="request" />
 
-<h3>Page Templates</h3>
-<c:set var="oldAvailableTypes" value="${availableTypes}" />
-<c:set var="availableTypes" value="SlingCMS-PageTemplate" scope="request" />
-<sling:include path="${slingRequest.requestPathInfo.suffix}/templates" 
resourceType="sling-cms/components/general/namedcontainer" />
-<c:set var="availableTypes" value="${oldAvailableTypes}" scope="request" />
-
 <sling:call script="/libs/sling-cms/components/editor/scripts/finalize.jsp" />
 <c:set var="cmsEditEnabled" value="false" scope="request" />
\ No newline at end of file
diff --git 
a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/siteconfig/siteconfig.jsp
 
b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/templateeditor/templateeditor.jsp
similarity index 54%
copy from 
cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/siteconfig/siteconfig.jsp
copy to 
cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/templateeditor/templateeditor.jsp
index 60fe54d..6e9fbf1 100644
--- 
a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/siteconfig/siteconfig.jsp
+++ 
b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/templateeditor/templateeditor.jsp
@@ -20,19 +20,7 @@
  <c:set var="cmsEditEnabled" value="true" scope="request" />
 <sling:call script="/libs/sling-cms/components/editor/scripts/init.jsp" />
 
-<sling:include path="${slingRequest.requestPathInfo.suffix}/config" 
resourceType="sling-cms/components/cms/siteconfig/config" />
-
-<h3>Parameters</h3>
-<c:set var="oldAvailableTypes" value="${availableTypes}" />
-<c:set var="availableTypes" value="SlingCMS-Parameter" scope="request" />
-<sling:include path="${slingRequest.requestPathInfo.suffix}/parameters" 
resourceType="sling-cms/components/general/container" />
-<c:set var="availableTypes" value="${oldAvailableTypes}" scope="request" />
-
-<h3>Page Templates</h3>
-<c:set var="oldAvailableTypes" value="${availableTypes}" />
-<c:set var="availableTypes" value="SlingCMS-PageTemplate" scope="request" />
-<sling:include path="${slingRequest.requestPathInfo.suffix}/templates" 
resourceType="sling-cms/components/general/namedcontainer" />
-<c:set var="availableTypes" value="${oldAvailableTypes}" scope="request" />
+<sling:include path="${slingRequest.requestPathInfo.suffix}" 
resourceType="sling-cms/components/cms/pagetemplate" />
 
 <sling:call script="/libs/sling-cms/components/editor/scripts/finalize.jsp" />
 <c:set var="cmsEditEnabled" value="false" scope="request" />
\ No newline at end of file
diff --git 
a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/content/config/edit.json 
b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/content/config/edit.json
index 612482f..8d2096b 100644
--- a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/content/config/edit.json
+++ b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/content/config/edit.json
@@ -15,6 +15,96 @@
                        "siteconfig": {
                                "jcr:primaryType": "nt:unstructured",
                                "sling:resourceType": 
"sling-cms/components/cms/siteconfig"
+                       },
+                       "richtext-1": {
+                               "jcr:primaryType": "nt:unstructured",
+                               "sling:resourceType": 
"sling-cms/components/general/richtext",
+                               "text": "<br/><h3>Templates</h3>"
+                       },
+                       "contentactions": {
+                               "jcr:primaryType": "nt:unstructured",
+                               "sling:resourceType": 
"sling-cms/components/cms/contentactions",
+                               "actions": {
+                                       "template": {
+                                               "jcr:primaryType": 
"nt:unstructured",
+                                               "label": "Template",
+                                               "prefix": 
"/cms/template/create.html"
+                                       }
+                               }
+                       },
+                       "contenttable": {
+                               "jcr:primaryType": "nt:unstructured",
+                               "sling:resourceType": 
"sling-cms/components/cms/contenttable",
+                               "appendSuffix": "/templates",
+                               "columns": {
+                                       "jcr:primaryType": "nt:unstructured",
+                                       "name": {
+                                               "jcr:primaryType": 
"nt:unstructured",
+                                               "title": "Name"
+                                       },
+                                       "title": {
+                                               "jcr:primaryType": 
"nt:unstructured",
+                                               "title": "Title"
+                                       },
+                                       "lastModified": {
+                                               "jcr:primaryType": 
"nt:unstructured",
+                                               "title": "Last Modified"
+                                       },
+                                       "actions": {
+                                               "jcr:primaryType": 
"nt:unstructured",
+                                               "title": "Actions"
+                                       }
+                               },
+                               "types": {
+                                       "jcr:primaryType": "nt:unstructured",
+                                       "nt:unstructured": {
+                                               "jcr:primaryType": 
"nt:unstructured",
+                                               "columns": {
+                                                       "jcr:primaryType": 
"nt:unstructured",
+                                                       "name": {
+                                                               
"jcr:primaryType": "nt:unstructured",
+                                                               
"sling:resourceType": "sling-cms/components/cms/columns/name",
+                                                               "link": false
+                                                       },
+                                                       "title": {
+                                                               
"jcr:primaryType": "nt:unstructured",
+                                                               
"sling:resourceType": "sling-cms/components/cms/columns/text",
+                                                               "property": 
"jcr:title"
+                                                       },
+                                                       "lastModified": {
+                                                               
"jcr:primaryType": "nt:unstructured",
+                                                               
"sling:resourceType": "sling-cms/components/cms/columns/lastmodified",
+                                                               "subPath": ""
+                                                       },
+                                                       "actions": {
+                                                               
"jcr:primaryType": "nt:unstructured",
+                                                               
"sling:resourceType": "sling-cms/components/cms/columns/actions",
+                                                               "edit": {
+                                                                       
"jcr:primaryType": "nt:unstructured",
+                                                                       
"modal": false,
+                                                                       "new": 
false,
+                                                                       
"title": "Edit Template",
+                                                                       "text": 
"&#x270f;",
+                                                                       
"prefix": "/cms/template/edit.html"
+                                                               },
+                                                               "movecopy": {
+                                                                       
"jcr:primaryType": "nt:unstructured",
+                                                                       
"modal": true,
+                                                                       
"title": "Move / Copy Template",
+                                                                       "text": 
"&#x21c6;",
+                                                                       
"prefix": "/cms/shared/movecopy.html"
+                                                               },
+                                                               "delete": {
+                                                                       
"jcr:primaryType": "nt:unstructured",
+                                                                       
"modal": true,
+                                                                       
"title": "Delete Template",
+                                                                       "text": 
"&times;",
+                                                                       
"prefix": "/cms/shared/delete.html"
+                                                               }
+                                                       }
+                                               }
+                                       }
+                               }
                        }
                }
        }
diff --git 
a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/content/template/create.json
 
b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/content/template/create.json
new file mode 100644
index 0000000..e03f223
--- /dev/null
+++ 
b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/content/template/create.json
@@ -0,0 +1,54 @@
+{
+       "jcr:primaryType": "sling:Page",
+       "jcr:content": {
+               "sling:resourceType": "sling-cms/components/pages/base",
+               "jcr:title": "Create Template",
+               "jcr:primaryType": "nt:unstructured",
+               "container": {
+                       "jcr:primaryType": "nt:unstructured",
+                       "sling:resourceType": 
"sling-cms/components/general/container",
+                       "richtext": {
+                               "jcr:primaryType": "nt:unstructured",
+                               "sling:resourceType": 
"sling-cms/components/general/richtext",
+                               "text": "<h3>Create Template</h3>"
+                       },
+                       "slingform": {
+                               "jcr:primaryType": "nt:unstructured",
+                               "sling:resourceType": 
"sling-cms/components/editor/slingform",
+                               "actionSuffix": "/*",
+                               "button": "Create Template",
+                               
"successPrepend":"/libs/sling-cms/content/site/content.html",
+                               "fields": {
+                                       "jcr:primaryType": "nt:unstructured",
+                                       "sling:resourceType": 
"sling-cms/components/general/container",
+                                       "title": {
+                                               "jcr:primaryType": 
"nt:unstructured",
+                                               "sling:resourceType": 
"sling-cms/components/editor/fields/text",
+                                               "label": "Title",
+                                               "name": "jcr:title",
+                                               "required": true
+                                       },
+                                       "name": {
+                                               "jcr:primaryType": 
"nt:unstructured",
+                                               "sling:resourceType": 
"sling-cms/components/editor/fields/text",
+                                               "label": "Name",
+                                               "name": ":name",
+                                               "required": true
+                                       },
+                                       "primaryType": {
+                                               "jcr:primaryType": 
"nt:unstructured",
+                                               "sling:resourceType": 
"sling-cms/components/editor/fields/hidden",
+                                               "name": "jcr:primaryType",
+                                               "value": "nt:unstructured"
+                                       },
+                                       "resourceType": {
+                                               "jcr:primaryType": 
"nt:unstructured",
+                                               "sling:resourceType": 
"sling-cms/components/editor/fields/hidden",
+                                               "name": "sling:resourceType",
+                                               "value": 
"sling-cms/components/cms/pagetemplate"
+                                       }
+                               }
+                       }
+               }
+       }
+}
\ No newline at end of file
diff --git 
a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/content/config/edit.json 
b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/content/template/edit.json
similarity index 82%
copy from 
cms/ui/src/main/resources/jcr_root/libs/sling-cms/content/config/edit.json
copy to 
cms/ui/src/main/resources/jcr_root/libs/sling-cms/content/template/edit.json
index 612482f..c406ac7 100644
--- a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/content/config/edit.json
+++ 
b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/content/template/edit.json
@@ -10,11 +10,11 @@
                        "richtext": {
                                "jcr:primaryType": "nt:unstructured",
                                "sling:resourceType": 
"sling-cms/components/general/richtext",
-                               "text": "<h2>Configure Site</h2>"
+                               "text": "<h2>Edit Template</h2>"
                        },
                        "siteconfig": {
                                "jcr:primaryType": "nt:unstructured",
-                               "sling:resourceType": 
"sling-cms/components/cms/siteconfig"
+                               "sling:resourceType": 
"sling-cms/components/cms/templateeditor"
                        }
                }
        }

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

Reply via email to