clarion/app/assets/javascripts/management/conferences.js.coffee

21 lines
902 B
CoffeeScript
Raw Normal View History

2016-10-13 08:59:22 +03:00
conflictsScale=chroma.scale(['#469408', '#D9230F']).mode('lab');
2014-10-15 12:58:00 +03:00
$ ->
$('.cfp-toggle').click ->
$(this).addClass("disabled")
2016-10-13 08:59:22 +03:00
if $('#submissions-chart').length > 0
Morris.Line
element: 'submissions-chart'
data: $('#submissions-chart').data('submissions')
xkey: 'created_at'
ykeys: ['all_submissions', 'all_confirmations']
labels: ['Submissions', 'Confirmed submissions']
lineColors: ['#D9230F', '#469408']
resize: true
$('[data-conflicts]').each (e) ->
most_conflicts = parseInt($(this).data('most-conflicts'))
conflicts = parseInt($(this).data('conflicts'))
least_conflicts = parseInt($(this).data('least-conflicts'))
console.log 1.0 * (conflicts - least_conflicts) / (most_conflicts - least_conflicts)
$(this).css('background-color', conflictsScale(1.0 * (conflicts - least_conflicts) / (most_conflicts - least_conflicts)))