This commit is contained in:
Markos Gogoulos 2025-10-21 10:27:21 +03:00
parent 7acf748c24
commit f65338562e
3 changed files with 31 additions and 25 deletions

View File

@ -629,10 +629,12 @@ def view_media(request):
if request.user.is_authenticated: if request.user.is_authenticated:
if request.user.has_contributor_access_to_media(media) or is_mediacms_editor(request.user): if request.user.has_contributor_access_to_media(media) or is_mediacms_editor(request.user):
context["CAN_DELETE_MEDIA"] = True
context["CAN_EDIT_MEDIA"] = True context["CAN_EDIT_MEDIA"] = True
context["CAN_DELETE_COMMENTS"] = True context["CAN_DELETE_COMMENTS"] = True
if request.user == media.user or is_mediacms_editor(request.user):
context["CAN_DELETE_MEDIA"] = True
# in case media is video and is processing (eg the case a video was just uploaded) # in case media is video and is processing (eg the case a video was just uploaded)
# attempt to show it (rather than showing a blank video player) # attempt to show it (rather than showing a blank video player)
if media.media_type == 'video': if media.media_type == 'video':

View File

@ -217,16 +217,19 @@ export default function ViewerInfoContent(props) {
/> />
) : null} ) : null}
{userCan.editMedia || userCan.deleteMedia ? ( {userCan.editMedia ? (
<div className="media-author-actions"> <div className="media-author-actions">
{userCan.editMedia ? <EditMediaButton link={MediaPageStore.get('media-data').edit_url} /> : null} {userCan.editMedia ? <EditMediaButton link={MediaPageStore.get('media-data').edit_url} /> : null}
{userCan.deleteMedia ? (
<PopupTrigger contentRef={popupContentRef}> <PopupTrigger contentRef={popupContentRef}>
<button className="remove-media-icon" title={translateString('Delete media')}> <button className="remove-media-icon" title={translateString('Delete media')}>
<i className="material-icons">delete</i> <i className="material-icons">delete</i>
</button> </button>
</PopupTrigger> </PopupTrigger>
) : null}
{userCan.deleteMedia ? (
<PopupContent contentRef={popupContentRef}> <PopupContent contentRef={popupContentRef}>
<PopupMain> <PopupMain>
<div className="popup-message"> <div className="popup-message">
@ -244,6 +247,7 @@ export default function ViewerInfoContent(props) {
</span> </span>
</PopupMain> </PopupMain>
</PopupContent> </PopupContent>
) : null}
</div> </div>
) : null} ) : null}
</div> </div>

File diff suppressed because one or more lines are too long