本文整理汇总了Python中pushmaster.taglib.T.input方法的典型用法代码示例。如果您正苦于以下问题:Python T.input方法的具体用法?Python T.input怎么用?Python T.input使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pushmaster.taglib.T
的用法示例。
在下文中一共展示了T.input方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: new_request_form
# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import input [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
示例2: new_push_form
# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import input [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')),
),
)
示例3: edit_request_form
# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import input [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'),
),
),
),
)
示例4: sendtostage_form
# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import input [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')),
)
示例5: hidden
# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import input [as 别名]
def hidden(**kw):
return [T.input(type='hidden', name=name, value=value) for name, value in kw.items()]