Skip to content

Commit

Permalink
refactored
Browse files Browse the repository at this point in the history
  • Loading branch information
JannikStreek committed Dec 18, 2024
1 parent fe2a8ee commit c9915a9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
5 changes: 0 additions & 5 deletions lib/mindwendel_web/components/layouts.ex
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ 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
2 changes: 2 additions & 0 deletions lib/mindwendel_web/live/start_live/home.ex
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
defmodule MindwendelWeb.StartLive.Home do
use MindwendelWeb, :live_view

import MindwendelWeb.LiveHelpers

alias Mindwendel.Brainstormings
alias Mindwendel.Brainstormings.Brainstorming

Expand Down
7 changes: 2 additions & 5 deletions lib/mindwendel_web/templates/layout/app.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,7 @@
<a
class={"dropdown-item #{ if assigns[:brainstorming].id == brainstorming["id"], do: "active", else: "" }"}
href={
brainstorming_url(
brainstorming["id"],
get_in(brainstorming, ["admin_url_id"])
)
~p"/brainstormings/#{brainstorming["id"]}/##{brainstorming["admin_url_id"] || ""}"
}
>
{brainstorming["name"]}
Expand All @@ -80,7 +77,7 @@
<a
class={"nav-link #{if assigns[:brainstorming].id == brainstorming["id"], do: "active", else: "" }"}
href={
brainstorming_url(brainstorming["id"], get_in(brainstorming, ["admin_url_id"]))
~p"/brainstormings/#{brainstorming["id"]}/##{brainstorming["admin_url_id"] || ""}"
}
>
{brainstorming["name"]}
Expand Down

0 comments on commit c9915a9

Please sign in to comment.