Ejemplo n.º 1
0
class IGhostSchema(IIdentifiedContent):

    haunted = Reference(
        IContent,
        title=_(u"Target"),
        description=_(u"The internal item the ghost is mirroring."),
        required=True)
Ejemplo n.º 2
0
class IGhostFolderSchema(IIdentifiedContent):

    haunted = Reference(
        IContainer,
        title=_("Target"),
        description=_("The internal folder the ghost is mirroring"),
        required=True)
Ejemplo n.º 3
0
class ILinkSchema(ITitledContent):

    url = schema.URI(
        title=_(u"URL"),
        description=_(
            u"If the link goes to an external resource, fill in the "
            u"location, including the protocol, e.g. 'http://'."),
        required=False)

    relative = schema.Bool(
        title=_(u"Relative link"),
        description=_(
            u"If the link goes to an internal item in Silva, put a checkmark "
            u"here and lookup the target below."),
        default=False,
        required=True)

    target = Reference(interfaces.ISilvaObject,
        title=_(u"Target of relative link"),
        description=_(
            u"Make a reference to an internal item by looking it up."),
        required=False)

    @interface.invariant
    def url_validation(content):
        if content.relative and not content.target:
            raise interface.Invalid(
                _(u"Relative link selected without target."))
        if not content.relative and not content.url:
            raise interface.Invalid(
                _(u"Absolute link selected without URL. "
                  u"If the link goes to an internal item in Silva, "
                  u"put a checkmark in the relative link field."))
Ejemplo n.º 4
0
class IGhostAssetSchema(IIdentifiedContent):

    haunted = Reference(IAsset,
                        title=_(u"Target"),
                        description=_(u"The asset the ghost is mirroring"),
                        required=True)
Ejemplo n.º 5
0
class ITabFields(Interface):
    content = Reference(IPublishable,
                        title=u"Content to display in the tabs",
                        multiple=True,
                        required=True)