diff --git a/changelog.md b/changelog.md index def4f2d..c809d91 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,6 @@ # v0.1.3 - backlink to other notes in notes +- search tags on click # v0.1.2 - fix more typos diff --git a/lib/memex_web/components/contexts_table_component.ex b/lib/memex_web/components/contexts_table_component.ex index cc2456c..4006db3 100644 --- a/lib/memex_web/components/contexts_table_component.ex +++ b/lib/memex_web/components/contexts_table_component.ex @@ -105,7 +105,17 @@ defmodule MemexWeb.Components.ContextsTableComponent do end defp get_value_for_key(:tags, %{tags: tags}, _additional_data) do - tags |> Enum.join(", ") + assigns = %{tags: tags} + + ~H""" +
+ <%= for tag <- @tags do %> + <.link patch={Routes.context_index_path(Endpoint, :search, tag)} class="link"> + <%= tag %> + + <% end %> +
+ """ end defp get_value_for_key(:actions, context, %{actions: actions}) do diff --git a/lib/memex_web/components/notes_table_component.ex b/lib/memex_web/components/notes_table_component.ex index 94f8b7c..527faf7 100644 --- a/lib/memex_web/components/notes_table_component.ex +++ b/lib/memex_web/components/notes_table_component.ex @@ -105,7 +105,17 @@ defmodule MemexWeb.Components.NotesTableComponent do end defp get_value_for_key(:tags, %{tags: tags}, _additional_data) do - tags |> Enum.join(", ") + assigns = %{tags: tags} + + ~H""" +
+ <%= for tag <- @tags do %> + <.link patch={Routes.note_index_path(Endpoint, :search, tag)} class="link"> + <%= tag %> + + <% end %> +
+ """ end defp get_value_for_key(:actions, note, %{actions: actions}) do diff --git a/lib/memex_web/components/pipelines_table_component.ex b/lib/memex_web/components/pipelines_table_component.ex index 542d5c5..a2c5be7 100644 --- a/lib/memex_web/components/pipelines_table_component.ex +++ b/lib/memex_web/components/pipelines_table_component.ex @@ -118,7 +118,17 @@ defmodule MemexWeb.Components.PipelinesTableComponent do end defp get_value_for_key(:tags, %{tags: tags}, _additional_data) do - tags |> Enum.join(", ") + assigns = %{tags: tags} + + ~H""" +
+ <%= for tag <- @tags do %> + <.link patch={Routes.pipeline_index_path(Endpoint, :search, tag)} class="link"> + <%= tag %> + + <% end %> +
+ """ end defp get_value_for_key(:actions, pipeline, %{actions: actions}) do diff --git a/lib/memex_web/live/context_live/show.html.heex b/lib/memex_web/live/context_live/show.html.heex index 0b88abf..1d5be4d 100644 --- a/lib/memex_web/live/context_live/show.html.heex +++ b/lib/memex_web/live/context_live/show.html.heex @@ -3,7 +3,13 @@ <%= @context.slug %> -

<%= if @context.tags, do: @context.tags |> Enum.join(", ") %>

+
+ <%= for tag <- @context.tags do %> + <.link navigate={Routes.context_index_path(Endpoint, :search, tag)} class="link"> + <%= tag %> + + <% end %> +
<.context_content context={@context} /> diff --git a/lib/memex_web/live/note_live/show.html.heex b/lib/memex_web/live/note_live/show.html.heex index 690d329..f02b6ea 100644 --- a/lib/memex_web/live/note_live/show.html.heex +++ b/lib/memex_web/live/note_live/show.html.heex @@ -3,7 +3,13 @@ <%= @note.slug %> -

<%= if @note.tags, do: @note.tags |> Enum.join(", ") %>

+
+ <%= for tag <- @note.tags do %> + <.link navigate={Routes.note_index_path(Endpoint, :search, tag)} class="link"> + <%= tag %> + + <% end %> +
<.note_content note={@note} /> diff --git a/lib/memex_web/live/pipeline_live/show.html.heex b/lib/memex_web/live/pipeline_live/show.html.heex index 4072ba6..45b5aa4 100644 --- a/lib/memex_web/live/pipeline_live/show.html.heex +++ b/lib/memex_web/live/pipeline_live/show.html.heex @@ -3,7 +3,13 @@ <%= @pipeline.slug %> -

<%= if @pipeline.tags, do: @pipeline.tags |> Enum.join(", ") %>

+
+ <%= for tag <- @pipeline.tags do %> + <.link navigate={Routes.pipeline_index_path(Endpoint, :search, tag)} class="link"> + <%= tag %> + + <% end %> +
<%= if @pipeline.description do %>