diff --git a/public/js/components/NavDropdown.js b/public/js/components/NavDropdown.js
new file mode 100644
index 00000000..4da16575
--- /dev/null
+++ b/public/js/components/NavDropdown.js
@@ -0,0 +1,33 @@
+
+export default {
+ props: ["icon", "name"],
+ data: function() {
+ return {
+ open: false
+ };
+ },
+ computed: {
+ icon_classes: function() {
+ return {
+ fa: true,
+ [`fa-${this.icon}`]: true
+ };
+ }
+ },
+ watch: {
+ "$route": function() {
+ this.open = false;
+ }
+ },
+ template: /*html*/`
+
+
+
+ {{name}}
+
+
+
+ `
+};
diff --git a/public/js/components/pages/PlayerInfo.js b/public/js/components/pages/PlayerInfo.js
index 7573abef..c59e94bc 100644
--- a/public/js/components/pages/PlayerInfo.js
+++ b/public/js/components/pages/PlayerInfo.js
@@ -3,12 +3,13 @@ import DefaultLayout from '../layouts/DefaultLayout.js';
import { START, PLAYER_SEARCH } from '../Breadcrumb.js';
export default {
+ props: ["name"],
data: function() {
return {
breadcrumb: [START, PLAYER_SEARCH, {
- name: `Player profile for ${this.$route.params.name}`,
+ name: `Player profile for ${this.name}`,
icon: "user",
- link: `/profile/${this.$route.params.name}`
+ link: `/profile/${this.name}`
}]
};
},
@@ -18,7 +19,7 @@ export default {
},
template: /*html*/`
-
+
`
};
diff --git a/public/js/components/pages/cdb/Detail.js b/public/js/components/pages/cdb/Detail.js
index c027c941..6c44595b 100644
--- a/public/js/components/pages/cdb/Detail.js
+++ b/public/js/components/pages/cdb/Detail.js
@@ -1,29 +1,20 @@
-
-import { get_package, get_dependencies } from "../../../api/cdb.js";
-import { add } from "../../../service/mods.js";
-import store from '../../../store/mods.js';
+import { get_dependencies, get_package } from "../../../service/cdb.js";
+import { get_cdb_mod, get_game } from "../../../service/mods.js";
import FeedbackButton from "../../FeedbackButton.js";
import DefaultLayout from "../../layouts/DefaultLayout.js";
-import { START, ADMINISTRATION, MODS, CDB } from "../../Breadcrumb.js";
+import { START, ADMINISTRATION, MODS, CDB, CDB_DETAIL } from "../../Breadcrumb.js";
export default {
+ props: ["author", "name"],
components: {
"feedback-button": FeedbackButton,
"default-layout": DefaultLayout
},
data: function() {
- const author = this.$route.params.author;
- const name = this.$route.params.name;
return {
- author: author,
- name: name,
pkg: null,
deps: null,
- breadcrumb: [START, ADMINISTRATION, MODS, CDB, {
- name: `Package detail ${author}/${name}`,
- icon: "box-open",
- link: `/cdb/detail/${author}/${name}`
- }]
+ breadcrumb: [START, ADMINISTRATION, MODS, CDB, CDB_DETAIL(this.author, this.name)]
};
},
created: function() {
@@ -40,18 +31,8 @@ export default {
cdb_link: function() {
return `https://content.minetest.net/packages/${this.pkg.author}/${this.pkg.name}/`;
},
- is_installed: function() {
- return store.list && store.list.find(m => m.name == this.name && m.author == this.author);
- }
- },
- methods: {
- install: function() {
- return add({
- name: this.pkg.name,
- author: this.pkg.author,
- mod_type: this.pkg.type,
- source_type: "cdb"
- });
+ install_disabled: function() {
+ return get_cdb_mod(this.author, this.name) || (this.pkg && this.pkg.type == "game" && get_game());
}
},
template: /*html*/`
@@ -68,12 +49,12 @@ export default {
-
+
{{tag}}
Description
-
{{pkg.long_description}}
+
{{pkg.long_description || pkg.short_description}}
Dependencies
-
@@ -90,20 +71,20 @@ export default {
Actions