| 1 |
<?php |
| 2 |
/** |
| 3 |
* Statify: Widget Frontend View |
| 4 |
* |
| 5 |
* This file contains the viewmodel for the plugin's widget frontend. |
| 6 |
* |
| 7 |
* @package Statify |
| 8 |
*/ |
| 9 |
|
| 10 |
// Exit if accessed directly. |
| 11 |
defined( 'ABSPATH' ) || exit; |
| 12 |
|
| 13 |
$limit = (int) Statify::$options['limit']; |
| 14 |
$show_totals = (int) Statify::$options['show_totals']; |
| 15 |
?> |
| 16 |
|
| 17 |
<div id="statify_chart" class="statify-chart"> |
| 18 |
<span class="spinner is-active" title="<?php esc_html_e( 'loading', 'statify' ); ?>"></span> |
| 19 |
</div> |
| 20 |
|
| 21 |
<?php if ( $limit > 0 ) : ?> |
| 22 |
|
| 23 |
<div class="table referrer"> |
| 24 |
<p class="sub"><?php esc_html_e( 'Top referrers', 'statify' ); ?></p> |
| 25 |
<table> |
| 26 |
<tbody> |
| 27 |
<?php for ( $i = 0; $i < $limit; $i++ ) { ?> |
| 28 |
<tr class="placeholder"> |
| 29 |
<td colspan="2"> </td> |
| 30 |
</tr> |
| 31 |
<?php } ?> |
| 32 |
</tbody> |
| 33 |
</table> |
| 34 |
</div> |
| 35 |
|
| 36 |
<div class="table target"> |
| 37 |
<p class="sub"><?php esc_html_e( 'Top targets', 'statify' ); ?></p> |
| 38 |
<table> |
| 39 |
<tbody> |
| 40 |
<?php for ( $i = 0; $i < $limit; $i++ ) { ?> |
| 41 |
<tr class="placeholder"><td colspan="2"> </td></tr> |
| 42 |
<?php } ?> |
| 43 |
</tbody> |
| 44 |
</table> |
| 45 |
</div> |
| 46 |
|
| 47 |
<?php endif; if ( $show_totals ) : ?> |
| 48 |
<div class="table total"> |
| 49 |
<p class="sub"><?php esc_html_e( 'Totals', 'statify' ); ?></p> |
| 50 |
<table> |
| 51 |
<tbody> |
| 52 |
<tr class="placeholder"><td colspan="2"> </td></tr> |
| 53 |
<tr class="placeholder"><td colspan="2"> </td></tr> |
| 54 |
</table> |
| 55 |
</div> |
| 56 |
<?php endif; ?> |
| 57 |
|