cccamp23 theme improvements on badges

This commit is contained in:
msquare 2023-07-24 18:49:32 +02:00
parent c2e6dc5223
commit 0a1c85d6bd
4 changed files with 136 additions and 126 deletions

View File

@ -115,27 +115,36 @@ function admin_arrive()
]);
if ($usr->state->arrival_date) {
$day = $usr->state->arrival_date->format(__('Y-m-d'));
$day = $usr->state->arrival_date->format('Y-m-d');
if (!isset($arrival_count_at_day[$day])) {
$arrival_count_at_day[$day] = 0;
$arrival_count_at_day[$day] = [
'day' => $usr->state->arrival_date,
'count' => 0,
];
}
$arrival_count_at_day[$day]++;
$arrival_count_at_day[$day]['count']++;
}
if ($usr->personalData->planned_arrival_date) {
$day = $usr->personalData->planned_arrival_date->format(__('Y-m-d'));
$day = $usr->personalData->planned_arrival_date->format('Y-m-d');
if (!isset($planned_arrival_count_at_day[$day])) {
$planned_arrival_count_at_day[$day] = 0;
$planned_arrival_count_at_day[$day] = [
'day' => $usr->personalData->planned_arrival_date,
'count' => 0,
];
}
$planned_arrival_count_at_day[$day]++;
$planned_arrival_count_at_day[$day]['count']++;
}
if ($usr->personalData->planned_departure_date && $usr->state->arrived) {
$day = $usr->personalData->planned_departure_date->format(__('Y-m-d'));
$day = $usr->personalData->planned_departure_date->format('Y-m-d');
if (!isset($planned_departure_count_at_day[$day])) {
$planned_departure_count_at_day[$day] = 0;
$planned_departure_count_at_day[$day] = [
'day' => $usr->personalData->planned_departure_date,
'count' => 0,
];
}
$planned_departure_count_at_day[$day]++;
$planned_departure_count_at_day[$day]['count']++;
}
$users_matched[] = $usr;
@ -147,33 +156,33 @@ function admin_arrive()
$arrival_at_day = [];
$arrival_sum = 0;
foreach ($arrival_count_at_day as $day => $count) {
$arrival_sum += $count;
foreach ($arrival_count_at_day as $day => $entry) {
$arrival_sum += $entry['count'];
$arrival_at_day[$day] = [
'day' => $day,
'count' => $count,
'day' => $entry['day']->format(__('Y-m-d')),
'count' => $entry['count'],
'sum' => $arrival_sum,
];
}
$planned_arrival_at_day = [];
$planned_arrival_sum = 0;
foreach ($planned_arrival_count_at_day as $day => $count) {
$planned_arrival_sum += $count;
foreach ($planned_arrival_count_at_day as $day => $entry) {
$planned_arrival_sum += $entry['count'];
$planned_arrival_at_day[$day] = [
'day' => $day,
'count' => $count,
'day' => $entry['day']->format(__('Y-m-d')),
'count' => $entry['count'],
'sum' => $planned_arrival_sum,
];
}
$planned_departure_at_day = [];
$planned_departure_sum = 0;
foreach ($planned_departure_count_at_day as $day => $count) {
$planned_departure_sum += $count;
foreach ($planned_departure_count_at_day as $day => $entry) {
$planned_departure_sum += $entry['count'];
$planned_departure_at_day[$day] = [
'day' => $day,
'count' => $count,
'day' => $entry['day']->format(__('Y-m-d')),
'count' => $entry['count'],
'sum' => $planned_departure_sum,
];
}

View File

@ -52,6 +52,8 @@ $input-bg: $gray-darker;
$input-bg-disabled: lighten($gray-lighter, 15%);
$input-group-addon-bg: $gray-lighter;
$form-check-input-border: 1px solid $gray;
//== changed Pagination
$pagination-hover-color: $gray-lighter;
@ -115,6 +117,15 @@ $pagination-disabled-border-color: $gray-dark;
// Specials ===================================================================
.bg-primary,
.bg-success,
.bg-danger,
.bg-warning,
.bg-info,
.bg-light {
color: $gray-darker;
}
.navbar {
background: rgba(0, 0, 0, 0.7);
backdrop-filter: blur(6px);

View File

@ -16,16 +16,6 @@
'dark'
]
%}
{% set types_color=[
['primary', 'light'],
['secondary', 'light'],
['success', 'light'],
['danger', 'light'],
['warning', 'dark'],
['info', 'dark'],
['light', 'dark'],
['dark', 'light'],
] %}
{% set types_buttons=['link']|merge(types) %}
{% set shortsum='Lorem ipsum dolor…' %}
{% set lipsum='Lorem ipsum dolor sit amet, consectetur adipisici elit…' %}
@ -154,8 +144,8 @@
<span id="badges" class="ref-id"></span>
<h3>Badges <a href="#badges" class="ref-link">{{ m.icon('link') }}</a></h3>
<p>
{% for type in types_color %}
<span class="badge bg-{{ type[0] }} text-{{ type[1] }}">{{ type[0]|capitalize }}</span>
{% for type in types %}
<span class="badge bg-{{ type }}">{{ type|capitalize }}</span>
{% endfor %}
</p>
</div>