aptivate / kashana

Aptivate logframe django project
GNU Affero General Public License v3.0
13 stars 15 forks source link

No way to order results in the frontend #59

Open chavu opened 6 years ago

chavu commented 6 years ago

I'm trying to change the order of activities or result area entries but it is not working. I'm doing that in the backend by change the value of the 'Order' field. It would nice if you can provide drag-and-drop visual ordering in the front-end (Dashboard)

martinburchell commented 6 years ago

Thanks for the suggestion

martinburchell commented 5 years ago

It looks like we're not using the Order field as you note

It might be as simple as setting up ordering on the model to use this field. It might have ramifications elsewhere though

class Result(models.Model):
    class Meta:
        ordering = ['order']

This doesn't give you the drag and drop of course

chavu commented 5 years ago

Has this ordering been fixed and checked-in? How do I update my live instance of Kashana?

martinburchell commented 5 years ago

@chavu I haven't made this change because I am not sure if it will break functionality. If you're willing to test this for us I can make the change on a branch.

To update your local instance of Kashana you can do git pull origin master from within the folder where you have Kashana checked out.

If you're using our fabric deployment script to deploy Kashana to a remote server, just rerunning the script should suffice

chavu commented 5 years ago

Yes I'm willing to test the changes.

chavu commented 5 years ago

I made the change below on my kashana instance and its working ok. So I think you can make the change in the main branch.

class Result(models.Model): class Meta: ordering = ['order']

However it's still a pain to manage the ordering manually from the admin page. For example to insert something in the middle of the list I have to manually re-enter the ordering for all entries downwards. Therefore we still need drag and drop. Alternatively in the Admin you can provide a drop-down field to select the entry on which you want the new entry to follow, then the program does the re-numbering.

martinburchell commented 5 years ago

Ordering in the model fixed in https://github.com/aptivate/kashana/pull/75