This commit is contained in:
2019-12-30 20:35:52 +00:00
parent e30fa5b0bd
commit f3f2987550
2 changed files with 23 additions and 6 deletions

View File

@@ -14,12 +14,18 @@ export default {
if (ctx.icon && !ctx.icon.startsWith("fa-")) { if (ctx.icon && !ctx.icon.startsWith("fa-")) {
ctx.icon = "fa-" + ctx.icon; ctx.icon = "fa-" + ctx.icon;
} }
vm.appBar.icon = ctx.icon; vm.appBar.icon = ctx.icon;
vm.appBar.title = ctx.title; vm.appBar.title = ctx.title;
//Parse the forms object type if present
var formAyaType = 0;
if (ctx.formData && ctx.formData.ayaType != undefined) {
formAyaType = ctx.formData.ayaType;
}
//set the help url if presented or default to the User section intro //set the help url if presented or default to the User section intro
vm.appBar.helpUrl = ctx.helpUrl ? ctx.helpUrl : "user-intro"; vm.appBar.helpUrl = ctx.helpUrl ? ctx.helpUrl : "user-intro";
vm.appBar.menuItems = []; vm.appBar.menuItems = [];
//CONTEXT TOP PORTION //CONTEXT TOP PORTION
@@ -42,19 +48,24 @@ export default {
//LOGOUT //LOGOUT
vm.appBar.menuItems.push({ vm.appBar.menuItems.push({
title: window.$gz.locale.get("Logout"), title: window.$gz.locale.get("Logout"),
icon: "sign-out-alt", icon: "sign-out-alt",
key: "app:logout" key: "app:logout"
}); });
//divider //divider
vm.appBar.menuItems.push({ divider: true, inset: false }); vm.appBar.menuItems.push({ divider: true, inset: false });
//SEARCH
vm.appBar.menuItems.push({
title: window.$gz.locale.get("Search"),
icon: "search",
key: "app:search",
data: formAyaType
});
//HELP //HELP
vm.appBar.menuItems.push({ vm.appBar.menuItems.push({
title: window.$gz.locale.get("MenuHelp"), title: window.$gz.locale.get("MenuHelp"),
icon: "question-circle", icon: "question-circle",
key: "app:help", key: "app:help",
data: vm.appBar.helpUrl data: vm.appBar.helpUrl
@@ -149,6 +160,12 @@ export default {
var helpurl = vm.$store.state.helpUrl + item.data; var helpurl = vm.$store.state.helpUrl + item.data;
window.open(helpurl, "_blank"); window.open(helpurl, "_blank");
break; break;
case "search":
vm.$router.push({
name: "home-search",
params: { ayatype: item.data }
});
break;
case "logout": case "logout":
vm.$router.push("/login"); vm.$router.push("/login");
break; break;

View File

@@ -77,7 +77,7 @@ export default new Router({
import(/* webpackChunkName: "home" */ "./views/home-dashboard.vue") import(/* webpackChunkName: "home" */ "./views/home-dashboard.vue")
}, },
{ {
path: "/home-search", path: "/home-search/:ayatype",
name: "home-search", name: "home-search",
component: () => component: () =>
import(/* webpackChunkName: "home" */ "./views/home-search.vue") import(/* webpackChunkName: "home" */ "./views/home-search.vue")