From a8b8e36ad32f77812a7a1555ca2dd5c6d4f1260c Mon Sep 17 00:00:00 2001 From: mntmn Date: Wed, 9 Sep 2020 17:20:35 +0200 Subject: [PATCH] wip: migrate from deprecated swig templates to ejs --- docs/adding_languages.md | 12 +++--- helpers/mailer.js | 13 +----- package.json | 2 +- public/javascripts/backend.js | 3 -- routes/api/users.js | 1 - routes/root.js | 44 +++++++------------- spacedeck.js | 13 +----- views/artifact_list.html | 24 ----------- views/emails/action.html | 11 ----- views/error.ejs | 5 +++ views/error.html | 3 -- views/facebook.html | 26 ------------ views/{index.html => index.ejs} | 10 +---- views/layouts/outer-footer.ejs | 14 +++++++ views/layouts/outer-header.ejs | 29 +++++++++++++ views/layouts/outer.html | 50 ----------------------- views/not_found.ejs | 4 ++ views/not_found.html | 11 ----- views/partials/account.html | 36 ++++++++-------- views/partials/folders.html | 42 +++++++++---------- views/partials/login.html | 24 +++++------ views/partials/meta-folder.html | 16 ++++---- views/partials/meta.html | 14 +++---- views/partials/modal/access.html | 42 +++++++++---------- views/partials/modal/folder-settings.html | 8 ++-- views/partials/space.html | 10 ++--- views/partials/team.html | 30 +++++++------- views/partials/tool/background.html | 10 ++--- views/partials/tool/color.html | 8 ++-- views/partials/tool/object-options.html | 12 +++--- views/partials/tool/search.html | 2 +- views/partials/tool/shapes.html | 18 ++++---- views/partials/tool/text-formats.html | 14 +++---- views/partials/tool/toolbar-elements.html | 30 +++++++------- views/partials/tool/toolbar-object.html | 20 ++++----- views/partials/tool/toolbar-text.html | 8 ++-- views/partials/tool/zones.html | 4 +- views/public/contact.html | 10 ----- views/public/privacy.html | 9 ---- views/public/terms.html | 8 ---- views/space_list.html | 20 --------- views/{spacedeck.html => spacedeck.ejs} | 42 +++++++++---------- 42 files changed, 272 insertions(+), 440 deletions(-) delete mode 100644 views/artifact_list.html delete mode 100644 views/emails/action.html create mode 100644 views/error.ejs delete mode 100644 views/error.html delete mode 100644 views/facebook.html rename views/{index.html => index.ejs} (90%) create mode 100644 views/layouts/outer-footer.ejs create mode 100644 views/layouts/outer-header.ejs delete mode 100644 views/layouts/outer.html create mode 100644 views/not_found.ejs delete mode 100644 views/not_found.html delete mode 100644 views/public/contact.html delete mode 100644 views/public/privacy.html delete mode 100644 views/public/terms.html delete mode 100644 views/space_list.html rename views/{spacedeck.html => spacedeck.ejs} (72%) diff --git a/docs/adding_languages.md b/docs/adding_languages.md index 5972973..490323b 100644 --- a/docs/adding_languages.md +++ b/docs/adding_languages.md @@ -2,23 +2,23 @@ To add a new language to Spacedeck Open, follow these steps: -*The steps are ilustrated with Spanish (locale 'es') as the new language* +*The steps are illustrated with Spanish (locale 'es') as the new language* -- Include the new locale ('es') at the locale list (./spacedeck.js) +- Include the new locale ('es') in the locale list (./spacedeck.js): ``` locales: ["en",..., "es"], ``` -- Create the new translation file (/locales/**es.js** thar it's a copy of /locales/en.js). and translate the entries. -- Include the javascript for letting Spanish info accesible (at the end of /views/spacedeck.html) +- Create the new translation file (/locales/**es.js**, a copy of /locales/en.js) and translate the entries. +- Include the javascript for the new translation at the end of /views/spacedeck.ejs: ``` ... window.locales.es = {}; ... - window.locales.es.translation = {% include "./../locales/es.js" %}; + window.locales.es.translation = <%- include "./../locales/es.js" %>; ``` -- Include a radiobutton for users could seleect the new language (/views/partials/account.html) +- Include a radio button for users to select the new language (/views/partials/account.html) ```