appypod-rattail/gen/ui/template.pt

212 lines
10 KiB
Plaintext
Raw Normal View History

<metal:main define-macro="main">
<tal:doctype tal:replace="structure string:&lt;!DOCTYPE html PUBLIC
&quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot;
&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&gt;" />
<html tal:define="user tool/getUser;
2011-11-25 11:01:20 -06:00
isAnon tool/userIsAnon;
2011-09-18 08:00:05 -05:00
app tool/getApp;
appUrl app/absolute_url;
2011-11-25 11:01:20 -06:00
appFolder app/data;
appName tool/getAppName;
_ python: tool.translate;
req python: request;
resp req/RESPONSE;
lang tool/getUserLanguage;
layoutType tool/getLayoutType;
contextObj python: tool.getPublishedObject(layoutType);
dir python: tool.getLanguageDirection(lang);
discreetLogin python: tool.getAttr('discreetLogin', source='config');
dleft python: (dir == 'ltr') and 'left' or 'right';
dright python: (dir == 'ltr') and 'right' or 'left';
2012-05-08 07:49:45 -05:00
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', lang)"
tal:attributes="dir python: tool.getLanguageDirection(lang)">
<head>
<title tal:content="python: _('app_name')"></title>
<link rel="icon" type="image/x-icon" href="/favicon.ico"/>
2012-03-01 10:35:23 -06:00
<tal:link repeat="name tool/getGlobalCssJs">
<link tal:condition="python: name.endswith('.css') and not ((dir == 'ltr') and (name == 'appyrtl.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>
2011-12-05 11:15:45 -06:00
<body tal:on-error="structure python: tool.manageError(error)">
<tal:comment replace="nothing">Google Analytics stuff, if enabled</tal:comment>
<script tal:define="gaCode tool/getGoogleAnalyticsCode" tal:condition="gaCode"
type="text/javascript" tal:content="gaCode"></script>
2013-04-11 09:01:52 -05:00
<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" tal:attributes="align dleft"><br/>
<span tal:content="python: _('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>
<tal:comment replace="nothing">Popup for reinitializing the password</tal:comment>
<div id="askPasswordReinitPopup" class="popup" tal:condition="python: isAnon and tool.showForgotPassword()">
<form id="askPasswordReinitForm" method="post"
tal:attributes="action python: tool.absolute_url() + '/askPasswordReinit'">
<div align="center">
<p tal:content="python: _('app_login')"></p>
<input type="text" size="35" name="login" id="login" value=""/>
<br/><br/>
<input type="button" onClick="doAskPasswordReinit()"
tal:attributes="value python:_('ask_password_reinit')"/>
<input type="button" value="No" onClick="closePopup('askPasswordReinitPopup')"
tal:attributes="value python:_('object_cancel')"/>
</div>
</form>
</div>
2011-09-18 08:00:05 -05:00
<table class="main" align="center" cellpadding="0">
<tal:comment replace="nothing">Top banner</tal:comment>
<tr class="top" metal:define-slot="top">
<td tal:define="bannerName python: (dir == 'ltr') and 'banner' or 'bannerrtl'"
tal:attributes="style python: 'background-image: url(%s/ui/%s.jpg)' % (appUrl, bannerName)">
<tal:comment replace="nothing">Top links</tal:comment>
<div style="margin-top: 4px"
tal:define="pages tool/getMainPages" tal:attributes="align dright">
<tal:comment replace="nothing">Icon "home"</tal:comment>
<a class="pageLink" tal:attributes="href appUrl; title python: _('app_home')">
<img tal:attributes="src string: $appUrl/ui/home.gif" style="margin-right: 3px"/>
</a>
<tal:comment replace="nothing">Additional links (or icons) from icons.pt</tal:comment>
<metal:call use-macro="app/ui/icons/macros/links"/>
<tal:comment replace="nothing">Top-level pages</tal:comment>
<a tal:repeat="page pages" class="pageLink"
tal:content="page/title" tal:attributes="href page/absolute_url"></a>
<tal:comment replace="nothing">Connect link if discreet login</tal:comment>
<a id="loginLink" name="loginLink" onclick="showLoginForm()" class="pageLink" style="cursor:pointer"
tal:condition="python: isAnon and discreetLogin" tal:content="python: _('app_connect')">
</a>
<tal:comment replace="nothing">Language selector</tal:comment>
<tal:lg condition="tool/showLanguageSelector">
<select class="pageLink"
tal:define="languages tool/getLanguages;
defaultLanguage python: languages[0]"
tal:attributes="onchange string:window.location='$appUrl/config/changeLanguage?language=' + this.options[this.selectedIndex].value">
<option tal:repeat="lg languages"
tal:content="python: tool.getLanguageName(lg)"
tal:attributes="selected python:lang == lg; value lg">
</option>
</select>
</tal:lg>
</div>
</td>
</tr>
2011-09-18 08:00:05 -05:00
<tal:comment replace="nothing">The message strip</tal:comment>
<tr valign="top">
2011-09-18 08:00:05 -05:00
<td>
<div style="position: relative">
2011-11-25 11:01:20 -06:00
<metal:msg use-macro="app/ui/page/macros/message"/>
2011-09-18 08:00:05 -05:00
</div>
</td>
</tr>
<tal:comment replace="nothing">The user strip</tal:comment>
<tr>
<td>
<table class="userStrip" width="100%">
<tr>
<tal:comment replace="nothing">The user login form for anonymous users</tal:comment>
<td align="center"
tal:condition="python: isAnon and ('/temp_folder/' not in req['ACTUAL_URL'])">
<form id="loginForm" name="loginForm" method="post" class="login"
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"/>
<tal:comment replace="nothing">The login fields, directly shown or not (depends on discreetLogin)</tal:comment>
<span id="loginFields" name="loginFields"
tal:attributes="style python: discreetLogin and 'display:none' or 'display:block'">
<span class="userStripText" tal:content="python: _('app_login')"/>
<input type="text" name="__ac_name" id="__ac_name" value="" style="width: 142px"/>&nbsp;
<span class="userStripText" tal:content="python: _('app_password')"/>
<input type="password" name="__ac_password" id="__ac_password" style="width: 142px"/>
<input type="submit" name="submit" onclick="setLoginVars()"
tal:define="label python: _('app_connect')" tal:attributes="value label; alt label"/>
<tal:comment replace="nothing">Forgot password?</tal:comment>
<a class="lostPassword" href="javascript: openPopup('askPasswordReinitPopup')"
tal:condition="tool/showForgotPassword"
tal:content="python: _('forgot_password')">
</a>
</span>
</form>
</td>
<tal:comment replace="nothing">User info and controls for authenticated users</tal:comment>
<td tal:condition="not: isAnon">
<table class="buttons" width="99%">
<tr>
<td>
<tal:comment replace="nothing">Config</tal:comment>
<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>
<tal:comment replace="nothing">Additional icons from icons.pt</tal:comment>
2012-06-03 11:34:56 -05:00
<metal:call use-macro="app/ui/icons/macros/icons"/>
<tal:comment replace="nothing">Log out</tal:comment>
<a tal:attributes="href python: tool.absolute_url() + '/performLogout';
2012-06-03 11:34:56 -05:00
title python: _('app_logout')">
2011-11-25 11:01:20 -06:00
<img tal:attributes="src string: $appUrl/ui/logout.gif"/>
</a>
</td>
<td class="userStripText" tal:define="userInfo tool/getUserLine" tal:attributes="align dright">
<span tal:content="python: userInfo[0]"></span>
<a tal:condition="python: userInfo[1]"
tal:attributes="href python: userInfo[1]">
<img tal:attributes="src string: $appUrl/ui/edit.png"/>
</a>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tal:comment replace="nothing">The navigation strip</tal:comment>
<tr tal:condition="python: contextObj and (layoutType == 'view')">
<td><metal:navigate use-macro="app/ui/navigate/macros/navigationStrip"/></td>
</tr>
<tr>
<td>
<table width="100%" cellpadding="0" cellspacing="0">
2011-09-18 08:00:05 -05:00
<tr valign="top">
<tal:comment replace="nothing">Portlet</tal:comment>
<td tal:condition="python: tool.showPortlet(context, layoutType)" class="portlet">
2011-11-25 11:01:20 -06:00
<metal:portlet use-macro="app/ui/portlet/macros/portlet"/>
</td>
2011-09-18 08:00:05 -05:00
<tal:comment replace="nothing">Page content</tal:comment>
<td class="content"><span metal:define-slot="content"></span></td>
</tr>
</table>
</td>
</tr>
<tr><tal:comment replace="nothing">Footer</tal:comment>
<td><metal:call use-macro="app/ui/footer/macros/footer"/></td>
</tr>
</table>
</body>
</html>
</metal:main>