gitlabhq/gitlabhq — pull request #5796 by atomaka (2013-12-09 06:15:32+00:00)
Title: WIP: Broadcast Message Customization and Preview

This pull request is a work in progress. It needs to be rebased against master, refactored, and have tests written. However, I wanted to check to see if this sort of customization was something that might be accepted first. If it is, I will complete the necessary work.

The new broadcast message feature implements a color scheme that fits in with the GitLab themes. However, often times it is necessary for alerts to stand out. This PR implements the ability for administrators to customize the colors of their broadcast messages to allow them to determine the importance that a message be noticed. Since customization was added, the ability to preview this message was also implemented.

This was implemented via model and view changes to the new broadcast message feature. Specifically, two new fields were added to the database table for broadcast messages that represent the background and font colors of the message. These fields default to values currently set by GitLab. The administrative view for the broadcast messages was updated to include a link that expands two form fields when clicked and a preview of what the message will look like. JavaScript was added to do some of this. Finally, the broadcast message partial was updated to use the new database fields for the colors. This implementation method would likely change if I completed the functionality (probably in the way uncustomized messages are handled).

The default view of the current broadcast page adds a preview box that updates in real time based on the contents of the form. It also adds a link, "Customize Colors."
![preview](https://f.cloud.github.com/assets/650603/1702518/99813320-6097-11e3-8f7c-710200c8f8d5.png)

When the link is clicked, the form expands to allow the addition of colors.
![customize](https://f.cloud.github.com/assets/650603/1702524/cee2f38c-6097-11e3-9c0b-14ae94782bd2.png)