Using templates for note listing (refs #19048)

* adding noteTemplate template for li note element on the edit page
* adding explanation comments to previously commented code