diff --git a/components/Calendar.vue b/components/Calendar.vue
index 92db6f37..9b56ebe1 100644
--- a/components/Calendar.vue
+++ b/components/Calendar.vue
@@ -15,12 +15,7 @@
- -
-
-
- calendar.events.{{event.name}}
-
-
+
diff --git a/components/CalendarBanner.vue b/components/CalendarBanner.vue
index 8f71d6c6..002df957 100644
--- a/components/CalendarBanner.vue
+++ b/components/CalendarBanner.vue
@@ -5,12 +5,7 @@
calendar.banner:
diff --git a/components/CalendarEvent.vue b/components/CalendarEvent.vue
new file mode 100644
index 00000000..b6709d9c
--- /dev/null
+++ b/components/CalendarEvent.vue
@@ -0,0 +1,19 @@
+
+
+ {{ event.getRange(range) }}
+
+
+ calendar.events.{{event.name}}
+
+
+
+
+
+
diff --git a/components/CalendarMonthEvents.vue b/components/CalendarMonthEvents.vue
new file mode 100644
index 00000000..b8d86ee0
--- /dev/null
+++ b/components/CalendarMonthEvents.vue
@@ -0,0 +1,30 @@
+
+
+
+
+
diff --git a/locale/en/translations.suml b/locale/en/translations.suml
index 7c7e8bd2..ff63190b 100644
--- a/locale/en/translations.suml
+++ b/locale/en/translations.suml
@@ -701,3 +701,7 @@ calendar:
trans_prisoner: '{https://transprisoners.net/about/=Trans Prisoner Day of Action and Solidarity}'
xenogender_day: '{https://nonbinary.wiki/wiki/Xenogender=Xenogender Visibility Day}'
banner: 'We''re celebrating'
+ image:
+ header: 'Download an image'
+ overview: 'Overview'
+ labels: 'Labels'
diff --git a/locale/pl/translations.suml b/locale/pl/translations.suml
index ee938155..a8479393 100644
--- a/locale/pl/translations.suml
+++ b/locale/pl/translations.suml
@@ -1332,3 +1332,7 @@ calendar:
trans_prisoner: '{https://transprisoners.net/about/=Dzień Solidarności z Uwięzionymi Osobami Trans}'
xenogender_day: 'Dzień widoczności {/slowniki/terminologia#ksenopłciowość=Osób Ksenopłciowych}'
banner: 'Obchodzimy właśnie'
+ image:
+ header: 'Ściągnij w formie obrazka'
+ overview: 'Przegląd'
+ labels: 'Etykietki'
diff --git a/routes/calendar.vue b/routes/calendar.vue
index b0552a45..70c7e0cb 100644
--- a/routes/calendar.vue
+++ b/routes/calendar.vue
@@ -16,7 +16,20 @@
+
+
+
@@ -30,12 +43,14 @@
data() {
return {
year: new Date().getFullYear(),
+ imageOverview: `calendar/calendar-${process.env.LOCALE}-overview.png`,
+ imageLabels: `calendar/calendar-${process.env.LOCALE}-labels.png`,
}
},
head() {
return head({
title: this.$t('calendar.headerLong'),
- banner: `calendar/calendar-${process.env.LOCALE}.png`,
+ banner: this.imageOverview,
});
},
};
diff --git a/routes/calendarWide.vue b/routes/calendarWide.vue
index 7a01ea95..9f2aca42 100644
--- a/routes/calendarWide.vue
+++ b/routes/calendarWide.vue
@@ -8,7 +8,7 @@
- title
+ title/{{ config.calendar.route }}
@@ -16,7 +16,8 @@
calendar.months.{{i}}
-
+
+
@@ -30,6 +31,7 @@
data() {
return {
year: new Date().getFullYear(),
+ labels: this.$route.query.labels === 'true',
}
},
head() {
diff --git a/server/calendar.js b/server/calendar.js
index 1982a1ca..a0c1b68a 100644
--- a/server/calendar.js
+++ b/server/calendar.js
@@ -4,15 +4,20 @@ const fs = require('fs');
const Suml = require('suml');
const locale = new Suml().parse(fs.readFileSync(`./data/config.suml`).toString()).locale;
-(async () => {
+const shoot = async (url, filename) => {
const pr = new Pageres({
delay: 3,
+ scale: 2,
});
- pr.src(process.env.BASE_URL + '/calendar-wide', ['1500x300']);
-
+ pr.src(process.env.BASE_URL + url, ['1500x300']);
for (let buffer of await pr.run()) {
- const target = `${__dirname}/../static/calendar/calendar-${locale}.png`;
+ const target = `${__dirname}/../static/calendar/${filename}.png`;
console.log(target);
fs.writeFileSync(target, buffer);
}
+}
+
+(async () => {
+ await shoot('/calendar-wide', `calendar-${locale}-overview`);
+ await shoot('/calendar-wide?labels=true', `calendar-${locale}-labels`);
})();
diff --git a/src/calendar/helpers.js b/src/calendar/helpers.js
index e5abeee0..c06cab2b 100644
--- a/src/calendar/helpers.js
+++ b/src/calendar/helpers.js
@@ -59,6 +59,19 @@ export class Event {
length() {
return [...this.getDays(2021)].length;
}
+
+ getRange(year) {
+ const days = this.getDays(year);
+ if (days.length === 1) {
+ return days[0].day;
+ }
+
+ return `${days[0].day} – ${days[days.length - 1].day}`;
+ }
+
+ isFirstDay(day) {
+ return this.getDays(day.year)[0].equals(day);
+ }
}
export function day (dayOfMonth) {
diff --git a/static/calendar/calendar-pl-labels.png b/static/calendar/calendar-pl-labels.png
new file mode 100644
index 00000000..3b27c82c
Binary files /dev/null and b/static/calendar/calendar-pl-labels.png differ
diff --git a/static/calendar/calendar-pl-overview.png b/static/calendar/calendar-pl-overview.png
new file mode 100644
index 00000000..0a7b218c
Binary files /dev/null and b/static/calendar/calendar-pl-overview.png differ
diff --git a/static/calendar/calendar-pl.png b/static/calendar/calendar-pl.png
deleted file mode 100644
index 09d123ea..00000000
Binary files a/static/calendar/calendar-pl.png and /dev/null differ