protected final void processTemplate(FreenetRequest request, TemplateContext templateContext) throws RedirectException {
super.processTemplate(request, templateContext);
Sone currentSone = getCurrentSoneWithoutCreatingSession(request.getToadletContext());
- templateContext.set("core", webInterface.getCore());
+ templateContext.set("preferences", webInterface.getCore().getPreferences());
templateContext.set("currentSone", currentSone);
templateContext.set("localSones", webInterface.getCore().getLocalSones());
templateContext.set("request", request);
</div>
<%/if>
- <%foreach album.images image|paginate pageSize=core.preferences.imagesPerPage page=page>
+ <%foreach album.images image|paginate pageSize=preferences.imagesPerPage page=page>
<%first>
<h2><%= Page.ImageBrowser.Header.Images|l10n|html></h2>
<%include include/pagination.html pageParameter=="page">
<%elseif galleryRequested>
- <%foreach albums album|paginate pageSize=core.preferences.imagesPerPage pageParameter=request.page pagination=albumPagination>
+ <%foreach albums album|paginate pageSize=preferences.imagesPerPage pageParameter=request.page pagination=albumPagination>
<%first>
<h2><%= Page.ImageBrowser.Header.Albums|l10n|html></h2>
<%include include/pagination.html pagination=albumPagination pageParameter=="page">
<% post.text|html|store key==originalText text==true>
<% post.text|parse sone=post.sone|store key==parsedText>
<% parsedText|render|store key==renderedText text==true>
- <% parsedText|shorten length=core.preferences.charactersPerPost cut-off-length=core.preferences.postCutOffLength|render|store key==shortText text==true>
+ <% parsedText|shorten length=preferences.charactersPerPost cut-off-length=preferences.postCutOffLength|render|store key==shortText text==true>
<div class="post-text raw-text<%if !raw> hidden<%/if>"><% originalText></div>
<div class="post-text text<%if raw> hidden<%/if><%if !shortText|match key=renderedText> hidden<%/if>"><% renderedText></div>
<div class="post-text short-text<%if raw> hidden<%/if><%if shortText|match key=renderedText> hidden<%/if>"><% shortText></div>
<% reply.text|html|store key==originalText text==true>
<% reply.text|parse sone=reply.sone|store key==parsedText>
<% parsedText|render|store key==renderedText text==true>
- <% parsedText|shorten length=core.preferences.charactersPerPost cut-off-length=core.preferences.postCutOffLength|render|store key==shortText text==true>
+ <% parsedText|shorten length=preferences.charactersPerPost cut-off-length=preferences.postCutOffLength|render|store key==shortText text==true>
<div class="reply-text raw-text<%if !raw> hidden<%/if>"><% originalText></div>
<div class="reply-text text<%if raw> hidden<%/if><%if !shortText|match key=renderedText> hidden<%/if>"><% renderedText></div>
<div class="reply-text short-text<%if raw> hidden<%/if><%if shortText|match key=renderedText> hidden<%/if>"><% shortText></div>
*/
class SoneTemplatePageTest : WebPageTest() {
- // @get:JvmName("getPage1")
+ private val preferences by lazy { core.preferences!! }
private val page = object : SoneTemplatePage("path.html", template, webInterface, true) {}
@Test
}
@Test
- fun `core is set in template context`() {
- verifyVariableIsSet("core", core)
+ fun `preferences are set in template context`() {
+ verifyVariableIsSet("preferences", preferences)
}
@Test