reviewboard.reviews.ui.image¶
- class ImageReviewUI(review_request, obj)[source]¶
Bases:
FileAttachmentReviewUI
- allow_inline = True[source]¶
Whether the Review UI can be rendered inline in diffs and other places.
If set, the Review UI will be able to be displayed within the diff viewer (and potentially other locations).
- js_model_class = 'RB.ImageReviewable'[source]¶
The name of the JavaScript model class to use for the Review UI.
- js_view_class = 'RB.ImageReviewableView'[source]¶
The name of the JavaScript view class to use for the Review UI.
- get_page_cover_image_url()[source]¶
Return the URL to an image used to depict this on other sites.
The returned image URL will be used for services like Facebook, Slack, Twitter, etc. when linking to this file attachment.
- Returns:
The absolute URL to an image used to depict this file attachment.
- Return type:
- get_js_model_data()[source]¶
Return model data for the JavaScript AbstractReviewable subclass.
This will return information on the file attachment, its history, and any information on an attachment being diffed against.
Subclasses can override this to return additional data.
- Returns:
The attributes to pass to the model.
- Return type:
- serialize_comments(comments)[source]¶
Serialize the comments for the Review UI target.
By default, this will return a list of serialized comments, but it can be overridden to return other list or dictionary-based representations, such as comments grouped by an identifier or region. These representations must be serializable into JSON.
- Parameters:
comments (
list
ofreviewboard.reviews.models.base_comment.BaseComment
) – The list of objects to serialize. This will be the result ofget_comments()
.- Returns:
The list of serialized comment data.
- Return type:
- get_comment_thumbnail(comment)[source]¶
Return an HTML thumbnail for a comment.
If comment thumbnails are possible for the reviewable object, this function should return HTML for the thumbnail.
- Parameters:
comment (
reviewboard.reviews.models.base_comment.BaseComment
) – The comment to return a thumbnail for.- Returns:
The HTML for a thumbnail for the comment, or
None
if one can’t be generated (using the default thumbnailing for the comment type, if one exists).- Return type:
django.utils.safestring.SafeText
- __annotations__ = {}¶