mirror of
https://github.com/grocy/grocy.git
synced 2025-10-14 17:24:07 +00:00
Reorganize project part 2
This commit is contained in:
47
views/habitsoverview.blade.php
Normal file
47
views/habitsoverview.blade.php
Normal file
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
use Grocy\Services\HabitsService;
|
||||
$habitsService = new HabitsService();
|
||||
?>
|
||||
|
||||
@extends('layout.default')
|
||||
|
||||
@section('content')
|
||||
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
|
||||
|
||||
<h1 class="page-header">Habits overview</h1>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table id="habits-overview-table" class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Habit</th>
|
||||
<th>Next estimated tracking</th>
|
||||
<th>Last tracked</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($currentHabits as $curentHabitEntry) : ?>
|
||||
<tr class="<?php if (FindObjectInArrayByPropertyValue($habits, 'id', $curentHabitEntry->habit_id)->period_type === HabitsService::HABIT_TYPE_DYNAMIC_REGULAR && $habitsService->GetNextHabitTime($curentHabitEntry->habit_id) < date('Y-m-d H:i:s')) echo 'error-bg'; ?>">
|
||||
<td>
|
||||
<?php echo FindObjectInArrayByPropertyValue($habits, 'id', $curentHabitEntry->habit_id)->name; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php if (FindObjectInArrayByPropertyValue($habits, 'id', $curentHabitEntry->habit_id)->period_type === HabitsService::HABIT_TYPE_DYNAMIC_REGULAR): ?>
|
||||
<?php echo $habitsService->GetNextHabitTime($curentHabitEntry->habit_id); ?>
|
||||
<time class="timeago timeago-contextual" datetime="<?php echo $habitsService->GetNextHabitTime($curentHabitEntry->habit_id); ?>"></time>
|
||||
<?php else: ?>
|
||||
...
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $curentHabitEntry->last_tracked_time; ?>
|
||||
<time class="timeago timeago-contextual" datetime="<?php echo $curentHabitEntry->last_tracked_time; ?>"></time>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@stop
|
Reference in New Issue
Block a user