diffido/dist/diff.html

69 lines
1.3 KiB
HTML
Raw Normal View History

2018-01-16 22:24:30 +01:00
{% extends "base.html" %}
{% block body %}
2018-01-21 11:20:42 +01:00
<div id="app">
<div class="md-layout">
<div class="md-layout-item" md-card>
<div id="diffpanel"></div>
</div>
</div>
</div>
<script>
Vue.use(VueMaterial.default);
var app = new Vue({
el: '#app',
delimiters: ['${', '}'],
data: {
history: [],
difftext: '',
id: "{{id}}",
{% try %}
{% if diff %}
diff: "{{diff}}",
{% end %}
{% except %}
diff: null,
{% end %}
{% try %}
{% if oldid %}
oldid: "{{oldid}}",
{% end %}
{% except %}
oldid: null,
{% end %}
},
mounted: function() {
this.getDiff();
},
methods: {
getDiff: function() {
self = this;
var data = axios.get('/api/diff/' + this.id + '/' + this.diff + '/' + (this.oldid || '')).then(function(response) {
console.log(response);
self.difftext = response.data.diff;
var pretty_diff = Diff2Html.getPrettyHtml(self.difftext);
document.getElementById('diffpanel').innerHTML = pretty_diff;
});
}
}
});
</script>
<style>
body {
background-color: white;
}
.md-table {
width: 60%;
min-height: 800px;
max-height: 800px;
}
</style>
2018-01-16 22:24:30 +01:00
{% end %}