mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
Add (current) streak to motivation Banner
This commit is contained in:
@@ -91,6 +91,7 @@ class Dashboard extends CI_Controller {
|
||||
|
||||
$this->load->model('cat');
|
||||
$this->load->model('vucc');
|
||||
$this->load->model('dayswithqso_model');
|
||||
|
||||
$data['radio_status'] = $this->cat->recent_status();
|
||||
|
||||
@@ -100,6 +101,13 @@ class Dashboard extends CI_Controller {
|
||||
$data['month_qsos'] = $this->logbook_model->month_qsos($logbooks_locations_array);
|
||||
$data['year_qsos'] = $this->logbook_model->year_qsos($logbooks_locations_array);
|
||||
|
||||
$rawstreak=$this->dayswithqso_model->getAlmostCurrentStreak();
|
||||
if (is_array($rawstreak)) {
|
||||
$data['current_streak']=$rawstreak['highstreak'];
|
||||
} else {
|
||||
$data['current_streak']=0;
|
||||
}
|
||||
|
||||
// Load Countries Breakdown data into array
|
||||
$CountriesBreakdown = $this->logbook_model->total_countries_confirmed($logbooks_locations_array);
|
||||
|
||||
|
||||
@@ -177,7 +177,12 @@ function getDistance($distance) {
|
||||
</div>
|
||||
<?php } else { ?>
|
||||
<div class="alert alert-warning alert-dismissible fade show" role="alert" style="margin-top: 1rem;">
|
||||
<span class="badge text-bg-info"><?= __("Important"); ?></span> <i class="fas fa-broadcast-tower"></i> <?= __("You have made no QSOs today; time to turn on the radio!"); ?>
|
||||
<span class="badge text-bg-info"><?= __("Important"); ?></span> <i class="fas fa-broadcast-tower"></i>
|
||||
<?php if (($current_streak ?? 0)>0) {
|
||||
echo sprintf(__("Don't lose your streak - You have already had at least one QSO for the last %s consecutive days."),$current_streak);
|
||||
} else {
|
||||
echo __("You have made no QSOs today; time to turn on the radio!");
|
||||
} ?>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
Reference in New Issue
Block a user