cccs-web / core

CCCS' customized django web application
4 stars 11 forks source link

possibility of using 'shorthand' in presentation of IFC theme when assigning sub-theme? #124

Closed cccs-ip closed 10 years ago

cccs-ip commented 10 years ago

When assigning sectors and theme vaues to a project, ror the IFC 'themes' (Performance Standards), our current selection tools spells t out the whole name of the PS prior to the 'sub-theme' name:

e.g. PS1: Assessment and Management of Environmental and Social Risks and Impacts > Community Engagement

...as these names are very long, this makes it impossible to see what sub-theme one is choosing.

Would it be possible for this presentation to show some form of 'shorthand' for the theme (PS) designation to allow us to see the sub-themes?

e.g. PS1 > Community Engagement

Most consultants will be aware of what each PS refers to by the number alone.

pwhipp commented 10 years ago

Yes. Sorry - I should have checked before adding #126. I've closed #126 on the assumption that we'll go for the abbreviation as a solution. I'll add it as a field in the categorisations and auto-populate it using: text before colon if colon present, acronym otherwise. Disambiguation by adding an integer.

The abbreviation will be an editable field so you can tweak the auto additions as necessary.

That should create a reasonable initial value for everything. Then I'll use the abbreviation rather than the full name in the object name making the selectors easier to handle.

pwhipp commented 10 years ago

To clarify abbreviation handling further:

The abbreviations would appear as an additional field on the category forms on the back end.

They would be used in the object name so they will appear in any default filter or selection. They are simply an alternative name (with a character limit of perhaps 8 - up to us).

They would not be used by default in the searches on admin (although this can easily be added).

Thus the abbreviation would immediately be seen in the m2m selection boxes throughout admin and anywhere else in admin where you are seeing the object name (where the "cat/subcat" appears with the slash separating them.

Elsewhere on the front end we would be free to use or ignore the abbreviation as we see fit.

I was not currently thinking of it as something we'd translate or use on the front end but both would always be options.

I was not currently thinking of applying them to the leaf categories although we can do this too if you wish. Thus

Old New
"PS2: Labor and Working Conditions/Child and Forced Labor Assessment" "PS2/Child and Forced Labor Assessment"
"Environment and Natural Resources/Global and Regional Trans-Boundary Environmental Concerns and Issues" "EaNR/Global and Regional Trans-Boundary Environmental Concerns and Issues"
pwhipp commented 10 years ago

I've done a quick and dirty solution to this which seems to work quite well. I've deployed it to production because it is only visible on the back end and is robust.

It is quick because the data model is unchanged - the abbreviation is calculated on the fly. This means you can't change it. It is dirty because there is no uniqueness check. This means that "Foo and Bar" will have the same abbreviation ('FaB') as "For all Boys". In practice I don't think this matters but if it does; this is at least a POC for the abbreviation strategy and I'll re-implement it as an actual data model field.

Close if you are happy with this fix.

cccs-ip commented 10 years ago

I will have a look, but I was most interested in defining a shorthand for the IFC, which is 'theme' with which I was having the most difficulty. I worry that your abbreviations for the other 'theme; fields will be too short for people to readily intuit (including me). I will re-confirm shortly. Thanks for this effort.

cccs-ip commented 10 years ago

Thanks again, Paul. I had a look. The abbreviations for 'themes' and 'subthemes' (excluding IFC) is too short. Please undo it (except for IFC).

It would be cool to have a way of editing abbreviations, where necessary.

pwhipp commented 10 years ago

OK I've left them all in but made the abbreviation a field. It is not translated. They default using my heuristic but can all be edited and set explicitly as necessary using up to eighteen characters as agreed.

I've also added the abbreviation to the admin listing so you have a handy lookup table.

This is done and deployed.

cccs-ip commented 10 years ago

Thanks, this worked very well. Took me over an hour, but I set abbreviations that seem to be working and descriptive. Added time was mostly b/c the system was forcing me to translate all the terms....