diff --git a/.vscode/settings.json b/.vscode/settings.json
new file mode 100644
index 0000000..fa1b462
--- /dev/null
+++ b/.vscode/settings.json
@@ -0,0 +1,3 @@
+{
+ "python.pythonPath": ".venv\\Scripts\\python.exe"
+}
\ No newline at end of file
diff --git a/home/models.py b/home/models.py
index 6d7e3de..dfbfdd6 100644
--- a/home/models.py
+++ b/home/models.py
@@ -7,6 +7,7 @@ from wagtail.core.fields import RichTextField
from wagtail.admin.edit_handlers import FieldPanel, InlinePanel
from wagtail.images.edit_handlers import ImageChooserPanel
from wagtail.search import index
+from wagtail.api import APIField
class HomePage(Page):
@@ -29,6 +30,10 @@ class HomePage(Page):
index.SearchField('body'),
]
+ api_fields = [
+ APIField('carousel_images'),
+ ]
+
class CarouselImage(Orderable):
page = ParentalKey(HomePage, on_delete=models.CASCADE, related_name='carousel_images')
@@ -39,3 +44,8 @@ class CarouselImage(Orderable):
ImageChooserPanel('image'),
FieldPanel('caption'),
]
+
+ api_fields = [
+ APIField('image'),
+ APIField('caption'),
+ ]
diff --git a/home/templates/home/home_page.html b/home/templates/home/home_page.html
index 8e013e2..f3df148 100644
--- a/home/templates/home/home_page.html
+++ b/home/templates/home/home_page.html
@@ -1,5 +1,5 @@
{% extends "base.html" %}
-{% load static %}
+{% load static wagtailcore_tags %}
{% block body_class %}template-homepage{% endblock %}
@@ -8,7 +8,68 @@
{% endblock extra_css %}
{% block content %}
+
+
+ {% for neco in nekde %}
+
+

+
+
+ {% endfor %}
+
+
+
+ {{ page.body|richtext }}
+
+
{% endblock content %}
+
+{% block extra_js %}
+
+{% endblock %}
\ No newline at end of file
diff --git a/hvezdarna/api.py b/hvezdarna/api.py
new file mode 100644
index 0000000..2d9bc94
--- /dev/null
+++ b/hvezdarna/api.py
@@ -0,0 +1,15 @@
+from wagtail.api.v2.views import PagesAPIViewSet
+from wagtail.api.v2.router import WagtailAPIRouter
+from wagtail.images.api.v2.views import ImagesAPIViewSet
+from wagtail.documents.api.v2.views import DocumentsAPIViewSet
+
+# Create the router. "wagtailapi" is the URL namespace
+api_router = WagtailAPIRouter('wagtailapi')
+
+# Add the three endpoints using the "register_endpoint" method.
+# The first parameter is the name of the endpoint (eg. pages, images). This
+# is used in the URL of the endpoint
+# The second parameter is the endpoint class that handles the requests
+api_router.register_endpoint('pages', PagesAPIViewSet)
+api_router.register_endpoint('images', ImagesAPIViewSet)
+api_router.register_endpoint('documents', DocumentsAPIViewSet)
diff --git a/hvezdarna/settings/base.py b/hvezdarna/settings/base.py
index de8b696..b7f9da7 100644
--- a/hvezdarna/settings/base.py
+++ b/hvezdarna/settings/base.py
@@ -38,7 +38,8 @@ INSTALLED_APPS = [
'wagtail.search',
'wagtail.admin',
'wagtail.core',
-
+ 'rest_framework',
+ 'wagtail.api.v2',
'modelcluster',
'taggit',
diff --git a/hvezdarna/static/css/hvezdarna.css b/hvezdarna/static/css/hvezdarna.css
index e69de29..c291cf5 100644
--- a/hvezdarna/static/css/hvezdarna.css
+++ b/hvezdarna/static/css/hvezdarna.css
@@ -0,0 +1,3 @@
+footer {
+ background-color: #505050;
+}
diff --git a/hvezdarna/static/css/hvezdarna.less b/hvezdarna/static/css/hvezdarna.less
index e69de29..4ea9c36 100644
--- a/hvezdarna/static/css/hvezdarna.less
+++ b/hvezdarna/static/css/hvezdarna.less
@@ -0,0 +1,5 @@
+
+
+footer {
+ background-color: #505050;
+}
diff --git a/hvezdarna/static/js/muj-kolotoc.js b/hvezdarna/static/js/muj-kolotoc.js
new file mode 100644
index 0000000..2d0c994
--- /dev/null
+++ b/hvezdarna/static/js/muj-kolotoc.js
@@ -0,0 +1,938 @@
+/******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+/******/
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+/******/
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId]) {
+/******/ return installedModules[moduleId].exports;
+/******/ }
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ i: moduleId,
+/******/ l: false,
+/******/ exports: {}
+/******/ };
+/******/
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+/******/
+/******/ // Flag the module as loaded
+/******/ module.l = true;
+/******/
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+/******/
+/******/
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+/******/
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+/******/
+/******/ // define getter function for harmony exports
+/******/ __webpack_require__.d = function(exports, name, getter) {
+/******/ if(!__webpack_require__.o(exports, name)) {
+/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
+/******/ }
+/******/ };
+/******/
+/******/ // define __esModule on exports
+/******/ __webpack_require__.r = function(exports) {
+/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
+/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
+/******/ }
+/******/ Object.defineProperty(exports, '__esModule', { value: true });
+/******/ };
+/******/
+/******/ // create a fake namespace object
+/******/ // mode & 1: value is a module id, require it
+/******/ // mode & 2: merge all properties of value into the ns
+/******/ // mode & 4: return value when already ns object
+/******/ // mode & 8|1: behave like require
+/******/ __webpack_require__.t = function(value, mode) {
+/******/ if(mode & 1) value = __webpack_require__(value);
+/******/ if(mode & 8) return value;
+/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
+/******/ var ns = Object.create(null);
+/******/ __webpack_require__.r(ns);
+/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
+/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
+/******/ return ns;
+/******/ };
+/******/
+/******/ // getDefaultExport function for compatibility with non-harmony modules
+/******/ __webpack_require__.n = function(module) {
+/******/ var getter = module && module.__esModule ?
+/******/ function getDefault() { return module['default']; } :
+/******/ function getModuleExports() { return module; };
+/******/ __webpack_require__.d(getter, 'a', getter);
+/******/ return getter;
+/******/ };
+/******/
+/******/ // Object.prototype.hasOwnProperty.call
+/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
+/******/
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "";
+/******/
+/******/
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(__webpack_require__.s = "a7c5");
+/******/ })
+/************************************************************************/
+/******/ ({
+
+/***/ "022d":
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+/*
+ MIT License http://www.opensource.org/licenses/mit-license.php
+ Author Tobias Koppers @sokra
+*/
+// css base code, injected by the css-loader
+// eslint-disable-next-line func-names
+module.exports = function (useSourceMap) {
+ var list = []; // return the list of modules as css string
+
+ list.toString = function toString() {
+ return this.map(function (item) {
+ var content = cssWithMappingToString(item, useSourceMap);
+
+ if (item[2]) {
+ return "@media ".concat(item[2], " {").concat(content, "}");
+ }
+
+ return content;
+ }).join('');
+ }; // import a list of modules into the list
+ // eslint-disable-next-line func-names
+
+
+ list.i = function (modules, mediaQuery, dedupe) {
+ if (typeof modules === 'string') {
+ // eslint-disable-next-line no-param-reassign
+ modules = [[null, modules, '']];
+ }
+
+ var alreadyImportedModules = {};
+
+ if (dedupe) {
+ for (var i = 0; i < this.length; i++) {
+ // eslint-disable-next-line prefer-destructuring
+ var id = this[i][0];
+
+ if (id != null) {
+ alreadyImportedModules[id] = true;
+ }
+ }
+ }
+
+ for (var _i = 0; _i < modules.length; _i++) {
+ var item = [].concat(modules[_i]);
+
+ if (dedupe && alreadyImportedModules[item[0]]) {
+ // eslint-disable-next-line no-continue
+ continue;
+ }
+
+ if (mediaQuery) {
+ if (!item[2]) {
+ item[2] = mediaQuery;
+ } else {
+ item[2] = "".concat(mediaQuery, " and ").concat(item[2]);
+ }
+ }
+
+ list.push(item);
+ }
+ };
+
+ return list;
+};
+
+function cssWithMappingToString(item, useSourceMap) {
+ var content = item[1] || ''; // eslint-disable-next-line prefer-destructuring
+
+ var cssMapping = item[3];
+
+ if (!cssMapping) {
+ return content;
+ }
+
+ if (useSourceMap && typeof btoa === 'function') {
+ var sourceMapping = toComment(cssMapping);
+ var sourceURLs = cssMapping.sources.map(function (source) {
+ return "/*# sourceURL=".concat(cssMapping.sourceRoot || '').concat(source, " */");
+ });
+ return [content].concat(sourceURLs).concat([sourceMapping]).join('\n');
+ }
+
+ return [content].join('\n');
+} // Adapted from convert-source-map (MIT)
+
+
+function toComment(sourceMap) {
+ // eslint-disable-next-line no-undef
+ var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));
+ var data = "sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(base64);
+ return "/*# ".concat(data, " */");
+}
+
+/***/ }),
+
+/***/ "4933":
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony import */ var _node_modules_vue_style_loader_index_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_Kolotoc_vue_vue_type_style_index_0_lang_css_shadow__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("5c23");
+/* harmony import */ var _node_modules_vue_style_loader_index_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_Kolotoc_vue_vue_type_style_index_0_lang_css_shadow__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_vue_style_loader_index_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_Kolotoc_vue_vue_type_style_index_0_lang_css_shadow__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _node_modules_vue_style_loader_index_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_Kolotoc_vue_vue_type_style_index_0_lang_css_shadow__WEBPACK_IMPORTED_MODULE_0__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _node_modules_vue_style_loader_index_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_Kolotoc_vue_vue_type_style_index_0_lang_css_shadow__WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
+
+
+/***/ }),
+
+/***/ "5c23":
+/***/ (function(module, exports, __webpack_require__) {
+
+// style-loader: Adds some css to the DOM by adding a \r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Kolotoc.vue?vue&type=script&lang=js&shadow\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Kolotoc.vue?vue&type=script&lang=js&shadow\"","import { render, staticRenderFns } from \"./Kolotoc.vue?vue&type=template&id=2800e8f6&shadow\"\nimport script from \"./Kolotoc.vue?vue&type=script&lang=js&shadow\"\nexport * from \"./Kolotoc.vue?vue&type=script&lang=js&shadow\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./Kolotoc.vue?vue&type=style&index=0&lang=css&shadow\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n null,\n null\n ,true\n)\n\nexport default component.exports","import './setPublicPath'\nimport Vue from 'vue'\nimport wrap from '@vue/web-component-wrapper'\n\n// runtime shared by every component chunk\nimport 'css-loader/dist/runtime/api.js'\nimport 'vue-style-loader/lib/addStylesShadow'\nimport 'vue-loader/lib/runtime/componentNormalizer'\n\nimport mujKolotoc from '~root/src/components/Kolotoc.vue?shadow'\nwindow.customElements.define('muj-kolotoc', wrap(Vue, mujKolotoc))","/**\n * Translates the list format produced by css-loader into something\n * easier to manipulate.\n */\nexport default function listToStyles (parentId, list) {\n var styles = []\n var newStyles = {}\n for (var i = 0; i < list.length; i++) {\n var item = list[i]\n var id = item[0]\n var css = item[1]\n var media = item[2]\n var sourceMap = item[3]\n var part = {\n id: parentId + ':' + i,\n css: css,\n media: media,\n sourceMap: sourceMap\n }\n if (!newStyles[id]) {\n styles.push(newStyles[id] = { id: id, parts: [part] })\n } else {\n newStyles[id].parts.push(part)\n }\n }\n return styles\n}\n","import listToStyles from './listToStyles'\n\nexport default function addStylesToShadowDOM (parentId, list, shadowRoot) {\n var styles = listToStyles(parentId, list)\n addStyles(styles, shadowRoot)\n}\n\n/*\ntype StyleObject = {\n id: number;\n parts: Array\n}\n\ntype StyleObjectPart = {\n css: string;\n media: string;\n sourceMap: ?string\n}\n*/\n\nfunction addStyles (styles /* Array */, shadowRoot) {\n const injectedStyles =\n shadowRoot._injectedStyles ||\n (shadowRoot._injectedStyles = {})\n for (var i = 0; i < styles.length; i++) {\n var item = styles[i]\n var style = injectedStyles[item.id]\n if (!style) {\n for (var j = 0; j < item.parts.length; j++) {\n addStyle(item.parts[j], shadowRoot)\n }\n injectedStyles[item.id] = true\n }\n }\n}\n\nfunction createStyleElement (shadowRoot) {\n var styleElement = document.createElement('style')\n styleElement.type = 'text/css'\n shadowRoot.appendChild(styleElement)\n return styleElement\n}\n\nfunction addStyle (obj /* StyleObjectPart */, shadowRoot) {\n var styleElement = createStyleElement(shadowRoot)\n var css = obj.css\n var media = obj.media\n var sourceMap = obj.sourceMap\n\n if (media) {\n styleElement.setAttribute('media', media)\n }\n\n if (sourceMap) {\n // https://developer.chrome.com/devtools/docs/javascript-debugging\n // this makes source maps inside style tags work properly in Chrome\n css += '\\n/*# sourceURL=' + sourceMap.sources[0] + ' */'\n // http://stackoverflow.com/a/26603875\n css += '\\n/*# sourceMappingURL=data:application/json;base64,' + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + ' */'\n }\n\n if (styleElement.styleSheet) {\n styleElement.styleSheet.cssText = css\n } else {\n while (styleElement.firstChild) {\n styleElement.removeChild(styleElement.firstChild)\n }\n styleElement.appendChild(document.createTextNode(css))\n }\n}\n","// addapted from the document.currentScript polyfill by Adam Miller\n// MIT license\n// source: https://github.com/amiller-gh/currentScript-polyfill\n\n// added support for Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1620505\n\n(function (root, factory) {\n if (typeof define === 'function' && define.amd) {\n define([], factory);\n } else if (typeof module === 'object' && module.exports) {\n module.exports = factory();\n } else {\n root.getCurrentScript = factory();\n }\n}(typeof self !== 'undefined' ? self : this, function () {\n function getCurrentScript () {\n var descriptor = Object.getOwnPropertyDescriptor(document, 'currentScript')\n // for chrome\n if (!descriptor && 'currentScript' in document && document.currentScript) {\n return document.currentScript\n }\n\n // for other browsers with native support for currentScript\n if (descriptor && descriptor.get !== getCurrentScript && document.currentScript) {\n return document.currentScript\n }\n \n // IE 8-10 support script readyState\n // IE 11+ & Firefox support stack trace\n try {\n throw new Error();\n }\n catch (err) {\n // Find the second match for the \"at\" string to get file src url from stack.\n var ieStackRegExp = /.*at [^(]*\\((.*):(.+):(.+)\\)$/ig,\n ffStackRegExp = /@([^@]*):(\\d+):(\\d+)\\s*$/ig,\n stackDetails = ieStackRegExp.exec(err.stack) || ffStackRegExp.exec(err.stack),\n scriptLocation = (stackDetails && stackDetails[1]) || false,\n line = (stackDetails && stackDetails[2]) || false,\n currentLocation = document.location.href.replace(document.location.hash, ''),\n pageSource,\n inlineScriptSourceRegExp,\n inlineScriptSource,\n scripts = document.getElementsByTagName('script'); // Live NodeList collection\n \n if (scriptLocation === currentLocation) {\n pageSource = document.documentElement.outerHTML;\n inlineScriptSourceRegExp = new RegExp('(?:[^\\\\n]+?\\\\n){0,' + (line - 2) + '}[^<]*\r\n\r\n\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Kolotoc.vue?vue&type=script&lang=js&shadow\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Kolotoc.vue?vue&type=script&lang=js&shadow\"","import { render, staticRenderFns } from \"./Kolotoc.vue?vue&type=template&id=2800e8f6&shadow\"\nimport script from \"./Kolotoc.vue?vue&type=script&lang=js&shadow\"\nexport * from \"./Kolotoc.vue?vue&type=script&lang=js&shadow\"\nfunction injectStyles (context) {\n \n var style0 = require(\"./Kolotoc.vue?vue&type=style&index=0&lang=css&shadow\")\nif (style0.__inject__) style0.__inject__(context)\n\n}\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n injectStyles,\n null,\n null\n ,true\n)\n\nexport default component.exports","import './setPublicPath'\nimport Vue from 'vue'\nimport wrap from '@vue/web-component-wrapper'\n\n// runtime shared by every component chunk\nimport 'css-loader/dist/runtime/api.js'\nimport 'vue-style-loader/lib/addStylesShadow'\nimport 'vue-loader/lib/runtime/componentNormalizer'\n\nimport mujKolotoc from '~root/src/components/Kolotoc.vue?shadow'\nwindow.customElements.define('muj-kolotoc', wrap(Vue, mujKolotoc))","/**\n * Translates the list format produced by css-loader into something\n * easier to manipulate.\n */\nexport default function listToStyles (parentId, list) {\n var styles = []\n var newStyles = {}\n for (var i = 0; i < list.length; i++) {\n var item = list[i]\n var id = item[0]\n var css = item[1]\n var media = item[2]\n var sourceMap = item[3]\n var part = {\n id: parentId + ':' + i,\n css: css,\n media: media,\n sourceMap: sourceMap\n }\n if (!newStyles[id]) {\n styles.push(newStyles[id] = { id: id, parts: [part] })\n } else {\n newStyles[id].parts.push(part)\n }\n }\n return styles\n}\n","import listToStyles from './listToStyles'\n\nexport default function addStylesToShadowDOM (parentId, list, shadowRoot) {\n var styles = listToStyles(parentId, list)\n addStyles(styles, shadowRoot)\n}\n\n/*\ntype StyleObject = {\n id: number;\n parts: Array\n}\n\ntype StyleObjectPart = {\n css: string;\n media: string;\n sourceMap: ?string\n}\n*/\n\nfunction addStyles (styles /* Array */, shadowRoot) {\n const injectedStyles =\n shadowRoot._injectedStyles ||\n (shadowRoot._injectedStyles = {})\n for (var i = 0; i < styles.length; i++) {\n var item = styles[i]\n var style = injectedStyles[item.id]\n if (!style) {\n for (var j = 0; j < item.parts.length; j++) {\n addStyle(item.parts[j], shadowRoot)\n }\n injectedStyles[item.id] = true\n }\n }\n}\n\nfunction createStyleElement (shadowRoot) {\n var styleElement = document.createElement('style')\n styleElement.type = 'text/css'\n shadowRoot.appendChild(styleElement)\n return styleElement\n}\n\nfunction addStyle (obj /* StyleObjectPart */, shadowRoot) {\n var styleElement = createStyleElement(shadowRoot)\n var css = obj.css\n var media = obj.media\n var sourceMap = obj.sourceMap\n\n if (media) {\n styleElement.setAttribute('media', media)\n }\n\n if (sourceMap) {\n // https://developer.chrome.com/devtools/docs/javascript-debugging\n // this makes source maps inside style tags work properly in Chrome\n css += '\\n/*# sourceURL=' + sourceMap.sources[0] + ' */'\n // http://stackoverflow.com/a/26603875\n css += '\\n/*# sourceMappingURL=data:application/json;base64,' + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + ' */'\n }\n\n if (styleElement.styleSheet) {\n styleElement.styleSheet.cssText = css\n } else {\n while (styleElement.firstChild) {\n styleElement.removeChild(styleElement.firstChild)\n }\n styleElement.appendChild(document.createTextNode(css))\n }\n}\n","// addapted from the document.currentScript polyfill by Adam Miller\n// MIT license\n// source: https://github.com/amiller-gh/currentScript-polyfill\n\n// added support for Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1620505\n\n(function (root, factory) {\n if (typeof define === 'function' && define.amd) {\n define([], factory);\n } else if (typeof module === 'object' && module.exports) {\n module.exports = factory();\n } else {\n root.getCurrentScript = factory();\n }\n}(typeof self !== 'undefined' ? self : this, function () {\n function getCurrentScript () {\n var descriptor = Object.getOwnPropertyDescriptor(document, 'currentScript')\n // for chrome\n if (!descriptor && 'currentScript' in document && document.currentScript) {\n return document.currentScript\n }\n\n // for other browsers with native support for currentScript\n if (descriptor && descriptor.get !== getCurrentScript && document.currentScript) {\n return document.currentScript\n }\n \n // IE 8-10 support script readyState\n // IE 11+ & Firefox support stack trace\n try {\n throw new Error();\n }\n catch (err) {\n // Find the second match for the \"at\" string to get file src url from stack.\n var ieStackRegExp = /.*at [^(]*\\((.*):(.+):(.+)\\)$/ig,\n ffStackRegExp = /@([^@]*):(\\d+):(\\d+)\\s*$/ig,\n stackDetails = ieStackRegExp.exec(err.stack) || ffStackRegExp.exec(err.stack),\n scriptLocation = (stackDetails && stackDetails[1]) || false,\n line = (stackDetails && stackDetails[2]) || false,\n currentLocation = document.location.href.replace(document.location.hash, ''),\n pageSource,\n inlineScriptSourceRegExp,\n inlineScriptSource,\n scripts = document.getElementsByTagName('script'); // Live NodeList collection\n \n if (scriptLocation === currentLocation) {\n pageSource = document.documentElement.outerHTML;\n inlineScriptSourceRegExp = new RegExp('(?:[^\\\\n]+?\\\\n){0,' + (line - 2) + '}[^<]*
+
+
+
-
+
{% block extra_js %}
{# Override this in templates to add extra javascript #}
{% endblock %}
diff --git a/hvezdarna/urls.py b/hvezdarna/urls.py
index d1b8710..a7d7e10 100644
--- a/hvezdarna/urls.py
+++ b/hvezdarna/urls.py
@@ -8,7 +8,11 @@ from wagtail.documents import urls as wagtaildocs_urls
from search import views as search_views
+from .api import api_router
+
+
urlpatterns = [
+ path('api/v2/', api_router.urls),
path('django-admin/', admin.site.urls),
path('admin/', include(wagtailadmin_urls)),