本文整理汇总了Python中gluon.DIV.add_class方法的典型用法代码示例。如果您正苦于以下问题:Python DIV.add_class方法的具体用法?Python DIV.add_class怎么用?Python DIV.add_class使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gluon.DIV
的用法示例。
在下文中一共展示了DIV.add_class方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: render_row
# 需要导入模块: from gluon import DIV [as 别名]
# 或者: from gluon.DIV import add_class [as 别名]
def render_row(row_id, label, widget, comment, hidden=False):
if hasattr(widget, "element"):
submit = widget.element("input", _type="submit")
if submit:
submit.add_class("small primary button")
controls_width = "medium-12" if label is False else "medium-10"
controls_col = DIV(widget, _class="%s columns controls" % controls_width)
if label:
if isinstance(label, LABEL):
label.add_class("left inline")
label_col = DIV(label, _class="medium-2 columns")
else:
if label is not False:
controls_col.add_class("medium-offset-2")
label_col = ""
if comment:
comment = render_tooltip(label,
comment,
_class="inline-tooltip tooltip",
)
if hasattr(comment, "add_class"):
comment.add_class("inline-tooltip")
controls_col.append(comment)
_class = "form-row row hide" if hidden else "form-row row"
return DIV(label_col, controls_col, _class=_class, _id=row_id)
示例2: summary
# 需要导入模块: from gluon import DIV [as 别名]
# 或者: from gluon.DIV import add_class [as 别名]
#.........这里部分代码省略.........
if r.http == "POST" and content.get("success"):
# Form successfully processed: behave like the
# primary method handler and redirect to next
next_url = content.get("next")
if next_url:
self.next = next_url
return content
for k, v in content.items():
if k not in ("tabs", "sections", "widget"):
output[k] = v
content = content.get("widget", "EMPTY")
elif active_tab == tab_idx and isinstance(content, MAP):
active_map = content
s.append(DIV(content,
_id="%s-container" % widget_id,
_class="widget-container"))
widget_idx += 1
if common:
commons.append(s)
else:
sections.append(s)
tab_idx += 1
# Remove widget ID
r.get_vars.pop("w", None)
# Add tabs + sections to output
if len(sections) > 1:
output["tabs"] = tablist
# Hide tabbed sections initially to avoid visible artifacts
# in slow page loads (S3.search.summary_tabs will un-hide the active one):
for s in sections:
s.add_class("hide")
else:
# Hide tabs if there's only one section (but then don't hide
# the section!)
output["tabs"] = ""
output["sections"] = sections
# Add common sections to output
output["common"] = commons
# Filter targets
target = " ".join(targets)
# Filter form
filter_ajax = True
if show_filter_form:
# Where to retrieve filtered data from:
if active_tab != 0:
submit_url_vars = {"t": active_tab}
else:
submit_url_vars = {}
filter_submit_url = attr.get("filter_submit_url")
if not filter_submit_url:
_vars = self._remove_filters(r.get_vars)
_vars.update(submit_url_vars)
filter_submit_url = r.url(vars=_vars)
# Where to retrieve updated filter options from:
filter_ajax_url = attr.get("filter_ajax_url",
r.url(method="filter",
vars={},
representation="options"))