Compare commits

...

4 Commits

  1. 11
      CHANGELOG.md
  2. 8
      assets/css/_phoenix.scss
  3. 26
      assets/css/app.scss
  4. 4
      assets/js/app.js
  5. 10
      assets/js/keyboard-navigation.js
  6. 4
      deploy.sh
  7. 18
      lib/mirage_web/live/page_live.html.leex
  8. 20
      lib/mirage_web/templates/user_session/new.html.eex
  9. 44
      lib/mirage_web/templates/user_settings/edit.html.eex
  10. 2
      mix.exs

11
CHANGELOG.md

@ -5,6 +5,17 @@ See [Conventional Commits](Https://conventionalcommits.org) for commit guideline
<!-- changelog -->
## [v0.9.0](https://git.inhji.de/inhji/mirage/compare/v0.8.0...v0.9.0) (2021-02-06)
### Features:
* add font styles
* remove keyboard navigation again
## [v0.8.0](https://git.inhji.de/inhji/mirage/compare/v0.7.2...v0.8.0) (2021-02-06)

8
assets/css/_phoenix.scss

@ -25,11 +25,7 @@
}
.invalid-feedback {
color: $color-danger;
background: $bg-danger;
display: block;
margin: -1rem 0 2rem;
}
form .alert {
margin-top: -2rem;
margin-bottom: 1rem;
padding: 0.5rem;
}

26
assets/css/app.scss

@ -12,7 +12,7 @@ $font-content: 'Open Sans', Helvetica, sans-serif;
$font-heading: $font-content;
$bg-base: #111;
$bg-content: #333;
$bg-content: #282c34;
$bg-info: #31708f;
$color-info: #d9edf7;
@ -212,6 +212,30 @@ kbd {
border-radius: 3px;
}
/* === Forms === */
form {
margin-bottom: 2rem;
fieldset {
border: 0;
margin-bottom: 1rem;
input[type=text],
input[type=url],
input[type=email],
input[type=password] {
background: $bg-content;
color: white;
padding: 0.5rem;
width: 100%;
border-radius: 0;
border: 0;
}
}
}
/* === Content === */
article {

4
assets/js/app.js

@ -17,7 +17,6 @@ import {Socket} from "phoenix"
import NProgress from "nprogress"
import {LiveSocket} from "phoenix_live_view"
import initEditor from "./editor.js"
import {keyDownHandler} from "./keyboard-navigation.js"
let csrfToken = document.querySelector("meta[name='csrf-token']").getAttribute("content")
let liveSocket = new LiveSocket("/live", Socket, {params: {_csrf_token: csrfToken}})
@ -26,9 +25,6 @@ let liveSocket = new LiveSocket("/live", Socket, {params: {_csrf_token: csrfToke
window.addEventListener("phx:page-loading-start", info => NProgress.start())
window.addEventListener("phx:page-loading-stop", info => NProgress.done())
// Handle Keypresses for navigation
window.addEventListener("keydown", keyDownHandler)
// connect if there are any LiveViews on the page
liveSocket.connect()

10
assets/js/keyboard-navigation.js

@ -1,10 +0,0 @@
export function keyDownHandler(e) {
switch (e.key) {
case "n":
window.location.href = '/notes';
break;
case "h":
window.location.href = '/';
break;
}
}

4
deploy.sh

@ -3,13 +3,13 @@
echo ""
echo "Pushing changes..."
echo "--------------------------"
git push
git push origin main
echo ""
echo "Build starting!"
echo "--------------------------"
ssh -T mirage@inhji.de << EOSSH
cd /opt/mirage
git pull
git pull origin main
./build.sh
EOSSH
echo ""

18
lib/mirage_web/live/page_live.html.leex

@ -30,20 +30,4 @@
</li>
</ul>
</div>
</section>
<section class="width-full bg-content">
<h2>Keyboard Navigation</h2>
<div class="content html">
<p>This page has some keyboard shortcuts to navigate it.</p>
<dl>
<dt><kbd>n</kbd></dt>
<dd>Navigates to notes</dd>
<dt><kbd>h</kbd></dt>
<dd>Navigates to home</dd>
</dl>
</div>
</section>
</section>

20
lib/mirage_web/templates/user_session/new.html.eex

@ -9,14 +9,22 @@
</div>
<% end %>
<%= label f, :email %>
<%= email_input f, :email, required: true %>
<fieldset>
<%= label f, :email %>
<%= email_input f, :email, required: true %>
</fieldset>
<%= label f, :password %>
<%= password_input f, :password, required: true %>
<fieldset>
<%= label f, :password %>
<%= password_input f, :password, required: true %>
</fieldset>
<%= label f, :remember_me, "Keep me logged in for 60 days" %>
<%= checkbox f, :remember_me %>
<fieldset>
<%= label f, :remember_me do %>
<%= checkbox f, :remember_me %>
<span>Keep me logged in for 60 days</span>
<% end %>
</fieldset>
<div>
<%= submit "Log in" %>

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

@ -13,13 +13,17 @@
<%= hidden_input f, :action, name: "action", value: "update_email" %>
<%= label f, :email %>
<%= email_input f, :email, required: true %>
<%= error_tag f, :email %>
<fieldset>
<%= label f, :email %>
<%= email_input f, :email, required: true %>
<%= error_tag f, :email %>
</fieldset>
<%= label f, :current_password, for: "current_password_for_email" %>
<%= password_input f, :current_password, required: true, name: "current_password", id: "current_password_for_email" %>
<%= error_tag f, :current_password %>
<fieldset>
<%= label f, :current_password, for: "current_password_for_email" %>
<%= password_input f, :current_password, required: true, name: "current_password", id: "current_password_for_email" %>
<%= error_tag f, :current_password %>
</fieldset>
<div>
<%= submit "Change email" %>
@ -37,19 +41,25 @@
<%= hidden_input f, :action, name: "action", value: "update_password" %>
<%= label f, :password, "New password" %>
<%= password_input f, :password, required: true %>
<%= error_tag f, :password %>
<fieldset>
<%= label f, :password, "New password" %>
<%= password_input f, :password, required: true %>
<%= error_tag f, :password %>
</fieldset>
<%= label f, :password_confirmation, "Confirm new password" %>
<%= password_input f, :password_confirmation, required: true %>
<%= error_tag f, :password_confirmation %>
<fieldset>
<%= label f, :password_confirmation, "Confirm new password" %>
<%= password_input f, :password_confirmation, required: true %>
<%= error_tag f, :password_confirmation %>
</fieldset>
<%= label f, :current_password, for: "current_password_for_password" %>
<%= password_input f, :current_password, required: true, name: "current_password", id: "current_password_for_password" %>
<%= error_tag f, :current_password %>
<fieldset>
<%= label f, :current_password, for: "current_password_for_password" %>
<%= password_input f, :current_password, required: true, name: "current_password", id: "current_password_for_password" %>
<%= error_tag f, :current_password %>
</fieldset>
<div>
<fieldset>
<%= submit "Change password" %>
</div>
</fieldset>
<% end %>

2
mix.exs

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

Loading…
Cancel
Save