my $items = [];
my $message = "";
- $items = $submissions->select(del => 0);
+ my $show_deleted = $c->param('show_deleted') ? 1 : 0;
+
+ $items = $submissions->select(del => $show_deleted, limit => 10);
if (!$items) {
$message = $submissions->last_error;
$c->render(json => {message => $message, error => 1});
const data = {
message: '',
submissions: [],
+ status: '',
+ showDeletedSubjs: false,
urls: {
update: '/admin/submissions/update',
get: '/admin/submissions/get',
};
const computed = {};
const methods = {
- updateItem: function editItem(item) {
+ updateItem: function updateItem(item) {
+ var url = this.urls.list;
+ if (this.showDeletedSubjs) {
+ url = url + '?show_deleted=1'
+ }
+ this.$http.get(url).then(
+ (resp) => { // success
+ this.submissions = resp.body.items || [];
+ this.message = resp.body.message || '';
+ initItems(this.submissions);
+ this.status = "";
+ },
+ (resp) => { // fail
+ this.boxItems = [];
+ this.message = resp.body.message || "failed to get items";
+ this.status = "update_failed";
+ }
+ );
},
deleteItem: function deleteItem() {
const target = [];
<div class="app-frame" id="submissions-manager">
<h3>Submissions</h3>
- <div v-text="message">
- </div>
+ <div v-text="message"></div>
<form class="items">
<table class="table table-hover">
<thead>
</tbody>
</table>
- <box-editor :box="item" v-for="item in boxItems"></box-editor>
-
<div class="actions">
<button class="btn btn-default" type="button" v-on:click="updateItem()">Update</button>
<button class="btn btn-default" type="button" v-on:click="deleteItem()">Delete</button>
+ <label>
+ <input type="checkbox" v-model="showDeletedSubjs"
+ v-on:click="updateItem()">削除済みのタレコミも表示</input>
+ </label>
</div>
</form>
</div>