Correct misplaced endif in legend Issue #685

Fix for:
https://github.com/geoadmin/mf-geoadmin3/issues/685

Minor change: so should be merged before deploy.