You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

75 lines
2.2 KiB

  1. @extends('layouts.map')
  2. @section('content')
  3. @include('partials/logged-in')
  4. <div id="daterange"><div class="in">
  5. <div class="ui form">
  6. <div class="fields">
  7. <div class="five wide field"><input type="text" id="range-from" placeholder="from" value="<?= $range_from ?>"></div>
  8. <div class="five wide field"><input type="text" id="range-to" placeholder="to" value="<?= $range_to ?>"></div>
  9. <div class="five wide field"><input type="text" id="timezone" value="<?= $range_tz ?>"></div>
  10. <button class="ui submit button" id="range-go">Go</button>
  11. </div>
  12. </div>
  13. @if($database->micropub_endpoint)
  14. <div class="ui form hidden" style="margin-top: 4px;" id="trip-create-form">
  15. <div class="fields">
  16. <div style="display: flex; margin-right: 4px;">
  17. <select id="trip-mode">
  18. @foreach(['walk', 'run', 'bicycle', 'scooter', 'car', 'taxi', 'bus', 'train', 'boat', 'plane'] as $mode)
  19. <option value="{{ $mode }}">{{ $mode }}</option>
  20. @endforeach
  21. </select>
  22. </div>
  23. <button class="ui submit button" id="trip-create">Create Trip</button>
  24. </div>
  25. </div>
  26. @endif
  27. </div></div>
  28. <div id="calendar">
  29. <div class="scroll">
  30. <?php
  31. $days = array_fill(1,31,['#']);
  32. try {
  33. $tz = new DateTimeZone($database->timezone);
  34. } catch(Exception $e) {
  35. $tz = new DateTimeZone('UTC');
  36. }
  37. $start = new DateTime($database->created_at);
  38. $end = new DateTime();
  39. $start->setTimeZone($tz);
  40. $end->setTimeZone($tz);
  41. $i = clone $start;
  42. while((int)$i->format('Y') <= (int)$end->format('Y') && (int)$i->format('M') <= (int)$end->format('M')) {
  43. ?>
  44. @include('partials/calendar', [
  45. 'year' => $i->format('Y'),
  46. 'month' => $i->format('m'),
  47. 'days' => $days,
  48. 'day_name_length' => 3,
  49. 'month_href' => null,
  50. 'first_day' => 1,
  51. 'pn' => []
  52. ])
  53. <?php
  54. $i = $i->add(new DateInterval('P1M'));
  55. }
  56. ?>
  57. </div>
  58. </div>
  59. <div id="map"></div>
  60. <div id="graphs">
  61. <input id="is-metric" type="hidden" value="{{ $database->metric }}">
  62. <div id="battery-chart" width="800" height="160"></div>
  63. </div>
  64. <div id="database" data-name="{{ $database->name }}" data-token="{{ $database->read_token }}" data-write-token="{{ $database->write_token }}"></div>
  65. @endsection