This is an automated email from the ASF dual-hosted git repository. dklco pushed a commit to branch SLING-7900 in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-app-cms.git
commit 3e2496b828151d4b378e88032ca170283a94db74 Author: JE Bailey <[email protected]> AuthorDate: Tue Sep 11 16:01:47 2018 -0400 table updates and modals --- ui/src/main/frontend/src/js/cms.js | 5 +- .../sling-cms/components/cms/columns/name/name.jsp | 25 +++---- .../components/cms/columns/publish/publish.jsp | 2 +- .../components/cms/contentbreadcrumb/edit.json | 31 ++++++++ .../components/cms/contenttable/contenttable.jsp | 33 ++++---- .../components/editor/fields/file/field.jsp | 87 ++++++++++------------ .../components/editor/fields/repeating/field.jsp | 12 +-- 7 files changed, 108 insertions(+), 87 deletions(-) diff --git a/ui/src/main/frontend/src/js/cms.js b/ui/src/main/frontend/src/js/cms.js index 7f17092..d53ed3d 100644 --- a/ui/src/main/frontend/src/js/cms.js +++ b/ui/src/main/frontend/src/js/cms.js @@ -54,12 +54,13 @@ Sling.CMS = { $('body').append($modal); $modal.find('.modal-card-body').load(link + " " +path,function(){ var submitButton = $modal.find('button:submit'); - $modal.find('.modal-card-foot').append(submitButton); + var closeButton = $modal.find('.close-modal'); + submitButton.insertBefore(closeButton); submitButton.on("click",function(){ $modal.find('form').submit(); }) $modal.addClass('is-active'); - $modal.find('.close-modal').click(function(){ + closeButton.click(function(){ $modal.css('display','none').remove(); return false; }); diff --git a/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/columns/name/name.jsp b/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/columns/name/name.jsp index 0245485..5455d56 100644 --- a/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/columns/name/name.jsp +++ b/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/columns/name/name.jsp @@ -17,16 +17,15 @@ * under the License. */ --%> <%@include file="/libs/sling-cms/global.jsp"%> -<td> - <c:set var="colValue" value="${resource.name}" /> - <c:choose> - <c:when test="${colConfig.valueMap.link}"> - <a class="button is-outlined" href="${colConfig.valueMap.prefix}${resource.path}"> - <sling:encode value="${colValue}" mode="HTML" /> - </a> - </c:when> - <c:otherwise> - <sling:encode value="${colValue}" mode="HTML" /> - </c:otherwise> - </c:choose> -</td> \ No newline at end of file +<td><c:set var="colValue" value="${resource.name}" /> <c:choose> + <c:when test="${colConfig.valueMap.link}"> + <a class="has-text-primary" + href="${colConfig.valueMap.prefix}${resource.path}"> + <span class="icon"><i class="jam jam-link"></i></span> + <sling:encode value="${colValue}" mode="HTML" /> + </a> + </c:when> + <c:otherwise> + <sling:encode value="${colValue}" mode="HTML" /> + </c:otherwise> + </c:choose></td> \ No newline at end of file diff --git a/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/columns/publish/publish.jsp b/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/columns/publish/publish.jsp index 2005d42..ee55ded 100644 --- a/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/columns/publish/publish.jsp +++ b/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/columns/publish/publish.jsp @@ -25,7 +25,7 @@ </a> </c:when> <c:otherwise> - <a class="button is-warning Fetch-Modal" href="/cms/shared/publish.html${resource.path}" title="Click to Publish" data-title="Publish" data-path=".Main-Content form"> + <a class="button is-danger Fetch-Modal" href="/cms/shared/publish.html${resource.path}" title="Click to Publish" data-title="Publish" data-path=".Main-Content form"> <i class="jam jam-upload"></i> </a> </c:otherwise> diff --git a/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/contentbreadcrumb/edit.json b/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/contentbreadcrumb/edit.json new file mode 100644 index 0000000..e5f0709 --- /dev/null +++ b/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/contentbreadcrumb/edit.json @@ -0,0 +1,31 @@ + { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "sling-cms/components/editor/slingform", + "title": "Suffix BreadCrumb", + "button": "Save Suffix Breadcrumb", + "fields": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "sling-cms/components/general/container", + "level": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "sling-cms/components/editor/fields/text", + "label": "Depth", + "name": "depth", + "required": true, + "type": "number" + }, + "levelTypeHint": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "sling-cms/components/editor/fields/hidden", + "name": "level@TypeHint", + "value": "Long" + }, + "prefix": { + "jcr:primaryType": "nt:unstructured", + "sling:resourceType": "sling-cms/components/editor/fields/text", + "label": "Prefix", + "name": "prefix", + "required": true + } + } +} \ No newline at end of file diff --git a/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/contenttable/contenttable.jsp b/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/contenttable/contenttable.jsp index 288d921..80819b1 100644 --- a/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/contenttable/contenttable.jsp +++ b/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/contenttable/contenttable.jsp @@ -16,29 +16,30 @@ * specific language governing permissions and limitations * under the License. */ --%> - <%@page import="org.apache.sling.cms.core.models.components.Breadcrumbs"%> - <%@include file="/libs/sling-cms/global.jsp"%> - <sling:adaptTo adaptable="${slingRequest}" adaptTo="org.apache.sling.cms.core.models.components.ContentTable" var="model"/> - <div class="container is-fullwidth"> +<%@page import="org.apache.sling.cms.core.models.components.Breadcrumbs"%> +<%@include file="/libs/sling-cms/global.jsp"%> +<sling:adaptTo adaptable="${slingRequest}" + adaptTo="org.apache.sling.cms.core.models.components.ContentTable" + var="model" /> <table class="table is-fullwidth is-striped"> <thead> <tr> <c:forEach var="column" items="${model.columnData}"> - <th class="${column.classString}" data-attribute="${column.name}"> - <sling:encode value="${column.title}" mode="HTML" /> - </th> + <th class="${column.classString}" + data-attribute="${column.name}"><sling:encode + value="${column.title}" mode="HTML" /></th> </c:forEach> </tr> </thead> <tbody> <c:forEach var="child" items="${model.children}"> - <tr class="sortable__row" data-resource="${child.path}" data-type="${child.dataType}"> - <c:forEach var="column" items="${model.columnData}"> - <c:set var="colConfig" value="${column.resource}" scope="request" /> - <sling:include path="${child.path}" resourceType="${column.fieldResourceType}" /> - </c:forEach> - </tr> - </c:forEach> + <tr class="sortable__row" data-resource="${child.path}" + data-type="${child.dataType}"> + <c:forEach var="column" items="${model.columnData}"> + <c:set var="colConfig" value="${column.resource}" scope="request" /> + <sling:include path="${child.path}" resourceType="${column.fieldResourceType}" /> + </c:forEach> + </tr> + </c:forEach> </tbody> -</table> -</div> \ No newline at end of file +</table> \ No newline at end of file diff --git a/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/fields/file/field.jsp b/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/fields/file/field.jsp index 9817976..7b0748c 100644 --- a/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/fields/file/field.jsp +++ b/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/fields/file/field.jsp @@ -16,59 +16,48 @@ * specific language governing permissions and limitations * under the License. */ --%> - <%@include file="/libs/sling-cms/global.jsp"%> +<%@include file="/libs/sling-cms/global.jsp"%> <c:choose> - <c:when test="${properties.accepts}"> - <c:set var="accepts" value="${properties.accepts}" /> - </c:when> - <c:otherwise> - <c:set var="accepts" value="image/*,audio/*,video/*,application/json,text/css,application/pdf" /> - </c:otherwise> + <c:when test="${properties.accepts}"> + <c:set var="accepts" value="${properties.accepts}" /> + </c:when> + <c:otherwise> + <c:set var="accepts" + value="image/*,audio/*,video/*,application/json,text/css,application/pdf" /> + </c:otherwise> </c:choose> <div class="repeating"> - <fieldset disabled="disabled" class="repeating__template is-hidden"> - <div class="repeating__item Grid"> + <fieldset disabled="disabled" class="repeating__template is-hidden"> + <div class="repeating__item Grid"> <div class="file has-name is-fullwidth"> - <label class="file-label"> - <input type="file" class="file-input" name="${properties.name}" ${required} accept="${accepts}" /> - <span class="file-cta"> - <span class="file-icon"> - <i class="jam jam-upload"></i> - </span> - <span class="file-label"> - Browse - </span> - </span> - <span class="file-name"> - No File Selected - </span> - <span class='control'> - <span class="button repeating__remove button">-</span> - </span> + <label class="file-label"> <input type="file" + class="file-input" name="${properties.name}" + ${required} accept="${accepts}" /> <span + class="file-cta"> <span class="file-icon"> + <i class="jam jam-upload"></i> + </span> <span class="file-label"> Browse </span> + </span> <span class="file-name"> No File Selected </span> <span + class='control'> <span + class="button repeating__remove button">-</span> + </span> </label> </div> - </div> - </fieldset> - <div class="repeating__container"> - <div class="repeating__item Grid"> - <div class="file has-name is-fullwidth"> - <label class="file-label"> - <input type="file" class="file-input" name="${properties.name}" ${required} accept="${accepts}" /> - <span class="file-cta"> - <span class="file-icon"> - <i class="jam jam-upload"></i> - </span> - <span class="file-label"> - Browse - </span> - </span> - <span class="file-name"> - No File Selected - </span> - <span class="button repeating__remove button">-</span> - </label> - </div> - </div> - </div> - <button class="repeating__add button">+</button> + </div> + </fieldset> + <div class="repeating__container"> + <div class="repeating__item Grid"> + <div class="file has-name is-fullwidth"> + <label class="file-label"> <input type="file" + class="file-input" name="${properties.name}" + ${required} accept="${accepts}" /> <span + class="file-cta"> <span class="file-icon"> + <i class="jam jam-upload"></i> + </span> <span class="file-label"> Browse </span> + </span> <span class="file-name"> No File Selected </span> <span + class="button repeating__remove button">-</span> + </label> + </div> + </div> + </div> + <a class="repeating__add button">+</a> </div> \ No newline at end of file diff --git a/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/fields/repeating/field.jsp b/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/fields/repeating/field.jsp index fec99b8..bd50290 100644 --- a/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/fields/repeating/field.jsp +++ b/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/fields/repeating/field.jsp @@ -24,9 +24,9 @@ <input type="${properties.type}" value="" class="input" name="${properties.name}" ${required} ${disabled} /> </div> <div class="control"> - <button class="repeating__remove button"> + <a class="repeating__remove button"> <span class="jam jam-minus"></span> - </button> + </a> </div> </div> </fieldset> @@ -37,14 +37,14 @@ <input type="${properties.type}" value="${value}" class="input" name="${properties.name}" ${required} ${disabled} /> </div> <div class="control"> - <button class="repeating__remove button"> + <a class="repeating__remove button"> <span class="jam jam-minus"></span> - </button> + </a> </div> </div> </c:forEach> </div> - <button class="repeating__add button"> + <a class="repeating__add button"> <span class="jam jam-plus"></span> - </button> + </a> </div> \ No newline at end of file
