当前位置: 首页>>代码示例>>Python>>正文


Python HTML.td方法代码示例

本文整理汇总了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)
开发者ID:Mondego,项目名称:pyreco,代码行数:17,代码来源:allPythonContent.py

示例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)
开发者ID:saschagottfried,项目名称:OpenShift-ToDoPyramid,代码行数:19,代码来源:grid.py

示例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))
开发者ID:Mondego,项目名称:pyreco,代码行数:17,代码来源:allPythonContent.py

示例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)
开发者ID:Mondego,项目名称:pyreco,代码行数:18,代码来源:allPythonContent.py

示例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)
开发者ID:saschagottfried,项目名称:OpenShift-ToDoPyramid,代码行数:20,代码来源:grid.py


注:本文中的webhelpers.html.builder.HTML.td方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。