Пример #1
0
def index():
    """
    Edit content
    """
    item = application.getItemByUUID(request.args(0))

    db.plugin_picture_info.thumbnail.readable = False
    db.plugin_picture_info.thumbnail.writable = False
    db.plugin_picture_info.renditions.readable = False
    db.plugin_picture_info.renditions.writable = False

    content = db.plugin_picture_info(item_id=item.unique_id)

    form = SQLFORM(
        db.plugin_picture_info,
        record=content,
        showid=False,
        submit_button=T('Save'))

    if form.process().accepted:
        application.notifyChanges(item.unique_id)
        application.indexItem(item.unique_id)
        response.flash = None

    return dict(form=form, item=item, content=content)
Пример #2
0
def delete_photo():
    item = application.getItemByUUID(request.args(0))
    content = db.plugin_photoset_content(item_id=item.unique_id)
    photo = db.plugin_photoset_photo(request.args(1))

    content.photoset.remove(photo.id)
    del db.plugin_photoset_photo[photo.id]
    content.update_record()
    application.notifyChanges(item.unique_id)

    return CAT('')
Пример #3
0
def delete_photo():
    item = application.getItemByUUID(request.args(0))
    content = db.plugin_photoset_content(item_id=item.unique_id)
    photo = db.plugin_photoset_photo(request.args(1))

    content.photoset.remove(photo.id)
    del db.plugin_photoset_photo[photo.id]
    content.update_record()
    application.notifyChanges(item.unique_id)

    return CAT('')
Пример #4
0
def meta():
    """
    Edit/Show item metadata info
    """
    item = application.getItemByUUID(request.args(0))

    if item is None:
        raise HTTP(404)

    contentType = application.getContentType(item.item_type)
    l_names = [
        (r.language_tag, r.english_name) for r in db(
            db.languages.id > 0
        ).select(orderby=db.languages.english_name)
    ]
    db.item.language_tag.requires = IS_IN_SET(
        l_names,
        zero=None
    )

    # issue #5 hidde some fields from metadata
    db.item.provider.readable = False
    db.item.provider.writable = False
    db.item.provider_service.readable = False
    db.item.provider_service.writable = False
    db.item.copyright_holder.readable = False
    db.item.copyright_holder.writable = False
    db.item.copyright_url.readable = False
    db.item.copyright_url.writable = False
    db.item.copyright_notice.readable = False
    db.item.copyright_notice.writable = False
    db.item.pubstatus.readable = False
    db.item.pubstatus.writable = False

    form = SQLFORM(db.item, record=item)

    if form.process().accepted:
        # session.flash = "Done !"
        # send an email to all the users who has access to this item
        application.notifyChanges(item.unique_id)
        application.indexItem(item.unique_id)
        if request.ajax:
            response.js = "$('#metaModal').modal('hide');"
        else:
            redirect(application.getItemURL(item.unique_id))

    return locals()
def edit_form():
    item = application.getItemByUUID(request.args(0))
    content = db.plugin_photoset_content(item_id=item.unique_id)

    db.plugin_photoset_content.photoset.readable = False
    db.plugin_photoset_content.photoset.writable = False
    db.plugin_photoset_content.item_id.readable = False
    db.plugin_photoset_content.item_id.writable = False

    form = SQLFORM(db.plugin_photoset_content,
                   record=content,
                   showid=False,
                   submit_button=T('Save'))

    if form.process().accepted:
        application.notifyChanges(item.unique_id)
        application.indexItem(item.unique_id)
        response.flash = T('Saved')

    return form
Пример #6
0
def meta():
    """
    Edit/Show item metadata info
    """
    item = application.getItemByUUID(request.args(0))

    if item is None:
        raise HTTP(404)

    contentType = application.getContentType(item.item_type)
    l_names = [(r.language_tag, r.english_name) for r in db(
        db.languages.id > 0).select(orderby=db.languages.english_name)]
    db.item.language_tag.requires = IS_IN_SET(l_names, zero=None)

    # issue #5 hidde some fields from metadata
    db.item.provider.readable = False
    db.item.provider.writable = False
    db.item.provider_service.readable = False
    db.item.provider_service.writable = False
    db.item.copyright_holder.readable = False
    db.item.copyright_holder.writable = False
    db.item.copyright_url.readable = False
    db.item.copyright_url.writable = False
    db.item.copyright_notice.readable = False
    db.item.copyright_notice.writable = False
    db.item.pubstatus.readable = False
    db.item.pubstatus.writable = False

    form = SQLFORM(db.item, record=item)

    if form.process().accepted:
        # session.flash = "Done !"
        # send an email to all the users who has access to this item
        application.notifyChanges(item.unique_id)
        application.indexItem(item.unique_id)
        if request.ajax:
            response.js = "$('#metaModal').modal('hide');"
        else:
            redirect(application.getItemURL(item.unique_id))

    return locals()
Пример #7
0
def index():
    """
    Edit content
    """
    item = application.getItemByUUID(request.args(0))
    if item is None:
        raise HTTP(404)

    content = db.plugin_text_text(item_id=item.unique_id)

    form = SQLFORM(db.plugin_text_text,
                   record=content,
                   showid=False,
                   submit_button=T('Save'))

    if form.process().accepted:
        application.notifyChanges(item.unique_id)
        application.indexItem(item.unique_id)
        redirect(application.getItemURL(item.unique_id))
        response.flash = T('Done')

    return dict(form=form, item=item, content=content)
Пример #8
0
def edit_form():
    item = application.getItemByUUID(request.args(0))
    content = db.plugin_photoset_content(item_id=item.unique_id)

    db.plugin_photoset_content.photoset.readable = False
    db.plugin_photoset_content.photoset.writable = False
    db.plugin_photoset_content.item_id.readable = False
    db.plugin_photoset_content.item_id.writable = False

    form = SQLFORM(
        db.plugin_photoset_content,
        record=content,
        showid=False,
        submit_button=T('Save')
    )

    if form.process().accepted:
        application.notifyChanges(item.unique_id)
        application.indexItem(item.unique_id)
        response.flash = T('Saved')

    return form
Пример #9
0
def index():
    """
    Edit content
    """
    item = application.getItemByUUID(request.args(0))

    db.plugin_picture_info.renditions.readable = False
    db.plugin_picture_info.renditions.writable = False

    content = db.plugin_picture_info(item_id=item.unique_id)

    form = SQLFORM(
        db.plugin_picture_info,
        record=content,
        showid=False,
        submit_button=T('Save'))

    if form.process().accepted:
        application.notifyChanges(item.unique_id)
        application.indexItem(item.unique_id)
        response.flash = None

    return dict(form=form, item=item, content=content)
Пример #10
0
def index():
    """
    Edit content
    """
    item = application.getItemByUUID(request.args(0))
    if item is None:
        raise HTTP(404)

    content = db.plugin_text_text(item_id=item.unique_id)

    form = SQLFORM(
        db.plugin_text_text,
        record=content,
        showid=False,
        submit_button=T('Save'))

    if form.process().accepted:
        application.notifyChanges(item.unique_id)
        application.indexItem(item.unique_id)
        redirect(application.getItemURL(item.unique_id))
        response.flash = T('Done')

    return dict(form=form, item=item, content=content)