Ignore:
Timestamp:
Aug 11, 2010 3:42:40 PM (14 years ago)
Author:
fenix
Message:
  • removed some unnecessary trailing white spaces;
  • fixed batch related labels;
  • made batch_size field disable when batching is not allowed
  • fixed navigation bug (removed unnecessary separator)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • quintagroup.portlet.collection/trunk/quintagroup/portlet/collection/collection.py

    r2704 r2740  
    2929class NotValidBatchSizeValue(ValidationError): 
    3030    """This is not valid batch size value. 
    31      
     31 
    3232    """ 
    3333 
     
    4747                                  default=[u"Title", u"Description"], 
    4848                                  value_type=schema.Choice(vocabulary='quintagroup.portlet.collection.vocabularies.PortletAttributesVocabulary')) 
    49                                    
     49 
    5050    styling = schema.Choice(title=_(u"Portlet style"), 
    5151                            description=_(u"description_styling", default=u"Choose a css style for the porlet."), 
     
    5555 
    5656 
    57     show_item_more = schema.Bool(title=_(u"Show more... link for collection items."), 
     57    show_item_more = schema.Bool(title=_(u"Show more... link for collection items"), 
    5858                                 description=_(u"If enabled, a more... link will appear in the bottom of the each collection item, " 
    5959                                                "linking to the corresponding item."), 
    6060                                 required=True, 
    6161                                 default=True) 
    62                         
    63     link_title = schema.Bool(title=_(u"Link title."), 
     62 
     63    link_title = schema.Bool(title=_(u"Link title"), 
    6464                                 description=_(u"If enabled, title will be shown as link to corresponding object. "), 
    6565                                 required=True, 
    6666                                 default=True) 
    6767 
    68     allow_batching = schema.Bool(title=_(u"Allow batching."), 
    69                                  description=_(u"If enabled, items will be splited into pages."), 
     68    allow_batching = schema.Bool(title=_(u"Allow batching"), 
     69                                 description=_(u"If enabled, items will be split into pages."), 
    7070                                 required=False, 
    7171                                 default=False) 
     
    7575                                          "(if not set 3 items will be displayed as default)."), 
    7676                            required=False, 
    77                             default=3,  
     77                            default=3, 
    7878                            constraint=validate_batch_size) 
    7979 
    8080class Assignment(base.Assignment): 
    8181    """ 
    82     Portlet assignment.     
     82    Portlet assignment. 
    8383    This is what is actually managed through the portlets UI and associated 
    8484    with columns. 
     
    108108        self.allow_batching = allow_batching 
    109109        self.batch_size = batch_size 
    110         
     110 
    111111    @property 
    112112    def title(self): 
     
    115115        """ 
    116116        return self.header 
    117      
     117 
    118118class Renderer(base.Renderer): 
    119119    """Portlet renderer. 
    120      
     120 
    121121    This is registered in configure.zcml. The referenced page template is 
    122122    rendered, and the implicit variable 'view' will refer to an instance 
     
    135135        delta = self.data.batch_size 
    136136        return [items[idx:idx + delta] for idx in range(0, len(items), delta)] 
    137      
     137 
    138138    def batch_navigation(self): 
    139139        return self.navigation(batches=self.batches()) 
     
    145145                            for index, batch in enumerate(self.batches())]) 
    146146        return self.items_listing(portlet_items=self.results()) 
    147          
     147 
    148148class AddForm(base.AddForm): 
    149149    """Portlet add form. 
    150      
     150 
    151151    This is registered in configure.zcml. The form_fields variable tells 
    152152    zope.formlib which fields to display. The create() method actually 
    153153    constructs the assignment that is being added. 
    154154    """ 
     155 
    155156    form_fields = form.Fields(IQCollectionPortlet) 
    156157    form_fields['target_collection'].custom_widget = UberSelectionWidget 
    157      
     158 
    158159    label = _(u"Add Collection Portlet") 
    159160    description = _(u"This portlet display a listing of items from a Collection.") 
     
    164165class EditForm(base.EditForm): 
    165166    """Portlet edit form. 
    166      
     167 
    167168    This is registered with configure.zcml. The form_fields variable tells 
    168169    zope.formlib which fields to display. 
Note: See TracChangeset for help on using the changeset viewer.