Search in sources :

Example 6 with ProgressValue

use of org.olat.modules.coach.ui.ProgressValue in project openolat by klemens.

the class ProgressRenderer method getCellValue.

@Override
protected String getCellValue(Object val) {
    StringBuilder sb = new StringBuilder();
    if (val instanceof ProgressValue) {
        ProgressValue progress = (ProgressValue) val;
        int green = Math.round(100.0f * ((float) progress.getGreen() / (float) progress.getTotal()));
        String[] values = new String[] { Integer.toString(progress.getGreen()), Integer.toString(progress.getTotal()) };
        String tooltip = translator.translate("tooltip.of", values);
        sb.append("<div class='progress' title='").append(tooltip).append("'>").append("<div class='progress-bar' role='progressbar' aria-valuenow='").append(progress.getGreen()).append("' aria-valuemin='0' aria-valuemax='").append(progress.getTotal()).append("' style='width: ").append(green).append("%;'/>").append("<span class='sr-only'>").append(green).append("%</span></div></div>");
    /*
			<div class="progress-bar" role="progressbar" aria-valuenow="${used}" aria-valuemin="0" aria-valuemax="100" style="width:${used};">
	    		<span class="sr-only">${used}%</span>
	    	</div>
	    	*/
    }
    return sb.toString();
}
Also used : ProgressValue(org.olat.modules.coach.ui.ProgressValue)

Aggregations

ProgressValue (org.olat.modules.coach.ui.ProgressValue)6 GroupStatEntry (org.olat.modules.coach.model.GroupStatEntry)2 Light (org.olat.modules.coach.ui.LightedValue.Light)2