Skip to content

Commit e2bc1ed

Browse files
committed
Don't wrap list view in 10-column div. Fix checkbox template for latest version of Bootstrap.
1 parent 3f6d185 commit e2bc1ed

File tree

5 files changed

+86
-89
lines changed

5 files changed

+86
-89
lines changed

plugins/appfuse-maven-plugin/src/main/resources/appfuse/web/jsf/list-view.ftl

Lines changed: 43 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -9,57 +9,55 @@
99
<ui:define name="bodyId">${pojoNameLower}List</ui:define>
1010

1111
<ui:define name="body">
12-
<div class="col-sm-10">
13-
<h2>${'#'}{text['${pojoNameLower}List.heading']}</h2>
12+
<h2>${'#'}{text['${pojoNameLower}List.heading']}</h2>
1413

15-
<h:form id="searchForm" styleClass="form-inline">
16-
<div id="search" class="text-right">
17-
<span class="col-sm-9">
18-
<h:inputText id="q" name="q" size="20" value="${'#'}{${pojoNameLower}List.query}" styleClass="form-control input-sm"/>
19-
</span>
20-
<h:commandButton value="${'#'}{text['button.search']}" styleClass="btn btn-default btn-sm" action="${'#'}{${pojoNameLower}List.search}"/>
21-
</div>
22-
</h:form>
14+
<h:form id="searchForm" styleClass="form-inline">
15+
<div id="search" class="text-right">
16+
<span class="col-sm-9">
17+
<h:inputText id="q" name="q" size="20" value="${'#'}{${pojoNameLower}List.query}" styleClass="form-control input-sm"/>
18+
</span>
19+
<h:commandButton value="${'#'}{text['button.search']}" styleClass="btn btn-default btn-sm" action="${'#'}{${pojoNameLower}List.search}"/>
20+
</div>
21+
</h:form>
2322

24-
<p>${'#'}{text['${pojoNameLower}List.message']}</p>
23+
<p>${'#'}{text['${pojoNameLower}List.message']}</p>
2524

26-
<h:form id="edit${pojo.shortName}">
25+
<h:form id="edit${pojo.shortName}">
2726

28-
<div id="actions" class="btn-group">
29-
<h:commandButton value="${'#'}{text['button.add']}" action="add" id="add" immediate="true" styleClass="btn btn-primary"/>
30-
<h:commandButton value="${'#'}{text['button.done']}" action="home" id="cancel" immediate="true" styleClass="btn btn-default"/>
31-
</div>
27+
<div id="actions" class="btn-group">
28+
<h:commandButton value="${'#'}{text['button.add']}" action="add" id="add" immediate="true" styleClass="btn btn-primary"/>
29+
<h:commandButton value="${'#'}{text['button.done']}" action="home" id="cancel" immediate="true" styleClass="btn btn-default"/>
30+
</div>
3231

33-
<p:dataTable id="${util.getPluralForWord(pojoNameLower)}" var="${pojoNameLower}" value="${'#'}{${pojoNameLower}List.${util.getPluralForWord(pojoNameLower)}}"
34-
sortBy="${'#'}{${pojoNameLower}List.sortColumn}" paginator="true" rows="25"
35-
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
36-
rowsPerPageTemplate="5,10,15">
37-
<#foreach field in pojo.getAllPropertiesIterator()>
38-
<p:column>
39-
<f:facet name="header">
40-
<p:column sortBy="${field.name}">
41-
<h:outputText value="${'#'}{text['${pojoNameLower}.${field.name}']}" />
42-
</p:column>
43-
</f:facet>
44-
<#if field.equals(pojo.identifierProperty)>
45-
<h:commandLink action="${'#'}{${pojoNameLower}Form.edit}" value="${'#'}{${pojoNameLower}.${field.name}}">
46-
<f:param name="${field.name}" value="${'#'}{${pojoNameLower}.${field.name}}"/>
47-
<f:param name="from" value="list"/>
48-
</h:commandLink>
49-
<#elseif !c2h.isCollection(field) && !c2h.isManyToOne(field) && !c2j.isComponent(field)>
50-
<#if field.value.typeName == "java.util.Date" || field.value.typeName == "date">
51-
<#lt/> <h:outputText value="${'#'}{${pojoNameLower}.${field.name}}" escape="true"/>
52-
<#elseif field.value.typeName == "boolean">
53-
<#lt/> <h:selectBooleanCheckbox value="${'#'}{${pojoNameLower}Form.${pojoNameLower}.${field.name}}" id="${field.name}" disabled="disabled"/>
54-
<#else>
55-
<#lt/> <h:outputText value="${'#'}{${pojoNameLower}.${field.name}}" escape="true"/>
56-
</#if>
32+
<p:dataTable id="${util.getPluralForWord(pojoNameLower)}" var="${pojoNameLower}" value="${'#'}{${pojoNameLower}List.${util.getPluralForWord(pojoNameLower)}}"
33+
sortBy="${'#'}{${pojoNameLower}List.sortColumn}" paginator="true" rows="25"
34+
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
35+
rowsPerPageTemplate="5,10,15">
36+
<#foreach field in pojo.getAllPropertiesIterator()>
37+
<p:column>
38+
<f:facet name="header">
39+
<p:column sortBy="${field.name}">
40+
<h:outputText value="${'#'}{text['${pojoNameLower}.${field.name}']}" />
41+
</p:column>
42+
</f:facet>
43+
<#if field.equals(pojo.identifierProperty)>
44+
<h:commandLink action="${'#'}{${pojoNameLower}Form.edit}" value="${'#'}{${pojoNameLower}.${field.name}}">
45+
<f:param name="${field.name}" value="${'#'}{${pojoNameLower}.${field.name}}"/>
46+
<f:param name="from" value="list"/>
47+
</h:commandLink>
48+
<#elseif !c2h.isCollection(field) && !c2h.isManyToOne(field) && !c2j.isComponent(field)>
49+
<#if field.value.typeName == "java.util.Date" || field.value.typeName == "date">
50+
<#lt/> <h:outputText value="${'#'}{${pojoNameLower}.${field.name}}" escape="true"/>
51+
<#elseif field.value.typeName == "boolean">
52+
<#lt/> <h:selectBooleanCheckbox value="${'#'}{${pojoNameLower}Form.${pojoNameLower}.${field.name}}" id="${field.name}" disabled="disabled"/>
53+
<#else>
54+
<#lt/> <h:outputText value="${'#'}{${pojoNameLower}.${field.name}}" escape="true"/>
5755
</#if>
58-
</p:column>
59-
</#foreach>
60-
</p:dataTable>
61-
</h:form>
62-
</div>
56+
</#if>
57+
</p:column>
58+
</#foreach>
59+
</p:dataTable>
60+
</h:form>
6361
</ui:define>
6462
</ui:composition>
6563
</html>

plugins/appfuse-maven-plugin/src/main/resources/appfuse/web/spring/list-view.ftl

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,27 @@
1313
</div>
1414
</c:if>
1515

16-
<h2><fmt:message key="${pojoNameLower}List.heading"/></h2>
16+
<h2><fmt:message key="${pojoNameLower}List.heading"/></h2>
1717

18-
<form method="get" action="${'$'}{ctx}/${util.getPluralForWord(pojoNameLower)}" id="searchForm" class="form-inline">
19-
<div id="search" class="text-right">
20-
<span class="col-sm-9">
21-
<input type="text" size="20" name="q" id="query" value="${'$'}{param.q}"
22-
placeholder="<fmt:message key="search.enterTerms"/>" class="form-control input-sm"/>
23-
</span>
24-
<button id="button.search" class="btn btn-default btn-sm" type="submit">
25-
<i class="icon-search"></i> <fmt:message key="button.search"/>
26-
</button>
27-
</div>
28-
</form>
18+
<form method="get" action="${'$'}{ctx}/${util.getPluralForWord(pojoNameLower)}" id="searchForm" class="form-inline">
19+
<div id="search" class="text-right">
20+
<span class="col-sm-9">
21+
<input type="text" size="20" name="q" id="query" value="${'$'}{param.q}"
22+
placeholder="<fmt:message key="search.enterTerms"/>" class="form-control input-sm"/>
23+
</span>
24+
<button id="button.search" class="btn btn-default btn-sm" type="submit">
25+
<i class="icon-search"></i> <fmt:message key="button.search"/>
26+
</button>
27+
</div>
28+
</form>
2929

30-
<p><fmt:message key="${pojoNameLower}List.message"/></p>
30+
<p><fmt:message key="${pojoNameLower}List.message"/></p>
3131

32-
<div id="actions" class="btn-group">
33-
<a href='<c:url value="/${pojoNameLower}form"/>' class="btn btn-primary">
34-
<i class="icon-plus icon-white"></i> <fmt:message key="button.add"/></a>
35-
<a href='<c:url value="/home"/>' class="btn btn-default"><i class="icon-ok"></i> <fmt:message key="button.done"/></a>
36-
</div>
32+
<div id="actions" class="btn-group">
33+
<a href='<c:url value="/${pojoNameLower}form"/>' class="btn btn-primary">
34+
<i class="icon-plus icon-white"></i> <fmt:message key="button.add"/></a>
35+
<a href='<c:url value="/home"/>' class="btn btn-default"><i class="icon-ok"></i> <fmt:message key="button.done"/></a>
36+
</div>
3737

3838
<display:table name="${pojoNameLower}List" class="table table-condensed table-striped table-hover" requestURI="" id="${pojoNameLower}List" export="true" pagesize="25">
3939
<#foreach field in pojo.getAllPropertiesIterator()>

plugins/appfuse-maven-plugin/src/main/resources/appfuse/web/struts/list-view.ftl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
<title><fmt:message key="${pojoNameLower}List.title"/></title>
66
<meta name="menu" content="${pojo.shortName}Menu"/>
77
</head>
8-
9-
<div class="col-sm-10">
8+
<body>
109
<h2><fmt:message key="${pojoNameLower}List.heading"/></h2>
1110

1211
<form method="get" action="${'$'}{ctx}/${util.getPluralForWord(pojoNameLower)}" id="searchForm" class="form-inline">
@@ -60,4 +59,4 @@
6059
<display:setProperty name="export.csv.filename"><fmt:message key="${pojoNameLower}List.title"/>.csv</display:setProperty>
6160
<display:setProperty name="export.pdf.filename"><fmt:message key="${pojoNameLower}List.title"/>.pdf</display:setProperty>
6261
</display:table>
63-
</div>
62+
</body>

plugins/appfuse-maven-plugin/src/main/resources/appfuse/web/tapestry/list-view.ftl

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,29 +10,29 @@
1010
</div>
1111
</t:if>
1212

13-
<div class="col-sm-10">
14-
<h2>${'$'}{message:${pojoNameLower}List.heading}</h2>
13+
<h2>${'$'}{message:${pojoNameLower}List.heading}</h2>
1514

16-
<form t:type="form" method="get" t:id="searchForm" autofocus="false" class="form-inline">
17-
<div id="search" class="text-right">
18-
<span class="col-sm-9">
19-
<t:textfield size="20" name="q" t:id="q" placeholder="${'$'}{message:search.enterTerms}" class="form-control input-sm"/>
20-
</span>
21-
<button type="submit" class="btn btn-default btn-sm"><i class="icon-search"></i> ${'$'}{message:button.search}</button>
22-
</div>
23-
</form>
15+
<form t:type="form" method="get" t:id="searchForm" autofocus="false" class="form-inline">
16+
<div id="search" class="text-right">
17+
<span class="col-sm-9">
18+
<t:textfield size="20" name="q" t:id="q" placeholder="${'$'}{message:search.enterTerms}" class="form-control input-sm"/>
19+
</span>
20+
<button type="submit" class="btn btn-default btn-sm"><i class="icon-search"></i> ${'$'}{message:button.search}</button>
21+
</div>
22+
</form>
2423

25-
<div id="actions" class="btn-group">
26-
<a t:type="eventlink" event="add" id="add" class="btn btn-primary"><i class="icon-plus icon-white"></i> ${'$'}{message:button.add}</a>
27-
<a t:type="eventlink" event="done" id="done" class="btn btn-default"><i class="icon-ok"></i> ${'$'}{message:button.done}</a>
28-
</div>
24+
<p>${'$'}{message:${pojoNameLower}List.message}</p>
2925

30-
<t:grid source="${util.getPluralForWord(pojoNameLower)}" row="${pojoNameLower}" id="${pojoNameLower}List" class="table table-condensed table-striped table-hover">
31-
<p:${pojo.identifierProperty.name}cell>
32-
<a t:type="actionlink" t:id="edit" context="${pojoNameLower}.${pojo.identifierProperty.name}" id="${pojoNameLower}-${'$'}{${pojoNameLower}.${pojo.identifierProperty.name}}">
33-
${'$'}{${pojoNameLower}.${pojo.identifierProperty.name}}
34-
</a>
35-
</p:${pojo.identifierProperty.name}cell>
36-
</t:grid>
26+
<div id="actions" class="btn-group">
27+
<a t:type="eventlink" event="add" id="add" class="btn btn-primary"><i class="icon-plus icon-white"></i> ${'$'}{message:button.add}</a>
28+
<a t:type="eventlink" event="done" id="done" class="btn btn-default"><i class="icon-ok"></i> ${'$'}{message:button.done}</a>
3729
</div>
30+
31+
<t:grid source="${util.getPluralForWord(pojoNameLower)}" row="${pojoNameLower}" id="${pojoNameLower}List" class="table table-condensed table-striped table-hover">
32+
<p:${pojo.identifierProperty.name}cell>
33+
<a t:type="actionlink" t:id="edit" context="${pojoNameLower}.${pojo.identifierProperty.name}" id="${pojoNameLower}-${'$'}{${pojoNameLower}.${pojo.identifierProperty.name}}">
34+
${'$'}{${pojoNameLower}.${pojo.identifierProperty.name}}
35+
</a>
36+
</p:${pojo.identifierProperty.name}cell>
37+
</t:grid>
3838
</html>

web/struts/src/main/webapp/template/css_xhtml/checkbox.ftl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ that for checkboxes we do not want the label field to show up as checkboxes hand
2626
lables
2727
-->
2828
<#assign hasFieldErrors = fieldErrors?? && fieldErrors[parameters.name]??/>
29-
<fieldset class="form-group<#if hasFieldErrors> has-error</#if>">
30-
<label class="checkbox">
29+
<fieldset class="checkbox<#if hasFieldErrors> has-error</#if>">
30+
<label>
3131
<#include "/${parameters.templateDir}/simple/checkbox.ftl" />
3232
${parameters.label?html}
3333
</label>

0 commit comments

Comments
 (0)