本文整理汇总了Python中webhelpers.html.builder.HTML.td方法的典型用法代码示例。如果您正苦于以下问题:Python HTML.td方法的具体用法?Python HTML.td怎么用?Python HTML.td使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类webhelpers.html.builder.HTML
的用法示例。
在下文中一共展示了HTML.td方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: due_date_td
# 需要导入模块: from webhelpers.html.builder import HTML [as 别名]
# 或者: from webhelpers.html.builder.HTML import td [as 别名]
def due_date_td(self, col_num, i, item):
"""Generate the column for the due date.
"""
if item.due_date is None:
return HTML.td('')
span_class = 'due-date badge'
if item.past_due:
span_class += ' badge-important'
due_date = localize_datetime(item.due_date, self.user_tz)
span = HTML.tag(
"span",
c=HTML.literal(due_date.strftime('%Y-%m-%d %H:%M:%S')),
class_=span_class,
)
return HTML.td(span)
示例2: due_date_td
# 需要导入模块: from webhelpers.html.builder import HTML [as 别名]
# 或者: from webhelpers.html.builder.HTML import td [as 别名]
def due_date_td(self, col_num, i, item):
"""Generate the column for the due date.
Time-Zone Localization is done in the model
"""
if item.due_date is None:
return HTML.td('')
span_class = 'due-date badge'
if item.past_due:
span_class += ' badge-important'
due_date = item.due_date
span = HTML.tag(
"span",
c=HTML.literal(due_date.strftime('%Y-%m-%d %H:%M:%S')),
class_=span_class,
)
return HTML.td(span)
示例3: action_td
# 需要导入模块: from webhelpers.html.builder import HTML [as 别名]
# 或者: from webhelpers.html.builder.HTML import td [as 别名]
def action_td(self, col_num, i, item):
"""Generate the column that has the actions in it.
"""
return HTML.td(HTML.literal("""\
<div class="btn-group">
<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
Action
<span class="caret"></span>
</a>
<ul class="dropdown-menu" id="%s">
<li><a class="todo-edit" href="#">Edit</a></li>
<li><a class="todo-complete" href="#">Complete</a></li>
</ul>
</div>
""" % item.id))
示例4: tags_td
# 需要导入模块: from webhelpers.html.builder import HTML [as 别名]
# 或者: from webhelpers.html.builder.HTML import td [as 别名]
def tags_td(self, col_num, i, item):
"""Generate the column for the tags.
"""
tag_links = []
for tag in item.sorted_tags:
tag_url = '%s/tags/%s' % (self.request.application_url, tag.name)
tag_class = 'label'
if self.selected_tag and tag.name == self.selected_tag:
tag_class += ' label-warning'
else:
tag_class += ' label-info'
anchor = HTML.tag("a", href=tag_url, c=tag.name,
class_=tag_class)
tag_links.append(anchor)
return HTML.td(*tag_links, _nl=True)
示例5: tags_td
# 需要导入模块: from webhelpers.html.builder import HTML [as 别名]
# 或者: from webhelpers.html.builder.HTML import td [as 别名]
def tags_td(self, col_num, i, item):
"""Generate the column for the tags.
Apply special tag CSS for currently selected tag matched route '/tags/{tag_name}'
"""
tag_links = []
for tag in item.sorted_tags:
tag_url = self.request.route_url('taglist', tag_name=tag.name)
tag_class = 'label'
if self.selected_tag and tag.name == self.selected_tag:
tag_class += ' label-warning'
else:
tag_class += ' label-info'
anchor = HTML.tag("a", href=tag_url, c=tag.name,
class_=tag_class)
tag_links.append(anchor)
return HTML.td(*tag_links, _nl=True)