6 Commits

  1. 17
      CHANGELOG.md
  2. 1
      assets/css/_navigation.scss
  3. 3
      assets/css/app.scss
  4. 4
      lib/mirage_web/templates/layout/_header.html.eex
  5. 17
      lib/mirage_web/templates/layout/_sidebar.html.eex
  6. 1
      lib/mirage_web/templates/layout/_user_menu.html.eex
  7. 31
      lib/mirage_web/templates/layout/root.html.leex
  8. 2
      lib/mirage_web/templates/user/index.html.eex
  9. 8
      lib/mirage_web/views/layout_view.ex
  10. 2
      mix.exs

17
CHANGELOG.md

@ -5,6 +5,23 @@ See [Conventional Commits](Https://conventionalcommits.org) for commit guideline
<!-- changelog -->
## [v0.61.0](https://git.inhji.de/inhji/mirage/compare/v0.60.0...v0.61.0) (2021-02-27)
### Features:
* rename user index to inbox
* move most navigation to sidebar
* add body class
* move sidebar to _sidebar.html.eex
* sidebar with nice shadow
## [v0.60.0](https://git.inhji.de/inhji/mirage/compare/v0.59.1...v0.60.0) (2021-02-27)

1
assets/css/_navigation.scss

@ -70,6 +70,7 @@ aside#sidebar {
position: fixed;
width: $width-sidebar;
height: 100vh;
box-shadow: 1px 0px 3px 0px rgba(0,0,0,0.75);
@include color-assign(background-color, navigation);

3
assets/css/app.scss

@ -19,6 +19,7 @@ $colors: (
primary-inverse: material-color($primary-color, 'a700'),
on-primary: material-color('blue-grey', '50'),
navigation: material-color('blue-grey', '900'),
navigation-var: material-color('blue-grey', '800'),
on-navigation: material-color('blue-grey', '50')
),
dark: (
@ -118,7 +119,7 @@ a {
.flex-3 {flex: 3;}
.flex-4 {flex: 4;}
#wrapper {
body.logged-in #wrapper {
margin-left: $width-sidebar;
}

4
lib/mirage_web/templates/layout/_header.html.eex

@ -2,10 +2,6 @@
<nav role="navigation">
<ul>
<%= active_link(@conn, @_s.header_title.value, to: "/", wrap_tag: :li) %>
<%= active_link(@conn, "१ Notes", to: "/notes", wrap_tag: :li) %>
<%= active_link(@conn, "२ Links", to: "/links", wrap_tag: :li) %>
<%= active_link(@conn, "३ Topics", to: "/topics", wrap_tag: :li) %>
<%= active_link(@conn, "४ Lists", to: "/lists", wrap_tag: :li) %>
<li class="spacer"></li>
<%= render "_user_menu.html", assigns %>
</ul>

17
lib/mirage_web/templates/layout/_sidebar.html.eex

@ -0,0 +1,17 @@
<aside id="sidebar">
<ul>
<li>
<a>&nbsp;</a>
</li>
<li>
<%= active_link(@conn, "Inbox", to: Routes.user_path(@conn, :index), wrap_tag: :li) %>
</li>
<%= active_link(@conn, "Notes", to: "/notes", wrap_tag: :li) %>
<%= active_link(@conn, "Links", to: "/links", wrap_tag: :li) %>
<%= active_link(@conn, "Topics", to: "/topics", wrap_tag: :li) %>
<%= active_link(@conn, "Lists", to: "/lists", wrap_tag: :li) %>
<li>
<a href="/user/settings">Settings</a>
</li>
</ul>
</aside>

1
lib/mirage_web/templates/layout/_user_menu.html.eex

@ -1,5 +1,4 @@
<%= if @current_user do %>
<%= active_link(@conn, "User", to: Routes.user_path(@conn, :index), wrap_tag: :li) %>
<li><%= link "Log out", to: Routes.user_session_path(@conn, :delete), method: :delete %></li>
<% else %>
<%= if not Mirage.Accounts.has_user? do %>

31
lib/mirage_web/templates/layout/root.html.leex

@ -10,34 +10,11 @@
<link phx-track-static rel="stylesheet" href="<%= Routes.static_path(@conn, "/css/app.css") %>"/>
<script defer phx-track-static type="text/javascript" src="<%= Routes.static_path(@conn, "/js/app.js") %>"></script>
</head>
<body>
<body class="<%= body_class(assigns) %>">
<div class="container">
<aside id="sidebar">
<ul>
<li>
<a href="#">Search</a>
</li>
<li>
<a href="#">Inbox</a>
</li>
<li>
<a href="/notes">Notes</a>
</li>
<li>
<a href="/links">Links</a>
</li>
<li>
<a href="/topics">Topics</a>
</li>
<li class="spacer"></li>
<li>
<a href="#">Settings</a>
</li>
<li>
<a href="#">Logout</a>
</li>
</ul>
</aside>
<%= if @current_user do %>
<%= render "_sidebar.html", assigns %>
<% end %>
<div id="wrapper">
<%= render "_header.html", assigns %>

2
lib/mirage_web/templates/user/index.html.eex

@ -1,5 +1,5 @@
<header class="hero">
<h1>Hello human!</h1>
<h1>Inbox</h1>
</header>
<%= render MirageWeb.SharedView, "user_menu.html", assigns %>

8
lib/mirage_web/views/layout_view.ex

@ -14,4 +14,12 @@ defmodule MirageWeb.LayoutView do
</svg>
"""
end
def body_class(assigns) do
if assigns.current_user do
"logged-in"
else
"logged-out"
end
end
end

2
mix.exs

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

Loading…
Cancel
Save