Display the full url for uploaded files via the CMS_FILES_MODULE.
Keep db/mails in checkout.
This commit is contained in:
1
examples/demo/site/db/mails/README.md
Normal file
1
examples/demo/site/db/mails/README.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
This directory can be used to keep emails sent by the CMS.
|
||||||
@@ -97,7 +97,7 @@ feature -- Access: router
|
|||||||
do
|
do
|
||||||
map_uri_template_agent (a_router, "/" + uploads_location, agent execute_upload (?, ?, a_api), Void) -- Accepts any method GET, HEAD, POST, PUT, DELETE, ...
|
map_uri_template_agent (a_router, "/" + uploads_location, agent execute_upload (?, ?, a_api), Void) -- Accepts any method GET, HEAD, POST, PUT, DELETE, ...
|
||||||
map_uri_template_agent (a_router, "/" + uploads_location + "{filename}", agent display_uploaded_file_info (?, ?, a_api), a_router.methods_get)
|
map_uri_template_agent (a_router, "/" + uploads_location + "{filename}", agent display_uploaded_file_info (?, ?, a_api), a_router.methods_get)
|
||||||
map_uri_template_agent (a_router, "/" + uploads_location + "remove/{filename}", agent remove_file (?, ?, a_api), a_router.methods_get)
|
map_uri_template_agent (a_router, "/" + uploads_location + "{filename}/remove", agent remove_file (?, ?, a_api), a_router.methods_get)
|
||||||
end
|
end
|
||||||
|
|
||||||
uploads_location: STRING = "upload/"
|
uploads_location: STRING = "upload/"
|
||||||
@@ -133,6 +133,7 @@ feature -- Handler
|
|||||||
local
|
local
|
||||||
body: STRING_8
|
body: STRING_8
|
||||||
r: CMS_RESPONSE
|
r: CMS_RESPONSE
|
||||||
|
l_file_url: STRING_8
|
||||||
f: CMS_FILE
|
f: CMS_FILE
|
||||||
md: detachable CMS_FILE_METADATA
|
md: detachable CMS_FILE_METADATA
|
||||||
fn: READABLE_STRING_32
|
fn: READABLE_STRING_32
|
||||||
@@ -193,12 +194,18 @@ feature -- Handler
|
|||||||
else
|
else
|
||||||
body.append ("NA")
|
body.append ("NA")
|
||||||
end
|
end
|
||||||
|
body.append ("<br/>%N")
|
||||||
|
|
||||||
|
--| File Url
|
||||||
|
l_file_url := req.script_url ("/" + l_files_api.file_link (f).location)
|
||||||
|
body.append ("<strong>File URL: </strong>")
|
||||||
|
body.append (l_file_url)
|
||||||
body.append ("<br/><br/>%N")
|
body.append ("<br/><br/>%N")
|
||||||
|
|
||||||
body.append ("<a class=%"button%" href=%"" + req.script_url ("/" + l_files_api.file_link (f).location) + "%">Download</a>%N")
|
body.append ("<a class=%"button%" href=%"" + l_file_url + "%">Download</a>%N")
|
||||||
body.append ("<a class=%"button%" href=%"" + req.script_url ("/" + uploads_location + "remove/" + f.filename) + "%">Remove</a>%N")
|
body.append ("<a class=%"button%" href=%"" + req.script_url ("/" + uploads_location + f.filename + "/remove") + "%">Remove</a>%N")
|
||||||
body.append ("</div>%N") -- metadata
|
body.append ("</div>%N") -- metadata
|
||||||
|
body.append ("<br/>%N")
|
||||||
body.append ("<div class=%"overview%">")
|
body.append ("<div class=%"overview%">")
|
||||||
if
|
if
|
||||||
attached f.relative_path.extension as ext and then
|
attached f.relative_path.extension as ext and then
|
||||||
@@ -425,7 +432,7 @@ feature -- Handler
|
|||||||
|
|
||||||
-- add remove button
|
-- add remove button
|
||||||
a_output.append ("<td>")
|
a_output.append ("<td>")
|
||||||
a_output.append ("<a class=%"button%" href=%"" + req.script_url ("/" + uploads_location + "remove/" + f.filename) + "%">Remove</a>%N")
|
a_output.append ("<a class=%"button%" href=%"" + req.script_url ("/" + uploads_location + f.filename + "/remove") + "%">Remove</a>%N")
|
||||||
a_output.append ("</td>%N")
|
a_output.append ("</td>%N")
|
||||||
|
|
||||||
a_output.append ("</tr>%N")
|
a_output.append ("</tr>%N")
|
||||||
|
|||||||
Reference in New Issue
Block a user