Changeset 1816 in products


Ignore:
Timestamp:
Feb 24, 2010 12:06:14 PM (14 years ago)
Author:
mylan
Message:

#142: Fix access of of seo_context view in seo_context_properties template, and by adapters

Location:
quintagroup.seoptimizer/branches/refactoring2.3.0/quintagroup/seoptimizer
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • quintagroup.seoptimizer/branches/refactoring2.3.0/quintagroup/seoptimizer/adapters.py

    r1781 r1816  
    3939        """ 
    4040        request = self.context.REQUEST 
    41         meta_keywords = '' 
     41        meta_keywords = [] 
    4242        filtered_keywords = [] 
    4343        portal_props = getToolByName(self.context, 'portal_properties') 
     
    4545        seo_context = queryMultiAdapter((self.context, request), name='seo_context') 
    4646        if seo_context: 
    47             meta_keywords = list(seo_context.meta_keywords()) 
     47            meta_keywords = list(seo_context['meta_keywords']) 
    4848        return ', '.join(meta_keywords) 
    4949 
  • quintagroup.seoptimizer/branches/refactoring2.3.0/quintagroup/seoptimizer/browser/templates/seo_context_properties.pt

    r1678 r1816  
    3131        tal:define="errors python:request.get('errors', {}); 
    3232                    Iterator python:modules['Products.CMFPlone'].IndexIterator; 
    33                     tabindex python:Iterator(mainSlot=False)"><!--TODO:implement validation and errors handling--> 
     33                    tabindex python:Iterator(mainSlot=False); 
     34                    seo_context here/@@seo_context"><!--TODO:implement validation and errors handling--> 
    3435      <h1 i18n:translate="heading_edit_seo_properties">Edit SEO Properties</h1> 
    3536      <div class="documentDescription" i18n:translate="description_edit_seo_properties"> 
     
    6465                   name="seo_title_override" 
    6566                   tabindex="" 
    66                    tal:attributes="checked python:view.test(here.hasProperty('qSEO_title'), 'on', None); 
     67                   tal:attributes="checked python:view.test(seo_context['has_seo_title'], 'on', None); 
    6768                                   tabindex tabindex/next;" 
    6869                   /> 
     
    7778                   value="" 
    7879                   tabindex="" 
    79                    tal:attributes="value request/seo_title | here/@@seo_context/seo_title; 
     80                   tal:attributes="value request/seo_title | seo_context/seo_title; 
    8081                                   tabindex tabindex/next;" 
    8182                   /> 
     
    9293                   name="seo_description_override" 
    9394                   tabindex="" 
    94                    tal:attributes="checked python:view.test(here.hasProperty('qSEO_description'), 'on', None); 
     95                   tal:attributes="checked python:view.test(seo_context['has_seo_description'], 'on', None); 
    9596                                   tabindex tabindex/next;" 
    9697                   /> 
     
    106107                      tabindex="" 
    107108                      tal:attributes="tabindex tabindex/next;" 
    108                       tal:content="request/seo_description | here/@@seo_context/seo_description" 
     109                      tal:content="request/seo_description | seo_context/seo_description" 
    109110                      /> 
    110111          </div> 
     
    125126                   name="seo_keywords_override" 
    126127                   tabindex="" 
    127                    tal:attributes="checked python:view.test(here.hasProperty('qSEO_keywords'), 'on', None); 
     128                   tal:attributes="checked python:view.test(seo_context['has_seo_keywords'], 'on', None); 
    128129                                   tabindex tabindex/next;" 
    129130                   /> 
     
    139140                      tabindex="" 
    140141                      tal:attributes="tabindex tabindex/next;" 
    141                       tal:define="keywords request/seo_keywords | here/@@seo_context/seo_keywords" 
     142                      tal:define="keywords request/seo_keywords | seo_context/seo_keywords" 
    142143                      tal:content="python:'\n'.join(keywords)" 
    143144                      /> 
     
    155156                   name="seo_html_comment_override" 
    156157                   tabindex="" 
    157                    tal:attributes="checked python:view.test(here.hasProperty('qSEO_html_comment'), 'on', None); 
     158                   tal:attributes="checked python:view.test(seo_context['has_html_comment'], 'on', None); 
    158159                                   tabindex tabindex/next;" 
    159160                   /> 
     
    168169                      tabindex="" 
    169170                      tal:attributes="tabindex tabindex/next;" 
    170                       tal:content="request/seo_html_comment | here/@@seo_context/seo_html_comment" 
     171                      tal:content="request/seo_html_comment | seo_context/seo_html_comment" 
    171172                      /> 
    172173          </div> 
     
    183184                   name="seo_robots_override" 
    184185                   tabindex="" 
    185                    tal:attributes="checked python:view.test(here.hasProperty('qSEO_robots'), 'on', None); 
     186                   tal:attributes="checked python:view.test(seo_context['has_seo_robots'], 'on', None); 
    186187                                   tabindex tabindex/next;" 
    187188                   /> 
     
    196197                   value="" 
    197198                   tabindex="" 
    198                    tal:attributes="value request/seo_robots | here/@@seo_context/seo_robots; 
     199                   tal:attributes="value request/seo_robots | seo_context/seo_robots; 
    199200                                   tabindex tabindex/next;" 
    200201                   /> 
     
    212213                   name="seo_distribution_override" 
    213214                   tabindex="" 
    214                    tal:attributes="checked python:view.test(here.hasProperty('qSEO_distribution'), 'on', None); 
     215                   tal:attributes="checked python:view.test(seo_context['has_seo_distribution'], 'on', None); 
    215216                                   tabindex tabindex/next;" 
    216217                   /> 
     
    225226                   value="" 
    226227                   tabindex="" 
    227                    tal:attributes="value request/seo_distribution | here/@@seo_context/seo_distribution; 
     228                   tal:attributes="value request/seo_distribution | seo_context/seo_distribution; 
    228229                                   tabindex tabindex/next;" 
    229230                   /> 
     
    244245                   name="seo_canonical_override" 
    245246                   tabindex="" 
    246                    tal:attributes="checked python:view.test(here.hasProperty('qSEO_canonical'), 'on', None); 
     247                   tal:attributes="checked python:view.test(seo_context['has_seo_canonical'], 'on', None); 
    247248                                   tabindex tabindex/next;" 
    248249                   /> 
     
    258259                   value="" 
    259260                   tabindex="" 
    260                    tal:attributes="value request/seo_canonical | here/@@seo_context/seo_canonical; 
     261                   tal:attributes="value request/seo_canonical | seo_context/seo_canonical; 
    261262                                   tabindex tabindex/next;" 
    262263                   /> 
     
    264265          <div class="field" 
    265266               tal:define="fieldName string:seo_custommetatags; 
    266                            nonEmptylocalMetaTags here/@@seo_context/seo_nonEmptylocalMetaTags;"> 
     267                           nonEmptylocalMetaTags seo_context/seo_nonEmptylocalMetaTags;"> 
    267268            <label i18n:translate="label_custom_metatags" for="seo_custom_metatags"> 
    268269              Custom Meta Tags 
     
    288289                   tal:define="columnNames python:['meta name', 'meta content']; 
    289290                               columnIds   python:['meta_name', 'meta_content']; 
    290                                globalMT    here/@@seo_context/seo_globalWithoutLocalCustomMetaTags; 
    291                                localMT    here/@@seo_context/seo_localCustomMetaTags;"> 
     291                               globalMT    seo_context/seo_globalWithoutLocalCustomMetaTags; 
     292                               localMT    seo_context/seo_localCustomMetaTags;"> 
    292293                <thead> 
    293294                    <tr> 
Note: See TracChangeset for help on using the changeset viewer.