Changeset 2740 in products for quintagroup.portlet.collection/trunk/quintagroup/portlet/collection/collection.py
- Timestamp:
- Aug 11, 2010 3:42:40 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
quintagroup.portlet.collection/trunk/quintagroup/portlet/collection/collection.py
r2704 r2740 29 29 class NotValidBatchSizeValue(ValidationError): 30 30 """This is not valid batch size value. 31 31 32 32 """ 33 33 … … 47 47 default=[u"Title", u"Description"], 48 48 value_type=schema.Choice(vocabulary='quintagroup.portlet.collection.vocabularies.PortletAttributesVocabulary')) 49 49 50 50 styling = schema.Choice(title=_(u"Portlet style"), 51 51 description=_(u"description_styling", default=u"Choose a css style for the porlet."), … … 55 55 56 56 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"), 58 58 description=_(u"If enabled, a more... link will appear in the bottom of the each collection item, " 59 59 "linking to the corresponding item."), 60 60 required=True, 61 61 default=True) 62 63 link_title = schema.Bool(title=_(u"Link title ."),62 63 link_title = schema.Bool(title=_(u"Link title"), 64 64 description=_(u"If enabled, title will be shown as link to corresponding object. "), 65 65 required=True, 66 66 default=True) 67 67 68 allow_batching = schema.Bool(title=_(u"Allow batching ."),69 description=_(u"If enabled, items will be split edinto pages."),68 allow_batching = schema.Bool(title=_(u"Allow batching"), 69 description=_(u"If enabled, items will be split into pages."), 70 70 required=False, 71 71 default=False) … … 75 75 "(if not set 3 items will be displayed as default)."), 76 76 required=False, 77 default=3, 77 default=3, 78 78 constraint=validate_batch_size) 79 79 80 80 class Assignment(base.Assignment): 81 81 """ 82 Portlet assignment. 82 Portlet assignment. 83 83 This is what is actually managed through the portlets UI and associated 84 84 with columns. … … 108 108 self.allow_batching = allow_batching 109 109 self.batch_size = batch_size 110 110 111 111 @property 112 112 def title(self): … … 115 115 """ 116 116 return self.header 117 117 118 118 class Renderer(base.Renderer): 119 119 """Portlet renderer. 120 120 121 121 This is registered in configure.zcml. The referenced page template is 122 122 rendered, and the implicit variable 'view' will refer to an instance … … 135 135 delta = self.data.batch_size 136 136 return [items[idx:idx + delta] for idx in range(0, len(items), delta)] 137 137 138 138 def batch_navigation(self): 139 139 return self.navigation(batches=self.batches()) … … 145 145 for index, batch in enumerate(self.batches())]) 146 146 return self.items_listing(portlet_items=self.results()) 147 147 148 148 class AddForm(base.AddForm): 149 149 """Portlet add form. 150 150 151 151 This is registered in configure.zcml. The form_fields variable tells 152 152 zope.formlib which fields to display. The create() method actually 153 153 constructs the assignment that is being added. 154 154 """ 155 155 156 form_fields = form.Fields(IQCollectionPortlet) 156 157 form_fields['target_collection'].custom_widget = UberSelectionWidget 157 158 158 159 label = _(u"Add Collection Portlet") 159 160 description = _(u"This portlet display a listing of items from a Collection.") … … 164 165 class EditForm(base.EditForm): 165 166 """Portlet edit form. 166 167 167 168 This is registered with configure.zcml. The form_fields variable tells 168 169 zope.formlib which fields to display.
Note: See TracChangeset
for help on using the changeset viewer.