2018-12-05 16:35:54 +01:00
|
|
|
const HomeRouter = {
|
2018-12-28 10:18:21 +01:00
|
|
|
template: `
|
2019-07-21 15:20:32 +02:00
|
|
|
<div>
|
2019-07-22 18:51:02 +02:00
|
|
|
<div id="om-msg-cards" class="column pull-right-sm is-four-fifths-desktop">
|
2019-07-22 18:40:51 +02:00
|
|
|
<a v-if="isSearchActiv" @click="goBackToDashboard">< zurück zu allen Einträgen</a>
|
|
|
|
<b-button class="subscribe-btn" v-if="isSubscripeButtonActiv" type="is-primary" @click="">#IPSUM ABONNIEREN</b-button>
|
2019-07-21 15:20:32 +02:00
|
|
|
<MsgCard
|
|
|
|
v-for="id in messagelist.slice().reverse()"
|
|
|
|
:key="id"
|
|
|
|
:msg="messages[id] || {}"
|
|
|
|
></MsgCard>
|
|
|
|
</div>
|
2018-12-05 16:35:54 +01:00
|
|
|
</div>`,
|
2018-12-28 10:18:21 +01:00
|
|
|
data: function () {
|
|
|
|
return {
|
|
|
|
messagelist: _messagelist,
|
|
|
|
messages: _messages,
|
2019-07-22 18:40:51 +02:00
|
|
|
isSearchActiv: _isSearchActiv,
|
|
|
|
isSubscripeButtonActiv: _isSubscripeButtonActiv
|
2018-12-28 10:18:21 +01:00
|
|
|
};
|
|
|
|
},
|
|
|
|
methods: {
|
2019-07-19 12:52:43 +02:00
|
|
|
list_messages: function() {
|
|
|
|
messages();
|
2019-07-22 18:40:51 +02:00
|
|
|
},
|
|
|
|
goBackToDashboard: function() {
|
|
|
|
//Home neu rendern ...
|
|
|
|
//windows.history.go();
|
2018-12-19 18:18:42 +01:00
|
|
|
|
2019-07-22 18:40:51 +02:00
|
|
|
_isSearchActiv = false;
|
|
|
|
}
|
|
|
|
},
|
2019-02-06 17:00:38 +01:00
|
|
|
mounted: function () {
|
|
|
|
this.list_messages();
|
|
|
|
//this.refresh_messages();
|
2019-01-31 19:01:40 +01:00
|
|
|
}
|
2018-12-05 16:35:54 +01:00
|
|
|
};
|
2018-12-28 10:18:21 +01:00
|
|
|
|
2019-02-06 17:00:38 +01:00
|
|
|
function get_insert_message(id) {
|
2019-06-20 17:17:45 +02:00
|
|
|
$.ajax({ url: "api/msg/id/"+id, method: "GET" }).done(function (msg) {
|
2018-12-28 10:18:21 +01:00
|
|
|
Vue.set(_messages, id, msg);
|
|
|
|
}).fail(function (e, f, g) {
|
|
|
|
console.log("cannot load " + id + ".json: " + e + f + g);
|
|
|
|
})
|
|
|
|
}
|