Modify

Opened 5 years ago

Closed 5 years ago

Last modified 5 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

Description

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.

traciniadminpanel-use-add-script-data-r12844.diff.

Attachments (3)

Change History (12)

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

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

comment:2 Changed 5 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 5 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 5 years ago by Dirk Stöcker

Resolution: fixed
Status: newclosed

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

comment:5 Changed 5 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 5 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 5 years ago by Dirk Stöcker

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

comment:8 Changed 5 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 5 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

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Dirk Stöcker.
The resolution will be deleted.

Add Comment


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

 
Note: See TracTickets for help on using tickets.