changeset 2479:0d6c53e6c591

plugin blog static: added background parameter, to set an image
author Goffi <goffi@goffi.org>
date Mon, 22 Jan 2018 08:36:36 +0100
parents e5acc83a9d51
children dc55b854ccf3
files src/plugins/plugin_misc_static_blog.py
diffstat 1 files changed, 21 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/src/plugins/plugin_misc_static_blog.py	Sun Jan 21 20:20:38 2018 +0100
+++ b/src/plugins/plugin_misc_static_blog.py	Mon Jan 22 08:36:36 2018 +0100
@@ -44,29 +44,32 @@
 
 class StaticBlog(object):
 
-    params = """
+    params = u"""
     <params>
     <individual>
-    <category name="%(category_name)s" label="%(category_label)s">
-        <param name="%(title_name)s" label="%(title_label)s" value="" type="string" security="0"/>
-        <param name="%(banner_name)s" label="%(banner_label)s" value="" type="string" security="0"/>
-        <param name="%(keywords_name)s" label="%(keywords_label)s" value="" type="string" security="0"/>
-        <param name="%(description_name)s" label="%(description_label)s" value="" type="string" security="0"/>
+    <category name="{category_name}" label="{category_label}">
+        <param name="{title_name}" label="{title_label}" value="" type="string" security="0"/>
+        <param name="{banner_name}" label="{banner_label}" value="" type="string" security="0"/>
+        <param name="{background_name}" label="{background_label}" value ="" type="string" security="0"/>
+        <param name="{keywords_name}" label="{keywords_label}" value="" type="string" security="0"/>
+        <param name="{description_name}" label="{description_label}" value="" type="string" security="0"/>
      </category>
     </individual>
     </params>
-    """ % {
-        'category_name': C.STATIC_BLOG_KEY,
-        'category_label': D_(C.STATIC_BLOG_KEY),
-        'title_name': C.STATIC_BLOG_PARAM_TITLE,
-        'title_label': D_('Page title'),
-        'banner_name': C.STATIC_BLOG_PARAM_BANNER,
-        'banner_label': D_('Banner URL'),
-        'keywords_name': C.STATIC_BLOG_PARAM_KEYWORDS,
-        'keywords_label': D_('Keywords'),
-        'description_name': C.STATIC_BLOG_PARAM_DESCRIPTION,
-        'description_label': D_('Description'),
-    }
+    """.format(
+        category_name = C.STATIC_BLOG_KEY,
+        category_label = D_(C.STATIC_BLOG_KEY),
+        title_name = C.STATIC_BLOG_PARAM_TITLE,
+        title_label = D_('Page title'),
+        banner_name = C.STATIC_BLOG_PARAM_BANNER,
+        banner_label = D_('Banner URL'),
+        background_name = u"Background",
+        background_label = D_(u"Background image URL"),
+        keywords_name = C.STATIC_BLOG_PARAM_KEYWORDS,
+        keywords_label = D_('Keywords'),
+        description_name = C.STATIC_BLOG_PARAM_DESCRIPTION,
+        description_label = D_('Description'),
+    )
 
     def __init__(self, host):
         try:  # TODO: remove this attribute when all blogs can be retrieved