denny / ShinyCMS

ShinyCMS is an open source CMS. This is the Perl version, built with Catalyst and DBIC. (There is also a Ruby on Rails version: www.github.com/denny/ShinyCMS-ruby)
58 stars 24 forks source link

File Manager, Clicking Files Has No Effect #50

Open wbraswell opened 9 years ago

wbraswell commented 9 years ago

When I invoke root/admin/filemanager/view.tt I should be able to click on each file (either image or non-image) and have something happen. According to the code, CKEditor should be launched with some unknown action, which doesn't work.

[% file.filename %]

BECOMES

nmakers_home.tt

Which gives a Javascript syntax error because callFunction has a missing first argument and goes straight to a comma.

If we can't have CKEditor launched for whatever reason, we at least need to make it so that there are valid links to download the files. As it is now, we can only look at a list of files, clicking on the files does nothing!

wbraswell commented 9 years ago

Here's my work-around code from view.tt:

    [%- IF file.image %]
<a href="/static/[% path.join( '/' ) %]/[% file.filename %]"><img src="/static/[% path.join( '/' ) IF path %]/[% file.filename %]" class="filemanager-img" alt="[% file.filename %]" title="Click to select this image"></a>
<br><a href="/static/[% path.join( '/' ) %]/[% file.filename %]">[% file.filename %]</a>
    [%- ELSE %]
<a href="/static/[% path.join( '/' ) %]/[% file.filename %]"><img src="/static/images/icons/file.png" class="filemanager-img" alt="[% file.filename %]" title="Click to select file"></a>
<br><a href="/static/[% path.join( '/' ) %]/[% file.filename %]">[% file.filename %]</a>
    [%- END %]
denny commented 8 years ago

The filepicker window is primarily designed to be launched from CKEditor, rather than vice versa. I thought it might be useful to also make it directly visible in the admin area, but in practice it's mostly just caused confusion. I may remove the link from the admin menus until a better UI can be written...

wbraswell commented 8 years ago

Why can't we just have file download links?