From cc65c917261c7ea2d34054bf7b7adfa930a9c3e6 Mon Sep 17 00:00:00 2001 From: Tiago Vasconcelos Date: Mon, 27 Feb 2023 18:13:26 +0000 Subject: [PATCH] Initial skeleton --- config.json | 0 .../stall-details/stall-details.html | 0 .../components/stall-details/stall-details.js | 15 ++++++++++ static/js/index.js | 15 ++++++++++ static/js/utils.js | 18 ++++++++++++ templates/nostrmarket/_api_docs.html | 26 +++++++++++++++++ templates/nostrmarket/index.html | 29 +++++++++++++++++++ 7 files changed, 103 insertions(+) create mode 100644 config.json create mode 100644 static/components/stall-details/stall-details.html create mode 100644 static/components/stall-details/stall-details.js create mode 100644 static/js/index.js create mode 100644 static/js/utils.js create mode 100644 templates/nostrmarket/_api_docs.html create mode 100644 templates/nostrmarket/index.html diff --git a/config.json b/config.json new file mode 100644 index 0000000..e69de29 diff --git a/static/components/stall-details/stall-details.html b/static/components/stall-details/stall-details.html new file mode 100644 index 0000000..e69de29 diff --git a/static/components/stall-details/stall-details.js b/static/components/stall-details/stall-details.js new file mode 100644 index 0000000..5b929e1 --- /dev/null +++ b/static/components/stall-details/stall-details.js @@ -0,0 +1,15 @@ +async function stallDetails(path) { + const template = await loadTemplateAsync(path) + Vue.component('stall-details', { + name: 'stall-details', + template, + + //props: ['stall-id', 'adminkey', 'inkey', 'wallet-options'], + data: function () { + return { + tab: 'info', + relay: null + } + } + }) +} diff --git a/static/js/index.js b/static/js/index.js new file mode 100644 index 0000000..b48f3b1 --- /dev/null +++ b/static/js/index.js @@ -0,0 +1,15 @@ +const stalls = async () => { + Vue.component(VueQrcode.name, VueQrcode) + + await relayDetails('static/components/stall-details/stall-details.html') + + new Vue({ + el: '#vue', + mixins: [windowMixin], + data: function () { + return {} + } + }) +} + +stalls() diff --git a/static/js/utils.js b/static/js/utils.js new file mode 100644 index 0000000..11ebc81 --- /dev/null +++ b/static/js/utils.js @@ -0,0 +1,18 @@ +function loadTemplateAsync(path) { + const result = new Promise(resolve => { + const xhttp = new XMLHttpRequest() + + xhttp.onreadystatechange = function () { + if (this.readyState == 4) { + if (this.status == 200) resolve(this.responseText) + + if (this.status == 404) resolve(`
Page not found: ${path}
`) + } + } + + xhttp.open('GET', path, true) + xhttp.send() + }) + + return result +} diff --git a/templates/nostrmarket/_api_docs.html b/templates/nostrmarket/_api_docs.html new file mode 100644 index 0000000..9ed2f47 --- /dev/null +++ b/templates/nostrmarket/_api_docs.html @@ -0,0 +1,26 @@ + + +

+ Nostr Market
+ + Created by, + motorina0 +

+
+
+ Swagger REST API Documentation +
+
diff --git a/templates/nostrmarket/index.html b/templates/nostrmarket/index.html new file mode 100644 index 0000000..86f0077 --- /dev/null +++ b/templates/nostrmarket/index.html @@ -0,0 +1,29 @@ +{% extends "base.html" %} {% from "macros.jinja" import window_vars with context +%} {% block page %} +
+
+ + section + +
+ +
+ + +
+ {{SITE_TITLE}} Nostr Market Extension +
+
+ + + {% include "nostrmarket/_api_docs.html" %} + +
+
+
+{% endblock%}{% block scripts %} {{ window_vars(user) }} + + + + +{% endblock %}