impresspages / ImpressPages

ImpressPages is php framework with admin panel. Build functional website in one hour.
http://www.impresspages.org
Other
501 stars 178 forks source link

RepositoryFile 'preview' is broken #768

Closed flakerimi closed 8 years ago

flakerimi commented 8 years ago

If I add 'preview' => 'list', on

 array(
    'label' => 'PDF',
    'field' => 'file',
    'type' => 'RepositoryFile',
    'preview' => 'list',
   'path' => 'pdfs'
 ),

it does nothing on Repository Browser, but on File list it shows 'list' word. New feature is cool but has broken old feature as referenced on Docs https://www.impresspages.org/docs/form-object/repositoryfile

array(
        'name' => 'someName',
        'label' => 'Anything you like',
       'type' => 'RepositoryFile',
       'preview' => 'thumbnails', //or list. This defines how files have to be displayed in the repository browser
       )
jankus commented 8 years ago

It depends were are you using this configuration. If you use it on GRID then it's not implemented. "preview" on GRID is reserved for other needs.

flakerimi commented 8 years ago

Ignore this, it need more tests.

flakerimi commented 8 years ago

Repository Browser need and Update. https://github.com/impresspages/ImpressPages/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+repository

maskas commented 8 years ago

I'm a bit lost in this issue. Do yo mean there is a pull request open, that solves some particular issue?

flakerimi commented 8 years ago

Sorry, it was Sunday code, not tested, and for a moment I thought I made smth. :)

I was thinking that Repository need some attention, like how you organize files, since dealing with a lot of files is a bit problem.

Here is a scenario I was dealing:

on Grid there is no option how to open Repository as List, and when I upload PDF they will be displayed as Thumbs, and no filename is displayed, and you are somehow lost, especially when you have a lot of pdfs and images.

I had same problem 2 years ago, but I managed to say to client kind of "Deal with it", and that wasn't great. I tried to made some changes here #409 but folders wasn't maybe great idea.

I would love to help rethink how you organize files in repository, and do something about it, but I am not sure how much I can follow your logic. I tried once, but now I want to be sure that I will help a bit.

I am open for discussion about this, if there is a will.

maskas commented 8 years ago

There is one small thing that could be done easily and could solve 80% of the problem. RepositoryFile (https://www.impresspages.org/docs/form-object/repositoryfile) input field has a 'preview' option that can be set to 'list'. This will force file browser to display files as list instead of thumbnails.

Unfortunately, this option is not implemented in GRID field and not passed along as it conflicts with 'preview' option of grid itself. But this can be solved by naming that option differently. E.g. 'repositoryPreview'. You can add this option in https://github.com/impresspages/ImpressPages/blob/master/Ip/Internal/Grid/Model/Field/RepositoryFile.php in the same way 'fileLimit' option is in place.