Changeset 332

Show
Ignore:
Timestamp:
04/27/06 09:10:43
Author:
chervol
Message:

added adsence properties to schema

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • SimpleBlog/branches/plone-2.1-Blogging-APIs/BlogEntry.py

    r331 r332  
    9797                           i18n_domain = "SimpleBlog", 
    9898                           description = 'Controls if the Entry (when published) shown as the first Entry. If not checked, the effective date is used.')), 
    99  
    10099    LinesField('sendTrackBackURLs', 
    101100               languageIndependent = True, 
     
    107106                                  i18n_domain = "plone")), 
    108107 
    109  
     108    BooleanField('enableTopAdsence', 
     109                 widget = BooleanWidget(format = 'select',  
     110                           label_msgid = "label_enable_top_adsence", 
     111                           description_msgid = "help_enable_top_adsence", 
     112                           i18n_domain = "SimpleBlog", 
     113                           label = 'Enable top Adsence block', 
     114                           description = None)), 
     115    StringField('topAdsence', 
     116                vocabulary = 'listAdesnceTemplates', 
     117                widget = SelectionWidget(format = 'select',  
     118                        label_msgid = "label_top_adsence", 
     119                        description_msgid = "help_top_adsence", 
     120                        i18n_domain = "SimpleBlog", 
     121                        label = 'Top Adsence', 
     122                        description = None)), 
     123    BooleanField('enableBottomAdsence', 
     124                 widget = BooleanWidget(format = 'select',  
     125                           label_msgid = "label_enable_bottom_adsence", 
     126                           description_msgid = "help_enable_bottom_adsence", 
     127                           i18n_domain = "SimpleBlog", 
     128                           label = 'Enable bottom Adsence block', 
     129                           description = None)), 
     130    StringField('bottomAdsence', 
     131                vocabulary = 'listAdesnceTemplates', 
     132                widget = SelectionWidget(format = 'select',  
     133                        label_msgid = "label_bottom_adsence", 
     134                        description_msgid = "help_bottom_adsence", 
     135                        i18n_domain = "SimpleBlog", 
     136                        label = 'Bottom Adsence', 
     137                        description = None)), 
    110138    )) 
    111139 
     
    251279        parent = self.aq_parent 
    252280        portal = self.portal_url.getPortalObject() 
    253          
    254281        while parent != portal: 
    255282           if parent.portal_type == 'Blog': 
     
    259286        return tuple(tags) 
    260287 
     288    def listAdesnceTemplates(self): 
     289        """ return list of available adsence blocks """ 
     290        pp = getToolByName(self, 'portal_properties') 
     291        templates = () 
     292        try: 
     293            templates = pp.simpleblog_properties.getProperty('adsence_templates',()) 
     294        except: 
     295            pass 
     296        return templates 
     297 
    261298registerType(BlogEntry) 
  • SimpleBlog/branches/plone-2.1-Blogging-APIs/skins/SimpleBlog/blogentry_view.pt

    r331 r332  
    1515        <tal:block tal:define="obj python:here"> 
    1616 
    17                  
    18                <div metal:define-macro="full" tal:define="showReadMore python:0"> 
    19                  
    20                        <tal:block tal:define="size headerSize | python:1;title obj/title_or_id"> 
    21                        <h1 class="noMargin"> 
    22                                  <img src="#" tal:attributes="src string:${here/portal_url}/${here/getIcon};alt title" /> 
    23                                  <span tal:replace="title"/> 
    24                        </h1> 
     17         
     18        <div metal:define-macro="full" tal:define="showReadMore python:0"> 
     19         
     20            <tal:block tal:define="size headerSize | python:1;title obj/title_or_id"> 
     21                <h1 class="noMargin"> 
     22                  <img src="#" tal:attributes="src string:${here/portal_url}/${here/getIcon};alt title" /> 
     23                  <span tal:replace="title"/> 
     24                </h1> 
    2525        </tal:block> 
    26          
    27                 <div metal:use-macro="here/document_actions/macros/document_actions"> 
    28                     Document actions (print, sendto etc) 
    29                 </div> 
    30                          
    31                         <div class="documentDescription description" tal:content="structure python:obj.Description()">  
    32                                 description 
    33                         </div> 
    34                         <div tal:replace="structure python:obj.getBody()" /><br/> 
     26     
     27            <div metal:use-macro="here/document_actions/macros/document_actions"> 
     28                Document actions (print, sendto etc) 
     29            </div> 
     30             
     31            <div class="documentDescription description" tal:content="structure python:obj.Description()">  
     32                description 
     33            </div> 
     34            <div style="float:left;"  
     35                 tal:condition="here/getEnableTopAdsence"> 
     36                <div tal:define="adsence here/getTopAdsence;" 
     37                     tal:replace="structure python:path('/here/'+adsence)" 
     38                     tal:on-error="string: "></div></div> 
     39            <div tal:replace="structure python:obj.getBody()" /> 
     40                        <div style="float:left;"  
     41                 tal:condition="here/getEnableBottomAdsence"> 
     42                <div tal:define="adsence here/getBottomAdsence;" 
     43                           tal:replace="structure python:path('/here/'+adsence)" 
     44                           tal:on-error="string: "></div></div><br/> 
    3545                        <tal:tags metal:use-macro="obj/SimpleBlog_macros/macros/technoratiTags"/> 
    3646                        <tal:byLine metal:use-macro="obj/SimpleBlog_macros/macros/ByLineFoot"/> 
    37                        <div tal:define="batch here/getTrackbacks" 
     47            <div tal:define="batch here/getTrackbacks" 
    3848                             tal:condition="batch"  
    3949                             id="trackbacks" class="field"> 
     
    4959                           </div> 
    5060                        </div> 
    51                        <tal:commandline tal:condition="python:here.portal_type!='BlogEntry'"> 
    52                                <div metal:use-macro="obj/SimpleBlog_macros/macros/commandLine"/> 
    53                                <div metal:use-macro="obj/SimpleBlog_macros/macros/commandLineNonStandard"/> 
    54                        </tal:commandline> 
    55                </div> 
    56                 <a href="#comments"></a>                        
     61            <tal:commandline tal:condition="python:here.portal_type!='BlogEntry'"> 
     62                <div metal:use-macro="obj/SimpleBlog_macros/macros/commandLine"/> 
     63                <div metal:use-macro="obj/SimpleBlog_macros/macros/commandLineNonStandard"/> 
     64            </tal:commandline> 
     65        </div> 
     66                <a href="#comments"></a>             
    5767        </tal:block> 
    5868    </tal:main-macro>