示例#1
0
文件: exsyntax.py 项目: JdeH/pytigon
def list_action(context, action, title="", icon_name="", target='_top', attrs='', tag_class="", url="", active=False):
    if attrs:
        ret = action_fun(context, action, title, icon_name, target, attrs, tag_class, url if url else "{tp}action/%s/" % action)
    elif active:
        ret = action_fun(context, action, title, icon_name, target, "data-role='button'", "btn btn-outline-secondary no_close no_cancel", url if url else "{tp}action/%s/" % action)
    else:
        ret = action_fun(context, action, title, icon_name, target, "data-role='button'", "btn btn-outline-secondary no_ok no_cancel", url if url else "{tp}action/%s/" % action)
    return ret
示例#2
0
文件: exsyntax.py 项目: JdeH/pytigon
def view_row(context, title = "", icon_name = "", target = "popup_info", attrs = "", tag_class = "", url = ""):
    if url:
        href=url
    else:
        href = "{tp}%s/_/view/" % context['object'].id
    ret = action_fun(context, 'view_row', title, icon_name, target, attrs,tag_class, href)
    return ret
示例#3
0
文件: exsyntax.py 项目: JdeH/pytigon
def new_row_base(context, action="new_row/-", title="", icon_name="", target='', attrs='', tag_class="", url=""):
    if url:
        url2=url
    else:
        url2='{tp}{x1}/add/'
    ret = action_fun(context, action, title, icon_name, target, attrs, tag_class, url2)
    if title and title[0] == '+':
        description = title[1:]
        title = ""
    else:
        description = title
    ret['description'] = description
    return ret
示例#4
0
文件: exsyntax.py 项目: JdeH/pytigon
def action(context, action, title = "", icon_name = "", target = "", attrs = "", tag_class = "", url = ""):
    ret = action_fun(context, action, title, icon_name, target, attrs, tag_class, url)
    return ret
示例#5
0
文件: exsyntax.py 项目: JdeH/pytigon
def wiki_button(context, subject, wiki_description, icon_name="", target='_self',  attrs="", tag_class="", url=""):
    wiki_name = wiki_from_str(wiki_description)
    wiki_url = "/schwiki/%s/%s/view/" % (subject, wiki_name)
    return action_fun(context, "wiki", wiki_description, icon_name, target, attrs, tag_class, url if url else wiki_url)
示例#6
0
文件: exsyntax.py 项目: JdeH/pytigon
def get_row(context, title = "", icon_name = "", target = "", attrs = "", tag_class = "", url = ""):
    ret = action_fun(context, 'get_row', title, icon_name, target, attrs, tag_class, url)
    ret['id'] = context['object'].id
    ret['text'] = str(context['object'])
    return ret