Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to sort folders first #190

Open
mgc8 opened this issue Jan 19, 2024 · 4 comments
Open

Option to sort folders first #190

mgc8 opened this issue Jan 19, 2024 · 4 comments

Comments

@mgc8
Copy link

mgc8 commented Jan 19, 2024

Hi, this is a great tool, simple and to the point, thank you for setting it up!

Would it be possible to add an option to have the folders always at the top when sorting? This should be available for each sorting option -- name, size, date, etc.

Thanks!

@misterunknown
Copy link
Owner

Well, that might be possible. I use an external library for sorting and stuff (DataTables), but didn't find a viable solution yet. Unfortunately, at the moment, my time for this project is quite limited, so I'm not sure when I can get back to that.

@mgc8
Copy link
Author

mgc8 commented Jan 22, 2024

Well, that might be possible. I use an external library for sorting and stuff (DataTables), but didn't find a viable solution yet. Unfortunately, at the moment, my time for this project is quite limited, so I'm not sure when I can get back to that.

That is understandable, of course. I will have a look as well, if I find a solution would you accept a patch/pull-request?

Later edit: I was able to implement this with a custom sort function and a couple small changes to the template (in order to include the "data-type" in other relevant columns as well). It works nicely for all relevant columns -- filename, last-modified, size, owner, group, etc. Let me know if you'd like me to submit that, and what your preferred format would be in that case!

@misterunknown
Copy link
Owner

Great to hear you could implement that. You can file a pull request and I look into it. Unfortunately I don't have reliable frontend tests yet, but if your changes aren't too big, I merge it. Keeping the directories always on top should be optional though, configurable either via the config array or in the frontend or both.

@mgc8
Copy link
Author

mgc8 commented Jan 24, 2024

Great to hear you could implement that. You can file a pull request and I look into it. Unfortunately I don't have reliable frontend tests yet, but if your changes aren't too big, I merge it. Keeping the directories always on top should be optional though, configurable either via the config array or in the frontend or both.

Sure, I can definitely do that. It'll take me a bit longer to get it ready with the options code/etc., but it should be within the coming week or so -- I'll send a pull request then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants