Changeset 7674 for main/waeup.sirp/trunk/src/waeup/sirp/browser
- Timestamp:
- 22 Feb 2012, 08:27:56 (13 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp/browser
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/browser/browser.txt
r7665 r7674 36 36 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"... 37 37 ...Welcome to the... 38 ... 39 40 We can change to German:: 41 >>> browser.getLink('de').click() 42 >>> print browser.contents 43 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"... 44 ...Anfragen... 45 ... 46 47 And then change back to English by clicking on the third link containing 'en' 48 behind 'Anfragen' and 'Einloggen':: 49 >>> browser.getLink('en', index=2).click() 50 >>> print browser.contents 51 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"... 52 ...Enquiries... 38 53 ... 39 54 -
main/waeup.sirp/trunk/src/waeup/sirp/browser/pages.py
r7659 r7674 26 26 import time 27 27 import re 28 import zope.i18nmessageid 28 29 from zope import schema 29 30 from zope.authentication.interfaces import ( … … 137 138 138 139 # 139 # Login/logout pages...140 # Login/logout and language switch pages... 140 141 # 141 142 … … 187 188 self.flash("You have been logged out. Thanks for using WAeUP SIRP!") 188 189 self.redirect(self.application_url()) 190 191 192 class LanguageChangePage(SIRPPage): 193 """ Language switch 194 """ 195 grok.context(ISIRPObject) 196 grok.name('change_language') 197 grok.require('waeup.Public') 198 199 def update(self, lang='en', view_name='@@index'): 200 self.response.setCookie('waeup.sirp.language', lang, path='/') 201 self.redirect(self.url(self.context, view_name)) 202 return 203 204 def render(self): 205 return 189 206 190 207 # -
main/waeup.sirp/trunk/src/waeup/sirp/browser/static/waeup-base.css
r7635 r7674 193 193 line-height: 18px; 194 194 } 195 196 .language { 197 color: #BFBFBF; 198 position:relative; 199 top:10px; 200 right:-160px; 201 } 202 203 .language a { 204 color: #BFBFBF; 205 } 206 207 .language a:hover { 208 color: #ffffff; 209 } -
main/waeup.sirp/trunk/src/waeup/sirp/browser/templates/facultypage.pt
r7464 r7674 1 <div tal:condition="python: not len(context.keys())">1 <div i18n:domain="waeup.sirp" i18n:translate="" tal:condition="python: not len(context.keys())"> 2 2 There no subobjects registered yet. 3 3 </div> 4 4 5 <table >5 <table i18n:domain="waeup.sirp"> 6 6 <thead> 7 7 <tr> 8 <th >Code</th>9 <th >Title</th>8 <th i18n:translate="code">Code</th> 9 <th i18n:translate="title">Title</th> 10 10 </tr> 11 11 </thead> -
main/waeup.sirp/trunk/src/waeup/sirp/browser/templates/staffsitelayout.pt
r7669 r7674 1 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2 <html xmlns="http://www.w3.org/1999/xhtml" 3 xmlns:i18n="http://xml.zope.org/namespaces/i18n" 4 i18n:domain="waeup.sirp" 5 xml:lang="en"> 2 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" i18n:domain="waeup.sirp"> 6 3 <head> 7 4 <title>WAeUP - your way up … … 29 26 <ul class="nav secondary-nav"> 30 27 <li tal:condition="not: layout/isAuthenticated"> 31 <a href="#" i18n:translate=" login"28 <a href="#" i18n:translate="" 32 29 tal:attributes="href python: view.url(layout.site, 'login')"> 33 30 Login … … 35 32 </li> 36 33 <li tal:condition="layout/isAuthenticated"> 37 <a href="#" tal:attributes="href python: view.url(layout.site, '@@contactadmin')"> 34 <a href="#" i18n:translate="" 35 tal:attributes="href python: view.url(layout.site, '@@contactadmin')"> 38 36 Contact 39 37 </a> 40 38 </li> 41 39 <li tal:condition="layout/isAuthenticated"> 42 <a href="#" tal:attributes="href python: view.url(context, '@@logout')">Logout</a> 40 <a href="#" i18n:translate="" 41 tal:attributes="href python: view.url(context, '@@logout')">Logout</a> 43 42 </li> 44 43 </ul> 44 <span class="language"> 45 <tal:languages 46 tal:content="structure provider:languages" /> | 47 </span> 45 48 </div> 46 49 </div> -
main/waeup.sirp/trunk/src/waeup/sirp/browser/templates/studentsitelayout.pt
r7669 r7674 1 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2 <html xmlns="http://www.w3.org/1999/xhtml" 3 xmlns:i18n="http://xml.zope.org/namespaces/i18n" 4 i18n:domain="waeup.sirp" 5 xml:lang="en"> 2 <html xmlns="http://www.w3.org/1999/xhtml" i18n:domain="waeup.sirp"> 6 3 <head> 7 4 <title>WAeUP - your way up … … 34 31 <ul class="nav secondary-nav"> 35 32 <li tal:condition="not: layout/isAuthenticated"> 36 <a href="#" tal:attributes="href python: view.url(layout.site, 'login')"> 33 <a href="#" i18n:translate="" 34 tal:attributes="href python: view.url(layout.site, 'login')"> 37 35 Login 38 36 </a> 39 37 </li> 40 38 <li tal:condition="layout/isAuthenticated"> 41 <a href="#" tal:attributes="href python: view.url(layout.site, '@@contactadmin')"> 39 <a href="#" i18n:translate="" 40 tal:attributes="href python: view.url(layout.site, '@@contactadmin')"> 42 41 Contact 43 42 </a> 44 43 </li> 45 44 <li tal:condition="layout/isAuthenticated"> 46 <a href="#" tal:attributes="href python: view.url(context, '@@logout')">Logout</a> 45 <a href="#" i18n:translate="" 46 tal:attributes="href python: view.url(context, '@@logout')">Logout</a> 47 47 </li> 48 48 </ul> 49 <span class="language"> 50 <tal:languages 51 tal:content="structure provider:languages" /> | 52 </span> 49 53 </div> 50 54 </div> 51 55 </div> 56 52 57 <div class="container"> 53 58 <ul class="student-info-bar" tal:condition="layout/isAuthenticated"> -
main/waeup.sirp/trunk/src/waeup/sirp/browser/viewlets.py
r7461 r7674 17 17 ## 18 18 import grok 19 import zope.i18nmessageid 20 from urllib import urlencode 19 21 from zope.component import getMultiAdapter, queryAdapter 20 22 from zope.interface import Interface … … 33 35 from waeup.sirp.utils.helpers import get_user_account 34 36 37 _ = zope.i18nmessageid.MessageFactory('waeup.sirp') 38 35 39 grok.templatedir('templates') 36 40 grok.context(ISIRPObject) # Make ISIRPObject the default context … … 41 45 class BreadCrumbManager(grok.ViewletManager): 42 46 grok.name('breadcrumbs') 47 48 class LanguageManager(grok.ViewletManager): 49 grok.name('languages') 43 50 44 51 class ActionBar(grok.ViewletManager): … … 200 207 url = self.view.url(breadcrumb.context, breadcrumb.target) 201 208 ) 209 210 class LanguageLink(grok.Viewlet): 211 """ An entry in the language selector. 212 213 This is only a baseclass that won't be rendered actually. Deriving 214 viewlets can override certain values and will be rendered with the 215 values set here as default. 216 """ 217 grok.baseclass() 218 grok.viewletmanager(LanguageManager) 219 grok.context(ISIRPObject) 220 grok.require('waeup.Public') 221 lang = 'de' 222 title = u'Deutsch' 223 224 def render(self): 225 args = {'lang':self.lang, 'view_name':self.view.__name__} 226 url = self.view.url( 227 self.context) + '/@@change_language?%s' % urlencode(args) 228 return u'| <a href="%s" title="%s">%s</a> ' % (url,self.title,self.lang) 229 230 class English(LanguageLink): 231 """A link to switch to English. 232 """ 233 lang = 'en' 234 title = u'English' 235 236 class French(LanguageLink): 237 """A link to switch to French. 238 """ 239 lang = 'fr' 240 title = u'Français' 241 242 class German(LanguageLink): 243 """A link to switch to German. 244 """ 245 lang = 'de' 246 title = u'Deutsch' 247 248 class Hausa(LanguageLink): 249 """A link to switch to Hausa. 250 """ 251 lang = 'ha' 252 title = u'Hausa' 253 254 class Yoruba(LanguageLink): 255 """A link to switch to Yoruba. 256 """ 257 lang = 'yo' 258 title = u'Yoruba' 202 259 203 260 … … 623 680 624 681 pnav = 1 625 tab_title = u'Academics'682 tab_title = _(u'Academics') 626 683 627 684 @property … … 638 695 grok.order(6) 639 696 grok.require('waeup.Anonymous') 640 tab_title = u'Enquiries'697 tab_title = _(u'Enquiries') 641 698 pnav = 2 642 699
Note: See TracChangeset for help on using the changeset viewer.