Jump to >

reviewboard.reviews.ui.image

class ImageReviewUI(review_request, obj)[source]
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

unicode

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

dict

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 of reviewboard.reviews.models.base_comment.BaseComment) – The list of objects to serialize. This will be the result of get_comments().

Returns

The list of serialized comment data.

Return type

list of dict

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