Closed Bug 412645 Opened 17 years ago Closed 17 years ago

Add weighting to categories (tags) for customizable ordering

Categories

(addons.mozilla.org Graveyard :: Administration, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: morgamic, Assigned: cpollett)

References

Details

Attachments

(1 file)

Need to add a weight column to tags so it can be sorted by weight then name.
Blocks: 396741
Chris, can you pick this up and knock this out?
Assignee: morgamic → cpollett
Maybe you want to do it like Drupal does: They allow values from -10 to 10, smaller values "float", higher "sink" to the bottom. But that's just a suggestion.
I just want an int(11) unsigned that can be anything. Think bugzilla. So could be 1, 20, 2000000, 4, 200 -- main thing is just to sort using that same philosphy. Not sure why we need negative numbers, though, so I'd rather just use arbitrarily large increments of unsigned ints...
The patch I am attaching, adds a column weight to the tags table, it modifies the Amo model getTags method to sort by weight then name. Finally, if one goes to the admin control panel (tools?) --> List Manager -> Categories. Then Edit Categories for one of the Category Types, one sees a new field Category Weight that can be adjusted. It sorts ascending so if you make the weight larger it will tend to appear later in the sort order.
Attachment #307375 - Flags: review?(morgamic)
Just checking to see if the patch seemed okay.
Comment on attachment 307375 [details] [diff] [review] adds weight field, plus adds to admin so can adjust Looks good -- did you remove DOS linebreaks in views/admin/tags_edit.thtml? If so, I'd like you to change only the code in this patch and to a subsequent patch to change the linebreaks (so the revision contains only code changes not style changes).
Attachment #307375 - Flags: review?(morgamic) → review+
It looks like both remora.sql and tags_edit had changed since created patch above. so I svn up'd and merged these and did as asked in #6. When I did I svn diff after doing this only four lines had changed in tags_edit.thtml . The original repository file didn't have any ^M's when I checked, and my patch didn't introduce any, so hopefully all is good.
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: