From daa4b0b30b8c63b80f4c9047406be5a36c664070 Mon Sep 17 00:00:00 2001 From: souliane Date: Tue, 13 May 2014 17:17:57 +0200 Subject: [PATCH] plugin misc_static_blog: renamed from tmp_blog_banner, now also with page's title, meta keywords and description --- src/core/constants.py | 7 +++- ...g_banner.py => plugin_misc_static_blog.py} | 38 +++++++++++-------- 2 files changed, 29 insertions(+), 16 deletions(-) rename src/plugins/{plugin_tmp_blog_banner.py => plugin_misc_static_blog.py} (50%) diff --git a/src/core/constants.py b/src/core/constants.py index b7b30205..c2ae5c5c 100644 --- a/src/core/constants.py +++ b/src/core/constants.py @@ -40,7 +40,12 @@ class Const(object): NO_SECURITY_LIMIT = -1 INDIVIDUAL = "individual" GENERAL = "general" - + # Parameters for static blog pages + STATIC_BLOG_KEY = "Blog page" + STATIC_BLOG_PARAM_TITLE = "Title" + STATIC_BLOG_PARAM_BANNER = "Banner" + STATIC_BLOG_PARAM_KEYWORDS = "Keywords" + STATIC_BLOG_PARAM_DESCRIPTION = "Description" ## Profile and entities ## PROF_KEY_NONE = '@NONE@' diff --git a/src/plugins/plugin_tmp_blog_banner.py b/src/plugins/plugin_misc_static_blog.py similarity index 50% rename from src/plugins/plugin_tmp_blog_banner.py rename to src/plugins/plugin_misc_static_blog.py index 94922aaf..52bd4658 100644 --- a/src/plugins/plugin_tmp_blog_banner.py +++ b/src/plugins/plugin_misc_static_blog.py @@ -1,7 +1,7 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# SAT temporary plugin for setting a blog banner +# SAT plugin for static blogs # Copyright (C) 2014 Adrien Cossa (souliane@mailoo.org) # This program is free software: you can redistribute it and/or modify @@ -19,37 +19,45 @@ from sat.core.i18n import _, D_ +from sat.core.constants import Const as C + PLUGIN_INFO = { - "name": "Blog Banner Plugin", - "import_name": "BLOG-BANNER", - "type": "TMP", + "name": "Static Blog Plugin", + "import_name": "STATIC-BLOG", + "type": "MISC", "protocols": [], "dependencies": [], - "main": "BlogBanner", + "main": "StaticBlog", "handler": "no", - "description": _("""Temporary plugin for setting a blog banner""") + "description": _("""Plugin for static blogs""") } -PARAM_KEY = "Misc" -PARAM_NAME_BANNER = "Blog banner" - -class BlogBanner(object): +class StaticBlog(object): params = """ - + + + + """ % { - 'category_name': PARAM_KEY, - 'category_label': D_(PARAM_KEY), - 'param_name': PARAM_NAME_BANNER, - 'param_label': D_('Blog banner URL') + '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'), } def __init__(self, host):