Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#10995 closed enhancement (fixed)

[PATCH] Use add_script_data to pass data instead directly using TemplateLoader and render.

Reported by: Jun Omae Owned by: Dirk Stöcker
Priority: normal Component: TracIniAdminPanelPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.12


The plugin currently directly use genshi.template.TemplateLoader and the rendering to pass data. I think that code is complicated. It would be simple to use add_script_data.


Attachments (3)

Change History (12)

comment:1 Changed 4 years ago by Dirk Stöcker

Sorry, that patch conflicts with the changes from #10994. Can you please recreate it?

comment:2 Changed 4 years ago by Dirk Stöcker

P.S. Please use "trunk". While I probably will fix large bugs and security issues, I don't plan to update the 0.12 branch in any other way.

comment:3 Changed 4 years ago by Jun Omae

Ok. Understand iniadminpanel branch policy.

I just created my patch, traciniadminpanel-use-add-script-data-r12853-trunk.diff for trunk.

comment:4 Changed 4 years ago by Dirk Stöcker

Resolution: fixed
Status: newclosed

(In [12855]) fix #10995 - optimize handling of javascript data passing

comment:5 Changed 4 years ago by Dirk Stöcker

Maybe you also know a solution for a small issue: The descriptions should get wiki formated properly, currently they are output as text.

comment:6 Changed 4 years ago by Jun Omae

Use format_to_html instead of format_to_oneline or wiki_to_html on genshi template. New patch, traciniadminpanel-wiki-to-html-r12855-trunk.diff, it would use wiki_to_html on genshi template.

comment:7 Changed 4 years ago by Dirk Stöcker

(In [12859]) see #10995: proper formating of doc texts

comment:8 Changed 4 years ago by Dirk Stöcker

Applied with modifications for better style.

Only problem I see is that wiki_to_html is described as deprecated in trac code and will be removed. format_to_wiki should be used instead, but I failed to do so. I don't yet fully understand the template system, especially not which functions are available to templates and which not.

Thanks for the help. I would have stalled that issue until the far future :-)

comment:9 Changed 4 years ago by Ryan J Ollos

wiki_to_html is deprecated, but the wiki_to_html function that is passed to the template is a partial function of format_to_html. See here.

It is extremely confusing that format_to_html is renamed to wiki_to_html when pased to the template!

Modify Ticket

as closed The owner will remain Dirk Stöcker.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.