mirror of
https://github.com/journeyman-cc/smeagol.git
synced 2026-04-12 18:05:06 +00:00
Not yet documented.
This commit is contained in:
parent
40f4f13667
commit
ba45ea5163
3 changed files with 24 additions and 20 deletions
|
|
@ -1,14 +1,14 @@
|
|||
{% extends "templates/base.html" %}
|
||||
{% block content %}
|
||||
<div id="content" class="auth">
|
||||
{% if has-uploaded %}
|
||||
{% if uploaded|not-empty %}
|
||||
{% for upload in uploaded %}
|
||||
{{upload.filename}}
|
||||
{% if upload.is-image %)
|
||||
{% if upload.is-image %}
|
||||
<p>
|
||||
<img id="uploaded-image" alt="Uploaded image" src="{{upload.resource}}"/>
|
||||
|
||||
{% i18n file-upload-link-text %}:
|
||||
<!-- TODO: i18n needed -->
|
||||
This is the {{upload.size|name}} file. {% i18n file-upload-link-text %}:
|
||||
|
||||
<code></code>
|
||||
</p>
|
||||
|
|
@ -19,6 +19,8 @@
|
|||
<code>[{{upload.filename}}]({{upload.resource}})</code>
|
||||
</p>
|
||||
{% endif %}
|
||||
<br clear="right"/>
|
||||
<hr/>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<form action="{{servlet-context}}/upload" enctype="multipart/form-data" method="POST">
|
||||
|
|
|
|||
|
|
@ -250,7 +250,6 @@
|
|||
(layout/render "upload.html"
|
||||
(merge (util/standard-params request)
|
||||
{:title (util/get-message :file-upload-title request)
|
||||
:has-uploaded (not (empty? uploaded))
|
||||
:uploaded uploaded}))))
|
||||
|
||||
(defn version-page
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
[me.raynes.fs :as fs]
|
||||
[noir.io :as nio]
|
||||
[smeagol.configuration :refer [config]]
|
||||
[smeagol.util :as util]
|
||||
[taoensso.timbre :as log])
|
||||
(:import [java.io File]
|
||||
[java.awt Image]
|
||||
|
|
@ -117,6 +118,8 @@
|
|||
(try
|
||||
(let [p (io/file path filename)]
|
||||
(.renameTo tmp-file p)
|
||||
(map
|
||||
#(assoc % :resource (subs (:location %) (inc (count util/content-dir))))
|
||||
(remove
|
||||
nil?
|
||||
(cons
|
||||
|
|
@ -124,7 +127,7 @@
|
|||
:filename filename
|
||||
:location (str p)
|
||||
:is-image (and (image? filename) true)}
|
||||
(remove nil? (or (auto-thumbnail path filename) '())))))
|
||||
(remove nil? (or (auto-thumbnail path filename) '()))))))
|
||||
(catch Exception x
|
||||
(log/error (str "Failed to move " tmp-file " to " path filename "; " (type x) ": " (.getMessage x)))
|
||||
(throw x)))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue