--- tracblogplugin/0.10/blog/admin.py 2006-05-11 20:45:38.000000000 +0200 +++ tracblogplugin-custom/0.10/blog/admin.py 2006-09-26 18:19:16.000000000 +0200 @@ -63,6 +63,7 @@ 'mark_updated' : 'true', 'nav_bar' : 'true', 'macro_blacklist': '', + 'footer': '', } if req.method == 'POST': if page == 'defaults': @@ -99,6 +100,8 @@ whether or not a '''Blog''' link should be shown in the navigation menu bar. '''Macro Blacklist''':: comma separated list of macros to strip from blog output. + '''Footer''':: + Wiki Formatted data, that will be added to end of every document. You may use Macros. Also use $U for name of current user and $D for "blog post date" according to "Date Format String" '''strftime formatting''':: ||%a||Locale's abbreviated weekday name.|| diff -Nru tracblogplugin/0.10/blog/new_blog.py tracblogplugin-custom/0.10/blog/new_blog.py --- tracblogplugin/0.10/blog/new_blog.py 2006-05-11 20:45:38.000000000 +0200 +++ tracblogplugin-custom/0.10/blog/new_blog.py 2006-09-29 11:29:17.558685672 +0200 @@ -130,10 +130,11 @@ comment = req.args.get('comment', '') readonly = int(req.args.has_key('readonly')) edit_rows = int(req.args.get('edite_rows', 20)) - req_tags = req.args.get('tags', []) + req_tags = req.args.get('tags', []) if req.method == 'POST': if action == 'edit': + if req.args.has_key('cancel'): req.redirect(self.env.href.blog()) page = WikiPage(self.env, pagename, None) @@ -147,7 +148,9 @@ if blogtitle: page.text = ''.join([titleline, wikitext]) else: - page.text = wikitext + page.text = wikitext + # Add footer + page.text = page.text.join(["\n\n",self.variable_substitution(req,self.env.config.get('blog', 'footer', ''))]) page.readonly = readonly page.save(req.authname, comment, req.remote_addr) # taglist = [x.strip() for x in req_tags.split(',') if x] @@ -207,11 +210,16 @@ } if preview: if blogtitle: - info['page_html'] = wiki_to_html(''.join([titleline, - req.args.get('text')]), + info['page_html'] = wiki_to_html(''.join([titleline, + req.args.get('text'), + "\n\n",self.variable_substitution(req,self.env.config.get('blog', 'footer', ''))]), self.env, req, db) else: - info['page_html'] = wiki_to_html(page.text, self.env, req, db) + info['page_html'] = wiki_to_html(page.text.join(["\n\n", + self.variable_substitution(req,self.env.config.get('blog', 'footer', ''))]), + self.env, + req, + db) info['readonly'] = int(req.args.has_key('readonly')) req.hdf['blog'] = info @@ -238,4 +246,7 @@ """ return [('blog', resource_filename(__name__, 'htdocs'))] - + def variable_substitution(self,req,string): + string = string.replace('$U',req.authname) + string = string.replace('$D',time.strftime(self.env.config.get('blog', 'date_format', '%x %X'))) + return string \ No newline at end of file diff -Nru tracblogplugin/0.10/blog/templates/blog_admin.cs tracblogplugin-custom/0.10/blog/templates/blog_admin.cs --- tracblogplugin/0.10/blog/templates/blog_admin.cs 2006-05-04 00:57:22.000000000 +0200 +++ tracblogplugin-custom/0.10/blog/templates/blog_admin.cs 2006-09-26 17:14:39.000000000 +0200 @@ -66,6 +66,11 @@ value="" /> +