3 Commits

  1. 11
      CHANGELOG.md
  2. 2
      lib/mirage/topics.ex
  3. 27
      lib/mirage_web/router.ex
  4. 14
      lib/mirage_web/templates/topic/show.html.eex
  5. 2
      lib/mirage_web/templates/user_settings/edit.html.eex
  6. 2
      mix.exs

11
CHANGELOG.md

@ -5,6 +5,17 @@ See [Conventional Commits](Https://conventionalcommits.org) for commit guideline
<!-- changelog -->
## [v0.56.2](https://git.inhji.de/inhji/mirage/compare/v0.56.1...v0.56.2) (2021-02-24)
### Bug Fixes:
* show tags for tagged notes/links
* consolidate all user routes
## [v0.56.1](https://git.inhji.de/inhji/mirage/compare/v0.56.0...v0.56.1) (2021-02-23)

2
lib/mirage/topics.ex

@ -3,7 +3,7 @@ defmodule Mirage.Topics do
alias Mirage.Repo
alias Mirage.Topics.Topic
@topic_preloads [notes: [:links, :topics, :backlinks], links: []]
@topic_preloads [notes: [:links, :topics, :backlinks], links: [:topics]]
@doc """
Returns the list of topics.

27
lib/mirage_web/router.ex

@ -29,7 +29,6 @@ defmodule MirageWeb.Router do
live "/", HomeLive, :index
resources "/topics", TopicController
resources "/settings", SettingController, only: [:index, :show, :edit, :update]
live "/links", LinkLive.Index, :index
live "/links/new", LinkLive.Index, :new
@ -46,12 +45,6 @@ defmodule MirageWeb.Router do
live "/notes/:id/show/edit", NoteLive.Show, :edit
end
scope "/user", MirageWeb do
pipe_through [:browser, :require_authenticated_user]
get "/", UserController, :index
end
# Other scopes may use custom stacks.
# scope "/api", MirageWeb do
# pipe_through :api
@ -78,6 +71,18 @@ defmodule MirageWeb.Router do
## Authentication routes
scope "/", MirageWeb do
pipe_through [:browser, :require_authenticated_user]
get "/user", UserController, :index
resources "/user/settings", SettingController, only: [:index, :show, :edit, :update]
get "/user/edit", UserSettingsController, :edit
put "/user/edit", UserSettingsController, :update
get "/user/edit/confirm_email/:token", UserSettingsController, :confirm_email
end
scope "/", MirageWeb do
pipe_through [:browser, :redirect_if_user_is_authenticated]
@ -91,14 +96,6 @@ defmodule MirageWeb.Router do
put "/user/reset_password/:token", UserResetPasswordController, :update
end
scope "/", MirageWeb do
pipe_through [:browser, :require_authenticated_user]
get "/user/settings", UserSettingsController, :edit
put "/user/settings", UserSettingsController, :update
get "/user/settings/confirm_email/:token", UserSettingsController, :confirm_email
end
scope "/", MirageWeb do
pipe_through [:browser]

14
lib/mirage_web/templates/topic/show.html.eex

@ -10,7 +10,12 @@
<header class="width-full">
<h2 class="title">
<%= note.title %>
</h2>
</h2>
<p class="tags">
<%= for topic <- note.topics do %>
<span class="tag"><%= topic.text %></span>
<% end %>
</p>
</header>
<% end %>
</article>
@ -24,7 +29,12 @@
<header class="width-full">
<h2 class="title">
<%= link.title || link.url %>
</h2>
</h2>
<p class="tags">
<%= for topic <- link.topics do %>
<span class="tag"><%= topic.text %></span>
<% end %>
</p>
</header>
<% end %>
</article>

2
lib/mirage_web/templates/user_settings/edit.html.eex

@ -1,5 +1,5 @@
<header class="hero">
<h1>Settings</h1>
<h1>Edit User</h1>
</header>
<h3>Change email</h3>

2
mix.exs

@ -1,7 +1,7 @@
defmodule Mirage.MixProject do
use Mix.Project
@version "0.56.1"
@version "0.56.2"
def project do
[

Loading…
Cancel
Save