Merge branch 'master' of git.1750studios.com:AniNite/SocialDragon
This commit is contained in:
commit
0269f6eb1c
|
@ -17,6 +17,32 @@ var app = new Vue({
|
||||||
// `this` inside methods points to the Vue instance
|
// `this` inside methods points to the Vue instance
|
||||||
this.currentItem = itm;
|
this.currentItem = itm;
|
||||||
this.showModal = true;
|
this.showModal = true;
|
||||||
|
},
|
||||||
|
approveItem: function (id) {
|
||||||
|
var req = new XMLHttpRequest();
|
||||||
|
req.addEventListener("load", function () {
|
||||||
|
console.log("Approved ID " + id);
|
||||||
|
});
|
||||||
|
req.open("POST", "/admin/approve/" + id);
|
||||||
|
req.send();
|
||||||
|
this.showModal = false;
|
||||||
|
var index = this.items.indexOf(this.currentItem);
|
||||||
|
if (index > -1) {
|
||||||
|
this.items.splice(index, 1);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
rejectItem: function (id) {
|
||||||
|
var req = new XMLHttpRequest();
|
||||||
|
req.addEventListener("load", function () {
|
||||||
|
console.log("Rejected ID " + id);
|
||||||
|
});
|
||||||
|
req.open("POST", "/admin/reject/" + id);
|
||||||
|
req.send();
|
||||||
|
this.showModal = false;
|
||||||
|
var index = this.items.indexOf(this.currentItem);
|
||||||
|
if (index > -1) {
|
||||||
|
this.items.splice(index, 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -20,19 +20,10 @@
|
||||||
|
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<slot name="footer">
|
<slot name="footer">
|
||||||
<slot name="actions">
|
|
||||||
<button class="mdl-button mdl-js-button mdl-button--raised mdl-button--colored modal-default-button">
|
|
||||||
<i class="material-icons">check</i> Approve
|
|
||||||
</button>
|
|
||||||
<button class="mdl-button mdl-js-button mdl-button--raised mdl-button--accent">
|
|
||||||
<i class="material-icons">cancel</i> Reject
|
|
||||||
</button>
|
|
||||||
<button class="mdl-button mdl-js-button mdl-button--icon close" @click="$emit('close')">
|
<button class="mdl-button mdl-js-button mdl-button--icon close" @click="$emit('close')">
|
||||||
<i class="material-icons">close</i>
|
<i class="material-icons">close</i>
|
||||||
</button>
|
</button>
|
||||||
</slot>
|
</slot>
|
||||||
</slot>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -43,7 +34,7 @@
|
||||||
<body>
|
<body>
|
||||||
<div class="mdl-layout mdl-js-layout mdl-layout--no-desktop-drawer-button mdl-layout--fixed-header">
|
<div class="mdl-layout mdl-js-layout mdl-layout--no-desktop-drawer-button mdl-layout--fixed-header">
|
||||||
{{ template "menu.html" . }}
|
{{ template "menu.html" . }}
|
||||||
<main class="mdl-layout__content" id="app">
|
<main class="mdl-layout__content" id="app" v-cloak="v-cloak">
|
||||||
<div class="mdl-grid">
|
<div class="mdl-grid">
|
||||||
<div class="mdl-cell mdl-cell--3-col" v-for="item in items">
|
<div class="mdl-cell mdl-cell--3-col" v-for="item in items">
|
||||||
<a v-on:click="detailPopup(item)">
|
<a v-on:click="detailPopup(item)">
|
||||||
|
@ -64,6 +55,17 @@
|
||||||
</video>
|
</video>
|
||||||
<img class="sd-res-media-both" alt="" v-bind:src="currentItem.Path" v-if="!currentItem.IsVideo" />
|
<img class="sd-res-media-both" alt="" v-bind:src="currentItem.Path" v-if="!currentItem.IsVideo" />
|
||||||
</div>
|
</div>
|
||||||
|
<div slot="footer">
|
||||||
|
<button class="mdl-button mdl-js-button mdl-button--raised mdl-button--colored modal-default-button" @click="approveItem(currentItem.ID)">
|
||||||
|
<i class="material-icons">check</i> Approve
|
||||||
|
</button>
|
||||||
|
<button class="mdl-button mdl-js-button mdl-button--raised mdl-button--accent" @click="rejectItem(currentItem.ID)">
|
||||||
|
<i class="material-icons">cancel</i> Reject
|
||||||
|
</button>
|
||||||
|
<button class="mdl-button mdl-js-button mdl-button--icon close" @click="showModal = false">
|
||||||
|
<i class="material-icons">close</i>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</modal>
|
</modal>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
<script src="/static/js/vendor/vue.min.js"></script>
|
|
||||||
<script src="/static/js/app.js"></script>
|
<script src="/static/js/app.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -10,7 +10,11 @@
|
||||||
<link rel="stylesheet" href="/static/css/vendor/material.min.css">
|
<link rel="stylesheet" href="/static/css/vendor/material.min.css">
|
||||||
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
|
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
|
||||||
<link rel="stylesheet" href="/static/css/app.css">
|
<link rel="stylesheet" href="/static/css/app.css">
|
||||||
|
<style media="screen">
|
||||||
|
[v-cloak] { display: none; }
|
||||||
|
</style>
|
||||||
|
|
||||||
<!-- Scripts -->
|
<!-- Scripts -->
|
||||||
<script src="/static/js/vendor/material.min.js"></script>
|
<script src="/static/js/vendor/material.min.js"></script>
|
||||||
|
<script src="/static/js/vendor/vue.min.js"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|
Loading…
Reference in a new issue