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 23aa309 Lots of UI tweaks and improvements
23aa309 is described below
commit 23aa309ff4fec8c74a6ba767da87054472f9231f
Author: Dan Klco <[email protected]>
AuthorDate: Thu Mar 22 12:30:21 2018 -0400
Lots of UI tweaks and improvements
---
cms/builder/src/main/provisioning/cms.txt | 14 ++++++-
cms/ui/src/main/frontend/src/js/scripts.js | 12 ++++--
cms/ui/src/main/frontend/src/scss/form.scss | 25 ++++++++++---
cms/ui/src/main/frontend/src/scss/styles.scss | 6 +--
.../etc/clientlibs/sling-cms-editor/editor.js | 6 +--
.../cms/componentconfig/componentconfig.jsp | 43 ++++++++++++----------
.../sling-cms/components/cms/pagetemplate.json | 4 ++
.../components/cms/pagetemplate/pagetemplate.jsp | 41 +++++++++------------
.../components/editor/slingform/slingform.jsp | 16 ++++----
...pl.ServiceUserMapperImpl.amended-sling-cms.json | 4 --
.../libs/sling-cms/content/site/create.json | 7 ++++
...rewriter.ReferenceMappingTransformerConfig.json | 0
....sling.engine.impl.auth.SlingAuthenticator.json | 0
...hitelist.fragment-serviceuser-webconsole.config | 20 ++++++++++
....internal.JcrResourceResolverFactoryImpl.config | 0
.../rewriter/reference-mapping-rewriter.json | 0
16 files changed, 129 insertions(+), 69 deletions(-)
diff --git a/cms/builder/src/main/provisioning/cms.txt
b/cms/builder/src/main/provisioning/cms.txt
index 0be8443..eb80dfb 100644
--- a/cms/builder/src/main/provisioning/cms.txt
+++ b/cms/builder/src/main/provisioning/cms.txt
@@ -27,4 +27,16 @@
org.apache.sling/org.apache.sling.cms.core/1.0.0-SNAPSHOT
org.apache.sling/org.apache.sling.cms.ui/1.0.0-SNAPSHOT
org.apache.sling/org.apache.sling.cms.reference/1.0.0-SNAPSHOT
-
\ No newline at end of file
+
+[:repoinit]
+ create service user sling-rewriter
+
+ set ACL for sling-rewriter
+ allow jcr:read on /
+ end
+
+[configurations]
+
org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.amended-sling.rewriter
+ user.mapping=[
+ "org.apache.sling.rewriter\=sling-rewriter"
+ ]
\ No newline at end of file
diff --git a/cms/ui/src/main/frontend/src/js/scripts.js
b/cms/ui/src/main/frontend/src/js/scripts.js
index 9637b9c..970c6a6 100644
--- a/cms/ui/src/main/frontend/src/js/scripts.js
+++ b/cms/ui/src/main/frontend/src/js/scripts.js
@@ -101,9 +101,10 @@ Sling.CMS = {
decorate: function($ctx){
$ctx.find('.Form-Ajax').submit(function(){
- $form = $(this);
+ var $form = $(this);
+ var $inputs =
$form.find('input,select,textarea,button');
var jcrcontent = false;
- $form.find('input').each(function(idx,inp){
+
$form.find('input,select,textarea').each(function(idx,inp){
if(inp.name.indexOf('jcr:content') !=
-1){
jcrcontent = true;
}
@@ -121,10 +122,12 @@ Sling.CMS = {
$form.append('<input
type="hidden" name="jcr:createdBy" />');
}
}
+ var data = new FormData(this);
+
$form.find('.Form-Ajax__wrapper').attr('disabled', 'disabled');
$.ajax({
url: $form.attr('action'),
type: 'POST',
- data: new FormData(this),
+ data: data,
processData: false,
contentType: false,
dataType: 'json',
@@ -142,9 +145,11 @@ Sling.CMS = {
error: function(xhr, msg, err){
if(window.self !== window.top){
window.top.Sling.CMS.ui.confirmMessage(msg, err,function(){
+
$form.find('.Form-Ajax__wrapper').removeAttr('disabled');
});
} else {
Sling.CMS.ui.confirmMessage(msg, err,function(){
+
$form.find('.Form-Ajax__wrapper').removeAttr('disabled');
});
}
}
@@ -351,6 +356,7 @@ Sling.CMS = {
$span.find('.taxonomy__title').text(title);
Sling.CMS.decorate($span);
$('.taxonomy__container').append($span);
+ $ctx.find('.taxonomy__field
input').val('');
}
return false;
});
diff --git a/cms/ui/src/main/frontend/src/scss/form.scss
b/cms/ui/src/main/frontend/src/scss/form.scss
index 0225541..2c281e1 100755
--- a/cms/ui/src/main/frontend/src/scss/form.scss
+++ b/cms/ui/src/main/frontend/src/scss/form.scss
@@ -14,6 +14,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
+fieldset {
+ background-color: #f9f9f9;
+ border: 1px solid #ccc;
+}
input[type="submit"],
input[type="reset"],
@@ -27,23 +32,31 @@ button {
}
-input[type="submit"]:hover,
-input[type="reset"]:hover,
-input[type="button"]:hover,
-button:hover {
+input[type="submit"]:disabled,
+input[type="reset"]:disabled,
+input[type="button"]:disabled,
+button:disabled {
background-color: gray;
}
input,
select,
textarea {
- border: 1px solid gray;
- box-shadow: inset 0 .5px .5px gray;
+ border: 1px solid #ccc;
+ box-shadow: inset 0 .5px .5px #ccc;
+ background-color: #fff;
border-radius: 1px;
vertical-align: middle;
padding: 0.5em 0.6em;
margin-bottom: 1em;
width: 100%;
+ height: 32px;
+}
+
+input:disabled,
+select:disabled,
+textarea:disabled {
+ background-color: #e2e2e2;
}
input[type="checkbox"] {
diff --git a/cms/ui/src/main/frontend/src/scss/styles.scss
b/cms/ui/src/main/frontend/src/scss/styles.scss
index 53cbc83..a2a36fd 100644
--- a/cms/ui/src/main/frontend/src/scss/styles.scss
+++ b/cms/ui/src/main/frontend/src/scss/styles.scss
@@ -91,7 +91,7 @@ ul.Breadcrumb {
background-color: white;
margin: 20% auto;
padding: 2em;
- border: 1px solid gray;
+ border: 1px solid #999;
width: 75%;
}
@@ -124,7 +124,7 @@ ul.Breadcrumb {
}
.Nav-Item:hover, .Nav-Item.Active {
- background-color: lightgray;
+ background-color: #ccc;
}
.note-group-select-from-files {
@@ -157,7 +157,7 @@ td.Cell-Actions {
thead {
text-align: left;
- background-color: gray;
+ background-color: #999;
color: white;
}
diff --git
a/cms/ui/src/main/resources/jcr_root/etc/clientlibs/sling-cms-editor/editor.js
b/cms/ui/src/main/resources/jcr_root/etc/clientlibs/sling-cms-editor/editor.js
index 9115be3..d38fe21 100644
---
a/cms/ui/src/main/resources/jcr_root/etc/clientlibs/sling-cms-editor/editor.js
+++
b/cms/ui/src/main/resources/jcr_root/etc/clientlibs/sling-cms-editor/editor.js
@@ -47,10 +47,10 @@ if(!window.CMSEditor){
$(".Sling-CMS__modal-background").click(function(){
CMSEditor.ui.hideModal();
});
- $(document).keypress(function(e){
- if(e.keyCode==27 &&
CMSEditor.ui.modalDisplayed===true){
+ $(window).on('keypress',function(e){
+ if(e.keyCode==27 && CMSEditor.ui.modalDisplayed
=== true){
CMSEditor.ui.hideModal();
- }
+ }
});
},
ui: {
diff --git
a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/componentconfig/componentconfig.jsp
b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/componentconfig/componentconfig.jsp
index a3d0dc7..c1bc911 100644
---
a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/componentconfig/componentconfig.jsp
+++
b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/componentconfig/componentconfig.jsp
@@ -17,22 +17,27 @@
* under the License.
*/ --%>
<%@include file="/libs/sling-cms/global.jsp"%>
-<dl>
- <c:forEach var="val" items="${resource.valueMap}">
- <c:if test="${not fn:contains(val.key,':')}">
- <dt>
- <sling:encode value="${val.key}" mode="HTML" />
- </dt>
- <dd>
- <c:catch var="ex">
- <c:forEach var="item"
items="${val.value}">
- <sling:encode value="${item}"
mode="HTML" />
- </c:forEach>
- </c:catch>
- <c:if test="${ex != null}">
- <sling:encode value="${val.value}"
mode="HTML" />
- </c:if>
- </dd>
- </c:if>
-</c:forEach>
-</dl>
+<c:if test="${not empty properties.type}">
+ <h4>
+ <sling:encode value="${properties.type}" mode="HTML" />
+ </h4>
+ <dl>
+ <c:forEach var="val" items="${properties}">
+ <c:if test="${not fn:contains(val.key,':') and val.key
!= 'type'}">
+ <dt>
+ <sling:encode value="${val.key}"
mode="HTML" />
+ </dt>
+ <dd>
+ <c:catch var="ex">
+ <c:forEach var="item"
items="${val.value}">
+ <sling:encode
value="${item}" mode="HTML" />
+ </c:forEach>
+ </c:catch>
+ <c:if test="${ex != null}">
+ <sling:encode
value="${val.value}" mode="HTML" />
+ </c:if>
+ </dd>
+ </c:if>
+ </c:forEach>
+ </dl>
+</c:if>
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
new file mode 100644
index 0000000..af5bfe9
--- /dev/null
+++
b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/pagetemplate.json
@@ -0,0 +1,4 @@
+{
+ "jcr:primaryType": "sling:Component",
+ "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/pagetemplate/pagetemplate.jsp
b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/pagetemplate/pagetemplate.jsp
index af227c5..48466d8 100644
---
a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/pagetemplate/pagetemplate.jsp
+++
b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/pagetemplate/pagetemplate.jsp
@@ -17,17 +17,12 @@
* under the License.
*/ --%>
<%@include file="/libs/sling-cms/global.jsp"%>
-<div>
- Template ${resource.path}
-</div>
+<a href="/cms/config/edit.html${resource.parent.parent.path}">
+ < Site Configuration
+</a>
+<h3><sling:encode value="${properties['jcr:title']}" mode="HTML" />
(${resource.path})</h3>
<dl>
<dt>
- Title
- </dt>
- <dd>
- <sling:encode value="${properties['jcr:title']}" mode="HTML" />
- </dd>
- <dt>
Allowed Paths
</dt>
<dd>
@@ -40,15 +35,6 @@
</ul>
</dd>
<dt>
- Configuration Fields
- </dt>
- <dd>
- <c:set var="oldAvailableTypes" value="${availableTypes}" />
- <c:set var="availableTypes" value="SlingCMS-FieldConfig"
scope="request" />
- <sling:include path="fields"
resourceType="sling-cms/components/general/container" />
- <c:set var="availableTypes" value="${oldAvailableTypes}"
scope="request" />
- </dd>
- <dt>
Available Component Types
</dt>
<dd>
@@ -61,18 +47,27 @@
</ul>
</dd>
<dt>
- Component Configurations
+ Template Content
+ </dt>
+ <dd>
+ <pre><sling:encode value="${properties.template}" mode="HTML"
/></pre>
+ </dd>
+ <dt>
+ Configuration Fields
</dt>
<dd>
<c:set var="oldAvailableTypes" value="${availableTypes}" />
- <c:set var="availableTypes" value="SlingCMS-ComponentConfig"
scope="request" />
- <sling:include path="componentConfigurations"
resourceType="sling-cms/components/general/container" />
+ <c:set var="availableTypes" value="SlingCMS-FieldConfig"
scope="request" />
+ <sling:include path="fields"
resourceType="sling-cms/components/general/container" />
<c:set var="availableTypes" value="${oldAvailableTypes}"
scope="request" />
</dd>
<dt>
- Template Content
+ Component Configurations
</dt>
<dd>
- <pre><sling:encode value="${properties.template}" mode="HTML"
/></pre>
+ <c:set var="oldAvailableTypes" value="${availableTypes}" />
+ <c:set var="availableTypes" value="SlingCMS-ComponentConfig"
scope="request" />
+ <sling:include path="componentConfigurations"
resourceType="sling-cms/components/general/container" />
+ <c:set var="availableTypes" value="${oldAvailableTypes}"
scope="request" />
</dd>
</dl>
diff --git
a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/slingform/slingform.jsp
b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/slingform/slingform.jsp
index c360e16..dd14a96 100644
---
a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/slingform/slingform.jsp
+++
b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/slingform/slingform.jsp
@@ -18,11 +18,13 @@
*/ --%>
<%@include file="/libs/sling-cms/global.jsp"%>
<form method="post"
action="${slingRequest.requestPathInfo.suffix}${properties.actionSuffix}"
enctype="multipart/form-data" class="Form-Ajax"
data-add-date="${properties.addDate != false}">
- <input type="hidden" name="_charset_" value="utf-8" />
- <sling:include path="fields"
resourceType="sling-cms/components/general/container" />
- <div class="Field-Group">
- <button type="submit" class="btn btn-success"
title="<sling:encode value="${properties.button}" mode="HTML_ATTR" />">
- <sling:encode value="${properties.button}" mode="HTML"
/>
- </button>
- </div>
+ <fieldset class="Form-Ajax__wrapper">
+ <input type="hidden" name="_charset_" value="utf-8" />
+ <sling:include path="fields"
resourceType="sling-cms/components/general/container" />
+ <div class="Field-Group">
+ <button type="submit" class="btn btn-success"
title="<sling:encode value="${properties.button}" mode="HTML_ATTR" />">
+ <sling:encode value="${properties.button}"
mode="HTML" />
+ </button>
+ </div>
+ </fieldset>
</form>
\ No newline at end of file
diff --git
a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/config/org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.amended-sling-cms.json
b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/config/org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.amended-sling-cms.json
deleted file mode 100644
index 57b092f..0000000
---
a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/config/org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.amended-sling-cms.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "jcr:primaryType": "sling:OsgiConfig",
- "user.mapping": "org.apache.sling.rewriter=sling-readall"
-}
\ No newline at end of file
diff --git
a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/content/site/create.json
b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/content/site/create.json
index 4b0ddf8..32ae858 100644
--- a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/content/site/create.json
+++ b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/content/site/create.json
@@ -35,6 +35,13 @@
"name": ":name",
"required": true
},
+ "url": {
+ "jcr:primaryType":
"nt:unstructured",
+ "sling:resourceType":
"sling-cms/components/editor/fields/text",
+ "label": "Primary URL",
+ "name": "sling:url",
+ "required": true
+ },
"locale": {
"jcr:primaryType":
"nt:unstructured",
"sling:resourceType":
"sling-cms/components/editor/fields/select",
diff --git
a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/config/org.apache.sling.cms.core.rewriter.ReferenceMappingTransformerConfig.json
b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/install/org.apache.sling.cms.core.rewriter.ReferenceMappingTransformerConfig.json
similarity index 100%
rename from
cms/ui/src/main/resources/jcr_root/libs/sling-cms/config/org.apache.sling.cms.core.rewriter.ReferenceMappingTransformerConfig.json
rename to
cms/ui/src/main/resources/jcr_root/libs/sling-cms/install/org.apache.sling.cms.core.rewriter.ReferenceMappingTransformerConfig.json
diff --git
a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/config/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
similarity index 100%
rename from
cms/ui/src/main/resources/jcr_root/libs/sling-cms/config/org.apache.sling.engine.impl.auth.SlingAuthenticator.json
rename to
cms/ui/src/main/resources/jcr_root/libs/sling-cms/install/org.apache.sling.engine.impl.auth.SlingAuthenticator.json
diff --git
a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/install/org.apache.sling.jcr.base.internal.LoginAdminWhitelist.fragment-serviceuser-webconsole.config
b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/install/org.apache.sling.jcr.base.internal.LoginAdminWhitelist.fragment-serviceuser-webconsole.config
new file mode 100644
index 0000000..b648112
--- /dev/null
+++
b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/install/org.apache.sling.jcr.base.internal.LoginAdminWhitelist.fragment-serviceuser-webconsole.config
@@ -0,0 +1,20 @@
+#
+# 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.
+#
+whitelist.bundles=["org.apache.sling.serviceuser.webconsole"]
+whitelist.name="org.apache.sling.serviceuser.webconsole"
\ No newline at end of file
diff --git
a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/config/org.apache.sling.jcr.resource.internal.JcrResourceResolverFactoryImpl.config
b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/install/org.apache.sling.jcr.resource.internal.JcrResourceResolverFactoryImpl.config
similarity index 100%
rename from
cms/ui/src/main/resources/jcr_root/libs/sling-cms/config/org.apache.sling.jcr.resource.internal.JcrResourceResolverFactoryImpl.config
rename to
cms/ui/src/main/resources/jcr_root/libs/sling-cms/install/org.apache.sling.jcr.resource.internal.JcrResourceResolverFactoryImpl.config
diff --git
a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/config/rewriter/reference-mapping-rewriter.json
b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/install/rewriter/reference-mapping-rewriter.json
similarity index 100%
rename from
cms/ui/src/main/resources/jcr_root/libs/sling-cms/config/rewriter/reference-mapping-rewriter.json
rename to
cms/ui/src/main/resources/jcr_root/libs/sling-cms/install/rewriter/reference-mapping-rewriter.json
--
To stop receiving notification emails like this one, please contact
[email protected].