mirror of
https://github.com/mediacms-io/mediacms.git
synced 2025-11-05 23:18:53 -05:00
test
This commit is contained in:
parent
7acf748c24
commit
f65338562e
@ -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':
|
||||||
|
|||||||
@ -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
Loading…
x
Reference in New Issue
Block a user