<#if bookMap?exists>
<#list bookMap?keys as bookKey>
<#if bookKey_index%2 = 0>
<tr class="odd">
<#else>
<tr class="even">
</#if>
<#assign values = bookMap[bookKey]>
<#if values?exists>
<#if values["book"]?exists>
<#assign book = values["book"]>
<td>${book.isbn?default("")}</td>
<td><a href="/book/show/${book.id?c}">${book.title?default("")}</a></td>
<td>
<#if values["authorList"]?exists>
<#assign authors=values["authorList"]>
<#if authors?exists>
<#list authors as author>
${author.username?default("")}
</#list>
</#if>
</#if>
</td>
<#if book.pubdate??><td>${book.pubdate?string("yyyy-MM-dd")}</td><#else><td> </td></#if>
<td>${book.publisher?default("")}</td>
</#if>
</#if>
</tr>
</#list>
</#if>
<#list bookMap?keys as bookKey>
<#if bookKey_index%2 = 0>
<tr class="odd">
<#else>
<tr class="even">
</#if>
<#assign values = bookMap[bookKey]>
<#if values?exists>
<#if values["book"]?exists>
<#assign book = values["book"]>
<td>${book.isbn?default("")}</td>
<td><a href="/book/show/${book.id?c}">${book.title?default("")}</a></td>
<td>
<#if values["authorList"]?exists>
<#assign authors=values["authorList"]>
<#if authors?exists>
<#list authors as author>
${author.username?default("")}
</#list>
</#if>
</#if>
</td>
<#if book.pubdate??><td>${book.pubdate?string("yyyy-MM-dd")}</td><#else><td> </td></#if>
<td>${book.publisher?default("")}</td>
</#if>
</#if>
</tr>
</#list>
</#if>
图书信息展示模板解析
本文介绍了一个用于展示图书信息的模板实现方式,包括ISBN、书名、作者列表、出版日期及出版社等字段的显示逻辑。该模板通过遍历图书集合并根据特定条件设置表格行的样式来呈现数据。

303

被折叠的 条评论
为什么被折叠?



