2018-11-08 19:23:39 +05:30
|
|
|
<script>
|
|
|
|
import DownloadViewer from '../../content_viewer/viewers/download_viewer.vue';
|
|
|
|
import { diffModes } from '../constants';
|
|
|
|
|
|
|
|
export default {
|
|
|
|
components: {
|
|
|
|
DownloadViewer,
|
|
|
|
},
|
|
|
|
props: {
|
|
|
|
diffMode: {
|
|
|
|
type: String,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
newPath: {
|
|
|
|
type: String,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
oldPath: {
|
|
|
|
type: String,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
projectPath: {
|
|
|
|
type: String,
|
|
|
|
required: false,
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
diffModes,
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<div class="diff-file-container">
|
|
|
|
<div class="diff-viewer">
|
2019-02-15 15:39:39 +05:30
|
|
|
<div v-if="diffMode === $options.diffModes.replaced" class="two-up view row">
|
2018-11-08 19:23:39 +05:30
|
|
|
<div class="col-sm-6 deleted">
|
2019-02-15 15:39:39 +05:30
|
|
|
<download-viewer :path="oldPath" :project-path="projectPath" />
|
2018-11-08 19:23:39 +05:30
|
|
|
</div>
|
|
|
|
<div class="col-sm-6 added">
|
2019-02-15 15:39:39 +05:30
|
|
|
<download-viewer :path="newPath" :project-path="projectPath" />
|
2018-11-08 19:23:39 +05:30
|
|
|
</div>
|
|
|
|
</div>
|
2019-02-15 15:39:39 +05:30
|
|
|
<div v-else-if="diffMode === $options.diffModes.new" class="added">
|
|
|
|
<download-viewer :path="newPath" :project-path="projectPath" />
|
2018-11-08 19:23:39 +05:30
|
|
|
</div>
|
2019-02-15 15:39:39 +05:30
|
|
|
<div v-else class="deleted">
|
|
|
|
<download-viewer :path="oldPath" :project-path="projectPath" />
|
2018-11-08 19:23:39 +05:30
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|