appypod-rattail/gen/ui/template.pt

173 lines
6.9 KiB
XML

<html metal:define-macro="main"
tal:define="user tool/getUser;
isAnon tool/userIsAnon;
app tool/getApp;
appUrl app/absolute_url;
appFolder app/data;
appName tool/getAppName;
_ python: tool.translate;
req python: request;
resp req/RESPONSE;
x python: resp.setHeader('Content-Type', 'text/html;;charset=UTF-8');
x python: resp.setHeader('Expires', 'Thu, 11 Dec 1975 12:05:00 GMT+2');
x python: resp.setHeader('Content-Language', req.get('language', 'en'))">
<head>
<title tal:content="tool/getAppName"></title>
<tal:link repeat="name tool/getGlobalCssJs">
<link tal:condition="python: name.endswith('.css')"
rel="stylesheet" type="text/css" tal:attributes="href string:$appUrl/ui/$name"/>
<script tal:condition="python: name.endswith('.js')"
type="text/javascript" tal:attributes="src string:$appUrl/ui/$name"></script>
</tal:link>
</head>
<body tal:on-error="structure python: tool.manageError(error)">
<table class="main" align="center" cellpadding="0">
<tal:comment replace="nothing">Top banner</tal:comment>
<tr class="top" metal:define-slot="top">
<td tal:attributes="style python: 'background-image: url(%s/ui/banner.jpg)' % appUrl">
<table width="100%">
<tr valign="top">
<tal:comment replace="nothing">Links to main pages</tal:comment>
<td>
<a tal:repeat="page tool/getMainPages" class="pageLink"
tal:content="page/title" tal:attributes="href page/absolute_url"></a>
</td>
<tal:comment replace="nothing">Language selector (links or listbox)</tal:comment>
<td align="right" tal:condition="tool/showLanguageSelector">
<tal:lgs define="languages tool/getLanguages;
defaultLanguage python: languages[0];
asLinks python: len(languages) &lt;= 5">
<table tal:condition="asLinks">
<tr>
<td tal:repeat="lang languages">
<a class="lang"
tal:attributes="href python: req.get('ACTUAL_URL')+'/switchLanguage?set_language=%s' % lang;
title python: tool.getLanguageName(lang)"
tal:content="python: lang"></a>
</td>
</tr>
</table>
<select tal:condition="not: asLinks"
tal:attributes="onchange string:window.location='${context/absolute_url}/switchLanguage?set_language=' + this.options[this.selectedIndex].value">
<option tal:repeat="lang languages"
tal:content="python: tool.getLanguageName(lang)"
tal:attributes="selected python:defaultLanguage == lang; value lang">
</option>
</select>
</tal:lgs>
</td>
</tr>
</table>
</td>
</tr>
<tal:comment replace="nothing">The message strip</tal:comment>
<tr>
<td>
<div style="position: relative">
<metal:msg use-macro="app/ui/page/macros/message"/>
</div>
<tal:comment replace="nothing">Grey background shown when popups are shown</tal:comment>
<div id="grey" class="grey"></div>
<tal:comment replace="nothing">Popup for confirming an action</tal:comment>
<div id="confirmActionPopup" class="popup">
<form id="confirmActionForm" method="post">
<div align="center">
<p id="appyConfirmText"></p>
<input type="hidden" name="actionType"/>
<input type="hidden" name="action"/>
<div id="commentArea" align="left"><br/>
<span tal:content="python: tool.translate('workflow_comment')" class="discreet"></span>
<textarea name="comment" cols="30" rows="3"></textarea>
<br/>
</div>
<br/>
<input type="button" onClick="doConfirm()"
tal:attributes="value python:_('yes')"/>
<input type="button" value="No" onClick="closePopup('confirmActionPopup')"
tal:attributes="value python:_('no')"/>
</div>
</form>
</div>
</td>
</tr>
<tal:comment replace="nothing">The user data strip</tal:comment>
<tr>
<td>
<table class="userStrip" width="100%">
<tr>
<td>
<tal:comment replace="nothing">The user login form for anonymous users</tal:comment>
<table align="center" tal:condition="python: isAnon and ('/temp_folder/' not in req['ACTUAL_URL'])"
class="login">
<tr><td>
<form name="loginform" method="post"
tal:attributes="action python: tool.absolute_url() + '/performLogin'">
<input type="hidden" name="js_enabled" id="js_enabled" value="0"/>
<input type="hidden" name="cookies_enabled" id="cookies_enabled" value=""/>
<input type="hidden" name="login_name" id="login_name" value=""/>
<input type="hidden" name="pwd_empty" id="pwd_empty" value="0"/>
<span>Login</span>&nbsp;
<input type="text" size="25" name="__ac_name" id="__ac_name" value=""/>&nbsp;
<span>Password</span>&nbsp;
<input type="password" size="25" name="__ac_password" id="__ac_password"/>
<input type="submit" name="submit" onclick="setLoginVars()"
tal:define="label python: _('Login');" tal:attributes="value label; alt label;"/>
</form>
</td></tr>
</table>
<tal:comment replace="nothing">User info and controls for authenticated users</tal:comment>
<table tal:condition="not: isAnon" class="buttons" width="99%">
<tr>
<td>
<!-- Go home -->
<a tal:attributes="href appUrl; title python: _('home')">
<img tal:attributes="src string: $appUrl/ui/home.gif"/>
</a>
<!-- Config -->
<a tal:condition="python: user.has_role('Manager')"
tal:attributes="href python: tool.getUrl(nav='');
title python: _('%sTool' % appName)">
<img tal:attributes="src string:$appUrl/ui/appyConfig.gif"/>
</a>
<!-- Logout -->
<a tal:attributes="href python: tool.absolute_url() + '/performLogout';
title python: _('logout')">
<img tal:attributes="src string: $appUrl/ui/logout.gif"/>
</a>
</td>
<td align="right" tal:define="userInfo tool/getUserLine">
<span tal:content="python: userInfo[0]"></span>
<a tal:attributes="href python: userInfo[1]">
<img tal:attributes="src string: $appUrl/ui/edit.gif"/>
</a>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table width="100%" cellpadding="0" cellspacing="0">
<tr valign="top">
<tal:comment replace="nothing">Portlet</tal:comment>
<td tal:condition="python: tool.showPortlet(context)" class="portlet">
<metal:portlet use-macro="app/ui/portlet/macros/portlet"/>
</td>
<tal:comment replace="nothing">Page content</tal:comment>
<td class="content"><span metal:define-slot="content"></span></td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>