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


Python T.span方法代码示例

本文整理汇总了Python中pushmaster.taglib.T.span方法的典型用法代码示例。如果您正苦于以下问题:Python T.span方法的具体用法?Python T.span怎么用?Python T.span使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pushmaster.taglib.T的用法示例。


在下文中一共展示了T.span方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: request_item

# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import span [as 别名]
def request_item(request, full_request=False):
    li = T.li(class_='request clearfix')(
        display_date(request.target_date),
        T.span(class_='email')(T.a(href=urls.user_home(request.owner))(logic.user_info(request.owner).full_name), ':'),
        T.a(href=request.uri, class_='request-subject')(request.subject),
        )
    if full_request:
        li(
            T.a(request.branch, href=config.git_branch_url % dict(branch=request.branch)),
            T.p(class_='content')(request.message),
        )

    if request.target_date > util.tznow().date():
        li.attrs['class'] += ' future'

    if request.urgent:
        li.attrs['class'] += ' urgent'

    if request.state == 'rejected':
        li.attrs['class'] += ' rejected'

    if request.owner == users.get_current_user():
        li.attrs['class'] += ' own'

    li(request_badges(request), T.span(request.branch, class_='branch'), T.div(linkify(request.message), class_='message'))

    return li
开发者ID:alanf,项目名称:PushmasterApp,代码行数:29,代码来源:common.py

示例2: get

# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import span [as 别名]
    def get(self, datestr):
        from_date, to_date = report_date_range(datestr)

        doc = common.Document(title='pushmaster: reports')
        doc.body(T.h1('Report for ', from_date.strftime('%e %b %Y'), ' - ', to_date.strftime('%e %b %Y')))

        pushes = query.pushes_for_the_week_of(from_date)
        for push in pushes:
            pushdiv = T.div(class_='push')
            pushdiv(T.h2(
                    T.a(href=push.uri)(
                        push.ltime.replace(tzinfo=timezone.UTC()).astimezone(config.timezone).strftime('%a, %l:%M %p, %e %b %Y'),
                        T.span(' '),
                        push.name or '',
                        ), 
                    T.span(' by '),
                    common.display_user_email(push.owner),
                    ))
            reqlist = T.ol(class_='requests')
            for request in query.push_requests(push):
                reqlist(common.request_item(request))
            pushdiv(reqlist)
            doc.body(pushdiv)

        doc.body(common.jquery_js, common.jquery_ui_js, common.pushmaster_js)

        doc.serialize(self.response.out)
开发者ID:wingerz,项目名称:pushmaster,代码行数:29,代码来源:report.py

示例3: request_actions_form

# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import span [as 别名]
def request_actions_form(request):
    form = T.form(action=request.uri, method='post', class_='request-actions')

    button_count = 0

    if request.state in ('requested', 'rejected'):
        form(T.button(type='submit', name='act', value='abandon')('Abandon'))
        button_count += 1

    elif request.state == 'accepted':
        if button_count:
            form(T.span(' or '))
        form(T.button(type='submit', name='act', value='markcheckedin')('Mark Checked In'))
        button_count += 1

    elif request.state == 'onstage':
        if button_count:
            form(T.span(' or '))
        form(T.button(type='submit', name='act', value='marktested')('Mark Tested'))
        button_count += 1

    if request.state in ('accepted', 'checkedin', 'onstage', 'tested'):
        if button_count:
            form(T.span(' or '))
        form(T.button(type='submit', name='act', value='withdraw')('Withdraw'))
        button_count += 1
        
    return form
开发者ID:wingerz,项目名称:pushmaster,代码行数:30,代码来源:request.py

示例4: request_display

# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import span [as 别名]
def request_display(request, push):
    title = T.h2(class_='request-title')(
        T.span(class_='subject')(request.subject),
        common.user_home_link(request.owner),
        common.display_date(request.target_date),
        )
    div = T.div(class_='request')(title)
    if request.branch:
        div(T.h3(T.span('Branch: '), T.a(request.branch, href=config.git_branch_url % dict(branch=request.branch))))

    if request.reject_reason:
        div(
            T.h3('Reject Reason:'),
            T.p(common.linkify(request.reject_reason), class_='reject-reason'),
            )

    div(T.div(class_='message')(common.linkify(request.message or '')))

    if request.urgent:
        title.attrs['class'] += ' urgent'

    title(common.request_badges(request))

    title(T.span(request.state, class_='state'))

    if not push or users.get_current_user() == push.owner:
        div(request_actions_form(request))

    return div
开发者ID:wingerz,项目名称:pushmaster,代码行数:31,代码来源:request.py

示例5: push_actions_form

# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import span [as 别名]
def push_actions_form(push, requests):
    form = T.form(action=push.uri, method='post', class_='small')
    fields = T.div(class_='fields')
    form(fields)

    button_count = 0

    if push.state in ('accepting', 'onstage') and filter(lambda r: r.state == 'checkedin', requests):
        if button_count:
            fields(T.span(' or '))
        fields(T.button(type='button', name='sendtostage', id='send-to-stage', value=push.uri)('Mark Deployed to Stage'))
        button_count +=1

    if push.state == 'onstage' and requests and all(r.state == 'tested' for r in requests):
        if button_count:
            fields(T.span(' or '))
        fields(T.button(type='submit', name='act', value='sendtolive')('Mark Live'))
        button_count +=1

    if push.state in ('accepting', 'onstage'):
        if button_count:
            fields(T.span(' or '))
        fields(T.button(type='submit', name='act', value='abandon')('Abandon'))
        button_count +=1

    return form
开发者ID:Yelp,项目名称:PushmasterApp,代码行数:28,代码来源:push.py

示例6: funcbar

# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import span [as 别名]
def funcbar():
    bar = T.div(class_='func')(
        T.a(id='new-request', href='#')('Make Request'),
        T.span(class_='sep')('|'),
        T.a(id='new-push', href='#')('Start Push'),
        T.span(class_='sep')('|'),
        T.a(id='details', href='#')(T.span('Show Details', class_='show'), T.span('Hide Details', class_='hide')),
        )
    return bar
开发者ID:alanf,项目名称:PushmasterApp,代码行数:11,代码来源:common.py

示例7: push_item

# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import span [as 别名]
def push_item(push):
    return T.li(class_='push')(
        T.a(href=push.uri)(
            common.display_datetime(push.ptime),
            T.span(' '),
            T.span(push.name or ''),
            ),
        common.user_home_link(push.owner),
        T.span(class_='state')(common.display_push_state(push)),
    )
开发者ID:wingerz,项目名称:pushmaster,代码行数:12,代码来源:push.py

示例8: navbar

# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import span [as 别名]
def navbar(current=None):
    nav = T.div(class_='nav')(
        T.a(href='/push/current')(T.span('Current Push')),
        T.span(class_='sep')('|'),
        T.a(href='/requests')('Requests'),
        T.span(class_='sep')('|'),
        T.a(href='/pushes')('Pushes'),
        T.span(class_='sep')('|'),
        T.a(href='/lastweek')('Last Week'),
        )
    return nav
开发者ID:alanf,项目名称:PushmasterApp,代码行数:13,代码来源:common.py

示例9: accepted_request_item

# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import span [as 别名]
 def accepted_request_item(request):
     li = common.request_item(request)
     if current_user == push.owner:
         li.children.insert(0, T.div(class_='actions')(
                 mark_checked_in_form(request),
                 T.span('or', class_='sep'),
                 withdraw_form(request),
                 T.span('or', class_='sep'),
                 reject_request_link(request),
                 ))
     return li
开发者ID:Yelp,项目名称:PushmasterApp,代码行数:13,代码来源:push.py

示例10: session

# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import span [as 别名]
def session():
    user = users.get_current_user()
    div = T.div(class_='session')(
        user_home_link(user),
        T.span(class_='sep')('|'),
        T.a(href=users.create_logout_url('/'))('Logout')
    )
    return div
开发者ID:wingerz,项目名称:pushmaster,代码行数:10,代码来源:common.py

示例11: get

# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import span [as 别名]
    def get(self):
        requests = query.current_requests()

        doc = common.Document(title='pushmaster: requests')
        doc.body(
            T.h2(('Current Requests (%d)' % len(requests)) if len(requests) > 5 else 'Current Requests'),
            common.request_list(requests) if requests else T.span('There are no requests at present.'),
            T.div(common.bookmarklet(self.hostname)),
            )
        doc.serialize(self.response.out)
开发者ID:Yelp,项目名称:PushmasterApp,代码行数:12,代码来源:request.py

示例12: push_item

# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import span [as 别名]
def push_item(push):
    requests = query.push_requests(push)
    return T.li(class_='push')(
        T.div(
            common.display_datetime(push.ptime),
            T.a(href=push.uri)(push.name or 'push'),
            common.user_home_link(push.owner, logic.user_info(push.owner)),
            T.span(class_='state')(common.display_push_state(push)),
            class_='headline',
            ),
        T.ol(map(common.request_item, requests)) if requests else T.div('No requests.'),
    )
开发者ID:Yelp,项目名称:PushmasterApp,代码行数:14,代码来源:push.py

示例13: reject_request_form

# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import span [as 别名]
def reject_request_form():
    return T.form(action='#', method='post', class_='reject-request', id='reject-request-form')(
        T.div(class_='fields')(
            hidden(act='reject', push='true', return_url=''),
            T.h2(class_='subject'),
            T.label(for_='reject-request-reason')(
                T.span('Reason:'),
                T.div(T.textarea(name='reason', id='reject-request-reason')),
                ),
            T.div(T.button(type='submit', class_='submit')('Reject')),
            ),
        )
开发者ID:alanf,项目名称:PushmasterApp,代码行数:14,代码来源:common.py

示例14: request_item

# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import span [as 别名]
def request_item(request):
    li = T.li(class_='request clearfix')(
        display_date(request.target_date),
        ' ',
        T.span(class_='email')(T.a(href=urls.user_home(request.owner))(logic.user_info(request.owner).full_name), ':'),
        ' ',
        T.a(href=request.uri, class_='request-subject')(request.subject),
        ' ',
        T.span(class_='verify')(request.time_to_verify),
        )

    if request.target_date > util.tznow().date():
        li.attrs['class'] += ' future'

    if request.urgent:
        li.attrs['class'] += ' urgent'

    if request.state == 'rejected':
        li.attrs['class'] += ' rejected'

    if request.owner == users.get_current_user():
        li.attrs['class'] += ' own'

    if request.branch and '/' in request.branch:
        repo, _, branch = request.branch.partition('/')
        repo = 'devs/%s.git' % repo
    else:
        repo, branch = 'yelp-main.git', request.branch

    request_branch = T.a(request.branch, class_='branch', href=config.git_branch_url % dict(repo=repo,branch=branch))
    li(
        ' ',
        request_badges(request),
        ' ',
        request_branch,
        ' ',
        T.div(linkify(request.message), class_='message'),
        )

    return li
开发者ID:Yelp,项目名称:PushmasterApp,代码行数:42,代码来源:common.py

示例15: render_doc

# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import span [as 别名]
    def render_doc(self, push, current_user, pending_requests):
        doc = common.Document(title='pushmaster: push: %s %s' % (util.format_datetime(push.ptime), push.name))
        doc.funcbar(T.span('|', class_='sep'), common.push_email(push, 'Send Mail to Requesters'))

        requests = query.push_requests(push)
        push_div = self.render_push_div(current_user, push, requests, pending_requests)
        doc.body(push_div)

        doc.scripts(common.script('/js/push.js'))
        push_json = ScriptCData('this.push = %s;' % json.dumps(dict(key=str(push.key()), state=push.state)))
        doc.head(T.script(type='text/javascript')(push_json))

        return doc
开发者ID:Yelp,项目名称:PushmasterApp,代码行数:15,代码来源:push.py


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