本文整理汇总了Python中pushmaster.taglib.T.div方法的典型用法代码示例。如果您正苦于以下问题:Python T.div方法的具体用法?Python T.div怎么用?Python T.div使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pushmaster.taglib.T
的用法示例。
在下文中一共展示了T.div方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: onstage_request_item
# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import div [as 别名]
def onstage_request_item(request):
li = common.request_item(request)
if current_user == push.owner:
li.children.insert(0, T.div(class_='actions')(mark_tested_form(request), T.span('or', class_='sep'), withdraw_form(request)))
elif current_user == request.owner:
li.children.insert(0, T.div(class_='actions')(mark_tested_form(request)))
return li
示例2: __init__
# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import div [as 别名]
def __init__(self, title='pushmaster'):
super(Document, self).__init__()
self.title = T.title(title) if title else T.title()
self.head = T.head(
meta_content_type,
self.title,
favicon,
reset_css,
jquery_ui_css,
pushmaster_css,
)
self.dialogs = T.div(id='dialogs')
self.scripts = T.div(jquery_js, jquery_ui_js, pushmaster_js, id='scripts')
request_form = new_request_form()
request_form(id='new-request-form')
self.dialogs(request_form)
push_form = new_push_form()
push_form(id='new-push-form')
self.dialogs(push_form)
stage_form = sendtostage_form()
stage_form(id='sendtostage-form')
self.dialogs(stage_form)
reject_form = reject_request_form()
self.dialogs(reject_form)
self.funcbar = funcbar()
self.body = T.body(session(), navbar(), self.funcbar)
self.html(self.head, self.body)
示例3: request_display
# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import div [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
示例4: new_push_form
# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import div [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')),
),
)
示例5: new_request_form
# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import div [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=util.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.input(id='new-request-tests-pass-url', name='tests_pass_url', class_='tests-pass-url'),
),
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: reject_request_form
# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import div [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')),
),
)
示例7: push_item
# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import div [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.'),
)
示例8: sendtostage_form
# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import div [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')),
)
示例9: request_item
# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import div [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
示例10: request_item
# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import div [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
示例11: take_ownership_form
# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import div [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
示例12: push_actions_form
# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import div [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
示例13: get
# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import div [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)
示例14: get
# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import div [as 别名]
def get(self, email):
email = urllib.unquote_plus(email)
doc = common.Document(title='pushmaster: recent activity: ' + email)
doc.body(T.div(class_='bookmarklet')(common.bookmarklet(self.hostname)))
user = users.User(email)
requests = query.requests_for_user(user)
pushes = query.pushes_for_user(user)
if requests:
doc.body(
T.h3('Recent Requests'),
T.ol(class_='my requests')(map(request_item, requests)),
)
if pushes:
doc.body(
T.h3('Recent Pushes'),
T.ol(class_='pushes')(map(push_item, pushes)),
)
doc.serialize(self.response.out)
示例15: session
# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import div [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