extract "new post" socket event-handling code and UI into a view template