Open mikeymicrophone opened 5 years ago
A little jQuery is probably the easiest way to implement this, but other technologies could be considered, especially if they provide the opening to start moving this page to a GraphQL submission system.
The page submits multiple clients in parallel using numbered element ids; the same tactic can be used for the additional apartments being added, although doing something different like automatically submitting individual apartments and placing new interface in their place would be another good solution. The small refactor required to start submitting objects individually rather than all together would not require much in the way of engineering.
Let's make this look better.
Here's the apartment portion of the template shown. https://github.com/mikeymicrophone/commissulator/blob/master/app/views/home/registration.html.erb#L56-L83
This is the partial generating the client panes. https://github.com/mikeymicrophone/commissulator/blob/master/app/views/home/_registrant.html.erb
The client panes receive roommate_number
based on how many panes are shown and how many occupants are indicated.
https://github.com/mikeymicrophone/commissulator/blob/master/app/controllers/home_controller.rb#L12
https://github.com/mikeymicrophone/commissulator/blob/master/app/views/home/registrant_add.js.erb
At the end of the registration card, the client fills in what other apartments they've seen. They don't usually write much here, but we want to make it easy and sexy to add more details there at the end of the form. We're going to start with an interface inviting them to add even more apartments than the two they can start with.