| 1 |
<?php |
| 2 |
/** |
| 3 |
* Progress block template |
| 4 |
* |
| 5 |
* @var $attributes - block attributes |
| 6 |
* @var $options - layout options |
| 7 |
* |
| 8 |
* @package Canvas |
| 9 |
*/ |
| 10 |
|
| 11 |
if ( $attributes['striped'] ) { |
| 12 |
$attributes['className'] .= ' cnvs-block-progress-striped'; |
| 13 |
|
| 14 |
if ( isset( $attributes['animated'] ) && $attributes['animated'] ) { |
| 15 |
$attributes['className'] .= ' cnvs-block-progress-animated'; |
| 16 |
} |
| 17 |
} |
| 18 |
|
| 19 |
?> |
| 20 |
|
| 21 |
<div class="<?php echo esc_attr( $attributes['className'] ); ?>" <?php echo ( isset( $attributes['anchor'] ) ? ' id="' . esc_attr( $attributes['anchor'] ) . '"' : '' ); ?>> |
| 22 |
|
| 23 |
<div class="cnvs-block-progress-bar" role="progressbar" aria-valuenow="<?php echo esc_attr( $attributes['width'] ); ?>" aria-valuemin="0" aria-valuemax="<?php echo esc_attr( $attributes['width'] ); ?>"> |
| 24 |
<?php |
| 25 |
if ( $attributes['displayPercent'] ) { |
| 26 |
echo esc_html( $attributes['width'] . '%' ); |
| 27 |
} |
| 28 |
?> |
| 29 |
</div> |
| 30 |
</div> |
| 31 |
|