Changeset 6690 for main


Ignore:
Timestamp:
6 Sep 2011, 21:55:38 (13 years ago)
Author:
Henrik Bettermann
Message:

Render two different sitelayout pagetemplates. The student version fits perfectly into iPhone browsers.

ToDo?: Use ResouceInclusion? for mobile.css.

Location:
main/waeup.sirp/trunk/src/waeup/sirp/browser
Files:
2 added
2 edited
1 moved

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/browser/layout.py

    r6687 r6690  
    124124    #: An instance of the default theme to use for the site layout
    125125    default_theme = WAeUPThemeGray1()
     126    stafftemp = grok.PageTemplateFile('templates/staffsitelayout.pt')
     127    studenttemp = grok.PageTemplateFile('templates/studentsitelayout.pt')
     128
    126129
    127130    @property
     
    166169        return 'waeup.Student' in roles
    167170
    168     def tableClass(self):
    169         if self.isStudent():
    170             return 'yui-t7'
    171         return 'yui-t1'
    172 
    173171    def update(self):
    174172        """Include the resources required by the chosen skin/theme.
     
    193191        return
    194192
     193    def render(self):
     194        if self.isStudent() or not self.isAuthenticated():
     195            return self.studenttemp.render(self)
     196        return self.stafftemp.render(self)
  • main/waeup.sirp/trunk/src/waeup/sirp/browser/static/waeup-base.css

    r6646 r6690  
    5252}
    5353
     54
     55.block {
     56    margin-bottom: 0.5em;
     57}
     58
    5459.block .bd {
    5560    padding-bottom: 1em;
     
    6267.wfstatus {
    6368  float: right;
     69}
     70
     71.studentmenu {
     72  text-align: center;
     73  line-height: 2;
    6474}
    6575
  • main/waeup.sirp/trunk/src/waeup/sirp/browser/templates/staffsitelayout.pt

    r6687 r6690  
    1313        tal:attributes="title string:RSS feed of ${layout/getAppTitle};
    1414            href python: view.url(layout.site, 'feed.rss')" />
     15
    1516  </head>
    1617  <body class="rounded yui-skin-sam">
    17     <div id="doc3" tal:attributes= "class layout/tableClass">
     18    <div id="doc3" class="yui-t1">
    1819      <div id="hd" role="banner">
    1920        <div id="hd">
     
    2526            </span> </h1>
    2627          <div id="navigation" class="yui-navset" style="text-align:right;">
    27             <ul id="primary-navigation" tal:condition="not: layout/isStudent">
     28            <ul id="primary-navigation">
    2829              <tal:primary_nav content="structure provider:primary_nav" />
    2930            </ul>
    30             <ul id="primary-navigation" tal:condition="layout/isStudent">
    31               <tal:primary_nav content="structure provider:primary_nav_student" />
    32             </ul>
    33             <ul id="user-navigation" tal:condition="layout/isAuthenticated">
    34               <li>
     31            <ul id="user-navigation">
     32              <li tal:condition="not: layout/isAuthenticated">
     33              <a href="#" tal:attributes="href python: view.url(layout.site, 'login')">
     34                  Login
     35              </a>
     36              </li>
     37              <li tal:condition="layout/isAuthenticated">
    3538              <a href="#" tal:attributes="href python: view.url(layout.site, '@@contactadmin')">
    3639                  Contact
    3740              </a>
    3841              </li>
    39               <li>
     42              <li tal:condition="layout/isAuthenticated">
    4043              <a href="#" tal:attributes="href python: view.url(context, '@@logout')">Logout</a>
    4144              </li>
     
    4750      </div>
    4851      <div id="bd" role="main">
    49         <span tal:condition="python: layout.isAuthenticated() and not layout.isStudent()"
     52        <span tal:condition="python: layout.isAuthenticated()"
    5053              tal:content="structure provider:breadcrumbs" />
    5154
    52         <div class="yui-b" tal:condition="not: layout/isStudent">
     55        <div class="yui-b">
    5356          <div class="block" tal:condition="layout/getStudentName">
    5457            <div class="hd">
     
    5962            </div>
    6063          </div>
    61           <div class="block">
     64          <div class="block" tal:condition="layout/isAuthenticated">
    6265            <div class="hd">
    6366              <h2 tal:content="layout/getUserTitle">Username</h2>
     
    6972        </div>
    7073
    71         <div class="yui-b" tal:condition="layout/isStudent">
    72           <div class="block" tal:condition="layout/getStudentName">
    73             <div>
    74               <tal:left content="structure provider:top_student" />
    75             </div>
    76           </div>
    77         </div>
    78 
    7974        <div id="yui-main">
    8075          <div class="yui-b">
    8176            <div class="yui-g">
    8277              <div class="block">
    83                 <div class="hd" tal:condition="not: layout/isStudent">
     78                <div class="hd" tal:condition="python: layout.isAuthenticated()">
    8479                  <span tal:content="view/title"> THE CONTENT TITLE </span>
    8580                  <span tal:condition="layout/getStudentName" class="wfstatus">
Note: See TracChangeset for help on using the changeset viewer.