core icon indicating copy to clipboard operation
core copied to clipboard

Drag'n'drop in the back end

Open leofeyer opened this issue 13 years ago • 52 comments

Make trees sortable and update all JavaScript wizards.

Download the attachments Related issues: #2058, #3375

--- Originally created on July 12th, 2009, at 12:49pm (ID 874)

leofeyer avatar Nov 29 '11 16:11 leofeyer

Unfortunately, it seems impossible to accomplish sortable page and file trees. Although there is a script that supports sortable nested lists (=trees), there are a lot of additional things like pagemounts, access permissions and circular references that it does not cover (of course, because they are TYPOlight specific). After two days of trial and error (mainly error), I am finally giving up.

I am going to leave the ticket open in case someone else wants to take care of it.

--- Originally created on October 18th, 2009, at 09:28pm

leofeyer avatar Nov 29 '11 16:11 leofeyer

A MooTools tree script is availble here: http://cpojer.net/page/Scripts

--- Originally created on October 20th, 2009, at 06:45pm

leofeyer avatar Nov 29 '11 16:11 leofeyer

here too : http://mifjs.net/tree/

--- Originally created by cyril on February 6th, 2010, at 10:44pm

ghost avatar Nov 29 '11 16:11 ghost

@andreas.schempp: How do I get your patch to work? It looks promising, but it does not do anything :)

--- Originally created on August 26th, 2011, at 03:55pm

leofeyer avatar Nov 29 '11 16:11 leofeyer

I see, currently only working in Safari/Chrome :)

--- Originally created on August 26th, 2011, at 04:15pm

leofeyer avatar Nov 29 '11 16:11 leofeyer

Andreas, which (version of the) JavaScript have you used? I have compared your changes to http://cpojer.net/MooTools/tree/Demos/, however there are differences. Also, where are Class.Binds and Class.Singleton from?

--- Originally created on October 26th, 2011, at 04:24pm

leofeyer avatar Nov 29 '11 16:11 leofeyer

Class.Binds is from mootools more.

--- Originally created by backbone on October 26th, 2011, at 04:57pm

ghost avatar Nov 29 '11 16:11 ghost

Class.Singleton is from PowerTools, as the tree class is. As far as I can remember, I had to adjust the script to work as required, like preventing first level items to be reordered as subitems.

--- Originally created on October 27th, 2011, at 08:23pm

aschempp avatar Nov 29 '11 16:11 aschempp

Any chance that you can create a patch using the latest version of the tree script? And please provide the copyright notices of any script that you use, otherwise I cannot add it.

--- Originally created on November 8th, 2011, at 07:52pm

leofeyer avatar Nov 29 '11 16:11 leofeyer

I will look into it, but probably not before the Camp...

--- Originally created on November 8th, 2011, at 08:57pm

aschempp avatar Nov 29 '11 16:11 aschempp

Maybe you can assign the ticket to me?

--- Originally created on November 8th, 2011, at 08:57pm

aschempp avatar Nov 29 '11 16:11 aschempp

I just merged the latest tree script, but it is 99% the same. The major changes are from me, I had to adjust it to work with Contao. In Contao backend, the tree is not like the frontend navigation (subitems inside li element), but there is a second li element for subitems. The original script did not support that.

Anyway, are you aware the script is not tested / does not work with Mode 6 (article) trees?

PS: I've also merged Contao 2.11 into the ticket branch, because afaik the feature should become available then.

--- Originally created on November 18th, 2011, at 12:32am

aschempp avatar Nov 29 '11 16:11 aschempp

How about this issue? Any progress or pull requests?

leofeyer avatar Dec 08 '11 18:12 leofeyer

You know there is a branch in the old SVN? It's all in there you should need...?

aschempp avatar Dec 09 '11 08:12 aschempp

I'll look into the whole pull request fun ;-)

aschempp avatar Dec 09 '11 17:12 aschempp

See pull request #3685

aschempp avatar Dec 12 '11 09:12 aschempp

I have added your changes, however it does not work :(

Also, you have messed up the code indentation in the JavaScript file. I had to correct it manually.

Does your code work on your installation?

leofeyer avatar Dec 27 '11 12:12 leofeyer

I'm afraid I have to move this ticket to a later release. It does not work at all in Firefox and only with a single item in Safari. If you want to move a second item, you have to reload the page first.

leofeyer avatar Dec 28 '11 17:12 leofeyer

I agree... I told you it's not done ;-)

aschempp avatar Dec 28 '11 19:12 aschempp

Once it is, it will be cool though ;)

leofeyer avatar Dec 28 '11 19:12 leofeyer

Have you found another idea to realise it?

AgentCT avatar Feb 12 '12 10:02 AgentCT

I am working on a own drag and drop solution for listing tree`s. There are a lot of pitfalls when you working on this features. The feature is part of my "Backend Tools for contao" project and would release anyway as modul. Maybe i could create a pre release only for the drag and drop tree feature?

You can take a look on how it works in this video: http://may17.de/dandd.mp4

may17 avatar Jun 12 '12 12:06 may17

That looks very good. Do you have a version for tests?

AgentCT avatar Jun 18 '12 08:06 AgentCT

that looks really nice. Have you done it for the page-tree, too?

HellPat avatar Jun 18 '12 09:06 HellPat

@psren At the moment the solution works only with tl_article but the page tree would be supported too. It`s a own mootools drag and drop class, specially written for contao so everything could be optimized individual.

@AgentCT I work on a beta solution and hope to release it soon on github.

may17 avatar Jun 18 '12 10:06 may17

Do you want to assign this to me, or @contao/workgroup-core ?

aschempp avatar Jul 28 '12 14:07 aschempp

hi andreas, for sure. I will contact you via skype in the next days to explain the trouble spots.

may17 avatar Jul 28 '12 20:07 may17

may17, May I suggest that the moveable cross icon be removed and the blue arrow be the item that moves the row? After drag cancel the onclick.

Would be cool to have for pages. I had not thought it was this hard to implement into Contao x-browser though!

Ruudt avatar Nov 16 '12 07:11 Ruudt

@may17 Do I remember correctly, that we talked about this issue recently? You told me it would be a lot easier to accomplish if we made some markup changes, but I don't remember if you also told me what changes would have to be made :)

leofeyer avatar Jul 16 '14 13:07 leofeyer

I guess the child list elements should be inside the parent list elements...

aschempp avatar Jul 16 '14 13:07 aschempp