From 4e2f369a0b5701a5e14e39d08acefb36e3cc08b8 Mon Sep 17 00:00:00 2001 From: Jannik Streek Date: Tue, 17 Dec 2024 17:02:25 +0100 Subject: [PATCH] fixes --- assets/js/app.js | 2 +- lib/mindwendel_web/components/layouts.ex | 5 +++++ lib/mindwendel_web/templates/layout/app.html.heex | 11 +++++++---- priv/gettext/de/LC_MESSAGES/default.po | 4 ++-- priv/gettext/default.pot | 4 ++-- priv/gettext/en/LC_MESSAGES/default.po | 4 ++-- 6 files changed, 19 insertions(+), 11 deletions(-) diff --git a/assets/js/app.js b/assets/js/app.js index 3be1c37b..5eaaf1d1 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -168,7 +168,7 @@ Hooks.StoreRecentBrainstorming = { recentBrainstormings[brainstormingId] = { id: brainstormingId, - admin_url_id: this.el.dataset.adminUrlId, + admin_url_id: this.el.dataset.adminUrlId || recentBrainstormings?.brainstormingId?.admin_url_id, name: this.el.dataset.name, last_accessed_at: this.el.dataset.lastAccessedAt } diff --git a/lib/mindwendel_web/components/layouts.ex b/lib/mindwendel_web/components/layouts.ex index f49e777e..7539a80e 100644 --- a/lib/mindwendel_web/components/layouts.ex +++ b/lib/mindwendel_web/components/layouts.ex @@ -18,6 +18,11 @@ defmodule MindwendelWeb.Layouts do Brainstormings.list_brainstormings_for(user.id, limit) end + def brainstorming_url(id, admin_url_id) do + admin_url_id = admin_url_id || "" + ~p"/brainstormings/#{id}/##{admin_url_id}" + end + def admin_view(current_view) do current_view == MindwendelWeb.Admin.BrainstormingLive.Edit end diff --git a/lib/mindwendel_web/templates/layout/app.html.heex b/lib/mindwendel_web/templates/layout/app.html.heex index d4128ec8..24e05dc9 100644 --- a/lib/mindwendel_web/templates/layout/app.html.heex +++ b/lib/mindwendel_web/templates/layout/app.html.heex @@ -47,11 +47,14 @@ {gettext("Your brainstormings")}