2018-08-08 09:31:56 +01:00
|
|
|
@php
|
|
|
|
/*
|
|
|
|
This code is used to determine the responsive classes added to the table cell.
|
|
|
|
The last 3 months are always visible.
|
|
|
|
The last 6 months are visible on md devices
|
|
|
|
The last 12 months are visible on lg+ devices
|
|
|
|
*/
|
|
|
|
$classes[0] = 'd-none d-lg-table-cell';
|
|
|
|
$classes[1] = 'd-none d-lg-table-cell';
|
|
|
|
$classes[2] = 'd-none d-lg-table-cell';
|
|
|
|
$classes[3] = 'd-none d-lg-table-cell';
|
|
|
|
$classes[4] = 'd-none d-lg-table-cell';
|
|
|
|
$classes[5] = 'd-none d-lg-table-cell';
|
|
|
|
$classes[6] = 'd-none d-lg-table-cell';
|
|
|
|
$classes[7] = 'd-none d-md-table-cell';
|
|
|
|
$classes[8] = 'd-none d-md-table-cell';
|
|
|
|
$classes[9] = 'd-none d-md-table-cell';
|
|
|
|
$classes[10] = '';
|
|
|
|
$classes[11] = '';
|
|
|
|
$classes[12] = '';
|
|
|
|
@endphp
|
2018-07-16 06:04:44 +01:00
|
|
|
<table class="table activity-grid">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
2018-08-08 09:31:56 +01:00
|
|
|
<th class="border-spacer-element">
|
|
|
|
{{-- This element is here purely to give the table a th:first-child so it can apply the left border,
|
|
|
|
even if the first child is hidden due to responsiveness --}}
|
|
|
|
</th>
|
2018-08-06 14:02:45 +01:00
|
|
|
@php
|
|
|
|
$i = 0;
|
|
|
|
@endphp
|
2018-07-16 06:04:44 +01:00
|
|
|
@foreach ($activity as $year => $months)
|
|
|
|
@foreach ($months as $month => $dates)
|
2018-08-08 09:31:56 +01:00
|
|
|
<th class="{{ $classes[$i] }}" colspan="{{ ceil($month_days[$year][$month] / 7) }}" style="vertical-align: top;">{{ $month }}@if ($i == 0 || $i == 12 || $month == 'Jan')<br/>{{ $year }}@endif</th>
|
2018-08-06 14:02:45 +01:00
|
|
|
@php
|
|
|
|
$i++
|
|
|
|
@endphp
|
2018-07-16 06:04:44 +01:00
|
|
|
@endforeach
|
|
|
|
@endforeach
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
2018-08-06 14:02:45 +01:00
|
|
|
{{-- Output a table containing columns for days 1-7, 8-14, 15-21, 22-28, 29-31 (if applicable) --}}
|
|
|
|
@for ($row = 0; $row < 7; $row++)
|
2018-07-16 06:04:44 +01:00
|
|
|
<tr>
|
2018-08-08 09:31:56 +01:00
|
|
|
<td class="border-spacer-element">
|
|
|
|
{{-- This element is here purely to give the table a th:first-child so it can apply the left border,
|
|
|
|
even if the first child is hidden due to responsiveness --}}
|
|
|
|
</td>
|
|
|
|
@php
|
|
|
|
$i = 0;
|
|
|
|
@endphp
|
2018-07-16 06:04:44 +01:00
|
|
|
@foreach ($activity as $year => $months)
|
|
|
|
@foreach ($months as $month => $dates)
|
2018-08-06 14:02:45 +01:00
|
|
|
@php
|
|
|
|
$day1 = $row + 1;
|
|
|
|
$day2 = $row + 8;
|
|
|
|
$day3 = $row + 15;
|
|
|
|
$day4 = $row + 22;
|
|
|
|
$day5 = $row + 29;
|
|
|
|
@endphp
|
|
|
|
|
|
|
|
@if (ceil($month_days[$year][$month] / 7) >= 1)
|
|
|
|
@if ($day1 <= $month_days[$year][$month])
|
|
|
|
@if (isset($dates[$day1]) && $dates[$day1] > 0)
|
2018-08-08 09:31:56 +01:00
|
|
|
<td class="has-activity {{ $classes[$i] }}" data-toggle="tooltip" data-placement="top" title="{{ trans_choice('gallery.user_profile.activity_summary', $dates[$day1], ['count' => $dates[$day1], 'date' => sprintf('%d %s %d', $day1, $month, $year)]) }}">
|
2018-08-06 14:02:45 +01:00
|
|
|
</td>
|
|
|
|
@else
|
2018-08-08 09:31:56 +01:00
|
|
|
<td class="no-activity {{ $classes[$i] }}">
|
2018-08-06 14:02:45 +01:00
|
|
|
</td>
|
|
|
|
@endif
|
|
|
|
@else
|
2018-08-08 09:31:56 +01:00
|
|
|
<td class="invalid-date {{ $classes[$i] }}">
|
2018-08-06 14:02:45 +01:00
|
|
|
</td>
|
|
|
|
@endif
|
|
|
|
@endif
|
|
|
|
|
|
|
|
@if (ceil($month_days[$year][$month] / 7) >= 2)
|
|
|
|
@if ($day2 <= $month_days[$year][$month])
|
|
|
|
@if (isset($dates[$day2]) && $dates[$day2] > 0)
|
2018-08-08 09:31:56 +01:00
|
|
|
<td class="has-activity {{ $classes[$i] }}" data-toggle="tooltip" data-placement="top" title="{{ trans_choice('gallery.user_profile.activity_summary', $dates[$day2], ['count' => $dates[$day2], 'date' => sprintf('%d %s %d', $day2, $month, $year)]) }}">
|
2018-08-06 14:02:45 +01:00
|
|
|
</td>
|
|
|
|
@else
|
2018-08-08 09:31:56 +01:00
|
|
|
<td class="no-activity {{ $classes[$i] }}">
|
2018-08-06 14:02:45 +01:00
|
|
|
</td>
|
|
|
|
@endif
|
|
|
|
@else
|
2018-08-08 09:31:56 +01:00
|
|
|
<td class="invalid-date {{ $classes[$i] }}">
|
2018-08-06 14:02:45 +01:00
|
|
|
</td>
|
|
|
|
@endif
|
|
|
|
@endif
|
|
|
|
|
|
|
|
@if (ceil($month_days[$year][$month] / 7) >= 3)
|
|
|
|
@if ($day3 <= $month_days[$year][$month])
|
|
|
|
@if (isset($dates[$day3]) && $dates[$day3] > 0)
|
2018-08-08 09:31:56 +01:00
|
|
|
<td class="has-activity {{ $classes[$i] }}" data-toggle="tooltip" data-placement="top" title="{{ trans_choice('gallery.user_profile.activity_summary', $dates[$day3], ['count' => $dates[$day3], 'date' => sprintf('%d %s %d', $day3, $month, $year)]) }}">
|
2018-08-06 14:02:45 +01:00
|
|
|
</td>
|
|
|
|
@else
|
2018-08-08 09:31:56 +01:00
|
|
|
<td class="no-activity {{ $classes[$i] }}">
|
2018-08-06 14:02:45 +01:00
|
|
|
</td>
|
|
|
|
@endif
|
|
|
|
@else
|
2018-08-08 09:31:56 +01:00
|
|
|
<td class="invalid-date {{ $classes[$i] }}">
|
2018-08-06 14:02:45 +01:00
|
|
|
</td>
|
|
|
|
@endif
|
|
|
|
@endif
|
|
|
|
|
|
|
|
@if (ceil($month_days[$year][$month] / 7) >= 4)
|
|
|
|
@if ($day4 <= $month_days[$year][$month])
|
|
|
|
@if (isset($dates[$day4]) && $dates[$day4] > 0)
|
2018-08-08 09:31:56 +01:00
|
|
|
<td class="has-activity {{ $classes[$i] }}" data-toggle="tooltip" data-placement="top" title="{{ trans_choice('gallery.user_profile.activity_summary', $dates[$day4], ['count' => $dates[$day4], 'date' => sprintf('%d %s %d', $day4, $month, $year)]) }}">
|
2018-08-06 14:02:45 +01:00
|
|
|
</td>
|
|
|
|
@else
|
2018-08-08 09:31:56 +01:00
|
|
|
<td class="no-activity {{ $classes[$i] }}">
|
2018-08-06 14:02:45 +01:00
|
|
|
</td>
|
|
|
|
@endif
|
|
|
|
@else
|
2018-08-08 09:31:56 +01:00
|
|
|
<td class="invalid-date {{ $classes[$i] }}">
|
2018-08-06 14:02:45 +01:00
|
|
|
</td>
|
|
|
|
@endif
|
|
|
|
@endif
|
|
|
|
|
|
|
|
@if (ceil($month_days[$year][$month] / 7) >= 5)
|
|
|
|
@if ($day5 <= $month_days[$year][$month])
|
|
|
|
@if (isset($dates[$day5]) && $dates[$day5] > 0)
|
2018-08-08 09:31:56 +01:00
|
|
|
<td class="has-activity {{ $classes[$i] }}" data-toggle="tooltip" data-placement="top" title="{{ trans_choice('gallery.user_profile.activity_summary', $dates[$day5], ['count' => $dates[$day5], 'date' => sprintf('%d %s %d', $day5, $month, $year)]) }}">
|
2018-08-06 14:02:45 +01:00
|
|
|
</td>
|
|
|
|
@else
|
2018-08-08 09:31:56 +01:00
|
|
|
<td class="no-activity {{ $classes[$i] }}">
|
2018-08-06 14:02:45 +01:00
|
|
|
</td>
|
|
|
|
@endif
|
|
|
|
@else
|
2018-08-08 09:31:56 +01:00
|
|
|
<td class="invalid-date {{ $classes[$i] }}">
|
2018-08-06 14:02:45 +01:00
|
|
|
</td>
|
|
|
|
@endif
|
2018-07-16 06:04:44 +01:00
|
|
|
@endif
|
2018-08-08 09:31:56 +01:00
|
|
|
|
|
|
|
@php
|
|
|
|
$i++
|
|
|
|
@endphp
|
2018-07-16 06:04:44 +01:00
|
|
|
@endforeach
|
|
|
|
@endforeach
|
|
|
|
</tr>
|
|
|
|
@endfor
|
|
|
|
</tbody>
|
|
|
|
</table>
|