show custom notices on the homepage (and consolidate motd)
Created by: sqs
- Adds a new setting property
notices
that contains messages to be shown on the homepage and in the global alerts at the top of the page (likemotd
) - Cleans up CSS to make the display of dismissible and non-dismissible alerts consistent (w.r.t. padding and sizing)
closes https://github.com/sourcegraph/sourcegraph/issues/653
Test plan:
Use the following user settings JSON and ensure that the global alerts and homepage notices are shown correctly, are consistently padded and sized, and are escaped.
{
"notices": [
{"location": "home", "message": "hello, world! **hello**", "dismissible": true},
{"location": "top", "message": "<small>This is a message **at the top**</small>"},
{
"location": "home",
"message": "Suspendisse potenti. Curabitur non sapien porttitor, euismod ligula quis, malesuada neque. Aliquam blandit nunc at quam consectetur dignissim at a dolor. Suspendisse nunc lacus, placerat nec ante non, tempus elementum nulla. Nunc aliquam justo dui, in elementum urna rhoncus non. Sed **egestas** [mattis](https://sourcegraph.com) <div classname='alert alert-danger'>hello</div> erat in congue. Integer quis ex ullamcorper, condimentum libero ut, elementum felis. Sed id sem tristique libero commodo eleifend in sed tellus. Fusce nisl ante, ullamcorper pulvinar accumsan non, vulputate quis nulla."
}
],
"motd": ["Hello, world!"]
}