From 5c054aab12d289c9f20c24da5f7e8ab9b8d2694b Mon Sep 17 00:00:00 2001 From: Nicholas Date: Wed, 27 Mar 2024 14:30:19 +0100 Subject: [PATCH] feature: show deletion date on ideation page #267 (#268) --- assets/js/app.js | 6 +- assets/scss/app.scss | 2 + .../scss/live/brainstorming_live/_show.scss | 8 +++ .../brainstormings/brainstorming.ex | 14 +++++ .../live/admin/brainstorming_live/edit.ex | 7 --- .../admin/brainstorming_live/edit.html.heex | 6 +- .../live/brainstorming_live/show.html.heex | 10 ++++ lib/mindwendel_web/live/live_helpers.ex | 13 +++++ priv/gettext/de/LC_MESSAGES/default.po | 56 +++++++++---------- priv/gettext/default.pot | 56 +++++++++---------- priv/gettext/en/LC_MESSAGES/default.po | 56 +++++++++---------- test/mindwendel_web/live/live_helpers_test.ex | 20 +++++++ 12 files changed, 157 insertions(+), 97 deletions(-) create mode 100644 assets/scss/live/brainstorming_live/_show.scss create mode 100644 test/mindwendel_web/live/live_helpers_test.ex diff --git a/assets/js/app.js b/assets/js/app.js index cc3cddb4..82ed56d0 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -2,7 +2,11 @@ // We include this here, so esbuild can handle e.g. copying fonts to the /priv/static/assets directory import "../scss/app.css"; -import { Modal } from "bootstrap" +import { Modal, Tooltip } from "bootstrap" + +// activate all tooltips: +const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle="tooltip"]') +const tooltipList = [...tooltipTriggerList].map(tooltipTriggerEl => new Tooltip(tooltipTriggerEl)) // webpack automatically bundles all modules in your // entry points. Those entry points can be configured diff --git a/assets/scss/app.scss b/assets/scss/app.scss index 26337f27..4f8092b7 100644 --- a/assets/scss/app.scss +++ b/assets/scss/app.scss @@ -7,6 +7,8 @@ $bootstrap-icons-font-dir: "../node_modules/bootstrap-icons/font/fonts/"; @import "../node_modules/bootstrap-icons/font/bootstrap-icons"; @import "live/idea_live/_index_component.scss"; +@import "live/brainstorming_live/_show.scss"; + .footer { height: 40px; } diff --git a/assets/scss/live/brainstorming_live/_show.scss b/assets/scss/live/brainstorming_live/_show.scss new file mode 100644 index 00000000..8a4631f3 --- /dev/null +++ b/assets/scss/live/brainstorming_live/_show.scss @@ -0,0 +1,8 @@ +.deletion-date-hint-tooltip { + --bs-tooltip-bg: #6c757d; + --bs-tooltip-color: var(--bs-white); +} + +.tooltip.show { + opacity: 1.0; +} \ No newline at end of file diff --git a/lib/mindwendel/brainstormings/brainstorming.ex b/lib/mindwendel/brainstormings/brainstorming.ex index 0ee5a798..8ee65990 100644 --- a/lib/mindwendel/brainstormings/brainstorming.ex +++ b/lib/mindwendel/brainstormings/brainstorming.ex @@ -63,4 +63,18 @@ defmodule Mindwendel.Brainstormings.Brainstorming do %IdeaLabel{name: gettext("yellow"), color: "#ffc107", position_order: 4} ] end + + def brainstorming_available_until(brainstorming) do + available_until = + Timex.shift(brainstorming.inserted_at, + days: + Application.fetch_env!(:mindwendel, :options)[:feature_brainstorming_removal_after_days] + ) + + Timex.format!( + available_until, + "{relative}", + :relative + ) + end end diff --git a/lib/mindwendel_web/live/admin/brainstorming_live/edit.ex b/lib/mindwendel_web/live/admin/brainstorming_live/edit.ex index 660eda44..51c0fb1e 100644 --- a/lib/mindwendel_web/live/admin/brainstorming_live/edit.ex +++ b/lib/mindwendel_web/live/admin/brainstorming_live/edit.ex @@ -154,13 +154,6 @@ defmodule MindwendelWeb.Admin.BrainstormingLive.Edit do end end - def brainstorming_available_until(brainstorming) do - Timex.shift(brainstorming.inserted_at, - days: - Application.fetch_env!(:mindwendel, :options)[:feature_brainstorming_removal_after_days] - ) - end - defp cancel_changeset_timer(socket) do if socket.assigns[:reset_changeset_timer_ref], do: Process.cancel_timer(socket.assigns.reset_changeset_timer_ref) diff --git a/lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex b/lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex index be8a5c31..34d58572 100644 --- a/lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex +++ b/lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex @@ -45,11 +45,7 @@ ) %>

- (<%= gettext("Brainstorming will be deleted ") %> <%= Timex.format!( - brainstorming_available_until(@brainstorming), - "{relative}", - :relative - ) %>) + (<%= brainstorming_available_until_full_text(@brainstorming) %>)

diff --git a/lib/mindwendel_web/live/brainstorming_live/show.html.heex b/lib/mindwendel_web/live/brainstorming_live/show.html.heex index 089ba83f..474c603b 100644 --- a/lib/mindwendel_web/live/brainstorming_live/show.html.heex +++ b/lib/mindwendel_web/live/brainstorming_live/show.html.heex @@ -44,6 +44,16 @@ <% end %> <% end %> + +
+ <%= brainstorming_available_until(@brainstorming) %> +
diff --git a/lib/mindwendel_web/live/live_helpers.ex b/lib/mindwendel_web/live/live_helpers.ex index 7f877a32..41486304 100644 --- a/lib/mindwendel_web/live/live_helpers.ex +++ b/lib/mindwendel_web/live/live_helpers.ex @@ -1,5 +1,8 @@ defmodule MindwendelWeb.LiveHelpers do import Phoenix.LiveView.Helpers + import MindwendelWeb.Gettext + + alias Mindwendel.Brainstormings.Brainstorming @doc """ Renders a component inside the `MindwendelWeb.ModalComponent` component. @@ -24,4 +27,14 @@ defmodule MindwendelWeb.LiveHelpers do def uuid do Ecto.UUID.generate() end + + def brainstorming_available_until_full_text(brainstorming) do + gettext("Brainstorming will be deleted in %{days}", + days: Brainstorming.brainstorming_available_until(brainstorming) + ) + end + + def brainstorming_available_until(brainstorming) do + Brainstorming.brainstorming_available_until(brainstorming) + end end diff --git a/priv/gettext/de/LC_MESSAGES/default.po b/priv/gettext/de/LC_MESSAGES/default.po index a171098c..00eec758 100644 --- a/priv/gettext/de/LC_MESSAGES/default.po +++ b/priv/gettext/de/LC_MESSAGES/default.po @@ -41,7 +41,7 @@ msgstr "%{name} - Neue Idee" msgid "Are you sure you want to delete this idea?" msgstr "Möchtest du die Idee löschen?" -#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:199 +#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:195 #, elixir-autogen, elixir-format msgid "Attention: This will delete the brainstorming with all belonging ideas and other associated records to it. This cant be undone" msgstr "Achtung: Hiermit löschst du das Brainstorming und alle dazugehörigen Ideen. Diese Aktion kann nicht rückgängig gemacht werden." @@ -67,22 +67,22 @@ msgstr "Erstelle ein Brainstorming." msgid "Create!" msgstr "Erstellen!" -#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:203 +#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:199 #, elixir-autogen, elixir-format msgid "Delete" msgstr "Löschen" -#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:193 +#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:189 #, elixir-autogen, elixir-format msgid "Delete Brainstorming" msgstr "Lösche Brainstorming" -#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:177 +#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:173 #, elixir-autogen, elixir-format msgid "Export to CSV" msgstr "Export als CSV" -#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:184 +#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:180 #, elixir-autogen, elixir-format msgid "Export to HTML" msgstr "Export als HTML" @@ -98,7 +98,7 @@ msgid "Idea created successfully" msgstr "Idee erstellt" #: lib/mindwendel_web/live/brainstorming_live/show.html.heex:25 -#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:107 +#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:117 #, elixir-autogen, elixir-format msgid "New Idea" msgstr "Neue Idee" @@ -108,7 +108,7 @@ msgstr "Neue Idee" msgid "New brainstorming" msgstr "Neues Brainstorming" -#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:64 +#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:74 #, elixir-autogen, elixir-format msgid "New idea" msgstr "Neue Idee" @@ -123,7 +123,7 @@ msgstr "Neue Idee (Hotkey: i)" msgid "No ideas brainstormed" msgstr "Bisher keine Ideen" -#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:110 +#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:120 #, elixir-autogen, elixir-format msgid "Open new idea page (Hotkey: i)" msgstr "Öffne neue Ideen Dialog (Hotkey: i)" @@ -190,12 +190,12 @@ msgstr "Brainstorming erfolgreich gelöscht" msgid "Your brainstorming was created successfully! Share the link with other people and start brainstorming." msgstr "Dein Brainstorming wurde erstellt! Teile den Link mit anderen Personen und legt los." -#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:59 +#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:55 #, elixir-autogen, elixir-format msgid "Edit Brainstorming" msgstr "Editiere Brainstorming" -#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:174 +#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:170 #, elixir-autogen, elixir-format msgid "Export" msgstr "Export" @@ -231,37 +231,32 @@ msgstr "Von" msgid "Administration for brainstorming: %{name}" msgstr "Administration für: %{name}" -#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:89 +#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:85 #, elixir-autogen, elixir-format msgid "Show brainstorming settings link for all users" msgstr "Zeige Link zur Administration für alle Nutzer" -#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:95 +#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:91 #, elixir-autogen, elixir-format msgid "Warning: Please make sure you save the admin link at the top, before hiding the settings link!" msgstr "Achtung: Bitte speichere den Admin-Link oben ab, bevor du den Link zur Administration versteckst." -#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:48 -#, elixir-autogen, elixir-format -msgid "Brainstorming will be deleted " -msgstr "Brainstorming wird gelöscht in " - #: lib/mindwendel_web/templates/static_page/home.html.heex:34 #, elixir-autogen, elixir-format msgid "Brainstormings will be deleted after %{days} days." msgstr "Brainstormings werden nach %{days} Tagen gelöscht." -#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:123 +#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:119 #, elixir-autogen, elixir-format msgid "Choose the label color" msgstr "Wähle die Farbe für das Label aus" -#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:112 +#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:108 #, elixir-autogen, elixir-format msgid "Edit Brainstorming Labels" msgstr "Editiere Brainstorming Labels" -#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:128 +#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:124 #, elixir-autogen, elixir-format msgid "Type the label name" msgstr "Gebe dem Label einen Namen" @@ -291,19 +286,19 @@ msgstr "Rot" msgid "yellow" msgstr "Gelb" -#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:164 +#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:160 #, elixir-autogen, elixir-format msgid "Add idea label" msgstr "Neues Label" -#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:137 +#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:133 #, elixir-autogen, elixir-format msgid "Remove idea label" msgstr "Löschen" -#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:76 -#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:103 -#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:153 +#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:72 +#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:99 +#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:149 #, elixir-autogen, elixir-format msgid "Saved" msgstr "Gespeichert" @@ -333,7 +328,7 @@ msgstr "Mindwendel Brainstorming" msgid "Share" msgstr "Teilen" -#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:88 +#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:98 #, elixir-autogen, elixir-format msgid "Share brainstorming" msgstr "Teile Dein Brainstorming" @@ -348,7 +343,7 @@ msgstr "Download als PNG" msgid "Download as svg" msgstr "Download als SVG" -#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:204 +#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:200 #, elixir-autogen, elixir-format, fuzzy msgid "Brainstorming delete are you sure" msgstr "Bist du sicher, dass das Brainstorming gelöscht werden soll?" @@ -363,7 +358,12 @@ msgstr "" msgid "Idea created updated" msgstr "" -#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:76 +#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:86 #, elixir-autogen, elixir-format msgid "Update idea" msgstr "" + +#: lib/mindwendel_web/live/live_helpers.ex:32 +#, elixir-autogen, elixir-format, fuzzy +msgid "Brainstorming will be deleted in %{days}" +msgstr "Brainstorming wird gelöscht in " diff --git a/priv/gettext/default.pot b/priv/gettext/default.pot index b69b45b0..36d36f98 100644 --- a/priv/gettext/default.pot +++ b/priv/gettext/default.pot @@ -40,7 +40,7 @@ msgstr "" msgid "Are you sure you want to delete this idea?" msgstr "" -#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:199 +#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:195 #, elixir-autogen, elixir-format msgid "Attention: This will delete the brainstorming with all belonging ideas and other associated records to it. This cant be undone" msgstr "" @@ -66,22 +66,22 @@ msgstr "" msgid "Create!" msgstr "" -#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:203 +#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:199 #, elixir-autogen, elixir-format msgid "Delete" msgstr "" -#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:193 +#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:189 #, elixir-autogen, elixir-format msgid "Delete Brainstorming" msgstr "" -#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:177 +#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:173 #, elixir-autogen, elixir-format msgid "Export to CSV" msgstr "" -#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:184 +#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:180 #, elixir-autogen, elixir-format msgid "Export to HTML" msgstr "" @@ -97,7 +97,7 @@ msgid "Idea created successfully" msgstr "" #: lib/mindwendel_web/live/brainstorming_live/show.html.heex:25 -#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:107 +#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:117 #, elixir-autogen, elixir-format msgid "New Idea" msgstr "" @@ -107,7 +107,7 @@ msgstr "" msgid "New brainstorming" msgstr "" -#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:64 +#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:74 #, elixir-autogen, elixir-format msgid "New idea" msgstr "" @@ -122,7 +122,7 @@ msgstr "" msgid "No ideas brainstormed" msgstr "" -#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:110 +#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:120 #, elixir-autogen, elixir-format msgid "Open new idea page (Hotkey: i)" msgstr "" @@ -189,12 +189,12 @@ msgstr "" msgid "Your brainstorming was created successfully! Share the link with other people and start brainstorming." msgstr "" -#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:59 +#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:55 #, elixir-autogen, elixir-format msgid "Edit Brainstorming" msgstr "" -#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:174 +#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:170 #, elixir-autogen, elixir-format msgid "Export" msgstr "" @@ -230,37 +230,32 @@ msgstr "" msgid "Administration for brainstorming: %{name}" msgstr "" -#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:89 +#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:85 #, elixir-autogen, elixir-format msgid "Show brainstorming settings link for all users" msgstr "" -#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:95 +#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:91 #, elixir-autogen, elixir-format msgid "Warning: Please make sure you save the admin link at the top, before hiding the settings link!" msgstr "" -#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:48 -#, elixir-autogen, elixir-format -msgid "Brainstorming will be deleted " -msgstr "" - #: lib/mindwendel_web/templates/static_page/home.html.heex:34 #, elixir-autogen, elixir-format msgid "Brainstormings will be deleted after %{days} days." msgstr "" -#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:123 +#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:119 #, elixir-autogen, elixir-format msgid "Choose the label color" msgstr "" -#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:112 +#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:108 #, elixir-autogen, elixir-format msgid "Edit Brainstorming Labels" msgstr "" -#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:128 +#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:124 #, elixir-autogen, elixir-format msgid "Type the label name" msgstr "" @@ -290,19 +285,19 @@ msgstr "" msgid "yellow" msgstr "" -#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:164 +#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:160 #, elixir-autogen, elixir-format msgid "Add idea label" msgstr "" -#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:137 +#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:133 #, elixir-autogen, elixir-format msgid "Remove idea label" msgstr "" -#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:76 -#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:103 -#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:153 +#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:72 +#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:99 +#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:149 #, elixir-autogen, elixir-format msgid "Saved" msgstr "" @@ -332,7 +327,7 @@ msgstr "" msgid "Share" msgstr "" -#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:88 +#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:98 #, elixir-autogen, elixir-format msgid "Share brainstorming" msgstr "" @@ -347,7 +342,7 @@ msgstr "" msgid "Download as svg" msgstr "" -#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:204 +#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:200 #, elixir-autogen, elixir-format msgid "Brainstorming delete are you sure" msgstr "" @@ -362,7 +357,12 @@ msgstr "" msgid "Idea created updated" msgstr "" -#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:76 +#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:86 #, elixir-autogen, elixir-format msgid "Update idea" msgstr "" + +#: lib/mindwendel_web/live/live_helpers.ex:32 +#, elixir-autogen, elixir-format +msgid "Brainstorming will be deleted in %{days}" +msgstr "" diff --git a/priv/gettext/en/LC_MESSAGES/default.po b/priv/gettext/en/LC_MESSAGES/default.po index 1fe9466c..a65ad321 100644 --- a/priv/gettext/en/LC_MESSAGES/default.po +++ b/priv/gettext/en/LC_MESSAGES/default.po @@ -41,7 +41,7 @@ msgstr "" msgid "Are you sure you want to delete this idea?" msgstr "" -#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:199 +#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:195 #, elixir-autogen, elixir-format msgid "Attention: This will delete the brainstorming with all belonging ideas and other associated records to it. This cant be undone" msgstr "" @@ -67,22 +67,22 @@ msgstr "" msgid "Create!" msgstr "" -#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:203 +#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:199 #, elixir-autogen, elixir-format msgid "Delete" msgstr "" -#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:193 +#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:189 #, elixir-autogen, elixir-format msgid "Delete Brainstorming" msgstr "" -#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:177 +#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:173 #, elixir-autogen, elixir-format msgid "Export to CSV" msgstr "" -#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:184 +#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:180 #, elixir-autogen, elixir-format msgid "Export to HTML" msgstr "" @@ -98,7 +98,7 @@ msgid "Idea created successfully" msgstr "" #: lib/mindwendel_web/live/brainstorming_live/show.html.heex:25 -#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:107 +#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:117 #, elixir-autogen, elixir-format msgid "New Idea" msgstr "" @@ -108,7 +108,7 @@ msgstr "" msgid "New brainstorming" msgstr "" -#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:64 +#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:74 #, elixir-autogen, elixir-format msgid "New idea" msgstr "" @@ -123,7 +123,7 @@ msgstr "" msgid "No ideas brainstormed" msgstr "" -#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:110 +#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:120 #, elixir-autogen, elixir-format msgid "Open new idea page (Hotkey: i)" msgstr "" @@ -190,12 +190,12 @@ msgstr "" msgid "Your brainstorming was created successfully! Share the link with other people and start brainstorming." msgstr "" -#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:59 +#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:55 #, elixir-autogen, elixir-format msgid "Edit Brainstorming" msgstr "" -#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:174 +#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:170 #, elixir-autogen, elixir-format msgid "Export" msgstr "" @@ -231,37 +231,32 @@ msgstr "" msgid "Administration for brainstorming: %{name}" msgstr "" -#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:89 +#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:85 #, elixir-autogen, elixir-format msgid "Show brainstorming settings link for all users" msgstr "" -#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:95 +#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:91 #, elixir-autogen, elixir-format msgid "Warning: Please make sure you save the admin link at the top, before hiding the settings link!" msgstr "" -#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:48 -#, elixir-autogen, elixir-format -msgid "Brainstorming will be deleted " -msgstr "" - #: lib/mindwendel_web/templates/static_page/home.html.heex:34 #, elixir-autogen, elixir-format msgid "Brainstormings will be deleted after %{days} days." msgstr "" -#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:123 +#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:119 #, elixir-autogen, elixir-format msgid "Choose the label color" msgstr "" -#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:112 +#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:108 #, elixir-autogen, elixir-format msgid "Edit Brainstorming Labels" msgstr "" -#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:128 +#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:124 #, elixir-autogen, elixir-format msgid "Type the label name" msgstr "" @@ -291,19 +286,19 @@ msgstr "" msgid "yellow" msgstr "" -#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:164 +#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:160 #, elixir-autogen, elixir-format msgid "Add idea label" msgstr "" -#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:137 +#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:133 #, elixir-autogen, elixir-format msgid "Remove idea label" msgstr "Remove" -#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:76 -#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:103 -#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:153 +#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:72 +#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:99 +#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:149 #, elixir-autogen, elixir-format msgid "Saved" msgstr "Saved" @@ -333,7 +328,7 @@ msgstr "Mindwendel Brainstorming" msgid "Share" msgstr "Share" -#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:88 +#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:98 #, elixir-autogen, elixir-format msgid "Share brainstorming" msgstr "Share brainstorming" @@ -348,7 +343,7 @@ msgstr "Download as png" msgid "Download as svg" msgstr "Download as svg" -#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:204 +#: lib/mindwendel_web/live/admin/brainstorming_live/edit.html.heex:200 #, elixir-autogen, elixir-format, fuzzy msgid "Brainstorming delete are you sure" msgstr "Are you sure that you want to delete this brainstorming?" @@ -363,7 +358,12 @@ msgstr "" msgid "Idea created updated" msgstr "" -#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:76 +#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:86 #, elixir-autogen, elixir-format msgid "Update idea" msgstr "" + +#: lib/mindwendel_web/live/live_helpers.ex:32 +#, elixir-autogen, elixir-format, fuzzy +msgid "Brainstorming will be deleted in %{days}" +msgstr "" diff --git a/test/mindwendel_web/live/live_helpers_test.ex b/test/mindwendel_web/live/live_helpers_test.ex new file mode 100644 index 00000000..72ee6e35 --- /dev/null +++ b/test/mindwendel_web/live/live_helpers_test.ex @@ -0,0 +1,20 @@ +defmodule MindwendelWeb.LiveHelpersTest do + use MindwendelWeb.ConnCase + import Phoenix.LiveViewTest + + alias Mindwendel.Factory + + setup do + %{brainstorming: Factory.insert!(:brainstorming)} + end + + test "contains deletion date", %{ + conn: conn, + brainstorming: brainstorming + } do + {:ok, _show_live_view, html} = + live(conn, Routes.brainstorming_show_path(conn, :show, brainstorming)) + + assert html =~ "in 29 days" + end +end