HTBox / allReady

This repo contains the code for allReady, an open-source solution focused on increasing awareness, efficiency and impact of preparedness campaigns as they are delivered by humanitarian and disaster response organizations in local communities.
http://www.htbox.org/projects/allready
MIT License
891 stars 627 forks source link

Re-use component for editing Locations #2287

Closed morcs closed 6 years ago

morcs commented 6 years ago

In Campaign\Edit.cshtml the location fields are rendered using

@Html.EditorFor(m => m.Location)

In Event\Edit.cshtml the markup is inline. It looks like we could just re-use the EditorFor here. The only differences I can see are:

if (Model.EventType == EventType.Rally) it sets the "Address 1" field to have data-val-required, but I think we might be requiring an address on all events anyway, and using EditorFor will include this.

There's an extra CSS class location-address1 too but searching the code it seems to be unused.

stevejgordon commented 6 years ago

Looks like this can be closed