Ignore:
Timestamp:
12 May 2011, 20:56:14 (14 years ago)
Author:
Henrik Bettermann
Message:

Make frontpage editable.

Location:
main/waeup.sirp/trunk/src/waeup/sirp
Files:
4 edited

Legend:

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

    r5964 r6065  
    3838    skin=u'gray waeup theme'
    3939   
     40    # The default frontpage.
     41    frontpage= """
     42This is the default frontpage of the portal.
     43
     44First thing to do after installation is to set a new
     45location for data files (imports/exports) in the
     46`Data Center <datacenter>`_
     47
     481. Heading
     49----------
     50
     51Text
     52
     531.2 Heading
     54...........
     55
     56Text
     57
     582. Heading
     59----------
     60
     61Text
     62
     632.1 Heading
     64...........
     65
     66Text
     67
     682.2 Heading
     69...........
     70
     71Text
     72
     73"""
     74   
     75    # The default title.
     76    title=u'Welcome to the Student Information and Registration Portal of %s' % name
     77   
    4078    @property
    4179    def logger(self):
     
    5896       
    5997   
    60     def __init__(self, name=name, skin=skin, **kw):
     98    def __init__(self, name=name, skin=skin, title=title, frontpage=frontpage, **kw):
    6199        super(University, self).__init__(**kw)
    62100        self.name = name
    63101        self.skin = skin
     102        self.title = title
     103        self.frontpage = frontpage
    64104        self.setup()
    65105
  • main/waeup.sirp/trunk/src/waeup/sirp/browser/pages.py

    r6028 r6065  
    4141from waeup.sirp.university.catalog import search
    4242from waeup.sirp.university.vocabularies import course_levels
     43from waeup.sirp.widgets.restwidget import ReSTWidget
    4344
    4445grok.context(IWAeUPObject)
     
    110111#
    111112
    112 class UniversityPage(WAeUPPage):
     113class UniversityPage(WAeUPDisplayFormPage):
    113114    """ The main university page.
    114115    """
     
    116117    grok.name('index')
    117118    grok.context(IUniversity)
    118     title = u'Welcome to SIRP'
    119119    pnav = 0
     120   
     121    form_fields = grok.AutoFields(IUniversity)
     122    form_fields['frontpage'].custom_widget = ReSTWidget
     123
     124    @property
     125    def title(self):
     126        return "Welcome"
     127
     128    @property
     129    def label(self):
     130        return self.context.title
    120131
    121132class Manage(WAeUPEditFormPage):
  • main/waeup.sirp/trunk/src/waeup/sirp/browser/templates/universitypage.pt

    r5412 r6065  
     1<h2 tal:content="view/label">Title</h2>
    12
    2 <h2>
    3   Welcome to the Student Information and Registration Portal of <span tal:replace="context/name">NAME</span>
    4 </h2>
    5 
    6 <p>
    7   This is the default frontpage of the Student Information and Registration Portal
    8   (SIRP) which is part of the West African eUniversity Project
    9   (<a href="http://www.waeup.org/">WAeUP</a>).
    10 </p>
    11 
    12 <p>
    13   First thing to do after installation is to set a new location
    14   for data files (imports/exports) in the <a
    15   href="datacenter">DataCenter</a>.
    16 </p>
    17 
    18 <p>
    19   You can tweak the layout starting with the page template
    20   <code>universitypage.pt</code> in
    21   <code>waeup/sirp/browser/templates/</code>.
    22 </p>
    23 
    24 <!--
    25     <div name="tableexample" class="yui-skin-sam">
    26     <div tal:replace="structure view/table/renderHTML" />
    27     </div>
    28 -->
    29 
    30 
     3<span tal:replace="structure view/widgets/frontpage">Frontpage</span>
  • main/waeup.sirp/trunk/src/waeup/sirp/interfaces.py

    r5968 r6065  
    4242        )
    4343
    44        
     44    title = schema.TextLine(
     45        title = u'Title of frontpage',
     46        default = u'No Title',
     47        required = False,
     48        )
     49
    4550    skin = schema.Choice(
    4651        title = u'Skin',
     
    4954        required = True,
    5055        )
     56       
     57    frontpage = schema.Text(
     58        title = u'Human readable frontpage in reST format',
     59        required = False,
     60        default = u'This is the SIRP frontpage.'
     61        )       
    5162
    5263    faculties = Attribute("A container for faculties.")
Note: See TracChangeset for help on using the changeset viewer.