Exemplo n.º 1
0
Arquivo: utils.py Projeto: hforge/itws
def get_linked_resources_message(resource, context, state='public'):
    # Customize message if webpage uses private/pending resources
    referenced_resources = list(get_linked_resources(resource))
    if len(referenced_resources) == 0:
        return None

    message = MSG(u'This {title} uses pending/private resources '
                  u'please go to '
                  u'<a href="{path}/;backlinks">backlinks interface</a>.')
    path = context.get_link(resource)
    path = XMLContent.encode(path)
    class_title = resource.class_title.gettext()
    message = message.gettext(title=class_title,
                              path=path).encode('utf8')
    message = XHTMLBody.decode(message)
    # Return custom message
    return message
Exemplo n.º 2
0
Arquivo: utils.py Projeto: hforge/itws
def build_warn_referenced_msg(resource, context, total):
    path = context.get_link(resource)
    path = XMLContent.encode(path)
    message = MSG_UNPUBLISHED_RESOURCES_LINKED(path=path, n=total)
    message = message.gettext().encode('utf8')
    return XHTMLBody.decode(message)
Exemplo n.º 3
0
 def get_value(self, resource, context, name, datatype):
     if name == 'configuration_shortcut':
         html = '<a href="/;edit_contact_options">configuration</a>'
         return XHTMLBody.decode(html)
     proxy = super(BoxContact_Edit, self)
     return proxy.get_value(resource, context, name, datatype)