comparison src/plugins/plugin_misc_static_blog.py @ 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 33c8c4973743
children
comparison
equal deleted inserted replaced
2478:e5acc83a9d51 2479:0d6c53e6c591
42 } 42 }
43 43
44 44
45 class StaticBlog(object): 45 class StaticBlog(object):
46 46
47 params = """ 47 params = u"""
48 <params> 48 <params>
49 <individual> 49 <individual>
50 <category name="%(category_name)s" label="%(category_label)s"> 50 <category name="{category_name}" label="{category_label}">
51 <param name="%(title_name)s" label="%(title_label)s" value="" type="string" security="0"/> 51 <param name="{title_name}" label="{title_label}" value="" type="string" security="0"/>
52 <param name="%(banner_name)s" label="%(banner_label)s" value="" type="string" security="0"/> 52 <param name="{banner_name}" label="{banner_label}" value="" type="string" security="0"/>
53 <param name="%(keywords_name)s" label="%(keywords_label)s" value="" type="string" security="0"/> 53 <param name="{background_name}" label="{background_label}" value ="" type="string" security="0"/>
54 <param name="%(description_name)s" label="%(description_label)s" value="" type="string" security="0"/> 54 <param name="{keywords_name}" label="{keywords_label}" value="" type="string" security="0"/>
55 <param name="{description_name}" label="{description_label}" value="" type="string" security="0"/>
55 </category> 56 </category>
56 </individual> 57 </individual>
57 </params> 58 </params>
58 """ % { 59 """.format(
59 'category_name': C.STATIC_BLOG_KEY, 60 category_name = C.STATIC_BLOG_KEY,
60 'category_label': D_(C.STATIC_BLOG_KEY), 61 category_label = D_(C.STATIC_BLOG_KEY),
61 'title_name': C.STATIC_BLOG_PARAM_TITLE, 62 title_name = C.STATIC_BLOG_PARAM_TITLE,
62 'title_label': D_('Page title'), 63 title_label = D_('Page title'),
63 'banner_name': C.STATIC_BLOG_PARAM_BANNER, 64 banner_name = C.STATIC_BLOG_PARAM_BANNER,
64 'banner_label': D_('Banner URL'), 65 banner_label = D_('Banner URL'),
65 'keywords_name': C.STATIC_BLOG_PARAM_KEYWORDS, 66 background_name = u"Background",
66 'keywords_label': D_('Keywords'), 67 background_label = D_(u"Background image URL"),
67 'description_name': C.STATIC_BLOG_PARAM_DESCRIPTION, 68 keywords_name = C.STATIC_BLOG_PARAM_KEYWORDS,
68 'description_label': D_('Description'), 69 keywords_label = D_('Keywords'),
69 } 70 description_name = C.STATIC_BLOG_PARAM_DESCRIPTION,
71 description_label = D_('Description'),
72 )
70 73
71 def __init__(self, host): 74 def __init__(self, host):
72 try: # TODO: remove this attribute when all blogs can be retrieved 75 try: # TODO: remove this attribute when all blogs can be retrieved
73 self.domain = host.plugins['MISC-ACCOUNT'].getNewAccountDomain() 76 self.domain = host.plugins['MISC-ACCOUNT'].getNewAccountDomain()
74 except KeyError: 77 except KeyError: