AgileVentures / osra

Sponsor orphans in Syria & ensure basic life & education requirements for Syrian children
MIT License
20 stars 39 forks source link

OSRA419 sort table headers hq_partners #385

Closed evo2013 closed 9 years ago

evo2013 commented 9 years ago

OSRA-419: 1) Implemented sortable headers . Last column Province is sorting by province_id not province name. Province name does not exist in Partner's model & calling a separate tabel throws error. Your comments? 2) Implemented up/down arrows for sorting but partners view is not picking up assets/images .gif files. Your comments? 3) Working on adding sort tests.

razorcd commented 9 years ago

First look at this PR: https://github.com/AgileVentures/osra/pull/384/files It has the sorting done for the Sponsors table with helper methods that can be used for other Models also. Once this is merged feel free to apply it to Partners.

Sorting on a model relation is done using the joins method: Partner.joins(:province).order("provinces.name desc") But it would be better to use the scope :column_sort and refactor it to also accept relations.

Instead of the up/down arrows, better use the glyphicons from bootstrap. See the sponsors sorting PR, it has 2 css classes that be added to a span element.

evo2013 commented 9 years ago

Cristian, I just checked this email account yesterday and got your message. Thanks for the feedback. I'll follow up on your recommendations and should have a new PR into OSRA by the weekend.