Esempio n. 1
0
def archive_files(community, files, path):
    folder = ArchiveFolder()
    contents = []
    for name, file in files.items():
        if ICommunityFolder.providedBy(file):
            folder[name] = archive_files(community, file, path + (name,))
            contents.append({
                'type': 'folder',
                'title': file.title + ' /',
                'url': file.__name__ + '/index.html',
            })
        else:
            folder[name] = file.blobfile
            contents.append({
                'type': 'file',
                'title': file.title,
                'url': file.__name__,
                'author': get_author(file),
                'date': str(file.created)
            })

    folder['index.html'] = ArchiveTemplate(
        'templates/archive_files.pt',
        community=community,
        title=files.title,
        path=path,
        contents=contents,
    )
    return folder
Esempio n. 2
0
def archive_files(community, files, path):
    folder = ArchiveFolder()
    contents = []
    for name, file in files.items():
        if ICommunityFolder.providedBy(file):
            folder[name] = archive_files(community, file, path + (name, ))
            contents.append({
                'type': 'folder',
                'title': file.title + ' /',
                'url': file.__name__ + '/index.html',
            })
        else:
            folder[name] = file.blobfile
            contents.append({
                'type': 'file',
                'title': file.title,
                'url': file.__name__,
                'author': get_author(file),
                'date': str(file.created)
            })

    folder['index.html'] = ArchiveTemplate(
        'templates/archive_files.pt',
        community=community,
        title=files.title,
        path=path,
        contents=contents,
    )
    return folder
Esempio n. 3
0
    def __init__(self, context, request):
        self.context = context
        self.request = request

        in_intranets = find_interface(context, IIntranets) is not None
        is_folder = ICommunityFolder.providedBy(context)
        self.use_folder_options = is_folder and in_intranets

        title = getattr(context, 'title', context.__name__)
        self.page_title = 'Advanced Settings for %s' % title
Esempio n. 4
0
    def __init__(self, context, request):
        self.context = context
        self.request = request

        is_folder = ICommunityFolder.providedBy(context)
        self.use_folder_options = is_folder

        self.use_unlock = lock.is_locked(context)

        title = getattr(context, "title", context.__name__)
        self.page_title = "Advanced Settings for %s" % title
Esempio n. 5
0
    def __init__(self, context, request):
        self.context = context
        self.request = request

        is_folder = ICommunityFolder.providedBy(context)
        self.use_folder_options = is_folder

        self.use_unlock = lock.is_locked(context)

        title = getattr(context, 'title', context.__name__)
        self.page_title = 'Advanced Settings for %s' % title
Esempio n. 6
0
    def __init__(self, context, request):
        self.context = context
        self.request = request

        in_intranets = find_interface(context, IIntranets) is not None
        is_folder = ICommunityFolder.providedBy(context)
        self.use_folder_options = is_folder and in_intranets

        self.use_unlock = lock.is_locked(context)

        title = getattr(context, 'title', context.__name__)
        self.page_title = 'Advanced Settings for %s' % title
Esempio n. 7
0
 def __init__(self, context, request):
     assert ICommunityFolder.providedBy(context)
     self.context = context
     self.request = request