8 Commits

  1. 23
      CHANGELOG.md
  2. 2
      assets/css/_cards.scss
  3. 2
      assets/css/app.scss
  4. 60
      assets/package-lock.json
  5. 28
      lib/mirage/notes.ex
  6. 10
      lib/mirage_web/live/inbox_live/item_component.ex
  7. 4
      lib/mirage_web/live/note_live/index.html.leex
  8. 2
      mix.exs

23
CHANGELOG.md

@ -5,6 +5,29 @@ See [Conventional Commits](Https://conventionalcommits.org) for commit guideline
<!-- changelog -->
## [v0.70.1](https://git.inhji.de/inhji/mirage/compare/v0.70.0...v0.70.1) (2021-03-13)
### Chores:
* mix format
* update deps
### Bug Fixes:
* improve inbox notes
* preload daily note
* remove list styles from note index
* make tags less agressive
* spread out listed cards
## [v0.70.0](https://git.inhji.de/inhji/mirage/compare/v0.69.1...v0.70.0) (2021-03-13)

2
assets/css/_cards.scss

@ -8,6 +8,8 @@
.card {
flex: 1;
flex-basis: 100%;
border-width: 1px;
border-style: solid;
@include color-assign(border-color, surface-var);

2
assets/css/app.scss

@ -228,7 +228,7 @@ kbd {
margin: 0.1rem;
border-radius: 5px;
border: 1px solid white;
@include color-assign(border-color, on-surface);
@include color-assign(border-color, surface-var);
}
}

60
assets/package-lock.json

@ -1640,9 +1640,9 @@
"dev": true
},
"node_modules/@types/node": {
"version": "14.14.33",
"resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.33.tgz",
"integrity": "sha512-oJqcTrgPUF29oUP8AsUqbXGJNuPutsetaa9kTQAQce5Lx5dTYWV02ScBiT/k1BX/Z7pKeqedmvp39Wu4zR7N7g==",
"version": "14.14.34",
"resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.34.tgz",
"integrity": "sha512-dBPaxocOK6UVyvhbnpFIj2W+S+1cBTkHQbFQfeeJhoKFbzYcVUGHvddeWPSucKATb3F0+pgDq0i6ghEaZjsugA==",
"dev": true
},
"node_modules/@types/q": {
@ -2234,9 +2234,9 @@
}
},
"node_modules/caniuse-lite": {
"version": "1.0.30001198",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001198.tgz",
"integrity": "sha512-r5GGgESqOPZzwvdLVER374FpQu2WluCF1Z2DSiFJ89KSmGjT0LVKjgv4NcAqHmGWF9ihNpqRI9KXO9Ex4sKsgA==",
"version": "1.0.30001199",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001199.tgz",
"integrity": "sha512-ifbK2eChUCFUwGhlEzIoVwzFt1+iriSjyKKFYNfv6hN34483wyWpLLavYQXhnR036LhkdUYaSDpHg1El++VgHQ==",
"dev": true
},
"node_modules/chalk": {
@ -3138,9 +3138,9 @@
"dev": true
},
"node_modules/electron-to-chromium": {
"version": "1.3.686",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.686.tgz",
"integrity": "sha512-SOJT3m00NX/gT3sD6E3PcZX6u3+zUmQq4+yp8QCKLOwf2ECnmh9eAY+eonhC/AAu5Gg2WrtUU2m7/+e85O0l6A==",
"version": "1.3.687",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.687.tgz",
"integrity": "sha512-IpzksdQNl3wdgkzf7dnA7/v10w0Utf1dF2L+B4+gKrloBrxCut+au+kky3PYvle3RMdSxZP+UiCZtLbcYRxSNQ==",
"dev": true
},
"node_modules/emojis-list": {
@ -4631,9 +4631,9 @@
"dev": true
},
"node_modules/nanoid": {
"version": "3.1.20",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.20.tgz",
"integrity": "sha512-a1cQNyczgKbLX9jwbS/+d7W8fX/RfgYR7lVWwWOGIPNgK2m0MWvrGF6/m4kk6U3QcFMnZf3RIhL0v2Jgh/0Uxw==",
"version": "3.1.21",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.21.tgz",
"integrity": "sha512-A6oZraK4DJkAOICstsGH98dvycPr/4GGDH7ZWKmMdd3vGcOurZ6JmWFUt0DA5bzrrn2FrUjmv6mFNWvv8jpppA==",
"dev": true,
"bin": {
"nanoid": "bin/nanoid.cjs"
@ -7631,9 +7631,9 @@
}
},
"node_modules/webpack": {
"version": "5.24.4",
"resolved": "https://registry.npmjs.org/webpack/-/webpack-5.24.4.tgz",
"integrity": "sha512-RXOdxF9hFFFhg47BryCgyFrEyyu7Y/75/uiI2DoUiTMqysK+WczVSTppvkR47oZcmI/DPaXCiCiaXBP8QjkNpA==",
"version": "5.25.0",
"resolved": "https://registry.npmjs.org/webpack/-/webpack-5.25.0.tgz",
"integrity": "sha512-jqQZopNCzt9c4K6Qa7j6kIhzHfR9wgF84go58VoNp4JbZrBr2D2l5lcv72CW80yc6NJl8CR6OY8xctnIs0r2uw==",
"dev": true,
"dependencies": {
"@types/eslint-scope": "^3.7.0",
@ -9363,9 +9363,9 @@
"dev": true
},
"@types/node": {
"version": "14.14.33",
"resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.33.tgz",
"integrity": "sha512-oJqcTrgPUF29oUP8AsUqbXGJNuPutsetaa9kTQAQce5Lx5dTYWV02ScBiT/k1BX/Z7pKeqedmvp39Wu4zR7N7g==",
"version": "14.14.34",
"resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.34.tgz",
"integrity": "sha512-dBPaxocOK6UVyvhbnpFIj2W+S+1cBTkHQbFQfeeJhoKFbzYcVUGHvddeWPSucKATb3F0+pgDq0i6ghEaZjsugA==",
"dev": true
},
"@types/q": {
@ -9851,9 +9851,9 @@
}
},
"caniuse-lite": {
"version": "1.0.30001198",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001198.tgz",
"integrity": "sha512-r5GGgESqOPZzwvdLVER374FpQu2WluCF1Z2DSiFJ89KSmGjT0LVKjgv4NcAqHmGWF9ihNpqRI9KXO9Ex4sKsgA==",
"version": "1.0.30001199",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001199.tgz",
"integrity": "sha512-ifbK2eChUCFUwGhlEzIoVwzFt1+iriSjyKKFYNfv6hN34483wyWpLLavYQXhnR036LhkdUYaSDpHg1El++VgHQ==",
"dev": true
},
"chalk": {
@ -10549,9 +10549,9 @@
"dev": true
},
"electron-to-chromium": {
"version": "1.3.686",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.686.tgz",
"integrity": "sha512-SOJT3m00NX/gT3sD6E3PcZX6u3+zUmQq4+yp8QCKLOwf2ECnmh9eAY+eonhC/AAu5Gg2WrtUU2m7/+e85O0l6A==",
"version": "1.3.687",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.687.tgz",
"integrity": "sha512-IpzksdQNl3wdgkzf7dnA7/v10w0Utf1dF2L+B4+gKrloBrxCut+au+kky3PYvle3RMdSxZP+UiCZtLbcYRxSNQ==",
"dev": true
},
"emojis-list": {
@ -11654,9 +11654,9 @@
"dev": true
},
"nanoid": {
"version": "3.1.20",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.20.tgz",
"integrity": "sha512-a1cQNyczgKbLX9jwbS/+d7W8fX/RfgYR7lVWwWOGIPNgK2m0MWvrGF6/m4kk6U3QcFMnZf3RIhL0v2Jgh/0Uxw==",
"version": "3.1.21",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.21.tgz",
"integrity": "sha512-A6oZraK4DJkAOICstsGH98dvycPr/4GGDH7ZWKmMdd3vGcOurZ6JmWFUt0DA5bzrrn2FrUjmv6mFNWvv8jpppA==",
"dev": true
},
"neo-async": {
@ -13910,9 +13910,9 @@
}
},
"webpack": {
"version": "5.24.4",
"resolved": "https://registry.npmjs.org/webpack/-/webpack-5.24.4.tgz",
"integrity": "sha512-RXOdxF9hFFFhg47BryCgyFrEyyu7Y/75/uiI2DoUiTMqysK+WczVSTppvkR47oZcmI/DPaXCiCiaXBP8QjkNpA==",
"version": "5.25.0",
"resolved": "https://registry.npmjs.org/webpack/-/webpack-5.25.0.tgz",
"integrity": "sha512-jqQZopNCzt9c4K6Qa7j6kIhzHfR9wgF84go58VoNp4JbZrBr2D2l5lcv72CW80yc6NJl8CR6OY8xctnIs0r2uw==",
"dev": true,
"requires": {
"@types/eslint-scope": "^3.7.0",

28
lib/mirage/notes.ex

@ -124,22 +124,24 @@ defmodule Mirage.Notes do
where: n.title == ^date_title,
select: n
case Repo.one(q) do
%Note{} = note ->
[note]
note =
case Repo.one(q) do
%Note{} = note ->
[note]
nil ->
template = Mirage.Settings.get_setting_by_name!("daily_template")
IO.inspect(template)
nil ->
template = Mirage.Settings.get_setting_by_name!("daily_template")
{:ok, note} =
create_note(%{
title: date_title,
content: template.value
})
{:ok, note} =
create_note(%{
title: date_title,
content: template.value
})
[note]
end
[note]
end
note |> preload_note()
end
def today_title() do

10
lib/mirage_web/live/inbox_live/item_component.ex

@ -1,6 +1,5 @@
defmodule MirageWeb.InboxLive.ItemComponent do
use Phoenix.LiveComponent
use MirageWeb, :live_view
use MirageWeb, :live_component
def render(assigns) do
~L"""
@ -10,6 +9,13 @@ defmodule MirageWeb.InboxLive.ItemComponent do
</span>
<span>
<strong><%= @note.title %></strong>
<p><%= @note.content |> String.slice(0..50) %>..</p>
<p class="tags">
<span class="tag">Views: <%= @note.views %></span>
<%= for topic <- @note.topics do %>
<span class="tag"><%= topic.text %></span>
<% end %>
</p>
</span>
<% end %>
"""

4
lib/mirage_web/live/note_live/index.html.leex

@ -17,7 +17,7 @@
<section class="bg-content width-full">
<h3>✒️ Last Edited</h3>
<div class="cards list">
<div class="cards">
<%= for note <- @notes.last_edited do %>
<%= link to: Routes.note_show_path(@socket, :show, note), class: "col card" do %>
<strong><%= note.title %></strong>
@ -30,7 +30,7 @@
<section class="bg-content width-full">
<h3>🕶️ Most Viewed</h3>
<div class="cards list">
<div class="cards">
<%= for note <- @notes.most_viewed do %>
<%= link to: Routes.note_show_path(@socket, :show, note), class: "col card" do %>
<strong><%= note.title %></strong>

2
mix.exs

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

Loading…
Cancel
Save