Add timezone, image description, code cleanup, ... #18
This commit is contained in:
parent
855dac7e1a
commit
7429e12dbe
6 changed files with 40 additions and 46 deletions
|
@ -1,4 +1,4 @@
|
||||||
(defproject yenu "0.1.0-SNAPSHOT"
|
(defproject yenu "1.0.1"
|
||||||
:description "yenu -- The image sharing tool for friends"
|
:description "yenu -- The image sharing tool for friends"
|
||||||
:url "https://yenu.de/"
|
:url "https://yenu.de/"
|
||||||
|
|
||||||
|
|
|
@ -6,25 +6,25 @@
|
||||||
{% if next-image %}
|
{% if next-image %}
|
||||||
<a class="btn btn-secondary" href="/show/{{ next-image.id }}">
|
<a class="btn btn-secondary" href="/show/{{ next-image.id }}">
|
||||||
{% else %}
|
{% else %}
|
||||||
<a class="btn btn-secondary disabled" href="#">
|
<a class="btn btn-secondary disabled" href="#">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<span class="fa fa-arrow-left"></span>
|
<span class="fa fa-arrow-left"></span>
|
||||||
Neuer
|
Neuer
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<a class="btn btn-secondary" href="/">
|
<a class="btn btn-secondary" href="/">
|
||||||
<span class="fa fa-home"></span>
|
<span class="fa fa-home"></span>
|
||||||
Gallerie
|
Gallerie
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
{% if prev-image %}
|
{% if prev-image %}
|
||||||
<a class="btn btn-secondary" href="/show/{{ prev-image.id }}">
|
<a class="btn btn-secondary" href="/show/{{ prev-image.id }}">
|
||||||
{% else %}
|
{% else %}
|
||||||
<a class="btn btn-secondary disabled" href="#">
|
<a class="btn btn-secondary disabled" href="#">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
Älter
|
Älter
|
||||||
<span class="fa fa-arrow-right"></span>
|
<span class="fa fa-arrow-right"></span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="pull-left clearfix">
|
<div class="pull-left clearfix">
|
||||||
|
@ -38,13 +38,11 @@
|
||||||
|
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
|
|
||||||
<hr>
|
<div class="detail-image mb-3">
|
||||||
<div class="detail-image">
|
|
||||||
<a href="/images/raw/{{ image.hash }}">
|
<a href="/images/raw/{{ image.hash }}">
|
||||||
<img class="card-img-top" src="/images/normal/{{ image.hash }}" alt="{{ image.title }}"/>
|
<img class="card-img-top" src="/images/normal/{{ image.hash }}" alt="{{ image.title }}"/>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<hr>
|
|
||||||
{% ifequal identity ":creator" %}
|
{% ifequal identity ":creator" %}
|
||||||
<div class="btn-group pull-right clearfix" role="group">
|
<div class="btn-group pull-right clearfix" role="group">
|
||||||
<a class="btn btn-primary btn-sm" href="/edit/{{ image.id }}">
|
<a class="btn btn-primary btn-sm" href="/edit/{{ image.id }}">
|
||||||
|
@ -58,7 +56,7 @@
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endifequal %}
|
||||||
|
|
||||||
<p>{{ image.created_at|parse-date|date:"dd-MM-yyyy HH:mm" }} Uhr</p>
|
<p>{{ image.created_at|parse-date|date:"dd.MM.yyyy, HH:mm" }} Uhr</p>
|
||||||
{% if image.description|length > 0 %}
|
{% if image.description|length > 0 %}
|
||||||
<div class="col-md7">
|
<div class="col-md7">
|
||||||
<p>{{ image.description|markdown-to-html|safe }}</p>
|
<p>{{ image.description|markdown-to-html|safe }}</p>
|
||||||
|
@ -84,23 +82,23 @@
|
||||||
<form action="/add-comment/{{ image.id }}" method="POST" class="form-horizontal">
|
<form action="/add-comment/{{ image.id }}" method="POST" class="form-horizontal">
|
||||||
{% csrf-field %}
|
{% csrf-field %}
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="author">Name</label>
|
<label for="author">Name</label>
|
||||||
<input type="text" name="author" class="form-control"
|
<input type="text" name="author" class="form-control"
|
||||||
value="{{ saved-author }}"
|
value="{{ saved-author }}"
|
||||||
placeholder="Bitte einen Namen wählen (wird beim nächsten Mal gespeichert)">
|
placeholder="Bitte einen Namen wählen (wird beim nächsten Mal gespeichert)">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="comment">Kommentar</label>
|
<label for="comment">Kommentar</label>
|
||||||
<textarea name="comment" class="form-control" rows="3"
|
<textarea name="comment" class="form-control" rows="3"
|
||||||
placeholder="Es kann auch Markdown-Syntax verwendet werden"></textarea>
|
placeholder="Es kann auch Markdown-Syntax verwendet werden"></textarea>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button type="submit" class="btn btn-success">
|
<button type="submit" class="btn btn-success">
|
||||||
<span class="fa fa-floppy-o"></span>
|
<span class="fa fa-floppy-o"></span>
|
||||||
Kommentar hinzufügen
|
Kommentar hinzufügen
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -1,17 +1,14 @@
|
||||||
{% extends "layout.html" %}
|
{% extends "layout.html" %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
{% safe %}{{ pagination }}{% endsafe %}
|
{% safe %}{{ pagination }}{% endsafe %}
|
||||||
{% safe %}{{ pagination-mobile }}{% endsafe %}
|
{% safe %}{{ pagination-mobile }}{% endsafe %}
|
||||||
|
|
||||||
<div class="clearfix d-flex justify-content-center flex-wrap">
|
<div class="clearfix d-flex justify-content-center flex-wrap">
|
||||||
{% for image in images %}
|
{% for image in images %}
|
||||||
<a href="/show/{{ image.id }}" class="thumbnail-image">
|
<a href="/show/{{ image.id }}" class="thumbnail-image" title="{{ image.title }}">
|
||||||
<img src="/images/thumbnails/{{ image.hash }}" alt="{{ image.title }}">
|
<img src="/images/thumbnails/{{ image.hash }}" alt="{{ image.title }}">
|
||||||
</a>
|
</a>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
<title>yenu -- the image sharing tool for friends</title>
|
<title>yenu -- the image sharing tool for friends</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<nav class="navbar navbar-toggleable-md bg-inverse navbar-inverse">
|
<nav class="navbar navbar-toggleable-md bg-inverse navbar-inverse">
|
||||||
{% if identity %}
|
{% if identity %}
|
||||||
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
|
@ -64,7 +63,7 @@
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-12 text-right mt-4 mb-1">
|
<div class="col-md-12 text-right mt-4 mb-1 text-muted">
|
||||||
<hr>
|
<hr>
|
||||||
<p>© 2013 - {% now yyyy %} Aaron & Beatrice Fischer</p>
|
<p>© 2013 - {% now yyyy %} Aaron & Beatrice Fischer</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
{% extends "layout.html" %}
|
{% extends "layout.html" %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
<div class="container mt-5">
|
<div class="container mt-5">
|
||||||
<div class="row justify-content-md-center">
|
<div class="row justify-content-md-center">
|
||||||
<div class="col-lg-5 col-sm-12">
|
<div class="col-lg-5 col-sm-12">
|
||||||
|
|
|
@ -5,7 +5,8 @@
|
||||||
[ring.util.anti-forgery :refer [anti-forgery-field]]
|
[ring.util.anti-forgery :refer [anti-forgery-field]]
|
||||||
[yenu.helpers.images :as image-helper]
|
[yenu.helpers.images :as image-helper]
|
||||||
[ring.middleware.anti-forgery :refer [*anti-forgery-token*]]
|
[ring.middleware.anti-forgery :refer [*anti-forgery-token*]]
|
||||||
[clj-time.format :as time-format])
|
[clj-time.format :as time-format]
|
||||||
|
[clj-time.core :as time])
|
||||||
(:use [markdown.core]))
|
(:use [markdown.core]))
|
||||||
|
|
||||||
(declare ^:dynamic *identity*)
|
(declare ^:dynamic *identity*)
|
||||||
|
@ -15,7 +16,7 @@
|
||||||
(filter/add-filter! :inc inc)
|
(filter/add-filter! :inc inc)
|
||||||
(filter/add-filter! :dec dec)
|
(filter/add-filter! :dec dec)
|
||||||
(filter/add-filter! :markdown-to-html md-to-html-string)
|
(filter/add-filter! :markdown-to-html md-to-html-string)
|
||||||
(filter/add-filter! :parse-date time-format/parse)
|
(filter/add-filter! :parse-date #(time/to-time-zone (time-format/parse %) (time/default-time-zone)))
|
||||||
|
|
||||||
(defn render
|
(defn render
|
||||||
"renders the HTML template located relative to resources/templates"
|
"renders the HTML template located relative to resources/templates"
|
||||||
|
|
Loading…
Reference in a new issue