Add timezone, image description, code cleanup, ... #18

This commit is contained in:
Aaron Fischer 2017-04-18 23:14:16 +02:00
parent 855dac7e1a
commit 7429e12dbe
6 changed files with 40 additions and 46 deletions

View file

@ -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/"

View file

@ -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>

View file

@ -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 %}

View file

@ -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>

View file

@ -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">

View file

@ -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"