wlanslovenija / PiplMesh

A social info portal for wireless networks.
http://dev.wlan-si.net/wiki/PiplMesh
Other
40 stars 19 forks source link

Issue #160 - Main page panels, rev2 #252

Closed NejcZupec closed 12 years ago

NejcZupec commented 12 years ago

This is a new pull request for main page panels. Panels are now draggable and droppable. Their position and collapsed status is saved in database. Everything is made with ajax. When window size is changed, all panels are reallocated.

mitar commented 12 years ago

Please update with latest from main repository.

mitar commented 12 years ago

Ping.

mitar commented 12 years ago

Tried it out. It is getting better. :-)

I don't like the loading sign when you are resizing the window. This is just ugly. Why would that be useful? I know that I am resizing the window. :-) Just leave it displayed and rewrap the windows as you can, you can do also a very quick animation to move them around, if you want.

Don't tell me that you are doing GET Ajax requests to store state on the server?

Drag and dropping does not always work. Sometimes it simply does not allow dropping on columns.

For collapsing, add some icon on the edge of the title space, not just collapse on every click. Change mouse into dragging when you are over title space.

NejcZupec commented 12 years ago

I'll fix other comments in next days... ;)

mitar commented 12 years ago

Will wait for that. :-)

NejcZupec commented 12 years ago

I've fixed almost everything, except:

1) Hard-coded URLs What is the best way to remove hard-coded URL? Constants defined in settings.py? And how can I get them in JS script?

2) Hiding div panels, while AJAX is moving panels around I'd like to hide div panels, but I don't know how. I've already tried to hide div and then show it back with CSS visibility value. But this is not working, because JavaScript is asynchronous. I've also tried callback functions. How can I fix that?

mitar commented 12 years ago

What is the best way to remove hard-coded URL? Constants defined in settings.py? And how can I get them in JS script?

No, you don't need constants. Django can resolve them for you. You just name them in urls.py and then Django knows how to give you the URL. You then a global JavaScript variable in the template where you store that URL into a variable. The best is to define a dict:

        /* <![CDATA[ */
        var piplMeshAPI = {
            'panels': '{% filter escapejs %}{% url "panels" %}{% endfilter %}'
        };
        /* ]]> */
mitar commented 12 years ago

Hiding div panels, while AJAX is moving panels around

I don't understand this question.

mitar commented 12 years ago

It looks nice. But still I cannot always drag and drop to some columns. If I move away, it sometimes does not allow to move to another column.

mitar commented 12 years ago

More work is needed.

mitar commented 12 years ago

Please tell me when you will fix everything. :-)

NejcZupec commented 12 years ago

Ok. I need a few hours ;) I'll notify you.

NejcZupec commented 12 years ago

Ok, I think, I've fixed almost everything... actually, I hope so :)

mitar commented 12 years ago

Fixed. Why is GET better than POST in this example?

Because it allows you to have the same view both for reading and updating the state. GET for reading, POST for updating.

mitar commented 12 years ago

I will not read and comment until you fix everything what I have already commented. Things are still not good. So, JavaScript style, too much for loops, spaces, how you do HTTP requests, database schema. All needs polishing. Please make a comment when you fix all of those.

mitar commented 12 years ago

Please update from main repository.

mitar commented 12 years ago

Now you will have to update from main repository, because the file is already there. :-)

mitar commented 12 years ago

Please update from main repository.

mitar commented 12 years ago

Please update from main repository.

So, do you want me to pull this in or will you try to remove JSON and change the model? How much in a hurry are you?

mitar commented 12 years ago

So, add TODOs and open tickets for things you will not do and link them here.

mitar commented 12 years ago

You can check 9a689d6e1143a8061a79e305d0fa926caf55eb97 to see how some things could be cleaned.