From d5498fcec7394d2b89667832853e239d5f496e1c Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Sun, 23 Aug 2020 21:51:00 +0200 Subject: Add localized texts to Benki post model. Change-Id: I123cfe2ff06f85dc14c705b21d723d1c68fd2e00 --- .../bookmarks/MlkBookmarkSubmissionForm.js | 6 +- .../lazychat/MlkLazychatSubmissionForm.js | 4 +- src/main/resources/db/changeLog-1.2.xml | 15 ++++ src/main/resources/db/changeLog-1.3.xml | 79 ++++++++++++++++++++++ src/main/resources/db/changeLog-1.4.xml | 43 ++++++++++++ src/main/resources/db/changeLog-1.5.xml | 41 +++++++++++ src/main/resources/db/changeLog.xml | 4 ++ src/main/resources/db/liquibase.properties | 2 +- 8 files changed, 190 insertions(+), 4 deletions(-) create mode 100644 src/main/resources/db/changeLog-1.2.xml create mode 100644 src/main/resources/db/changeLog-1.3.xml create mode 100644 src/main/resources/db/changeLog-1.4.xml create mode 100644 src/main/resources/db/changeLog-1.5.xml (limited to 'src/main/resources') diff --git a/src/main/resources/META-INF/resources/bookmarks/MlkBookmarkSubmissionForm.js b/src/main/resources/META-INF/resources/bookmarks/MlkBookmarkSubmissionForm.js index 6ecc355..b4d21d3 100644 --- a/src/main/resources/META-INF/resources/bookmarks/MlkBookmarkSubmissionForm.js +++ b/src/main/resources/META-INF/resources/bookmarks/MlkBookmarkSubmissionForm.js @@ -173,9 +173,11 @@ export class MlkBookmarkSubmissionForm extends HTMLElement { let post = await r.json(); this.uriInput.value = post.uri; - this.titleInput.value = post.title; - this.descriptionInput.innerText = post.description; this.visibilityInput.value = post.visibility; + if (post.texts['']) { + this.titleInput.value = post.texts[''].title; + this.descriptionInput.innerText = post.texts[''].description; + } this.loaded = true; } diff --git a/src/main/resources/META-INF/resources/lazychat/MlkLazychatSubmissionForm.js b/src/main/resources/META-INF/resources/lazychat/MlkLazychatSubmissionForm.js index c6334ad..3688527 100644 --- a/src/main/resources/META-INF/resources/lazychat/MlkLazychatSubmissionForm.js +++ b/src/main/resources/META-INF/resources/lazychat/MlkLazychatSubmissionForm.js @@ -107,8 +107,10 @@ export class MlkLazychatSubmissionForm extends HTMLElement { } let post = await r.json(); - this.textInput.value = post.content; this.visibilityInput.value = post.visibility; + if (post.texts['']) { + this.textInput.value = post.texts[''].content; + } this.loaded = true; } diff --git a/src/main/resources/db/changeLog-1.2.xml b/src/main/resources/db/changeLog-1.2.xml new file mode 100644 index 0000000..87ff426 --- /dev/null +++ b/src/main/resources/db/changeLog-1.2.xml @@ -0,0 +1,15 @@ + + + + + + + + + + diff --git a/src/main/resources/db/changeLog-1.3.xml b/src/main/resources/db/changeLog-1.3.xml new file mode 100644 index 0000000..a0659c0 --- /dev/null +++ b/src/main/resources/db/changeLog-1.3.xml @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + + + + + insert into benki.lazychat_message_texts(lazychat_message, language, content) + select id, '', content from benki.lazychat_messages; + + + + + + + + + + + + + + + + + + + + + insert into benki.bookmark_texts(bookmark, language, title, description) + select id, '', title, description from benki.bookmarks; + + + + + + + + + diff --git a/src/main/resources/db/changeLog-1.4.xml b/src/main/resources/db/changeLog-1.4.xml new file mode 100644 index 0000000..2e47dab --- /dev/null +++ b/src/main/resources/db/changeLog-1.4.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + ALTER TABLE benki.lazychat_message_texts INHERIT benki.post_texts; + + + + ALTER TABLE benki.bookmark_texts INHERIT benki.post_texts; + + + + diff --git a/src/main/resources/db/changeLog-1.5.xml b/src/main/resources/db/changeLog-1.5.xml new file mode 100644 index 0000000..c10beb1 --- /dev/null +++ b/src/main/resources/db/changeLog-1.5.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/db/changeLog.xml b/src/main/resources/db/changeLog.xml index 7d346aa..1c5c4ea 100644 --- a/src/main/resources/db/changeLog.xml +++ b/src/main/resources/db/changeLog.xml @@ -8,5 +8,9 @@ + + + + diff --git a/src/main/resources/db/liquibase.properties b/src/main/resources/db/liquibase.properties index 79aca15..38e258c 100644 --- a/src/main/resources/db/liquibase.properties +++ b/src/main/resources/db/liquibase.properties @@ -1,3 +1,3 @@ -url = jdbc:postgresql:///mulkcms?currentSchemas=public,benki +url = jdbc:postgresql://localhost:5432/mulkcms?currentSchemas=public,benki changeLogFile = src/main/resources/db/changeLog.xml schemas = public,benki -- cgit v1.2.3