reviewboard.reviews.templatetags.reviewtags¶
Returns the HTML for the trophies awarded to a review request.
Render a list of replies to a comment.
This loads all the replies made to a particular comment and renders them in order by timestamp, showing the author of each comment, the timestamp, and the text in the appropriate format.
Parameters: - context (django.template.RequestContext) – The template context for the page.
- review (reviewboard.reviews.models.review.Review) – The review being replied to.
- comment (reviewboard.reviews.models.base_comment.BaseComment) – The comment being replied to.
- context_id (unicode) – An internal ID used by the JavaScript code for storing and categorizing replies.
Returns: The resulting HTML for the replies.
Return type:
Render a list of replies to a body field of a review.
This loads all the replies made to a review’s header/footer body field and renders them in order by timestamp, showing the author of each comment, the timestamp, and the text in the appropriate format.
Parameters: - context (django.template.RequestContext) – The template context for the page.
- review (reviewboard.reviews.models.review.Review) – The review being replied to.
- body_field (unicode) – The body field to look up replies to. This can be either
body_top
orbody_bottom
. - context_id (unicode) – An internal ID used by the JavaScript code for storing and categorizing replies.
Returns: The resulting HTML for the replies.
Return type: Raises: django.template.TemplateSyntaxError
– There was an invalidbody_field
provided.
Render a template for displaying a reply.
This takes the same parameters as
reply_list()
. The template rendered by this function,reviews/review_reply_section.html
, is responsible for invokingreply_list()
and as such passes these variables through. It does not make use of them itself.Parameters: - context (django.template.Context) – The collection of key-value pairs available in the template.
- review (reviewboard.reviews.models.Review) – The review being replied to.
- comment (reviewboard.reviews.models.BaseComment) – The comment being replied to.
- context_type (unicode) – The type of comment being replied to. This is one of
diff_comments
,screenshot_comments
,file_attachment_comments
,general_comments
(if the reply is to a comment), orbody_top
orbody_bottom
if the reply is to the header or footer text of the review. - context_id (unicode) – The internal ID used by the JavaScript code for storing and categorizing comments.
- reply_to_text (unicode) – The text in the review being replied to.
Returns: The context to use when rendering the template included by the inclusion tag.
Return type:
Returns a humanized list of target reviewers in a review request.
Render all registered review request actions.
Parameters: context (django.template.Context) – The collection of key-value pairs available in the template. Returns: The HTML content to be rendered. Return type: unicode
Render all registered child actions.
Parameters: context (django.template.Context) – The collection of key-value pairs available in the template. Returns: The HTML content to be rendered. Return type: unicode
Loops through all fields in a fieldset.
This can take a fieldset instance or a fieldset ID.
Loop through all fieldsets.
Parameters: - context (dict) – The render context.
- nodelist (django.template.NodeList) – The contents of the template inside the blocktag.
- review_request_details (reviewboard.reviews.models.base_review_request_details.BaseReviewRequestDetails) – The review request or draft being rendered.
Returns: The rendered tag contents.
Return type: unicode
Render a block with a specific review request field.
Parameters: - context (dict) – The render context.
- nodelist (django.template.NodeList) – The contents of the template inside the blocktag.
- review_request_details (reviewboard.reviews.models.base_review_request_details.BaseReviewRequestDetails) – The review request or draft being rendered.
- field_id (unicode) – The ID of the field to add to the render context.
Returns: The rendered block.
Return type: unicode
Returns the URL based on a bug number on the specified review request.
If the repository the review request belongs to doesn’t have an associated bug tracker, this returns None.
Render the code for displaying a star used for starring items.
The rendered code should handle click events so that the user can toggle the star. The star is rendered by the template
reviews/star.html
.Parameters: - context (django.template.RequestContext) – The template context for the page.
- obj (reviewboard.reviews.models.review_request.ReviewRequest or reviewboard.reviews.models.group.Group) –
Returns: The rendered HTML for the star.
Return type:
Does the actual work of rendering the star. The star tag is a wrapper around this.
Renders the code responsible for handling comment issue statuses.
Turns an issue status code into a human-readable status string.
Return an icon name for the issue status.
Parameters: status (unicode) – The stored issue status for the comment. Returns: The icon name for the issue status. Return type: unicode
Renders a diff comment fragment expansion link.
This link will expand the context by the supplied expanding_above and expanding_below values.
expanding is expected to be one of ‘above’, ‘below’, or ‘line’.
Render a diff comment fragment header expansion link.
This link expands the context to contain the given line number.
Render the changed line number ranges for a diff, for use in e-mail.
This will display the original and patched line ranges covered by a comment, transforming the comment’s stored virtual line ranges into human-readable ranges. It’s intended for use in e-mail.
The template tag’s output will list the original line ranges only if there are ranges to show, and same with the patched line ranges.
Parameters: - context (django.template.Context) – The template context.
- chunks (list) – The list of chunks for the diff.
- comment (reviewboard.reviews.models.diff_comment.Comment) – The comment containing the line ranges.
Returns: A string representing the line ranges for the comment.
Return type: unicode
Output JSON-serialized data for a RB.ReviewablePage model.
The data will be used by
RB.ReviewablePage()
in order to populate the review request and editor with the necessary state.Parameters: context (django.template.RequestContext) – The current template context. Returns: The resulting JSON-serialized data. This consists of keys that are meant to be injected into an existing dictionary. Return type: unicode
Render a series of entries on the page.
Parameters: - context (django.template.RequestContext) – The existing template context on the page.
- entries (list of reviewboard.reviews.detail.BaseReviewRequestPageEntry) – The entries to render.
Returns: The resulting HTML for the entries.
Return type: unicode