本文整理汇总了Python中pushmaster.taglib.T.form方法的典型用法代码示例。如果您正苦于以下问题:Python T.form方法的具体用法?Python T.form怎么用?Python T.form使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pushmaster.taglib.T
的用法示例。
在下文中一共展示了T.form方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: take_ownership_form
# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import form [as 别名]
def take_ownership_form(object):
form = T.form(class_='small', action=object.uri, method='post')(
T.div(class_='fields')(
T.button(type='submit', name='act', value='take_ownership')('Take Ownership'),
),
)
return form
示例2: push_actions_form
# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import form [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
示例3: request_actions_form
# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import form [as 别名]
def request_actions_form(request):
form = T.form(action=request.uri, method='post', class_='request-actions')
if request.state in ('requested', 'rejected'):
form(T.button(type='submit', name='act', value='abandon')('Abandon'))
return form
示例4: request_actions_form
# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import form [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
示例5: new_request_form
# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import form [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
示例6: new_push_form
# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import form [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')),
),
)
示例7: edit_request_form
# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import form [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'),
),
),
),
)
示例8: reject_request_form
# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import form [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')),
),
)
示例9: sendtostage_form
# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import form [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')),
)
示例10: request_item
# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import form [as 别名]
def request_item(request):
li = common.request_item(request)
if is_push_owner:
li.children.insert(0, T.div(class_='actions')(
T.form(class_='small', action=request.uri, method='post')(
T.div(class_='fields')(
T.button(type='submit')('Accept'),
common.hidden(push=str(push.key()), act='accept')),
),
T.span('or', class_='sep'),
reject_request_link(request),
),
)
return li
示例11: mark_tested_form
# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import form [as 别名]
def mark_tested_form(request):
return T.form(class_='small', method='post', action=request.uri)(
T.div(class_='fields')(
T.button(type='submit')('Mark Verified'),
common.hidden(push='true', act='marktested')))
示例12: withdraw_form
# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import form [as 别名]
def withdraw_form(request):
return T.form(class_='small', method='post', action=request.uri)(
T.div(class_='fields')(
T.button(type='submit')('Withdraw'),
common.hidden(push='true', act='withdraw')))
示例13: mark_checked_in_form
# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import form [as 别名]
def mark_checked_in_form(request):
return T.form(class_='small', method='post', action=request.uri)(
T.div(class_='fields')(
T.button(type='submit')('Mark Checked In'),
common.hidden(push='true', act='markcheckedin')))