X-Git-Url: http://git.nikiroo.be/?p=nikiroo-utils.git;a=blobdiff_plain;f=library%2Fweb%2Ftemplates%2FWebLibraryServerTemplates.java;h=31abe69919acaf217e85c53c754d7a7d0b54a626;hp=482a1b826e12514a0714cf5cd3256531851d4166;hb=258e065f81071a861711ef935dca3ec5563f4360;hpb=e992c260c059c53c4aabc980db85efd58f190205 diff --git a/library/web/templates/WebLibraryServerTemplates.java b/library/web/templates/WebLibraryServerTemplates.java index 482a1b8..31abe69 100644 --- a/library/web/templates/WebLibraryServerTemplates.java +++ b/library/web/templates/WebLibraryServerTemplates.java @@ -1,4 +1,179 @@ package be.nikiroo.fanfix.library.web.templates; +import java.util.List; + +import be.nikiroo.fanfix.Instance; +import be.nikiroo.fanfix.bundles.UiConfig; +import be.nikiroo.fanfix.library.Template; +import be.nikiroo.utils.Version; + public class WebLibraryServerTemplates { + static private WebLibraryServerTemplates instance = new WebLibraryServerTemplates(); + + static public WebLibraryServerTemplates getInstance() { + return instance; + } + + public Template bookline(String luid, String href, String title, + String author, boolean cached) { + + String cachedClass = "cached"; + String cachedValue = "◉"; + if (!cached) { + cachedClass = "uncached"; + cachedValue = "○"; + } + + return new Template(getClass(), "bookline.html") // + .set("href", href) // + .set("cachedClass", cachedClass) // + .set("cached", cachedValue) // + .set("luid", luid) // + .set("title", title) // + .set("author", author) // + ; + } + + public Template index(boolean banner, List