171171 </span >
172172 </div >
173173 <div v-if =" attachments.length" class =" w-100 d-flex flex-wrap" >
174- <ModPhoto v-for =" attachment in attachments" :key =" 'attachment-' + attachment.id" :message =" message" :attachment =" attachment" class =" d-inline pr-1" />
174+ <div v-for =" attachment in attachments" :key =" 'attachment-' + attachment.id" :class =" {'d-inline':true, 'pr-1': true, addedImage: imageAdded(attachment.id), removeImage: imageRemoved(attachment.id)}" >
175+ <div class =" addedMessage pl-2 font-weight-bold text-success" >
176+ Added
177+ </div >
178+ <div class =" removedMessage pl-2 font-weight-bold text-warning" >
179+ Removed
180+ </div >
181+ <ModPhoto :message =" message" :attachment =" attachment" />
182+ </div >
175183 </div >
176184 <MessageReplyInfo v-if =" !pending || message.replies && message.replies.length" :message =" message" class =" d-inline" />
177185 </div >
194202 Sender only available to mods.
195203 </NoticeMessage >
196204 <NoticeMessage v-else variant =" danger" >
197- Can't identify sender. Could have been purged but probably a bug.
205+ Can't identify sender. Could have been purged but perhaps a bug.
198206 </NoticeMessage >
199207 </div >
200208 </div >
@@ -641,6 +649,36 @@ export default {
641649 this .$emit (' destroy' , this .message .id , this .next )
642650 },
643651 methods: {
652+ imageAdded (id ) {
653+ let ret = false
654+
655+ if (this .editreview && this .message && this .message .edits ) {
656+ this .message .edits .forEach (edit => {
657+ const n = edit .newimages ? JSON .parse (edit .newimages ) : []
658+ const o = edit .oldimages ? JSON .parse (edit .oldimages ) : []
659+ if (n .includes (id) && ! o .includes (id)) {
660+ ret = true
661+ }
662+ })
663+ }
664+
665+ return ret
666+ },
667+ imageRemoved (id ) {
668+ let ret = false
669+
670+ if (this .editreview && this .message && this .message .edits ) {
671+ this .message .edits .forEach (edit => {
672+ const n = edit .newimages ? JSON .parse (edit .newimages ) : []
673+ const o = edit .oldimages ? JSON .parse (edit .oldimages ) : []
674+ if (! n .includes (id) && o .includes (id)) {
675+ ret = true
676+ }
677+ })
678+ }
679+
680+ return ret
681+ },
644682 hasCollection (coll ) {
645683 let ret = false
646684
@@ -850,6 +888,7 @@ export default {
850888@import ' ~bootstrap/scss/functions' ;
851889@import ' ~bootstrap/scss/variables' ;
852890@import ' ~bootstrap/scss/mixins/_breakpoints' ;
891+ @import ' color-vars' ;
853892
854893.type {
855894 max- width: 150px ;
@@ -873,4 +912,25 @@ export default {
873912 grid- template- columns: 1fr ;
874913 }
875914}
915+
916+ .addedMessage ,
917+ .removedMessage {
918+ display: none;
919+ }
920+
921+ .addedImage {
922+ border: 1px solid $color- green-- dark ! important;
923+
924+ .addedMessage {
925+ display: block ! important;
926+ }
927+ }
928+
929+ .removedImage {
930+ border: 1px solid $color- red-- dark ! important;
931+
932+ .removedMessage {
933+ display: block ! important;
934+ }
935+ }
876936< / style>
0 commit comments