From 501eb5d56035c96d5d27b37979058a00ed8197a7 Mon Sep 17 00:00:00 2001 From: shibao Date: Sun, 27 Nov 2022 21:33:06 -0500 Subject: [PATCH] use project version on homepage --- changelog.md | 1 + lib/memex_web/live/home_live.ex | 4 +++- lib/memex_web/live/home_live.html.heex | 10 +++++----- priv/gettext/de/LC_MESSAGES/default.po | 2 +- priv/gettext/default.pot | 2 +- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/changelog.md b/changelog.md index ab88268..45643da 100644 --- a/changelog.md +++ b/changelog.md @@ -2,6 +2,7 @@ - improve search a whole lot - improve table information for notes and contexts - fix some typos +- use project version on homepage # v0.1.0 - initial release >:3c diff --git a/lib/memex_web/live/home_live.ex b/lib/memex_web/live/home_live.ex index 6c7ecfe..95df1d2 100644 --- a/lib/memex_web/live/home_live.ex +++ b/lib/memex_web/live/home_live.ex @@ -3,6 +3,8 @@ defmodule MemexWeb.HomeLive do Liveview for the main home page """ + @version Mix.Project.config()[:version] + use MemexWeb, :live_view alias Memex.Accounts alias MemexWeb.{Endpoint, FaqLive} @@ -10,6 +12,6 @@ defmodule MemexWeb.HomeLive do @impl true def mount(_params, _session, socket) do admins = Accounts.list_users_by_role(:admin) - {:ok, socket |> assign(page_title: gettext("home"), admins: admins)} + {:ok, socket |> assign(page_title: gettext("home"), admins: admins, version: @version)} end end diff --git a/lib/memex_web/live/home_live.html.heex b/lib/memex_web/live/home_live.html.heex index 9a8a4b2..b8391c2 100644 --- a/lib/memex_web/live/home_live.html.heex +++ b/lib/memex_web/live/home_live.html.heex @@ -120,12 +120,12 @@
  • <%= gettext("version:") %> <.link - href="https://gitea.bubbletea.dev/shibao/memex/src/branch/stable/CHANGELOG.md" + href="https://gitea.bubbletea.dev/shibao/memEx/src/branch/stable/changelog.md" class="flex flex-row justify-center items-center space-x-2 link" target="_blank" rel="noopener noreferrer" > -

    0.1.0

    +

    <%= @version %>

  • @@ -140,7 +140,7 @@
  • <.link - href="https://gitea.bubbletea.dev/shibao/memex" + href="https://gitea.bubbletea.dev/shibao/memEx" class="flex flex-row justify-center items-center space-x-2 link" target="_blank" rel="noopener noreferrer" @@ -151,7 +151,7 @@
  • <.link - href="https://weblate.bubbletea.dev/engage/memex" + href="https://weblate.bubbletea.dev/engage/memEx" class="flex flex-row justify-center items-center space-x-2 link" target="_blank" rel="noopener noreferrer" @@ -162,7 +162,7 @@
  • <.link - href="https://gitea.bubbletea.dev/shibao/memex/issues/new" + href="https://gitea.bubbletea.dev/shibao/memEx/issues/new" class="flex flex-row justify-center items-center space-x-2 link" target="_blank" rel="noopener noreferrer" diff --git a/priv/gettext/de/LC_MESSAGES/default.po b/priv/gettext/de/LC_MESSAGES/default.po index dd94a43..ac31c8f 100644 --- a/priv/gettext/de/LC_MESSAGES/default.po +++ b/priv/gettext/de/LC_MESSAGES/default.po @@ -475,7 +475,7 @@ msgstr "" msgid "%{slug} could not be found" msgstr "" -#: lib/memex_web/live/home_live.ex:13 +#: lib/memex_web/live/home_live.ex:15 #, elixir-autogen, elixir-format msgid "home" msgstr "" diff --git a/priv/gettext/default.pot b/priv/gettext/default.pot index 105a2ce..b888da6 100644 --- a/priv/gettext/default.pot +++ b/priv/gettext/default.pot @@ -464,7 +464,7 @@ msgstr "" msgid "%{slug} could not be found" msgstr "" -#: lib/memex_web/live/home_live.ex:13 +#: lib/memex_web/live/home_live.ex:15 #, elixir-autogen, elixir-format msgid "home" msgstr ""