[ppa-qps-devel] (no subject)
Brought to you by:
ods
|
From: <gl...@in...> - 2006-09-12 21:07:08
|
Добрый вечер,
> Если в inc_top нужен title, то его надо явно передать, то есть должно быть:
> <%= template('inc_top', title=title) %>
файлы login.pyem и inc_top.pyem после разговоров с разработчиками приложения оказались
несколько в другом виде, но описанная проблема передачи параметров между шаблонами
осталась, несмотря на то, что синтаксис похож но тот, что был рекомендован:
login.pyem:
<%= template('inc_top', brick=brick) %>
<h1>Editor interface of <q><%= brick.site.title %></q></h1>
<form action="<%= quoteHTML(template.edit.prefix+brick.path()) %>" method="POST">
<table class="loginmenu">
<tr>
<td>Login:</td>
<td><input type="text" name="login"></td>
</tr>
<tr>
<td>Password:</td>
<td><input type="password" name="passwd"></td>
</tr>
<tr>
<td>Remember me:</td>
<td><input type=checkbox name="perm_login" value="y" checked="checked"></td>
</tr>
<tr>
<td colspan="2"><input type="submit" value="Login"></td>
</tr>
</table>
</form>
<%= template('inc_bottom', brick=brick) %>
inc_top.pyem:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Editor interface of <%= brick.site.title %></title>
<%
styleSheetURL = getattr(template.edit, 'styleSheetURL', None)
if styleSheetURL:
%><link rel="stylesheet" type="text/css" href="<%= quoteHTML(styleSheetURL) %>"><%
%>
</head>
<body>
<table width="100%">
<tr>
<td align="left" class="sitetitle">
<a href="<%= quoteHTML(template.edit.prefix)+'/' %>"><%
logoURL = getattr(template.edit, 'logoURL', None)
if logoURL:
%><img src="<%= quoteHTML(logoURL) %>" alt="Editor interface of "<%=
brick.site.title %>""><%
else:
%>Editor interface of <q><%= brick.site.title %></q><%
%></a>
</td>
<td align="right">
<table class="topmenu"><tr>
<%
if template.user:
for stream in template.allowedStreams:
if getattr(stream, 'showInMenu', 0):
%><td><a href="<%= quoteHTML(template.edit.prefix+stream.path()) %>"><%=
stream.title %></a></td><%
%>
</tr></table>
</td></tr>
<tr><td colspan="2" align="center">
<!-- end of inc_top -->
В логе опять пишет те же модули, кроме последних:
.....
File "inc_top.pyem", line 8, in ?
NameError: name 'brick' is not defined
Пишите, если есть идеи, как это исправить.
Спасибо за помощь,
Артем.
|