JS/CSS where is it

0 views
Skip to first unread message

Ian Wilson

unread,
Dec 8, 2006, 5:22:44 PM12/8/06
to turbo...@googlegroups.com
If I have something like this:
layout.kid
...
<div py:if="defined('getContent')" py:replace="getContent()">
...


newaccount.kid
<div ... py:layout="'layout.kid'">
...
<div py:def="getContent()">
${newAccountForm(**newAccountData)}
</div>
...


newAccountForm = TableForm(name='newAccountForm',
action='saveAccount', submit_text='Save',
fields=[TextField(name='userName', label='User Name:'),
TextField(name='emailAddress', label='Email Address:'),
PasswordField(name='password', label='Password:'),
PasswordField(name='verifyPassword', label='Verify Password:'),
CalendarDatePicker(name='dateOfBirth',
label='Birthday(Optional):')],
hidden_fields=[HiddenField(name='forwardUrl')]

And the problem is that CalendarDatePicker's javascript is not being
included when I use the newaccount template.

How can I fix this?

-Ian

Alberto Valverde

unread,
Dec 9, 2006, 6:02:28 AM12/9/06
to turbo...@googlegroups.com

I'm not very familiar (read: not at all) with Kid's py:layout so I'll
give some theory see if you can figure it out:

CSS and JS are included by some code in turbogears/view/templates/
sitetemplate.kid which your project's master.kid should inherit from.
If this code isn't called then resources will not be included.

You could try to duplicate that code from sitetemplate if it's not
being called in your layout template to achieve the same effect.

Alberto

Reply all
Reply to author
Forward
0 new messages