Fix trips

This commit is contained in:
2023-05-09 22:12:26 +10:00
parent 0b427934fc
commit 76e9e06e86
4 changed files with 195 additions and 53 deletions

View File

@@ -29,12 +29,13 @@ article class="h-entry"
- if post.location
img class="shadow-solid shadow-pink-100 dark:shadow-pink-200 rounded mb-4" src=post.large_map
div class="max-w-prose mx-auto text-gray-600 dark:text-gray-200 flex gap-4"
div class="block grow bg-orange-100 dark:bg-orange-600 rounded px-4 py-2 mb-12"
a href="/trips/#{trip.id}"
= "✈️ Part of the trip: "
strong #{trip.name}
| →
- if trip
div class="max-w-prose mx-auto text-gray-600 dark:text-gray-200 flex gap-4"
div class="block grow bg-orange-100 dark:bg-orange-600 rounded px-4 py-2 mb-12"
a href="/trips/#{trip.id}"
= "✈️ Part of the trip: "
strong #{trip.name}
| →
- if post.tags.map(&:label).include? "weekly"
div class="max-w-prose mx-auto text-gray-600 dark:text-gray-200 flex gap-4"
div class="grow" hx-get="/post/top_tracks/#{post.slug}" hx-trigger="load"

View File

@@ -1036,10 +1036,6 @@ video {
margin-bottom: 2rem;
}
.ml-\[7\] {
margin-left: 7;
}
.mr-1 {
margin-right: 0.25rem;
}
@@ -1064,10 +1060,6 @@ video {
margin-top: 0.125rem;
}
.mt-2 {
margin-top: 0.5rem;
}
.mt-4 {
margin-top: 1rem;
}
@@ -1076,6 +1068,82 @@ video {
margin-top: 1.5rem;
}
.mt-2 {
margin-top: 0.5rem;
}
.ml-4 {
margin-left: 1rem;
}
.ml-8 {
margin-left: 2rem;
}
.ml-2 {
margin-left: 0.5rem;
}
.ml-1 {
margin-left: 0.25rem;
}
.mb-1 {
margin-bottom: 0.25rem;
}
.ml-3 {
margin-left: 0.75rem;
}
.ml-1\.5 {
margin-left: 0.375rem;
}
.ml-2\.5 {
margin-left: 0.625rem;
}
.ml-\[2\.15\] {
margin-left: 2.15;
}
.ml-\[2\.25\] {
margin-left: 2.25;
}
.ml-\[2\.5\] {
margin-left: 2.5;
}
.ml-\[3\.5\] {
margin-left: 3.5;
}
.ml-\[4\.5\] {
margin-left: 4.5;
}
.ml-\[6\.5\] {
margin-left: 6.5;
}
.ml-\[6\] {
margin-left: 6;
}
.ml-\[6\.25\] {
margin-left: 6.25;
}
.ml-\[6\.75\] {
margin-left: 6.75;
}
.ml-\[7\] {
margin-left: 7;
}
.block {
display: block;
}
@@ -1108,14 +1176,6 @@ video {
height: 4rem;
}
.h-2 {
height: 0.5rem;
}
.h-4 {
height: 1rem;
}
.h-44 {
height: 11rem;
}
@@ -1124,12 +1184,20 @@ video {
height: 12rem;
}
.max-h-12 {
max-height: 3rem;
.h-2 {
height: 0.5rem;
}
.w-1 {
width: 0.25rem;
.h-4 {
height: 1rem;
}
.h-1 {
height: 0.25rem;
}
.max-h-12 {
max-height: 3rem;
}
.w-16 {
@@ -1160,6 +1228,14 @@ video {
width: 1.5rem;
}
.w-3 {
width: 0.75rem;
}
.w-1 {
width: 0.25rem;
}
.max-w-prose {
max-width: 65ch;
}
@@ -1279,12 +1355,16 @@ video {
border-bottom-width: 2px;
}
.border-t-4 {
border-top-width: 4px;
}
.border-l-2 {
border-left-width: 2px;
}
.border-t-4 {
border-top-width: 4px;
.border-l-4 {
border-left-width: 4px;
}
.border-solid {
@@ -1306,15 +1386,20 @@ video {
border-color: rgb(217 249 157 / var(--tw-border-opacity));
}
.border-transparent {
border-color: transparent;
}
.border-blue-100 {
--tw-border-opacity: 1;
border-color: rgb(219 234 254 / var(--tw-border-opacity));
}
.border-orange-100 {
--tw-border-opacity: 1;
border-color: rgb(255 237 213 / var(--tw-border-opacity));
}
.border-transparent {
border-color: transparent;
}
.bg-blue-100 {
--tw-bg-opacity: 1;
background-color: rgb(219 234 254 / var(--tw-bg-opacity));
@@ -1345,11 +1430,6 @@ video {
background-color: rgb(190 242 100 / var(--tw-bg-opacity));
}
.bg-orange-100 {
--tw-bg-opacity: 1;
background-color: rgb(255 237 213 / var(--tw-bg-opacity));
}
.bg-pink-100 {
--tw-bg-opacity: 1;
background-color: rgb(252 231 243 / var(--tw-bg-opacity));
@@ -1364,6 +1444,16 @@ video {
background-color: rgb(254 249 195 / 0.6);
}
.bg-green-100 {
--tw-bg-opacity: 1;
background-color: rgb(220 252 231 / var(--tw-bg-opacity));
}
.bg-orange-100 {
--tw-bg-opacity: 1;
background-color: rgb(255 237 213 / var(--tw-bg-opacity));
}
.fill-blue-100 {
fill: #dbeafe;
}
@@ -1389,6 +1479,26 @@ video {
padding: 0.5rem;
}
.p-4 {
padding: 1rem;
}
.p-\[1\.5\] {
padding: 1.5;
}
.p-\[2\.5\] {
padding: 2.5;
}
.p-\[3\.5\] {
padding: 3.5;
}
.p-\[6\.5\] {
padding: 6.5;
}
.px-1 {
padding-left: 0.25rem;
padding-right: 0.25rem;
@@ -1417,12 +1527,20 @@ video {
padding-bottom: 2rem;
}
.pt-4 {
padding-top: 1rem;
}
.pl-8 {
padding-left: 2rem;
}
.pl-6 {
padding-left: 1.5rem;
}
.pt-4 {
padding-top: 1rem;
.pl-4 {
padding-left: 1rem;
}
.text-left {
@@ -1461,6 +1579,10 @@ video {
font-size: 0.75rem;
}
.text-2xl {
font-size: 1.563rem;
}
.font-bold {
font-weight: 700;
}
@@ -1684,6 +1806,11 @@ h1, h2, h3, h4, h5, h6, h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
border-color: rgb(30 64 175 / var(--tw-border-opacity));
}
.hover\:border-orange-600:hover {
--tw-border-opacity: 1;
border-color: rgb(234 88 12 / var(--tw-border-opacity));
}
.hover\:bg-blue-100:hover {
--tw-bg-opacity: 1;
background-color: rgb(219 234 254 / var(--tw-bg-opacity));
@@ -1865,6 +1992,11 @@ h1, h2, h3, h4, h5, h6, h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
border-color: rgb(75 85 99 / var(--tw-border-opacity));
}
.dark\:border-orange-600 {
--tw-border-opacity: 1;
border-color: rgb(234 88 12 / var(--tw-border-opacity));
}
.dark\:border-orange-400 {
--tw-border-opacity: 1;
border-color: rgb(251 146 60 / var(--tw-border-opacity));
@@ -1899,16 +2031,6 @@ h1, h2, h3, h4, h5, h6, h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
background-color: rgb(112 26 117 / var(--tw-bg-opacity));
}
.dark\:bg-orange-400 {
--tw-bg-opacity: 1;
background-color: rgb(251 146 60 / var(--tw-bg-opacity));
}
.dark\:bg-orange-600 {
--tw-bg-opacity: 1;
background-color: rgb(234 88 12 / var(--tw-bg-opacity));
}
.dark\:bg-pink-600 {
--tw-bg-opacity: 1;
background-color: rgb(219 39 119 / var(--tw-bg-opacity));
@@ -1919,6 +2041,21 @@ h1, h2, h3, h4, h5, h6, h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
background-color: rgb(250 204 21 / var(--tw-bg-opacity));
}
.dark\:bg-green-600 {
--tw-bg-opacity: 1;
background-color: rgb(22 163 74 / var(--tw-bg-opacity));
}
.dark\:bg-orange-600 {
--tw-bg-opacity: 1;
background-color: rgb(234 88 12 / var(--tw-bg-opacity));
}
.dark\:bg-orange-400 {
--tw-bg-opacity: 1;
background-color: rgb(251 146 60 / var(--tw-bg-opacity));
}
.dark\:text-blue-200 {
--tw-text-opacity: 1;
color: rgb(191 219 254 / var(--tw-text-opacity));

View File

@@ -7,10 +7,9 @@
document.addEventListener("DOMContentLoaded", function () {
const times = document.querySelectorAll('time');
times.forEach((time) => {
const oldDtime = Date.parse(time.dateTime);
time.innerHTML = new Date(oldDtime).toLocaleDateString(navigator.language, { weekday:"long", year:"numeric", month:"short", day:"numeric"});
});
const oldDtime = Date.parse(time.dateTime);
time.innerHTML = new Date(oldDtime).toLocaleDateString(navigator.language, { weekday:"long", year:"numeric", month:"short", day:"numeric"});
});
// mapboxgl.accessToken = 'pk.eyJ1IjoiZG5pdHphIiwiYSI6ImNsZWIyY3ZzaTE0cjUzdm4xdnZ6czRlYjUifQ.FRETOXYRID6T2IoB7qqRLg';
// var map = new mapboxgl.Map({
// container: 'map',

View File

@@ -1,3 +1,5 @@
require "time_math"
module Admin
module Repos
class PostRepo < Adamantium::Repo[:posts]
@@ -48,8 +50,11 @@ module Admin
end
def created_between(start_date, end_date)
end_date = TimeMath.month.advance(end_date, +2)
posts
.combine(:trips)
.where(post_type: %w[post check-in])
.published_between(start_date, end_date)
end
end