Refactor creation of text fields a bit

Details fields are all pretty homogenous, so...may as well do it with a
function!

More to come.

Change-Id: Icd2bdd37da62963b7c42c2f4e885b32123d0a23e
Phabricator: T76388
Merge "Refactor creation of text fields a bit"