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

Menu should have option to set order #13

Open
Light-Wizzard opened this issue Oct 1, 2018 · 2 comments
Open

Menu should have option to set order #13

Light-Wizzard opened this issue Oct 1, 2018 · 2 comments

Comments

@Light-Wizzard
Copy link
Contributor

Light-Wizzard commented Oct 1, 2018

Currently when I create a menu; it reorders it, I would like to have my Menu look like this: Home Blog About,
this is not possible the way its written.

It looks like you can order it by moving items around, but on save, the order is lost.

Also I am not sure why, but if I have more then one menu; clicking in the any record name other then the first record, will not open the URL box for that record, instead it toggles if for the first record.

Thanks

@dantti
Copy link
Member

dantti commented Oct 1, 2018

Yeah, sadly that part is a bit broken not well done, if you can provide patches I'm glad to review.

@Light-Wizzard
Copy link
Contributor Author

I got a headache looking at saveMenu in sqlengine.cpp; you use a for loop to iterate through the menus; you are using https://jqueryui.com/sortable/ to Sort the menu items; so it would also have to sorted order; you also have a menu_new; not sure that that is about yet; so unless you know off hand how this JavaScript works; it will take a lot of research to see how to find the order that they are in; that would be the headache you got when you wrote this module; and that means that google effect when you click into that field; is also part of this Sortable mess that is not working; and if upgrading to Bootstrap 4; this will also need to be updated; around this function; so this will take a major amount of research time just to figure out how this all works; its not just the C++ but the JavaScript; so this is not an easy fix; I will look for another way to do this; it would be easier then first trying to figure this out; and my guess from looking at the DOM for a sort order, is that there isn't one; but I will try to determine that before I assume it by the DOM; but when you move them around; I do not see property changes in the actual html controls; I think its only sorting the div they are in; which would make sense; so it looks like you need to figure out how to extract that in JavaScript and update some DOM element you can access from C++; and I have no idea how that works; since I am new to this whole concept you have here; I have worked with Wt; but its a whole different animal; I debugged TreeFrogs major failure that caused all there tools to fail to build; and submitted the fix; all so I could see how they go about doing things; the fact that it was broken so bad no one could use it; I got to thinking no one was; so I decided not to use it; point is I do not mind researching this and trying to fix it; but it looks like it would be easier to rewrite it then to try to figure out how it works; does that make sense to you; is it worth the effort to fix; or better off just rewrite from scratch; because that is what this type of headache is telling me to do; it seems you should be able to do var myOrder = $("#sortableListOrder").sortable("toArray"); and I have no idea how to get that information to C++; if you can read the content of this tag id; you have the sort order; now you need to use that in your for loop to figure out the order it should be in; but there is still that mess in why the input field is not activating a call to the jquery collapse to open up the URL box for that control.

I have not idea what would work better; I have not looked at JavaScript tools like this in years; a quick look did not turn up anything new; but I might have missed something; but I would need to know more about your Code; and from what I see of it; you do not like to use Comments; the code only tells what it does and not what you intended it to do; so comments are helpful; but lacking; making it a lot of guess work, research and testing.

There is so much I do not understand about this project; for one thing; it does not seem to use an ORM; and looks to be hard coded for SQLite; is that correct? If so; why; just a question to try to figure out the Database chose is all; not that I do not mind SQLite; but I normally use Postree in production because under a heavy load it does not fall down; and SQLite does I have seen it; its good for small jobs; but my websites take a lot of hits; one of them has over a 1,000 people a day on it; enough to give SQLite a work out; and I want to use this app on that website; so I would have to see test results for heavy traffic to justify it; but it seems easier to just use an ORM that is out there instead of reinventing the wheel; just an observation since i have not run any test on this CMS; and looked at the performance test; but not a load test; and that is way more important.

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

No branches or pull requests

2 participants