Exemple #1
0
def index():
    """
    Edit/Show package content
    """
    pkg_item = application.getItemByUUID(request.args(0))
    content = db.plugin_package_content(item_id=pkg_item.unique_id)

    form = SQLFORM(db.plugin_package_content, record=content, showid=False)

    if form.process().accepted:
        application.indexItem(pkg_item.unique_id)
        redirect(URL('default', 'index'))

    return locals()
Exemple #2
0
def index():
    """
    Edit/Show package content
    """
    pkg_item = application.getItemByUUID(request.args(0))
    content = db.plugin_package_content(item_id=pkg_item.unique_id)

    form = SQLFORM(
        db.plugin_package_content,
        record=content,
        showid=False)

    if form.process().accepted:
        application.indexItem(pkg_item.unique_id)
        redirect(URL('default', 'index'))

    return locals()
Exemple #3
0
def changelog():
    item = application.getItemByUUID(request.args(0))
    pkg_content = db.plugin_package_content(item_id=item.unique_id)
    query = (
        db.plugin_package_content_archive.current_record == pkg_content.id)
    db.plugin_package_content_archive.modified_on.label = T('Date & Time')
    db.plugin_package_content_archive.modified_on.readable = True
    db.plugin_package_content_archive.modified_by.label = T('User')
    db.plugin_package_content_archive.modified_by.readable = True
    fields = [
        db.plugin_package_content_archive.modified_on,
        db.plugin_package_content_archive.modified_by
    ]

    def gen_links(row):
        diff = A(
            SPAN(_class="glyphicon glyphicon-random"),
            _href=URL('diff', args=[item.unique_id, row.id]),
            _class="btn btn-default",
            _title=T("Differences"),
        )

        return CAT(diff)

    links = [dict(header='', body=gen_links)]

    changes = SQLFORM.grid(
        query,
        orderby=[~db.plugin_package_content_archive.modified_on],
        fields=fields,
        args=request.args[:1],
        create=False,
        editable=False,
        details=False,
        deletable=False,
        searchable=False,
        csv=False,
        links=links,
    )

    return locals()
Exemple #4
0
def changelog():
    item = application.getItemByUUID(request.args(0))
    pkg_content = db.plugin_package_content(item_id=item.unique_id)
    query = (
        db.plugin_package_content_archive.current_record == pkg_content.id)
    db.plugin_package_content_archive.modified_on.label = T('Date & Time')
    db.plugin_package_content_archive.modified_on.readable = True
    db.plugin_package_content_archive.modified_by.label = T('User')
    db.plugin_package_content_archive.modified_by.readable = True
    fields = [
        db.plugin_package_content_archive.modified_on,
        db.plugin_package_content_archive.modified_by
    ]

    def gen_links(row):
        diff = A(SPAN(
            _class="glyphicon glyphicon-random"),
            _href=URL(
                'diff',
                args=[item.unique_id, row.id]),
            _class="btn btn-default",
            _title=T("Differences"),
        )

        return CAT(diff)

    links = [dict(header='', body=gen_links)]

    changes = SQLFORM.grid(
        query,
        orderby=[~db.plugin_package_content_archive.modified_on],
        fields=fields,
        args=request.args[:1],
        create=False, editable=False, details=False, deletable=False,
        searchable=False,
        csv=False,
        links=links,
    )

    return locals()
Exemple #5
0
def diff():
    item = application.getItemByUUID(request.args(0))
    content = db.plugin_package_content(item_id=item.unique_id)
    archive = db.plugin_package_content_archive(request.args(1))
    return locals()
Exemple #6
0
def diff():
    item = application.getItemByUUID(request.args(0))
    content = db.plugin_package_content(item_id=item.unique_id)
    archive = db.plugin_package_content_archive(request.args(1))
    return locals()