OpenTreeMap/OTM2 — pull request #1792 by RickMohr (2014-11-13 18:11:57+00:00)
Title: Merge species

"Merge Required" tab shows controls for resolving diffs and "solving" a merge

* Set up context for merge table (including unique names & ID's for radio buttons)
* Currently showing the merge table below its associated table row; could be changed to a popup.
* When a merge is required, only allow creating a new species if "common name" doesn't match

Bug fixing and refactoring in Species validation, including:
* Filter Species by instance when matching
* Extract function `_prepare_merge_data` and rewrite
* Don't show diffs for a field if the matched Species' value is empty (as it will be for most fields).
* If all diffs are with such empty values, don't require a merge
* Add tests for row status and merge data

Also:
* Fix layout problems in main `imports.html` template
* Rename errors.MERGE_REQ as errors.MERGE_REQUIRED
* Remove errors.TOO_MANY_SPECIES; it's subsumed by errors.MERGE_REQUIRED

Also, remove everything related to USDA code -- because it doesn't match OTM code like we thought.

We thought that OTM codes matched USDA codes except when there's a cultivar. But that's not the case. For example:
Silver maple: OTM code "ACSA1", USDA code "ACSA2"
Sugar maple : OTM code "ACSA2", USDA code "ACSA3"
Willow acacia: OTM code "ACSA3", USDA code "ACSA10"

So matching USDA code introduces false matches (and was a marginal feature to start with) so it's now gone.