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


Python T.label方法代码示例

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


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

示例1: new_request_form

# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import label [as 别名]
def new_request_form(push=None, subject='', message='', branch=''):
    label = T.a(class_='toggle', href='#')('New Request') if push else 'New Request'
    class_ = 'push request' if push else 'request'
    content = T.div(class_='content')
    form = T.form(action='/requests', method='post', class_=class_)(
        T.fieldset(class_='container')(
            T.legend(label),
            content(
                T.div(
                    T.label(for_='new-request-subject')('Subject'),
                    T.input(name='subject', id='new-request-subject', value=subject),
                    ),
                T.div(
                    T.label(for_='new-request-branch')('Branch'),
                    T.input(name='branch', id='new-request-branch', value=branch),
                    ),
                T.div(
                    T.label(for_='new-request-message')('Message'),
                    T.textarea(name='message', id='new-request-message', rows='40', cols='120')(message),
                    ),
                T.div(
                    T.label(for_='new-request-target-date')('Push Date'),
                    T.input(name='target_date', id='new-request-target-date', class_='date', value=logic.tznow().date().strftime('%Y-%m-%d')),
                    ),
                T.fieldset(class_='flags')(
                    T.legend('Flags'),
                    T.div(
                        T.input(id='new-request-urgent', type='checkbox', name='urgent', class_='checkbox'),
                        T.label(for_='new-request-urgent', class_='checkbox')('Urgent (e.g. P0)'),
                        ),
                    T.div(
                        T.input(id='new-request-tests-pass', type='checkbox', name='tests_pass', class_='checkbox'),
                        T.label(for_='new-request-tests-pass', class_='checkbox')('Passes Buildbot'),
                        ),
                    T.div(
                        T.input(id='new-request-no-testing', type='checkbox', name='no_testing', class_='checkbox'),
                        T.label(for_='new-request-no-testing', class_='checkbox')('No Testing Required'),
                        ),
                    T.div(
                        T.input(id='new-request-push-plans', type='checkbox', name='push_plans', class_='checkbox'),
                        T.label(class_='checkbox', for_='new-request-push-plans')('Push Plans'),
                        ),
                    T.div(
                        T.input(id='new-request-js-serials', type='checkbox', name='js_serials', class_='checkbox'),
                        T.label(class_='checkbox', for_='new-request-js-serials')('Bump Javascript Serials'),
                        ),
                    T.div(
                        T.input(id='new-request-img-serials', type='checkbox', name='img_serials', class_='checkbox'),
                        T.label(class_='checkbox', for_='new-request-img-serials')('Bump Image Serials'),
                        ),
                    ),
                T.button(type='submit')('Create')
                ),
            ),
        )
    if push:
        content(T.input(type='hidden', name='push', value=str(push.key())))
    return form
开发者ID:wingerz,项目名称:pushmaster,代码行数:60,代码来源:common.py

示例2: edit_request_form

# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import label [as 别名]
def edit_request_form(request):
    request_id = str(request.key())
    return T.form(action=request.uri, method='post', class_='edit request')(
        T.fieldset(class_='container')(
            T.legend(T.a(class_='toggle', href='#')('Edit Request')),
            T.div(class_='content')(
                T.div(
                    T.label(for_='edit-request-subject-'+request_id)('Subject'),
                    T.input(name='subject', id='edit-request-subject-'+request_id, value=request.subject),
                    ),
                T.div(
                    T.label(for_='edit-request-branch-'+request_id)('Branch'),
                    T.input(name='branch', id='edit-request-branch-'+request_id, value=request.branch or ''),
                    ),
                T.div(
                    T.label(for_='edit-request-message-'+request_id)('Message'),
                    T.textarea(name='message', id='edit-request-message-'+request_id)(request.message or ''),
                    ),
                T.div(
                    T.label(for_='edit-request-target-date-'+request_id)('Push Date'),
                    T.input(name='target_date', id='edit-request-target-date-'+request_id, class_='date', value=request.target_date.strftime('%Y-%m-%d') if request.target_date else ''),
                    ),
                T.fieldset(class_='flags')(
                    T.legend('Flags'),
                    T.div(
                        T.input(id='edit-request-urgent-'+request_id, type='checkbox', name='urgent', class_='checkbox', checked=request.urgent),
                        T.label(for_='edit-request-urgent-'+request_id, class_='checkbox')('Urgent (e.g. P0)'),
                        ),
                    T.div(
                        T.input(id='edit-request-tests-pass-'+request_id, type='checkbox', name='tests_pass', checked=request.tests_pass, class_='checkbox'),
                        T.label(for_='edit-request-tests-pass-'+request_id, class_='checkbox')('Passes Buildbot'),
                        ),
                    T.div(
                        T.input(id='edit-request-no-testing-'+request_id, type='checkbox', name='no_testing', checked=request.no_testing, class_='checkbox'),
                        T.label(for_='edit-request-no-testing-'+request_id, class_='checkbox')('No Testing (batch-only)'),
                        ),
                    T.div(
                        T.input(id='edit-request-push-plans-'+request_id, type='checkbox', name='push_plans', checked=request.push_plans, class_='checkbox'),
                        T.label(for_='edit-request-push-plans-'+request_id, class_='checkbox')('Push Plans'),
                        ),
                    T.div(
                        T.input(id='edit-request-js-serials-'+request_id, type='checkbox', name='js_serials', checked=request.js_serials, class_='checkbox'),
                        T.label(for_='edit-request-js-serials-'+request_id, class_='checkbox')('Bump Javascript Serials'),
                        ),
                    T.div(
                        T.input(id='edit-request-img-serials-'+request_id, type='checkbox', name='img_serials', checked=request.img_serials, class_='checkbox'),
                        T.label(for_='edit-request-img-serials-'+request_id, class_='checkbox')('Bump Image Serials'),
                        ),
                    ),
                T.div(
                    T.button(type='submit', name='act', value='edit')('Save'),
                    ),
                ),
            ),
        )
开发者ID:wingerz,项目名称:pushmaster,代码行数:57,代码来源:request.py

示例3: new_push_form

# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import label [as 别名]
def new_push_form():
    return T.form(action='/pushes', method='post', class_='new-push')(
        T.div(class_='fields')(
            T.input(type='hidden', name='act', value='new_push'),
            T.div(T.label(for_='new-push-name')('Name:')),
            T.div(T.input(type='text', name='name', class_='push-name', id='new-push-name')),
            T.div(T.button(type='submit', class_='submit')('Start New Push')),
            ),
        )
开发者ID:alanf,项目名称:PushmasterApp,代码行数:11,代码来源:common.py

示例4: reject_request_form

# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import label [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

示例5: sendtostage_form

# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import label [as 别名]
def sendtostage_form():
    return T.form(action='#', method='post', class_='send-to-stage')(
        T.div(class_='fields')(
            T.input(type='hidden', name='act', value='sendtostage'),
            T.div(T.label(for_='dest-stage')('Destination:')),
            T.div(
                T.select(name='stage', class_='dest-stage', id='dest-stage')(
                    (T.option(value=stage)(stage)) for stage in model.Push.all_stages
                    ),
                ),
            ),
            T.div(T.button(type='submit', class_='submit')('Mark Deployed to Stage')),
        )
开发者ID:alanf,项目名称:PushmasterApp,代码行数:15,代码来源:common.py


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