diff --git a/config/sync/node.settings.yml b/config/sync/node.settings.yml index 3a9d97e..6fcede9 100644 --- a/config/sync/node.settings.yml +++ b/config/sync/node.settings.yml @@ -1,3 +1,3 @@ _core: default_config_hash: 2OMXCScXUOLSYID9-phjO4q36nnnaMWNUlDxEqZzG1U -use_admin_theme: false +use_admin_theme: true diff --git a/config/sync/views.view.content.yml b/config/sync/views.view.content.yml index 70591e0..11897dc 100644 --- a/config/sync/views.view.content.yml +++ b/config/sync/views.view.content.yml @@ -8,7 +8,7 @@ dependencies: _core: default_config_hash: 12Bd0mJQFIaXAkRfMVCAAcZ0oaxm94PoK8oHR9hkLmY id: content -label: Sadržaj +label: Vsebine module: node description: 'Find and manage content.' tag: default diff --git a/nuxt/app.vue b/nuxt/app.vue index 960c249..503788a 100644 --- a/nuxt/app.vue +++ b/nuxt/app.vue @@ -4,6 +4,9 @@
+ @@ -12,6 +15,7 @@ :root { --siva: #D9D9D9; --bela: #fff; + --crna: #000; --rdeca: #f00; --roza: #ED008C; } @@ -22,18 +26,36 @@ background: var(--siva); } + a { + color: var(--crna); + } + h1 { text-align: center; font-size: 5rem; margin: .2rem 0 1rem 0; } + h2 { + text-transform: uppercase; + margin-top: 0; + } + .vsebina { position: relative; z-index: 50; padding: 0 32px; } + a.gumb { + text-decoration: underline; + font-size: 3rem; + position: relative; + display: flex; + width: 100%; + justify-content: center; + } + .stran { position: relative; background: var(--bela); @@ -63,4 +85,33 @@ width: fit-content; } + footer { + position: relative; + z-index: 100; + } + + + @media screen and (max-width: 420px) { + .vsebina { + padding-right: 0; + padding-left: 0; + } + .stran { + margin: 0; + } + } + + .okvir { + position: relative; + background: var(--bela); + margin: 2rem; + border-radius: 24px; + padding: 2rem; + display: flex; + flex-wrap: wrap; + box-sizing: border-box; + max-width: 1216px; + margin-left: auto; + margin-right: auto; + } diff --git a/nuxt/components/DodajPojem.vue b/nuxt/components/DodajPojem.vue deleted file mode 100644 index f964720..0000000 --- a/nuxt/components/DodajPojem.vue +++ /dev/null @@ -1,28 +0,0 @@ - - - diff --git a/nuxt/components/Glava.vue b/nuxt/components/Glava.vue index 1132575..6370a7e 100644 --- a/nuxt/components/Glava.vue +++ b/nuxt/components/Glava.vue @@ -1,22 +1,39 @@ diff --git a/nuxt/components/Noga.vue b/nuxt/components/Noga.vue new file mode 100644 index 0000000..562d48d --- /dev/null +++ b/nuxt/components/Noga.vue @@ -0,0 +1,118 @@ + + + + + diff --git a/nuxt/components/Pojem.vue b/nuxt/components/Pojem.vue index 718fab7..84ed8d9 100644 --- a/nuxt/components/Pojem.vue +++ b/nuxt/components/Pojem.vue @@ -10,13 +10,16 @@ const props = defineProps({ naslov: String }) -const pojem = computed(() => store.pojmi[props.naslov]) -const revisionId = computed(() => pojem.value.id) +if (props.naslov && !(props.naslov in store.pojmi)) { + await store.naloziPojme() +} -await store.naloziPojme() +const pojem = computed(() => store.pojmi[props.naslov]) +const revisionId = computed(() => pojem.value ? pojem.value.id : null) const urejanje = ref(false) const container = ref(null) +const obrazec = ref(null) const urediPojem = async () => { // Ustvari pad s tekstom pojma, ce se ne obstaja @@ -29,86 +32,85 @@ const urediPojem = async () => { } onMounted(() => { - // Link na pojem direktno? Poskrolaj nanj + odpri editiranje + // Prazen pojem? Nazaj na manifest + if (!pojem.value.id) { + navigateTo('/manifest#skrol') + } + + // Link na editiranje pojma? Poskrolaj nanj + odpri editiranje if (route.params.guid === revisionId.value) { urejanje.value = true - window.container = container - setTimeout(() => container.value.scrollIntoView(), 50) + setTimeout(() => obrazec.value.scrollIntoView({ behavior: 'smooth' }), 50) + } else { + // Sicer samo poskrolaj na pojem + setTimeout(() => { + const sekcija = container.value.parentNode + console.log('skrolam?', sekcija) + if (sekcija) { + sekcija.scrollIntoView({ behavior: 'smooth' }) + } + }, 50) } }) diff --git a/nuxt/components/PojemForm.vue b/nuxt/components/PojemForm.vue index 44367ee..831e3ce 100644 --- a/nuxt/components/PojemForm.vue +++ b/nuxt/components/PojemForm.vue @@ -7,7 +7,6 @@ const store = usePojmiStore() const props = defineProps({ revisionId: String, pojem: Object, - urejanje: Object, onZapri: Function }) @@ -16,45 +15,76 @@ let email = ref('') const oddajPredlog = async data => { // @TODO vsebina pada v tekst, testirat + if (!naslov.value) { + alert("Manjka naslov pojma!") + return + } + + const starNaslov = props.pojem.naslov + const resp = await etherFetch('/getText', { padID: props.revisionId }) - store.ustvariPojem({ + const stvarjenje = store.ustvariPojem({ title: naslov.value, email: email.value, text: resp.data.text, uuid: props.revisionId }) + console.log(stvarjenje) alert("sprememba predlagana!") + + stvarjenje.then(() => { + console.log('NOV NASLOV?', starNaslov, props.pojem.naslov) + if (starNaslov !== props.pojem.naslov) { + navigateTo('/manifest/' + encodeURIComponent(props.pojem.naslov)) + } + }) + props.onZapri() } +// @TODO tole raje v pojmi.vue oz nov_pojem.vue - page! const etherNalozen = ev => { - navigateTo('/pojmi/' + props.revisionId) + if (props.pojem.nov) { + navigateTo('/manifest/dodaj/' + props.revisionId, { + replace: true + }) + } else { + navigateTo('/manifest/' + encodeURIComponent(props.pojem.naslov) + '/uredi/' + props.revisionId, { + replace: true + }) + } //window.location.hash = props.revisionId } diff --git a/nuxt/pages/manifest/index.vue b/nuxt/pages/manifest/index.vue new file mode 100644 index 0000000..cb1c3b0 --- /dev/null +++ b/nuxt/pages/manifest/index.vue @@ -0,0 +1,45 @@ + + + + + diff --git a/nuxt/pages/manifest/pojem.vue b/nuxt/pages/manifest/pojem.vue new file mode 100644 index 0000000..2cad06a --- /dev/null +++ b/nuxt/pages/manifest/pojem.vue @@ -0,0 +1,30 @@ + + + diff --git a/nuxt/pages/pojmi.vue b/nuxt/pages/pojmi.vue deleted file mode 100644 index d4cf9b5..0000000 --- a/nuxt/pages/pojmi.vue +++ /dev/null @@ -1,25 +0,0 @@ - - - - - diff --git a/nuxt/public/images/eu-logo.svg b/nuxt/public/images/eu-logo.svg new file mode 100644 index 0000000..c3a3120 --- /dev/null +++ b/nuxt/public/images/eu-logo.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/nuxt/public/images/kompot_sm.png b/nuxt/public/images/kompot_sm.png new file mode 100644 index 0000000..441c96e Binary files /dev/null and b/nuxt/public/images/kompot_sm.png differ diff --git a/nuxt/public/images/maska-logo.svg b/nuxt/public/images/maska-logo.svg new file mode 100644 index 0000000..a3cc2a5 --- /dev/null +++ b/nuxt/public/images/maska-logo.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/nuxt/public/images/peripheralvisions.png b/nuxt/public/images/peripheralvisions.png new file mode 100644 index 0000000..51fa62a Binary files /dev/null and b/nuxt/public/images/peripheralvisions.png differ diff --git a/nuxt/public/images/peripheralvisions.svg b/nuxt/public/images/peripheralvisions.svg new file mode 100644 index 0000000..7f9fc57 --- /dev/null +++ b/nuxt/public/images/peripheralvisions.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + diff --git a/nuxt/stores/pojmi.js b/nuxt/stores/pojmi.js index 65d4118..1b83922 100644 --- a/nuxt/stores/pojmi.js +++ b/nuxt/stores/pojmi.js @@ -6,11 +6,11 @@ export const usePojmiStore = defineStore('pojmi', { async naloziPojme() { const { jsonApiUrl, headers, deserialize } = useApi() - const data = await $fetch(`${jsonApiUrl}/node/concept`, { headers }) + const data = await $fetch(`${jsonApiUrl}/node/concept?sort=-changed`, { headers }) this.pojmi = await deserialize(data, s => ({ id: s.id, naslov: s.title, - tekst: s.body.processed, + tekst: s.body ? s.body.processed : '', media: s.field_media }), 'naslov') }, diff --git a/web/modules/custom/etherpad_api/etherpad_api.routing.yml b/web/modules/custom/etherpad_api/etherpad_api.routing.yml index e264194..228b10a 100644 --- a/web/modules/custom/etherpad_api/etherpad_api.routing.yml +++ b/web/modules/custom/etherpad_api/etherpad_api.routing.yml @@ -1,4 +1,4 @@ -etherpad_api.example: +etherpad_api.proxy: path: '/etherpad-api/{components}' defaults: _title: 'Etherpad API' diff --git a/web/modules/custom/etherpad_api/src/Client.php b/web/modules/custom/etherpad_api/src/Client.php index d54292d..bfa5ac6 100644 --- a/web/modules/custom/etherpad_api/src/Client.php +++ b/web/modules/custom/etherpad_api/src/Client.php @@ -17,13 +17,6 @@ class Client { */ protected $httpClient; - /** - * The config. - * - * @var \Drupal\Core\Config\ImmutableConfig - */ - protected $config; - protected $apiKey = null; protected $baseUrl = null; @@ -40,11 +33,11 @@ class Client { */ public function __construct(ClientInterface $httpClient, ImmutableConfig $config) { $this->httpClient = $httpClient; - $this->config = $config; $this->baseUrl = $config->get('url') ? rtrim($config->get('url'), '/') : null; $this->apiKey = $config->get('key'); } + /* Preveri veljavnost tokena-a s klicom na etherpadov api. */ public function checkToken() { if ($this->baseUrl) { return $this->request('checkToken'); @@ -53,7 +46,8 @@ class Client { } /** - * Method description. + * Poizvedi na etherpadov API. Doda baseURL in verzijo pred zeljen url, doda + * API ključ in uredi parametre. Vendo je POST! */ public function request($url, $opts = []) { $uri = "{$this->baseUrl}/" . self::API_VERSION . '/' . explode('?', $url)[0]; diff --git a/web/modules/custom/etherpad_api/src/Controller/EtherpadApiController.php b/web/modules/custom/etherpad_api/src/Controller/EtherpadApiController.php index 884d43d..dc8bb0b 100644 --- a/web/modules/custom/etherpad_api/src/Controller/EtherpadApiController.php +++ b/web/modules/custom/etherpad_api/src/Controller/EtherpadApiController.php @@ -36,6 +36,8 @@ class EtherpadApiController extends ControllerBase { $data = array_merge($request->query->all(), $request->request->all()); if ($data['padID']) { // @TODO prefix v config! + // Zahtevnejše ampak lepše bi bilo pa uporabit group API: + // https://etherpad.org/doc/v1.8.4/#index_creategroup $data['padID'] = 'yufu-' . $data['padID']; } $opts = ['form_params' => $data]; diff --git a/web/sites/default/default.services.yml b/web/sites/default/default.services.yml index 8a6cdf2..a2eb26d 100644 --- a/web/sites/default/default.services.yml +++ b/web/sites/default/default.services.yml @@ -206,14 +206,14 @@ parameters: # for more information about the topic in general. # Note: By default the configuration is disabled. cors.config: - enabled: false + enabled: true # Specify allowed headers, like 'x-allowed-header'. allowedHeaders: [] # Specify allowed request methods, specify ['*'] to allow all possible ones. allowedMethods: [] # Configure requests allowed from specific origins. Do not include trailing # slashes with URLs. - allowedOrigins: ['*'] + allowedOrigins: ['yufu.kompot.si', 'localhost'] # Sets the Access-Control-Expose-Headers header. exposedHeaders: false # Sets the Access-Control-Max-Age header.