Changeset 3530 for waeup/trunk/src


Ignore:
Timestamp:
30 Jun 2008, 17:01:14 (16 years ago)
Author:
adiwidjaja
Message:

Implemented basic viewlet structure.

Location:
waeup/trunk/src/waeup
Files:
14 added
4 edited
2 moved

Legend:

Unmodified
Added
Removed
  • waeup/trunk/src/waeup/app.py

    r3526 r3530  
    11import grok
    22from grok import index
     3from zope.interface import Interface
    34from interfaces import IUniversity
    45from setup import app_setup
     6from viewlets import MainArea
    57
    68class University(grok.Application, grok.Container):
     
    1214        app_setup.setup(self)
    1315
    14 class Index(grok.View):
    15     grok.context(University)
     16class Content(grok.Viewlet):
     17    grok.viewletmanager(MainArea)
     18    grok.context(IUniversity)
    1619
    17     def getFacList(self):
    18         return [x for x in self.context.values()
    19                 if IFaculty.providedBy(x)]
    2020
    2121class Edit(grok.EditForm):
  • waeup/trunk/src/waeup/app_templates/content.pt

    r3529 r3530  
    1 <html>
    2 <head>
    3   <link rel="stylesheet" type="text/css"
    4         tal:attributes="href static/simple.css" />
    5 </head>
    6 <body>
    71  <h1>Congratulations!</h1>
    82
    93  <h2>Your faculties:</h2>
    104
    11   <ul tal:repeat="fac context/values">
    12     <li>
     5  <ul>
     6    <li tal:repeat="fac context/values">
    137      <a href="."
    148         tal:content="fac/name"
     
    2014    <a href="@@studentsearch">Search</a>
    2115  </div>
    22 
    23 </body>
    24 </html>
  • waeup/trunk/src/waeup/app_templates/master.pt

    r3521 r3530  
    1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
    4       lang="en">
    5   <head>
    6     <meta tal:attributes="http-equiv string:Content-Type;
    7                           content string:text/html;;charset=utf-8" />
    8     <-- tal:head content="structure provider:head" / -->
    9   </head>
    10   <body>
    11 
    12     <!-- div id="header">
    13       <tal:header content="structure provider:header" />
    14     </div>
    15     <div id="left">
    16       <tal:left content="structure provider:left" />
    17     </div -->
    18     <div id="main">
    19       <tal:main content="structure provider:main" />
    20     </div>
    21     <div style="clear:both" />
    22     <!-- div id="footer">
    23       <tal:footer content="structure provider:footer" />
    24     </div -->
    25 
    26   </body>
     1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     2    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     3<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de">
     4        <head>
     5                <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
     6                <meta name="robots" content="index, follow" />
     7                <tal:head content="structure provider:head" />
     8                <link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.3.1/build/reset-fonts-grids/reset-fonts-grids.css" />
     9                <!--  <link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.3.1/build/base/base-min.css" /> -->
     10                <link rel="shortcut icon" tal:attributes="href static/favicon.ico" type="image/x-icon" />
     11        </head>
     12        <body id="doc3" class="yui-t2">
     13                <div id="hd">
     14                        <tal:header content="structure provider:header" />
     15                </div>
     16                <div id="bd">
     17                        <div id="yui-main">
     18                                <div class="yui-b">
     19                                        <tal:main content="structure provider:main" />
     20                                </div>
     21                        </div>
     22                        <div id="left" class="yui-b">
     23                                <tal:left content="structure provider:left" />
     24                        </div>
     25                </div>
     26                <div id="ft">
     27                        <tal:footer content="structure provider:footer" />
     28                </div>
     29        </body>
    2730</html>
  • waeup/trunk/src/waeup/basecontainer.py

    r3529 r3530  
    11import grok
    22from baseitem import BaseItem
     3from waeup.viewlets import MainArea
    34
    45class BaseContainer(BaseItem, grok.Container):
     
    1213    specialActions = []
    1314   
    14 class Index(grok.View):
     15class Content(grok.Viewlet):
     16    grok.viewletmanager(MainArea)
    1517    """
    16     Base view
     18    Base viewlet
    1719    """
    1820   
  • waeup/trunk/src/waeup/basecontainer_templates/content.pt

    r3529 r3530  
    1 <html>
    2 <head>
    3   <link rel="stylesheet" type="text/css"
    4         tal:attributes="href static/simple.css" />
    5 </head>
    6 <body>
    71    <h1 tal:content="context/name"></h1>
    82    <a href="" tal:attributes="href python:view.url(context.__parent__)">Up</a>
     
    2115        tal:attributes="href python:view.url(context, action)"
    2216        tal:content="action">Add</a>
    23 </body>
    24 </html>
  • waeup/trunk/src/waeup/baseitem.py

    r3528 r3530  
    11import grok
     2from waeup.viewlets import MainArea
    23
    34class BaseItem(grok.Model):
     
    1213        grok.EditForm.update(self)
    1314
    14 class Index(grok.DisplayForm):
    15 
    16     def update(self):
    17         self.form_fields = grok.AutoFields(self.context.__class__)
    18         grok.DisplayForm.update(self)
     15#class Content(grok.Viewlet, grok.DisplayForm):
     16#    grok.viewletmanager(MainArea)
     17#
     18#    def update(self):
     19#        self.form_fields = grok.AutoFields(self.context.__class__)
     20#        grok.DisplayForm.update(self)
Note: See TracChangeset for help on using the changeset viewer.