本文整理汇总了Python中pushmaster.taglib.T类的典型用法代码示例。如果您正苦于以下问题:Python T类的具体用法?Python T怎么用?Python T使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了T类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: take_ownership_form
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
开发者ID:alanf,项目名称:PushmasterApp,代码行数:7,代码来源:common.py
示例2: __init__
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')
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)
reject_form = reject_request_form()
self.dialogs(reject_form)
self.body = T.body(session(), navbar(), self.dialogs)
self.html(self.head, self.body)
开发者ID:wingerz,项目名称:pushmaster,代码行数:27,代码来源:common.py
示例3: request_display
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,代码行数:29,代码来源:request.py
示例4: onstage_request_item
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
开发者ID:Yelp,项目名称:PushmasterApp,代码行数:7,代码来源:push.py
示例5: get
def get(self):
doc = common.Document(title='pushmaster: recent pushes')
pushes = query.open_pushes()
doc.body(T.h1('Recent Pushes'), T.ol(map(push_item, pushes), class_='requests'))
doc.serialize(self.response.out)
开发者ID:Yelp,项目名称:PushmasterApp,代码行数:7,代码来源:push.py
示例6: request_actions_form
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
开发者ID:Yelp,项目名称:PushmasterApp,代码行数:7,代码来源:request.py
示例7: get
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)
开发者ID:Yelp,项目名称:PushmasterApp,代码行数:25,代码来源:home.py
示例8: get
def get(self):
doc = common.Document(title="pushmaster: today's pushes")
pushes = query.live_pushes_today()
doc.body(T.h1("Today's Pushes"), T.ol(map(push_item_full, pushes)))
self.dispatch_daily_push_report_email(doc)
doc.serialize(self.response.out)
开发者ID:alanf,项目名称:PushmasterApp,代码行数:8,代码来源:push.py
示例9: session
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,代码行数:8,代码来源:common.py
示例10: push_item
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,代码行数:10,代码来源:push.py
示例11: get
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,代码行数:10,代码来源:request.py
示例12: accepted_request_item
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,代码行数:11,代码来源:push.py
示例13: get
def get(self):
doc = common.Document(title='pushmaster: pushes')
pushes = query.open_pushes()
push_list = T.ol(map(push_item, pushes))
doc.body(T.h1('Recent Pushes'))
doc.body(push_list)
doc.body(common.jquery_js, common.jquery_ui_js, common.pushmaster_js)
doc.serialize(self.response.out)
开发者ID:wingerz,项目名称:pushmaster,代码行数:11,代码来源:push.py
示例14: push_item_full
def push_item_full(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(lambda item: common.request_item(item, full_request=True), requests)) if requests else T.div('No requests.'),
)
开发者ID:alanf,项目名称:PushmasterApp,代码行数:12,代码来源:push.py
示例15: new_push_form
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,代码行数:9,代码来源:common.py
示例16: render_doc
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,代码行数:13,代码来源:push.py
示例17: sendtostage_form
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,代码行数:13,代码来源:common.py
示例18: request_actions_form
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,代码行数:28,代码来源:request.py
示例19: request_item
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,代码行数:27,代码来源:common.py
示例20: push_actions_form
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,代码行数:26,代码来源:push.py
注:本文中的pushmaster.taglib.T类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论