Merge pull request #2378 from int2001/streak_banner

Add (current) streak to motivation Banner
This commit is contained in:
Joerg (DJ7NT)
2025-10-04 08:03:24 +02:00
committed by GitHub
2 changed files with 14 additions and 1 deletions

View File

@@ -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);

View File

@@ -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 loose 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 } ?>