# HG changeset patch # User Michiel Broek # Date 1559230793 -7200 # Node ID 0ec81755396e83eff15998073ed658315234f815 # Parent 2242521067a7a1e26dd4b7960f6137137dfc5108 Improved the progress bars for the fermentables and hops in the editor screens. diff -r 2242521067a7 -r 0ec81755396e README.design --- a/README.design Thu May 30 14:07:50 2019 +0200 +++ b/README.design Thu May 30 17:39:53 2019 +0200 @@ -3,7 +3,6 @@ Main table: products. - In Progress: view logs. Calendar: shows upcoming events. ----------------------------------------------------------------------------- diff -r 2242521067a7 -r 0ec81755396e www/js/prod_edit.js --- a/www/js/prod_edit.js Thu May 30 14:07:50 2019 +0200 +++ b/www/js/prod_edit.js Thu May 30 17:39:53 2019 +0200 @@ -489,8 +489,8 @@ } total_ibus = Math.round(total_ibus * 10) / 10; ferm_ibus = Math.round(ferm_ibus * 10) / 10; - hop_flavour = Math.round(hop_flavour * 100) / 10; - hop_aroma = Math.round(hop_aroma * 100) / 10; + hop_flavour = Math.round(hop_flavour * 1000 / 7.5) / 10; + hop_aroma = Math.round(hop_aroma * 1000 / 9) / 10; if (hop_flavour > 100) hop_flavour = 100; if (hop_aroma > 100) @@ -4344,41 +4344,67 @@ $("#est_og2").jqxNumberInput( Show3dec ); $("#mash_kg").jqxTooltip({ content: 'Het gewicht van alle mouten in de maisch.' }); $("#mash_kg").jqxNumberInput( Show3dec ); - $("#ferm_lintner").jqxTooltip({ content: 'De enzymkracht van alle mouten in de maisch. Moet hoger dan 35 zijn.' }); - $("#ferm_lintner").jqxNumberInput( Show0dec ); $("#perc_malts").jqxProgressBar({ width: 300, height: 23, theme: theme, showText: true, + max: 120, animationDuration: 0, colorRanges: [ { stop: 90, color: '#008C00' }, - { stop: 95, color: '#EB7331' }, - { stop: 100, color: '#FF0000' } - ] + { stop: 100, color: '#EB7331' }, + { stop: 120, color: '#FF0000' } + ], + renderText: function (text) { + return (Math.round(parseInt(text) * 1.2)) + '%'; + } }); $("#perc_sugars").jqxProgressBar({ width: 300, height: 23, theme: theme, showText: true, + max: 50, animationDuration: 0, colorRanges: [ - { stop: 20, color: '#008C00' }, - { stop: 100, color: '#FF0000' } - ] + { stop: 20, color: '#008C00' }, + { stop: 50, color: '#FF0000' } + ], + renderText: function (text) { + return (Math.round(parseInt(text) * 5) / 10) + '%'; + } }); $("#perc_cara").jqxProgressBar({ width: 300, height: 23, theme: theme, showText: true, + max: 50, animationDuration: 0, colorRanges: [ - { stop: 25, color: '#008C00' }, - { stop: 100, color: '#FF0000' } - ] + { stop: 25, color: '#008C00' }, + { stop: 50, color: '#FF0000' } + ], + renderText: function (text) { + return (Math.round(parseInt(text) * 5) / 10) + '%'; + } + }); + $("#ferm_lintner").jqxProgressBar({ + width: 300, + height: 23, + theme: theme, + showText: true, + max: 200, + animationDuration: 0, + colorRanges: [ + { stop: 30, color: '#FF0000' }, + { stop: 40, color: '#EB7331' }, + { stop: 200, color: '#008C00' } + ], + renderText: function (text) { + return (parseInt(text) * 2) + ' lintner'; + } }); $("#popupFermentable").jqxWindow({ width: 800, @@ -4593,7 +4619,20 @@ { stop: 60, color: '#00BF00' }, { stop: 80, color: '#00FF00' }, { stop: 100, color: '#80FF80' } - ] + ], + renderText: function (text) { + var val = parseInt(text); + if (val < 20) + return 'Weinig'; + else if (val < 40) + return 'Matig'; + else if (val < 60) + return 'Redelijk'; + else if (val < 80) + return 'Veel'; + else + return 'Zeer veel'; + } }); $("#hop_aroma").jqxProgressBar({ width: 300, height: 23, theme: theme, showText: true, @@ -4604,7 +4643,20 @@ { stop: 60, color: '#00BF00' }, { stop: 80, color: '#00FF00' }, { stop: 100, color: '#80FF80' } - ] + ], + renderText: function (text) { + var val = parseInt(text); + if (val < 20) + return 'Weinig'; + else if (val < 40) + return 'Matig'; + else if (val < 60) + return 'Redelijk'; + else if (val < 80) + return 'Veel'; + else + return 'Zeer veel'; + } }); $("#popupHop").jqxWindow({ width: 800, diff -r 2242521067a7 -r 0ec81755396e www/js/rec_edit.js --- a/www/js/rec_edit.js Thu May 30 14:07:50 2019 +0200 +++ b/www/js/rec_edit.js Thu May 30 17:39:53 2019 +0200 @@ -362,8 +362,8 @@ row.h_useat, parseFloat(row.h_amount)); } total_ibus = Math.round(total_ibus * 10) / 10; - hop_flavour = Math.round(hop_flavour * 100) / 10; - hop_aroma = Math.round(hop_aroma * 100) / 10; + hop_flavour = Math.round(hop_flavour * 1000 / 7.5) / 10; + hop_aroma = Math.round(hop_aroma * 1000 / 9) / 10; if (hop_flavour > 100) hop_flavour = 100; if (hop_aroma > 100) @@ -2813,42 +2813,68 @@ $("#est_color2").jqxNumberInput( Show0dec ); $("#est_og2").jqxTooltip({ content: 'Het begin SG wat je wilt bereiken. De moutstort wordt automatisch herberekend.' }); $("#est_og2").jqxNumberInput( Show3dec ); - $("#ferm_lintner").jqxTooltip({ content: 'De enzymkracht van alle mouten in de maisch. Moet hoger dan 35 zijn.' }); - $("#ferm_lintner").jqxNumberInput( Show0dec ); $("#perc_malts").jqxProgressBar({ width: 300, height: 23, theme: theme, showText: true, + max: 120, animationDuration: 0, colorRanges: [ { stop: 90, color: '#008C00' }, - { stop: 95, color: '#EB7331' }, - { stop: 100, color: '#FF0000' } - ] + { stop: 100, color: '#EB7331' }, + { stop: 120, color: '#FF0000' } + ], + renderText: function (text) { + return (Math.round(parseInt(text) * 1.2)) + '%'; + } }); $("#perc_sugars").jqxProgressBar({ width: 300, height: 23, theme: theme, showText: true, + max: 50, animationDuration: 0, colorRanges: [ - { stop: 20, color: '#008C00' }, - { stop: 100, color: '#FF0000' } - ] + { stop: 20, color: '#008C00' }, + { stop: 50, color: '#FF0000' } + ], + renderText: function (text) { + return (Math.round(parseInt(text) * 5) / 10) + '%'; + } }); $("#perc_cara").jqxProgressBar({ width: 300, height: 23, theme: theme, showText: true, + max: 50, animationDuration: 0, colorRanges: [ - { stop: 25, color: '#008C00' }, - { stop: 100, color: '#FF0000' } - ] + { stop: 25, color: '#008C00' }, + { stop: 50, color: '#FF0000' } + ], + renderText: function (text) { + return (Math.round(parseInt(text) * 5) / 10) + '%'; + } }); + $("#ferm_lintner").jqxProgressBar({ + width: 300, + height: 23, + theme: theme, + showText: true, + max: 200, + animationDuration: 0, + colorRanges: [ + { stop: 30, color: '#FF0000' }, + { stop: 40, color: '#EB7331' }, + { stop: 200, color: '#008C00' } + ], + renderText: function (text) { + return (parseInt(text) * 2) + ' lintner'; + } + }); $("#popupFermentable").jqxWindow({ width: 800, height: 300, @@ -3060,7 +3086,20 @@ { stop: 60, color: '#00BF00' }, { stop: 80, color: '#00FF00' }, { stop: 100, color: '#80FF80' } - ] + ], + renderText: function (text) { + var val = parseInt(text); + if (val < 20) + return 'Weinig'; + else if (val < 40) + return 'Matig'; + else if (val < 60) + return 'Redelijk'; + else if (val < 80) + return 'Veel'; + else + return 'Zeer veel'; + } }); $("#hop_aroma").jqxProgressBar({ width: 300, @@ -3074,7 +3113,20 @@ { stop: 60, color: '#00BF00' }, { stop: 80, color: '#00FF00' }, { stop: 100, color: '#80FF80' } - ] + ], + renderText: function (text) { + var val = parseInt(text); + if (val < 20) + return 'Weinig'; + else if (val < 40) + return 'Matig'; + else if (val < 60) + return 'Redelijk'; + else if (val < 80) + return 'Veel'; + else + return 'Zeer veel'; + } }); $("#popupHop").jqxWindow({ width: 800,