You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by dk...@apache.org on 2018/01/30 03:54:48 UTC

[sling-whiteboard] branch master updated: Adding URLS requiring authentication, adding a published widget and cleaned up the look and feel of the editor

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 fca2f0e  Adding URLS requiring authentication, adding a published widget and cleaned up the look and feel of the editor
fca2f0e is described below

commit fca2f0ea380f653e00b17d1509bbbcbfacdbc638
Author: Dan Klco <da...@gmail.com>
AuthorDate: Mon Jan 29 22:54:38 2018 -0500

    Adding URLS requiring authentication, adding a published widget and cleaned up the look and feel of the editor
---
 .../etc/clientlibs/sling-cms/css/editor.css        | 27 ++++---
 .../components/cms/contenttable/contenttable.jsp   | 16 ++++
 .../components/cms/pageeditbar/pageeditbar.jsp     |  4 +-
 .../libs/sling-cms/content/shared/publish.json     | 43 ++++++++++
 .../libs/sling-cms/content/shared/unpublish.json   | 43 ++++++++++
 .../libs/sling-cms/content/site/content.json       | 94 ++++++++++++++--------
 ....sling.engine.impl.auth.SlingAuthenticator.json | 13 +++
 7 files changed, 193 insertions(+), 47 deletions(-)

diff --git a/cms/ui/src/main/resources/jcr_root/etc/clientlibs/sling-cms/css/editor.css b/cms/ui/src/main/resources/jcr_root/etc/clientlibs/sling-cms/css/editor.css
index 55851ba..933bbc9 100644
--- a/cms/ui/src/main/resources/jcr_root/etc/clientlibs/sling-cms/css/editor.css
+++ b/cms/ui/src/main/resources/jcr_root/etc/clientlibs/sling-cms/css/editor.css
@@ -16,6 +16,19 @@
  * specific language governing permissions and limitations
  * under the License.
  */ 
+
+.Sling-CMS__component {
+	border: 1px solid rgba(0,0,0,0);
+}
+
+.Sling-CMS__component:hover {
+	border: 1px dashed #adadad;
+}
+
+.Sling-CMS__component-title {
+	padding: 0 10px;
+}
+ 
  
 .Sling-CMS__edit-bar {
 	width: 100%;
@@ -23,7 +36,7 @@
 	padding: .2em;
 	background-color: silver;
     line-height: 12px;
-    font-family: "Courier New", Courier, monospace;
+    font-family: "Open Sans", arial, sans-serif;
 }
 
 .Sling-CMS__edit-button {
@@ -36,16 +49,8 @@
     text-decoration: none;
 }
 
-.Sling-CMS__component {
-	border: 1px solid rgba(0,0,0,0);
-}
-
-.Sling-CMS__component:hover {
-	border: 1px dashed #adadad;
-}
-
-.Sling-CMS__component-title {
-	padding: 0 10px;
+.Sling-CMS__logo {
+	height: 30px;
 }
 
 .Sling-CMS__modal-background {
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 91b20ac..b519469 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
@@ -79,6 +79,22 @@
 										</c:forEach>
 									</td>
 								</c:when>
+								<c:when test="${colConfig.valueMap.type == 'Publish'}">
+									<td class="Cell-${colConfig.valueMap.type}">
+										<c:choose>
+											<c:when test="${sling:getRelativeResource(child,'jcr:content').valueMap.published}">
+												<a class="Button Fetch-Modal"  href="/cms/shared/unpublish.html${child.path}" title="Content Published" data-title="Unpublish" data-path=".Main-Content form">
+													 &#10003;
+												</a>
+											</c:when>
+											<c:otherwise>
+												<a class="Button Fetch-Modal"  href="/cms/shared/publish.html${child.path}" title="Content Not Published" data-title="Publish" data-path=".Main-Content form">
+													 &#10007;
+												</a>
+											</c:otherwise>
+										</c:choose>
+									</td>
+								</c:when>
 								<c:otherwise>
 									<c:choose>
 										<c:when test="${colConfig.valueMap.type == 'Static'}">
diff --git a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/pageeditbar/pageeditbar.jsp b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/pageeditbar/pageeditbar.jsp
index 26dfb0f..2d1a916 100644
--- a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/pageeditbar/pageeditbar.jsp
+++ b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/pageeditbar/pageeditbar.jsp
@@ -20,6 +20,8 @@
 <link rel="stylesheet" href="/etc/clientlibs/sling-cms/css/editor.css" />
 <sling:call script="/libs/sling-cms/components/editor/scripts/init.jsp" />
 <div class="Sling-CMS__edit-bar">
-	<a href="/cms" target="_blank" class="Sling-CMS__component-title">Sling CMS</a> 
+	<a href="/cms/start.html" target="_blank" class="Sling-CMS__component-title" target="Sling CMS">
+		<img src="/sling-logo.svg" class="Sling-CMS__logo" />
+	</a>
 </div>
 <sling:call script="/libs/sling-cms/components/editor/scripts/finalize.jsp" />
\ No newline at end of file
diff --git a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/content/shared/publish.json b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/content/shared/publish.json
new file mode 100644
index 0000000..2abc9d5
--- /dev/null
+++ b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/content/shared/publish.json
@@ -0,0 +1,43 @@
+{
+	"jcr:primaryType": "sling:Page",
+	"jcr:content": {
+		"sling:resourceType": "sling-cms/components/pages/base",
+		"jcr:title": "Publish Content",
+		"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>Publish Content</h3>"
+			},
+			"slingform": {
+				"jcr:primaryType": "nt:unstructured",
+				"sling:resourceType": "sling-cms/components/editor/slingform",
+				"button": "Publish",
+				"fields": {
+					"jcr:primaryType": "nt:unstructured",
+					"sling:resourceType": "sling-cms/components/general/container",
+					"path": {
+						"jcr:primaryType": "nt:unstructured",
+						"sling:resourceType" : "sling-cms/components/editor/fields/suffixlabel",
+						"label": "Do you want to publish:"
+					},
+					"published": {
+						"jcr:primaryType": "nt:unstructured",
+						"sling:resourceType": "sling-cms/components/editor/fields/hidden",
+						"name": "jcr:content/published",
+						"value": "true"
+					},
+					"publishedTypeHint": {
+						"jcr:primaryType": "nt:unstructured",
+						"sling:resourceType": "sling-cms/components/editor/fields/hidden",
+						"name": "jcr:content/published@TypeHint",
+						"value": "Boolean"
+					}
+				}
+			}
+		}
+	}
+}
\ No newline at end of file
diff --git a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/content/shared/unpublish.json b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/content/shared/unpublish.json
new file mode 100644
index 0000000..ece8b0f
--- /dev/null
+++ b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/content/shared/unpublish.json
@@ -0,0 +1,43 @@
+{
+	"jcr:primaryType": "sling:Page",
+	"jcr:content": {
+		"sling:resourceType": "sling-cms/components/pages/base",
+		"jcr:title": "Unpublish Content",
+		"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>Unpublish Content</h3>"
+			},
+			"slingform": {
+				"jcr:primaryType": "nt:unstructured",
+				"sling:resourceType": "sling-cms/components/editor/slingform",
+				"button": "Unpublish",
+				"fields": {
+					"jcr:primaryType": "nt:unstructured",
+					"sling:resourceType": "sling-cms/components/general/container",
+					"path": {
+						"jcr:primaryType": "nt:unstructured",
+						"sling:resourceType" : "sling-cms/components/editor/fields/suffixlabel",
+						"label": "Do you want to unpublish:"
+					},
+					"published": {
+						"jcr:primaryType": "nt:unstructured",
+						"sling:resourceType": "sling-cms/components/editor/fields/hidden",
+						"name": "jcr:content/published",
+						"value": "false"
+					},
+					"publishedTypeHint": {
+						"jcr:primaryType": "nt:unstructured",
+						"sling:resourceType": "sling-cms/components/editor/fields/hidden",
+						"name": "jcr:content/published@TypeHint",
+						"value": "Boolean"
+					}
+				}
+			}
+		}
+	}
+}
\ No newline at end of file
diff --git a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/content/site/content.json b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/content/site/content.json
index 8e9c79e..87ca62c 100644
--- a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/content/site/content.json
+++ b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/content/site/content.json
@@ -24,6 +24,10 @@
 						"jcr:primaryType": "nt:unstructured",
 						"title": "Title"
 					},
+					"published": {
+						"jcr:primaryType": "nt:unstructured",
+						"title": "Published"
+					},
 					"type": {
 						"jcr:primaryType": "nt:unstructured",
 						"title": "Type"
@@ -57,6 +61,10 @@
 								"property": "jcr:content/jcr:title",
 								"type": "String"
 							},
+							"publish": {
+								"jcr:primaryType": "nt:unstructured",
+								"type": "Publish"
+							},
 							"type": {
 								"jcr:primaryType": "nt:unstructured",
 								"value": "Page",
@@ -75,13 +83,6 @@
 							"actions": {
 								"jcr:primaryType": "nt:unstructured",
 								"type": "Actions",
-								"delete": {
-									"jcr:primaryType": "nt:unstructured",
-									"modal": true,
-									"title": "Delete the specified page",
-									"text": "&times;",
-									"prefix": "/cms/shared/delete.html"
-								},
 								"edit": {
 									"jcr:primaryType": "nt:unstructured",
 									"modal": false,
@@ -95,6 +96,13 @@
 									"title": "Move / Copy Page",
 									"text": "&#x21c6;",
 									"prefix": "/cms/shared/movecopy.html"
+								},
+								"delete": {
+									"jcr:primaryType": "nt:unstructured",
+									"modal": true,
+									"title": "Delete the specified page",
+									"text": "&times;",
+									"prefix": "/cms/shared/delete.html"
 								}
 							}
 						}
@@ -113,6 +121,10 @@
 								"link": false,
 								"type": "Name"
 							},
+							"publish": {
+								"jcr:primaryType": "nt:unstructured",
+								"type": "Publish"
+							},
 							"type": {
 								"jcr:primaryType": "nt:unstructured",
 								"value": "File",
@@ -131,13 +143,6 @@
 							"actions": {
 								"jcr:primaryType": "nt:unstructured",
 								"type": "Actions",
-								"delete": {
-									"jcr:primaryType": "nt:unstructured",
-									"modal": true,
-									"title": "Delete File",
-									"text": "&times;",
-									"prefix": "/cms/shared/delete.html"
-								},
 								"download": {
 									"jcr:primaryType": "nt:unstructured",
 									"modal": false,
@@ -150,6 +155,13 @@
 									"title": "Move / Copy File",
 									"text": "&#x21c6;",
 									"prefix": "/cms/shared/movecopy.html"
+								},
+								"delete": {
+									"jcr:primaryType": "nt:unstructured",
+									"modal": true,
+									"title": "Delete File",
+									"text": "&times;",
+									"prefix": "/cms/shared/delete.html"
 								}
 							}
 						}
@@ -168,6 +180,10 @@
 								"property": "jcr:content/jcr:title",
 								"type": "String"
 							},
+							"publish": {
+								"jcr:primaryType": "nt:unstructured",
+								"type": "Publish"
+							},
 							"type": {
 								"jcr:primaryType": "nt:unstructured",
 								"value": "Folder",
@@ -193,19 +209,19 @@
 									"text": "&#x270f;",
 									"prefix": "/cms/folder/edit.html"
 								},
-								"delete": {
-									"jcr:primaryType": "nt:unstructured",
-									"title": "Delete Folder",
-									"text": "&times;",
-									"prefix": "/cms/shared/delete.html",
-									"modal": true
-								},
 								"movecopy": {
 									"jcr:primaryType": "nt:unstructured",
 									"modal": true,
 									"title": "Move / Copy Folder",
 									"text": "&#x21c6;",
 									"prefix": "/cms/shared/movecopy.html"
+								},
+								"delete": {
+									"jcr:primaryType": "nt:unstructured",
+									"title": "Delete Folder",
+									"text": "&times;",
+									"prefix": "/cms/shared/delete.html",
+									"modal": true
 								}
 							}
 						}
@@ -224,6 +240,10 @@
 								"property": "jcr:content/jcr:title",
 								"type": "String"
 							},
+							"publish": {
+								"jcr:primaryType": "nt:unstructured",
+								"type": "Publish"
+							},
 							"type": {
 								"jcr:primaryType": "nt:unstructured",
 								"value": "Folder",
@@ -249,19 +269,19 @@
 									"text": "&#x270f;",
 									"prefix": "/cms/folder/edit.html"
 								},
-								"delete": {
-									"jcr:primaryType": "nt:unstructured",
-									"title": "Delete Folder",
-									"text": "&times;",
-									"prefix": "/cms/shared/delete.html",
-									"modal": true
-								},
 								"movecopy": {
 									"jcr:primaryType": "nt:unstructured",
 									"modal": true,
 									"title": "Move / Copy Folder",
 									"text": "&#x21c6;",
 									"prefix": "/cms/shared/movecopy.html"
+								},
+								"delete": {
+									"jcr:primaryType": "nt:unstructured",
+									"title": "Delete Folder",
+									"text": "&times;",
+									"prefix": "/cms/shared/delete.html",
+									"modal": true
 								}
 							}
 						}
@@ -280,6 +300,10 @@
 								"link": false,
 								"type": "Name"
 							},
+							"publish": {
+								"jcr:primaryType": "nt:unstructured",
+								"type": "Publish"
+							},
 							"type": {
 								"jcr:primaryType": "nt:unstructured",
 								"value": "Folder",
@@ -305,19 +329,19 @@
 									"text": "&#x270f;",
 									"prefix": "/cms/folder/edit.html"
 								},
-								"delete": {
-									"jcr:primaryType": "nt:unstructured",
-									"title": "Delete Folder",
-									"text": "&times;",
-									"prefix": "/cms/shared/delete.html",
-									"modal": true
-								},
 								"movecopy": {
 									"jcr:primaryType": "nt:unstructured",
 									"modal": true,
 									"title": "Move / Copy Folder",
 									"text": "&#x21c6;",
 									"prefix": "/cms/shared/movecopy.html"
+								},
+								"delete": {
+									"jcr:primaryType": "nt:unstructured",
+									"title": "Delete Folder",
+									"text": "&times;",
+									"prefix": "/cms/shared/delete.html",
+									"modal": true
 								}
 							}
 						}
diff --git a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/install/org.apache.sling.engine.impl.auth.SlingAuthenticator.json b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/install/org.apache.sling.engine.impl.auth.SlingAuthenticator.json
new file mode 100644
index 0000000..4e93201
--- /dev/null
+++ b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/install/org.apache.sling.engine.impl.auth.SlingAuthenticator.json
@@ -0,0 +1,13 @@
+{
+    "jcr:primaryType": "sling:OsgiConfig",
+    "sling.auth.requirements": [
+      "/bin",
+      "/cms",
+      "/libs",
+      "/apps",
+      "/etc",
+      "/home",
+      "/var",
+      "-/etc/clientlibs"
+    ]
+}
\ No newline at end of file

-- 
To stop receiving notification emails like this one, please contact
dklco@apache.org.