Skip to content

Commit

Permalink
Merge pull request #156 from justinedelson/feature/definition-list-co…
Browse files Browse the repository at this point in the history
…mponent

Adding a simple definition list component
  • Loading branch information
justinedelson committed Mar 23, 2014
2 parents 399cac0 + abb171e commit 81efb73
Show file tree
Hide file tree
Showing 7 changed files with 104 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:description="Definition List composed of terms and definitions."
jcr:primaryType="cq:Component"
jcr:title="Definition List"
sling:resourceSuperType="foundation/components/parbase"
componentGroup="General"/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<%--
#%L
ACS AEM Commons Package
%%
Copyright (C) 2014 Adobe
%%
Licensed 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.
#L%
--%>
<%@include file="/libs/foundation/global.jsp" %>
<%@ taglib prefix="wcmmode" uri="http://www.adobe.com/consulting/acs-aem-commons/wcmmode" %><%
%><%@ taglib prefix="widgets" uri="http://www.adobe.com/consulting/acs-aem-commons/widgets" %><%
%><%@ taglib prefix="xss" uri="http://www.adobe.com/consulting/acs-aem-commons/xss" %>
<c:set var="definitions" value="${widgets:getMultiFieldPanelValues(resource, 'definitions')}"/>
<c:choose>
<c:when test="${empty definitions}">
<wcmmode:edit><img class="cq-dl-placeholder cq-block-placeholder" src="/etc/designs/default/0.gif"/></wcmmode:edit>
</c:when>
<c:otherwise>
<dl>
<c:forEach items="${definitions}" var="definition">
<dt>${xss:encodeForHTML(xssAPI, definition['term'])}</dt>
<dd>${xss:encodeForHTML(xssAPI, definition['definition'])}</dt>
</c:forEach>
</dl>
</c:otherwise>
</c:choose>
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:primaryType="cq:Dialog"
title="Definition List"
width="600"
xtype="dialog">
<items
jcr:primaryType="cq:Widget"
xtype="tabpanel">
<items jcr:primaryType="cq:WidgetCollection">
<tab1
jcr:primaryType="cq:Panel"
title="Definitions">
<items jcr:primaryType="cq:WidgetCollection">
<definitions
jcr:primaryType="cq:Widget"
fieldLabel="Definitions"
name="./definitions"
orderable="{Boolean}true"
xtype="multifield">
<fieldConfig
jcr:primaryType="cq:Widget"
xtype="multifieldpanel">
<items jcr:primaryType="cq:WidgetCollection">
<term
jcr:primaryType="cq:Widget"
fieldLabel="Term"
key="term"
width="250"
xtype="textfield"/>
<definition
jcr:primaryType="cq:Widget"
fieldLabel="Definition"
key="definition"
width="250"
xtype="textarea"/>
</items>
</fieldConfig>
</definitions>
<typehint
jcr:primaryType="cq:Widget"
ignoreValue="{Boolean}true"
name="./definitions@TypeHint"
value="String[]"
xtype="hidden"/>
</items>
</tab1>
</items>
</items>
</jcr:root>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,13 @@ body {
.cq-placeholder-base;
background: url("../images/placeholders/cq-audio-placeholder.png" ) no-repeat scroll 50% 50%;
}

.cq-dl-placeholder {
.cq-placeholder-base;
background: url("../images/placeholders/cq-dl-placeholder.png" ) no-repeat scroll 50% 50%;
}

.cq-ul-placeholder {
.cq-placeholder-base;
background: url("../images/placeholders/cq-ul-placeholder.png" ) no-repeat scroll 50% 50%;
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 81efb73

Please sign in to comment.