Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
JannikStreek committed Dec 17, 2024
1 parent 4a3017c commit 4e2f369
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 11 deletions.
2 changes: 1 addition & 1 deletion assets/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
5 changes: 5 additions & 0 deletions lib/mindwendel_web/components/layouts.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 7 additions & 4 deletions lib/mindwendel_web/templates/layout/app.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,14 @@
{gettext("Your brainstormings")}
</a>
<ul class="dropdown-menu">
<%= for brainstorming <- assigns[:brainstormings_stored] do %>
<%= for brainstorming <- assigns[:brainstormings_stored] || [] do %>
<a
class={"dropdown-item #{ if assigns[:brainstorming].id == brainstorming["id"], do: "active", else: "" }"}
href={
~p"/brainstormings/#{brainstorming["id"]}/##{brainstorming["admin_url_id"]}"
brainstorming_url(
brainstorming["id"],
get_in(brainstorming, ["admin_url_id"])
)
}
>
{brainstorming["name"]}
Expand All @@ -72,12 +75,12 @@
<% end %>

<li class="nav-item"><hr class="dropdown-divider" /></li>
<%= for brainstorming <- assigns[:brainstormings_stored] do %>
<%= for brainstorming <- assigns[:brainstormings_stored] || [] do %>
<li class="nav-item d-lg-none">
<a
class={"nav-link #{if assigns[:brainstorming].id == brainstorming["id"], do: "active", else: "" }"}
href={
~p"/brainstormings/#{brainstorming["id"]}/##{brainstorming["admin_url_id"]}"
brainstorming_url(brainstorming["id"], get_in(brainstorming, ["admin_url_id"]))
}
>
{brainstorming["name"]}
Expand Down
4 changes: 2 additions & 2 deletions priv/gettext/de/LC_MESSAGES/default.po
Original file line number Diff line number Diff line change
Expand Up @@ -542,13 +542,13 @@ msgid "Your comment"
msgstr "Kommentar"

#: lib/mindwendel_web/controllers/static_page_html/home.html.heex:71
#: lib/mindwendel_web/templates/layout/app.html.heex:69
#: lib/mindwendel_web/templates/layout/app.html.heex:72
#, elixir-autogen, elixir-format
msgid "Legal Disclosure"
msgstr "Impressum"

#: lib/mindwendel_web/controllers/static_page_html/home.html.heex:72
#: lib/mindwendel_web/templates/layout/app.html.heex:65
#: lib/mindwendel_web/templates/layout/app.html.heex:68
#, elixir-autogen, elixir-format
msgid "Privacy"
msgstr "Datenschutzerklärung"
Expand Down
4 changes: 2 additions & 2 deletions priv/gettext/default.pot
Original file line number Diff line number Diff line change
Expand Up @@ -541,13 +541,13 @@ msgid "Your comment"
msgstr ""

#: lib/mindwendel_web/controllers/static_page_html/home.html.heex:71
#: lib/mindwendel_web/templates/layout/app.html.heex:69
#: lib/mindwendel_web/templates/layout/app.html.heex:72
#, elixir-autogen, elixir-format
msgid "Legal Disclosure"
msgstr ""

#: lib/mindwendel_web/controllers/static_page_html/home.html.heex:72
#: lib/mindwendel_web/templates/layout/app.html.heex:65
#: lib/mindwendel_web/templates/layout/app.html.heex:68
#, elixir-autogen, elixir-format
msgid "Privacy"
msgstr ""
Expand Down
4 changes: 2 additions & 2 deletions priv/gettext/en/LC_MESSAGES/default.po
Original file line number Diff line number Diff line change
Expand Up @@ -542,13 +542,13 @@ msgid "Your comment"
msgstr ""

#: lib/mindwendel_web/controllers/static_page_html/home.html.heex:71
#: lib/mindwendel_web/templates/layout/app.html.heex:69
#: lib/mindwendel_web/templates/layout/app.html.heex:72
#, elixir-autogen, elixir-format
msgid "Legal Disclosure"
msgstr ""

#: lib/mindwendel_web/controllers/static_page_html/home.html.heex:72
#: lib/mindwendel_web/templates/layout/app.html.heex:65
#: lib/mindwendel_web/templates/layout/app.html.heex:68
#, elixir-autogen, elixir-format
msgid "Privacy"
msgstr ""
Expand Down

0 comments on commit 4e2f369

Please sign in to comment.