Changeset View
Changeset View
Standalone View
Standalone View
src/resources/vue/App.vue
Show First 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | export default { | ||||
} | } | ||||
}, | }, | ||||
methods: { | methods: { | ||||
checkPermission(type) { | checkPermission(type) { | ||||
if (this.$root.hasPermission(type)) { | if (this.$root.hasPermission(type)) { | ||||
return true | return true | ||||
} | } | ||||
const hint = type == 'wallets' ? "Only account owners can access a wallet." : '' | const hint = type == 'wallets' ? this.$t('wallet.noperm') : '' | ||||
this.$root.errorPage(403, null, hint) | this.$root.errorPage(403, null, hint) | ||||
return false | return false | ||||
}, | }, | ||||
childMounted() { | childMounted() { | ||||
this.$root.updateBodyClass() | this.$root.updateBodyClass() | ||||
this.getFAQ() | this.getFAQ() | ||||
}, | }, | ||||
getFAQ() { | getFAQ() { | ||||
let page = this.$route.path | let page = this.$route.path | ||||
if (page == '/' || page == '/login') { | if (page == '/' || page == '/login') { | ||||
return | return | ||||
} | } | ||||
axios.get('/content/faq' + page, { ignoreErrors: true }) | axios.get('/content/faq' + page, { ignoreErrors: true }) | ||||
.then(response => { | .then(response => { | ||||
const result = response.data.faq | const result = response.data.faq | ||||
$('#faq').remove() | $('#faq').remove() | ||||
if (result && result.length) { | if (result && result.length) { | ||||
let faq = $('<div id="faq" class="faq mt-3"><h5>FAQ</h5><ul class="pl-4"></ul></div>') | let faq = $('<div id="faq" class="faq mt-3"><h5>' + this.$t('app.faq') + '</h5><ul class="pl-4"></ul></div>') | ||||
let list = [] | let list = [] | ||||
result.forEach(item => { | result.forEach(item => { | ||||
list.push($('<li>').append($('<a>').attr('href', item.href).text(item.title))) | list.push($('<li>').append($('<a>').attr('href', item.href).text(item.title))) | ||||
// Handle internal links with the vue-router | // Handle internal links with the vue-router | ||||
if (item.href.charAt(0) == '/') { | if (item.href.charAt(0) == '/') { | ||||
list[list.length-1].find('a').on('click', event => { | list[list.length-1].find('a').on('click', event => { | ||||
Show All 23 Lines |