mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Some templates still had this colour hardcoded. They are using angular so I didn't spend time updating them.
34 lines
841 B
CoffeeScript
34 lines
841 B
CoffeeScript
angular.module("admin.utils").factory "StatusMessage", ->
|
|
new class StatusMessage
|
|
types:
|
|
progress: {style: {color: '#ff9906'}}
|
|
alert: {style: {color: 'grey'}}
|
|
notice: {style: {color: 'grey'}}
|
|
success: {style: {color: '#9fc820'}}
|
|
failure: {style: {color: '#C85136'}}
|
|
error: {style: {color: '#C85136'}}
|
|
|
|
statusMessage:
|
|
text: ""
|
|
style: {}
|
|
|
|
invalidMessage: ""
|
|
|
|
setValidation: (isValid) ->
|
|
if isValid
|
|
StatusMessage.invalidMessage = ''
|
|
else
|
|
StatusMessage.invalidMessage = t("admin.form_invalid")
|
|
|
|
active: ->
|
|
@statusMessage.text != ''
|
|
|
|
display: (type, text) ->
|
|
@statusMessage.text = text
|
|
@statusMessage.style = @types[type].style
|
|
null
|
|
|
|
clear: ->
|
|
@statusMessage.text = ''
|
|
@statusMessage.style = {}
|