Exemple #1
0
class AddForm(base.AddForm):
    form_fields = form.Fields(IShowGalleriesPortlet)
    label = _(u"Add portlet to show pictures from galleries")
    description = _(u"This portlet shows pictures from galleries.")

    def create(self, data):
        return Assignment(**data)
Exemple #2
0
class IGalleryTemplateTerm(interface.Interface):
    """Make a utility registred with this interface.
    It will be used to build the vocabularies and to make the
    rendering"""

    name = schema.TextLine(title=_(u"Name"),
                           description=_(u"The friendly name of the template"))

    def template():
        """return the template (PageTemplate instance)"""

    def validate():
        """Return true/false by checking if the template can be applied to
Exemple #3
0
class IPhoto(interface.Interface):
    """Metadatas schema of a photo"""

    id = schema.ASCIILine(title=_(u"label_photo_id", default=u"Id"))

    title = schema.TextLine(title=_(u"label_photo_title", default=u"Title"))

    description = schema.TextLine(
        title=_(u"label_photo_description", default=u"Description"))

    url = schema.TextLine(title=_(u"label_photo_url", default=u"Source URL"))

    thumb_url = schema.TextLine(
        title=_(u"label_photo_thumb", default=u"Thumb source URL"))
Exemple #4
0
class IGallery(interface.Interface):
    """A gallery is the business component of collective.gallery. A gallery
    manage a set of photos. The schema contains classic dublin core

    """

    id = schema.ASCIILine(title=_(u"Id"))

    title = schema.TextLine(title=_(u"Title"))

    creator = schema.TextLine(title=_(u"Author"))

    description = schema.TextLine(title=_(u"Description"))

    date = schema.Date(title=_(u"Date"))

    def photos(scale="default"):
        """Return the list of all IPhoto contained in the gallery"""
Exemple #5
0
class IShowGalleriesPortlet(IPortletDataProvider):
    search_portal = schema.Bool(
        title=_(u'Search portal for galleries'),
        description=_(u'If selected, search the whole portal for galleries.'\
            'otherwise search only subfolders of the current path.'),
        required=True,
        default=True)

    num_pictures = schema.Int(
        title=_(u'Number of Pictures'),
        description=_(u'Define the number of pictures to show in the portlet'),
        required=True,
        default=1,
        min=1)

    image_size = schema.Choice(
        title=_(u'Image Size'),
        description=_(u'Select, which image scale should be used for the portlet.'),
        required=True,
        default=None,
        vocabulary="collective.gallery.ImageScaleVocabulary")
Exemple #6
0
from collective.gallery import messageFactory as _

gallery_view_title = _(u"Gallery view")
message_no_backend_for_link = _(
    u"message_no_backend_for_link",
    default=u"Gallery ERROR: This link is not supported.")
Exemple #7
0
class EditForm(base.EditForm):
    form_fields = form.Fields(IShowGalleriesPortlet)
    label = _(u"Add portlet to show pictures from galleries")
    description = _(u"This portlet shows pictures from galleries.")
Exemple #8
0
 def title(self):
     return _(u"Gallery Portlet")