Пример #1
0
def contact():
    id = 90
    from plugin_ckeditor import CKEditor
    box = cms.define_box()
    box.htmlcontent.widget = CKEditor(cms.db).widget

    box.name.writable = False

    box.id.writable = False
    box.id.readable = False

    box.boxtype.writable = False
    box.boxtype.readable = False

    box.avatar.writable = False
    box.avatar.readable = False

    box.link.writable = False
    box.link.readable = False

    box.setting.writable = False
    box.setting.readable = False

    box.textcontent.writable = False
    box.textcontent.readable = False

    form = SQLFORM(box, id)
    div = DIV(_class="panel panel-default")
    div.append(DIV(T('Thông tin hỗ trợ trực tuyến'), _class="panel-heading"))
    div.append(DIV(form, _class='panel-body'))
    if form.process().accepted:
        response.flash = T('Cập nhật thành công.')
    response.view = 'plugin_manager/index.html'
    return dict(content=div)
Пример #2
0
def edit_tin_tuc(id, cms, folder_id_ivinh):
    request = current.request
    T = current.T
    from plugin_ckeditor import CKEditor
    tin_tuc = cms.define_table('tintuc')
    tin_tuc.folder.default = folder_id_ivinh
    tin_tuc.folder.writable = False
    tin_tuc.folder.readable = False
    tin_tuc.htmlcontent.widget = CKEditor(cms.db).widget
    form = SQLFORM(tin_tuc, id)
    ajax = "ajax('%s', [''], 'news_detail')" % (URL(
        r=current.request,
        c='plugin_app',
        f='act_delete',
        args=[request.args(0)],
        vars=dict(table_name='tintuc', table_id=id)))
    form[0][-1] = TR(TD(INPUT(_type='submit', _value=T('Submit')),
                        INPUT(_type='button',
                              _value=T('Xóa bài viết'),
                              _onclick=ajax,
                              _class='btn btn-danger'),
                        _colspan="3"),
                     _class='act_ivinh')
    if form.process().accepted:
        current.response.flash = T('Cập nhật thành công.')
    return form
Пример #3
0
def add_cong_ty(folder):
	from sqlhtml import SQLFORM
   	from plugin_ckeditor import CKEditor
   	from plugin_cms import CmsModel
	T = current.T
	cms = CmsModel()
	db = cms.db
	div = DIV(_class='col-md-12')
	div.append(H2(SPAN(T('Thông tin chi tiết')),_class='title_name',_id='title_page'))
	cong_ty_edit = cms.define_table('cong_ty')
	cong_ty_id = db(cong_ty_edit.folder==folder).select().first()
	cong_ty_edit.folder.writable=False
	cong_ty_edit.folder.readable=False

	cong_ty_edit.start_time.writable=False
	cong_ty_edit.start_time.readable=False

	cong_ty_edit.danh_gia.writable=False
	cong_ty_edit.danh_gia.readable=False

	cong_ty_edit.is_maps.writable=False
	cong_ty_edit.is_maps.readable=False

	from plugin_app import widget_danh_muc
	cong_ty_edit.linh_vuc.widget=widget_danh_muc
	form=SQLFORM(cong_ty_edit,cong_ty_id)
	if form.process().accepted:
		current.response.flash = T("Cập nhật thành công!")
	div.append(form)
	return form
Пример #4
0
def view_san_pham(id, cms, folder_id_ivinh):
    request = current.request
    T = current.T
    div = DIV(_class='col-md-12', _id='news_detail')
    name = request.args(0)
    from plugin_ckeditor import CKEditor
    san_pham = cms.define_table('san_pham')
    # san_pham.folder.default=folder_id_ivinh
    # san_pham.folder.writable=False
    # san_pham.folder.readable=False
    from plugin_app import widget_danh_muc_san_pham
    san_pham.folder.widget = widget_danh_muc_san_pham
    san_pham.r_folder.writable = False
    san_pham.r_folder.readable = False
    san_pham.htmlcontent.widget = CKEditor(cms.db).widget

    form = SQLFORM(san_pham, id)
    ajax = "ajax('%s', [''], 'news_detail')" % (URL(
        r=current.request,
        c='plugin_app',
        f='act_delete',
        args=[request.args(0)],
        vars=dict(table_name='san_pham', table_id=id)))
    form[0][-1] = TR(TD(INPUT(_type='submit', _value=T('Submit')),
                        INPUT(_type='button',
                              _value=T('Xóa sản phẩm'),
                              _onclick=ajax,
                              _class='btn btn-danger'),
                        _colspan="3"),
                     _class='act_ivinh')
    if form.process().accepted:
        dcontent = cms.define_dcontent()
        link = cms.db.san_pham[request.vars.id].link
        id_d = cms.db((dcontent.dtable == 'san_pham')
                      & (dcontent.link == link)).update(
                          name=request.vars.name,
                          folder=request.vars.folder,
                          avatar=request.vars.avatar,
                          description=request.vars.description)
        current.response.flash = T('Cập nhật thành công.')
    div.append(form)
    return div