8 Commits

  1. 21
      CHANGELOG.md
  2. 2
      assets/css/_forms.scss
  3. 1
      assets/css/_phoenix.scss
  4. 43
      assets/css/app.scss
  5. 2
      lib/mirage_web/live/note_live/show.ex
  6. 34
      lib/mirage_web/live/note_live/show.html.leex
  7. 25
      lib/mirage_web/templates/topic/show.html.eex
  8. 2
      mix.exs

21
CHANGELOG.md

@ -5,6 +5,27 @@ See [Conventional Commits](Https://conventionalcommits.org) for commit guideline
<!-- changelog -->
## [v0.50.0](https://git.inhji.de/inhji/mirage/compare/v0.49.0...v0.50.0) (2021-02-21)
### Features:
* article styles for backlinks and sources
* make surface color blue-grey, make info alert green
### Bug Fixes:
* article margins
* excessive view counting
* bold text for alerts
* padding for forms
## [v0.49.0](https://git.inhji.de/inhji/mirage/compare/v0.48.1...v0.49.0) (2021-02-21)

2
assets/css/_forms.scss

@ -1,5 +1,5 @@
#modal {
padding: 0.5rem;
padding: 2rem;
margin-left: -2rem;
margin-right: -2rem;
@include color-assign(background-color, surface);

1
assets/css/_phoenix.scss

@ -4,6 +4,7 @@
margin-left: -2rem;
margin-right: -2rem;
border: 1px solid transparent;
font-weight: bold;
}
.alert-info {
color: $color-info;

43
assets/css/app.scss

@ -9,28 +9,28 @@ $primary-color: 'blue';
$colors: (
light: (
surface: material-color('grey', '50'),
surface-var: material-color('grey', '300'),
surface-dark: material-color('grey', '800'),
on-surface: material-color('grey', '900'),
background: material-color('grey', '200'),
surface: material-color('blue-grey', '50'),
surface-var: material-color('blue-grey', '200'),
surface-dark: material-color('blue-grey', '800'),
on-surface: material-color('blue-grey', '900'),
background: material-color('blue-grey', '200'),
primary: material-color($primary-color, '700'),
primary-inverse: material-color($primary-color, 'a700'),
on-primary: material-color('grey', '50'),
navigation: material-color('grey', '900'),
on-navigation: material-color('grey', '50')
on-primary: material-color('blue-grey', '50'),
navigation: material-color('blue-grey', '900'),
on-navigation: material-color('blue-grey', '50')
),
dark: (
surface: material-color('blue-grey', '800'),
surface-var: material-color('blue-grey', '800'),
surface-dark: material-color('grey', '800'),
on-surface: material-color('grey', '50'),
surface-dark: material-color('blue-grey', '800'),
on-surface: material-color('blue-grey', '50'),
background: material-color('blue-grey', '900'),
primary: material-color($primary-color, '700'),
primary-inverse: material-color($primary-color, '300'),
on-primary: material-color('grey', '50'),
navigation: material-color('grey', '900'),
on-navigation: material-color('grey', '50')
on-primary: material-color('blue-grey', '50'),
navigation: material-color('blue-grey', '900'),
on-navigation: material-color('blue-grey', '50')
)
);
@ -41,8 +41,8 @@ $colors: (
$font-content: 'Open Sans', Helvetica, sans-serif;
$font-heading: $font-content;
$bg-info: material-color('indigo', '500');
$color-info: material-color('indigo', '100');
$bg-info: material-color('green', '500');
$color-info: material-color('green', '100');
$bg-warning: #8a6d3b;
$color-warning: #fcf8e3;
$bg-danger: #a94442;
@ -224,6 +224,11 @@ kbd {
h4 {
margin-bottom: 1rem;
background: white;
padding: 0.5rem 1rem;
font-weight: bold;
border-bottom: 1px solid $border-base;
@include color-assign(border-color, on-surface);
}
a {
@ -333,6 +338,10 @@ kbd {
article {
margin-bottom: 4rem;
&.single {
margin-bottom: 2rem;
}
&>a {
text-decoration: none;
}
@ -349,8 +358,8 @@ article {
}
footer {
// border-top: 1px solid $border-base;
// @include color-assign(border-color, surface-var);
border-top: 1px solid $border-base;
@include color-assign(border-color, surface-var);
}
&:last-child {

2
lib/mirage_web/live/note_live/show.ex

@ -42,7 +42,6 @@ defmodule MirageWeb.NoteLive.Show do
note =
socket.assigns.note.id
|> Notes.get_note!()
|> Notes.view_note!()
|> Notes.preload_note()
{:noreply, socket |> assign(%{note: note})}
@ -57,7 +56,6 @@ defmodule MirageWeb.NoteLive.Show do
note =
note_id
|> Notes.get_note!()
|> Notes.view_note!()
|> Notes.preload_note()
{:noreply,

34
lib/mirage_web/live/note_live/show.html.leex

@ -11,21 +11,29 @@
return_to: Routes.note_show_path(@socket, :show, @note) %>
<% end %>
<header class="hero">
<h1><span class="id"><%= "##{@note.id}" %></span> <%= @note.title %></h1>
<p><time datetime="<%= @note.inserted_at %>"><%= Timex.from_now(@note.inserted_at) %></time> / <time datetime="<%= @note.updated_at %>"><%= Timex.from_now(@note.updated_at) %></time></p>
<p class="tags">
<%= for topic <- @note.topics do %>
<span class="tag"><%= topic.text %></span>
<% end %>
</p>
</header>
<article class="single">
<header class="hero">
<h1><span class="id"><%= "##{@note.id}" %></span> <%= @note.title %></h1>
<p><time datetime="<%= @note.inserted_at %>"><%= Timex.from_now(@note.inserted_at) %></time> / <time datetime="<%= @note.updated_at %>"><%= Timex.from_now(@note.updated_at) %></time></p>
<p class="tags">
<%= for topic <- @note.topics do %>
<span class="tag"><%= topic.text %></span>
<% end %>
</p>
</header>
<div class="width-full bg-content" phx-update="ignore" id="note-<%= @note.id %>">
<div class="content html">
<%= raw @note.content_html %>
<div class="width-full bg-content" phx-update="ignore" id="note-<%= @note.id %>">
<div class="content html">
<%= raw @note.content_html %>
</div>
</div>
</div>
<footer class="width-full bg-content">
<p class="tags">
<span class="tag">Views: <%= @note.views %></span>
</p>
</footer>
</article>
<%= if not Enum.empty?(@note.backlinks) do %>
<section class="backlinks">

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

@ -1,35 +1,18 @@
<header class="hero">
<h1>Topic <%= @topic.text %></h1>
<h1>Topic <em><%= @topic.text %></em></h1>
<p><%= Enum.count(@topic.notes) %> Notes</p>
</header>
<section>
<%= for note <- @topic.notes do %>
<article class="note" id="note-<%= note.id %>">
<article class="note single" id="note-<%= note.id %>">
<%= live_patch to: Routes.note_show_path(MirageWeb.Endpoint, :show, note) do %>
<header class="width-full">
<h2 class="title">
<%= note.title %>
</h2>
</header>
<% end %>
<!--
<section>
<div class="content html width-full bg-content">
<%= raw note.content_html %>
</div>
</section>
<footer class="width-full bg-content">
<time datetime="<%= note.inserted_at %>"><%= Timex.from_now(note.inserted_at) %></time>
<span class="tags">
<%= for topic <- note.topics do %>
<span class="tag"><%= topic.text %></span>
<% end %>
</span>
</footer>
-->
<% end %>
</article>
<% end %>
</section>

2
mix.exs

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

Loading…
Cancel
Save