<%namespace name="util" module="bodhi.server.util"/> <%def name="karma(karma, show_digit=False, optional_text=None, zero_thumbsup=True, show_details=None)"> <%doc> Return a span with the karma thumbsup icon, and an optional count of the karma. Example: 3 Args: karma (int): The amount of karma show_digit (bool): if true, show the amount of karma in the returned span optional_text (str): a string to place after the icon zero_thumbsup: if true, and karma is 0, show the thumbsup. otherwise if false, and karma is zero, show thumbsdown. show_details: 2-tuple of the positive and negative karma of an update, usually provided by _composite_karma property. % if karma < 0: % if show_details: % if show_details[0] > 0: % endif % endif % elif karma > 0: % if show_details: % if show_details[1] < 0: % else: % endif % else: % endif % else: % if show_details: % endif % if show_details and show_details != (0,0): % elif zero_thumbsup: % else: % endif %endif % if show_details: % endif % if optional_text: ${optional_text} % endif % if show_digit: ${karma} % endif <%def name="status_context(status)">\ <% statusmap = {'pending': 'info', 'testing': 'warning', 'stable': 'success', 'unpushed': 'danger', 'obsolete': 'secondary'} %>\ ${statusmap[status]}\ <%def name="compose_status_context(status)">\ <% statusmap = { 'requested': 'primary', 'pending': 'primary', 'initializing': 'warning', 'updateinfo': 'warning', 'punging': 'warning', 'notifying': 'warning', 'cleaning': 'warning', 'syncing_repo': 'warning', 'signing_repo': 'warning', 'success': 'success', 'failed': 'danger'} %>\ ${statusmap[status]}\ <%def name="status_text(update)"> ${update.status.value} % if update.request: ${update.request.value} % endif <%def name="comment(comment, display_update=True)"> % if comment.user.name == "bodhi":
${util.markup(comment.text, bodhi=False) | n}
${util.age(comment.timestamp)}
% else:
% if comment.karma and comment.karma < 0:
% else:
% endif
% if comment.user: User Icon ${comment.user.name} % if comment.text: % if comment.karma or comment.bug_feedback or any([True for feedback in comment.unique_testcase_feedback if feedback.karma]): commented & provided feedback % else: commented % endif % else: provided feedback % endif % endif % if display_update: on ${comment.update.get_title(', ', 1, ", …") | n} % endif ${util.age(comment.timestamp)}
% if comment.karma: ${karma(comment.karma, optional_text="karma")} % endif
<% has_feedback = False if comment.bug_feedback: for feedback in comment.bug_feedback: if feedback.karma: has_feedback = True if comment.testcase_feedback: for feedback in comment.testcase_feedback: if feedback.karma: has_feedback = True %> % if has_feedback or comment.text:
% if comment.text:
${util.markup(comment.text) | n}
%endif % if has_feedback:
% for feedback in comment.bug_feedback: % if feedback.karma:
${karma(feedback.karma)} ${util.bug_link(feedback.bug) | n}
% endif % endfor % if comment.testcase_feedback: % for feedback in comment.unique_testcase_feedback: % if feedback.karma:
${karma(feedback.karma)} ${util.testcase_link(feedback.testcase) | n}
% endif % endfor % endif
%endif
%endif
% endif <%def name="update(update, display_user=True, display_karma=True, display_commentcount=True)">
${util.type2icon(update['type'])|n}
${status_text(update)}
%if display_commentcount:
${sum(1 for c in update.comments if c.user.name != 'bodhi')}
%endif %if display_karma:
${karma(update.karma, show_digit=True, show_details=update._composite_karma)}
%endif
<%def name="override(override, display_user=True)">
created %if display_user: by ${override['submitter']['name']} %endif ${util.age(override['submission_date'])} for ${override['build']['release']['long_name']}
% if override['expired_date'] is None:
still active for ${util.age(override['expiration_date'], True)}
% else:
expired ${util.age(override['expired_date'])}
% endif
<%def name="markdown_help_modal()"> <%def name="frozen_badge()"> frozen