Modify

Opened 5 years ago

Last modified 3 years ago

#5515 new defect

Force Trac to use Genshi TextTemplate instead of MarkupTemplate

Reported by: anonymous Owned by: coderanger
Priority: normal Component: CondFieldsPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

I tried to install CondFieldsPlugin for 0.11 but it did not work until I changed the content-type returned from process_request(self, req) to 'text/plain'.

I modified this line in web_ui.js:

return 'condfields.js', {'condfields': data}, 'text/javascript'

to:

return 'condfields.js', {'condfields': data}, 'text/plain'

The reason is that it forces the Trac to use the Genshi TextTemplate instead of the Genshi MarkupTemplate for the javascript file.

Attachments (3)

trac-5515-1.jpg (61.8 KB) - added by anonymous 5 years ago.
trac-5515-2.jpg (55.6 KB) - added by anonymous 5 years ago.
trac-5515-3.jpg (46.8 KB) - added by anonymous 5 years ago.

Download all attachments as: .zip

Change History (6)

Changed 5 years ago by anonymous

comment:1 Changed 5 years ago by anonymous

I have modified the proposed solution in:

\...\Python\condfieldsplugin\0.11\condfields\web_ui.py (copied to the build dir too) build and installed it again and the good part it that now conditional fields are gone ... default fields are gone and one field is displayed twice!

Type is displayed, Priority is displayed twice and then the other default fields are gone as they are supposed to (Milestone, Component, Version, Keywords, CC and last being printed after optional fields: Assign to) these can be set again in the ini.

Priority displaying twice is the new problem here, why is it -not- displayed but instead displayed twice? Looks like #2042 on v0.10.

Enclosed screenshots are without condfields, settings, with condfields. De ticket_custom fields are marked red.

Changed 5 years ago by anonymous

Changed 5 years ago by anonymous

comment:2 Changed 5 years ago by anonymous

temporary solution ... while Priority always seems to be displayed I haven't got a clue yet why I modified templates\condfields.js to be able to submit.

Find de line (row 47?):

if(mode == 'view' && field == 'owner') continue

Add following exception:

if(mode == 'view' && field == 'owner') continue
if(mode == 'new' && field == 'priority') continue

comment:3 Changed 3 years ago by anonymous

Yo he conseguido solucionarlo copiando el fichero condfieldsplugin/0.11/condfields/templates/condfields.js dentro del patch /usr/lib/python2.4/site-packages/Trac-0.11.2.1-py2.4.egg/trac/htdocs/js

saludos

Add Comment

Modify Ticket

Action
as new .
Author


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

 
Note: See TracTickets for help on using tickets.