Skip to content

Commit

Permalink
Thymeleaf BETA03 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jpenren committed Apr 21, 2016
1 parent 9265b61 commit caf03d2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>io.github.jpenren</groupId>
<artifactId>thymeleaf-spring-data-dialect</artifactId>
<version>3.0.0.BETA02</version>
<version>3.0.0.BETA03</version>

<name>Thymeleaf Spring Data Dialect</name>
<description>Data pagination made easy with Thymeleaf and Spring Data</description>
Expand Down Expand Up @@ -102,7 +102,7 @@
<dependency>
<groupId>org.thymeleaf</groupId>
<artifactId>thymeleaf</artifactId>
<version>3.0.0.BETA02</version>
<version>3.0.0.BETA03</version>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ protected void doProcess(ITemplateContext context,
String attrValue = String.valueOf(attributeValue).trim();
PaginationDecorator decorator = PaginationDecoratorRegistry.getInstance().getDecorator(attrValue);
String html = decorator.decorate(tag, context);

boolean isUlNode = Strings.UL.equalsIgnoreCase(tag.getElementName());
boolean isUlNode = Strings.UL.equalsIgnoreCase(tag.getElementCompleteName());
if (isUlNode) {
structureHandler.replaceWith(html, false);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ protected void doProcess(ITemplateContext context,
Sort sort = page.getSort();
boolean isSorted = sort != null && sort.getOrderFor(attributeValue) != null;
String clas = isSorted ? SORTED_PREFIX.concat(sort.getOrderFor(attributeValue).getDirection().toString().toLowerCase()) : EMPTY;

tag.getAttributes().setAttribute(HREF, url);
String currentClass = tag.getAttributes().getValue(CLASS);
tag.getAttributes().setAttribute(CLASS, Strings.concat(currentClass, BLANK, clas));
structureHandler.setAttribute(HREF, url);
String currentClass = tag.getAttributeValue(CLASS);
structureHandler.setAttribute(CLASS, Strings.concat(currentClass, BLANK, clas));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ public String decorate(final IProcessableElementTag tag, final ITemplateContext
String lastPage = PageUtils.createPageUrl(context, page.getTotalPages()-1);
String raquo = isLastPage ? getRaquo(locale) : getRaquo(lastPage, locale);

boolean isUl = Strings.UL.equalsIgnoreCase(tag.getElementName());
String currentClass = tag.getAttributes().getValue(Strings.CLASS);
boolean isUl = Strings.UL.equalsIgnoreCase(tag.getElementCompleteName());
String currentClass = tag.getAttributeValue(Strings.CLASS);
String clas = (isUl && !Strings.isEmpty(currentClass)) ? currentClass : DEFAULT_CLASS;

return Messages.getMessage(BUNDLE_NAME, "pagination", locale, clas, laquo, previous, pageLinks, next, raquo);
Expand Down

0 comments on commit caf03d2

Please sign in to comment.