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
def request_display(request, push): title = T.h2(class_='request-title')( T.span(class_='subject')(request.subject), common.user_home_link(request.owner, logic.user_info(request.owner)), common.display_date(request.target_date), ) div = T.div(class_='request')(title) if request.branch: if '/' in request.branch: repo, _, branch = request.branch.partition('/') repo = 'devs/%s.git' % repo else: repo, branch = 'yelp-main.git', request.branch div(T.h3(T.span('Branch: '), T.a(request.branch, href=config.git_branch_url % dict(repo=repo,branch=branch)))) if push: div(T.h3(T.span('Push: '), T.a('%s %s' % (util.format_datetime(push.ptime), push.name), href=push.uri))) 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