mirror of https://gitlab.com/bashrc2/epicyon
Private calendar events have a different background color
parent
71baee0685
commit
a1af245f2d
|
@ -7,9 +7,11 @@
|
||||||
--time-color: black;
|
--time-color: black;
|
||||||
--place-color: black;
|
--place-color: black;
|
||||||
--event-color: #282c37;
|
--event-color: #282c37;
|
||||||
|
--event-public-color: #282c37;
|
||||||
--today-foreground: white;
|
--today-foreground: white;
|
||||||
--today-circle: red;
|
--today-circle: red;
|
||||||
--event-background: orange;
|
--event-background: orange;
|
||||||
|
--event-background-private: #ddd;
|
||||||
--event-foreground:white;
|
--event-foreground:white;
|
||||||
--title-text: #282c37;
|
--title-text: #282c37;
|
||||||
--title-background: #ccc;
|
--title-background: #ccc;
|
||||||
|
@ -138,6 +140,14 @@ a:focus {
|
||||||
|
|
||||||
.calendar__day__event {
|
.calendar__day__event {
|
||||||
color: var(--event-color);
|
color: var(--event-color);
|
||||||
|
background-color: var(--event-background-private);
|
||||||
|
float: left;
|
||||||
|
font-size: 28px;
|
||||||
|
position: relative;
|
||||||
|
padding: 20px;
|
||||||
|
}
|
||||||
|
.calendar__day__event_public {
|
||||||
|
color: var(--event-public-color);
|
||||||
float: left;
|
float: left;
|
||||||
font-size: 28px;
|
font-size: 28px;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
|
@ -10,6 +10,7 @@ import os
|
||||||
from uuid import UUID
|
from uuid import UUID
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
|
from utils import isPublicPost
|
||||||
from utils import loadJson
|
from utils import loadJson
|
||||||
from utils import saveJson
|
from utils import saveJson
|
||||||
from utils import locatePost
|
from utils import locatePost
|
||||||
|
@ -212,6 +213,8 @@ def getTodaysEvents(baseDir: str, nickname: str, domain: str,
|
||||||
if not _isHappeningPost(postJsonObject):
|
if not _isHappeningPost(postJsonObject):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
publicEvent = isPublicPost(postJsonObject)
|
||||||
|
|
||||||
postEvent = []
|
postEvent = []
|
||||||
dayOfMonth = None
|
dayOfMonth = None
|
||||||
for tag in postJsonObject['object']['tag']:
|
for tag in postJsonObject['object']['tag']:
|
||||||
|
@ -235,6 +238,7 @@ def getTodaysEvents(baseDir: str, nickname: str, domain: str,
|
||||||
tag['postId'] = postId.split('#statuses#')[1]
|
tag['postId'] = postId.split('#statuses#')[1]
|
||||||
tag['sender'] = postId.split('#statuses#')[0]
|
tag['sender'] = postId.split('#statuses#')[0]
|
||||||
tag['sender'] = tag['sender'].replace('#', '/')
|
tag['sender'] = tag['sender'].replace('#', '/')
|
||||||
|
tag['public'] = publicEvent
|
||||||
postEvent.append(tag)
|
postEvent.append(tag)
|
||||||
else:
|
else:
|
||||||
# tag is a place
|
# tag is a place
|
||||||
|
|
|
@ -82,6 +82,7 @@
|
||||||
"place-color": "black",
|
"place-color": "black",
|
||||||
"event-color": "#282c37",
|
"event-color": "#282c37",
|
||||||
"today-foreground": "white",
|
"today-foreground": "white",
|
||||||
|
"event-background-private": "grey",
|
||||||
"event-background": "lightgrey",
|
"event-background": "lightgrey",
|
||||||
"event-foreground": "white",
|
"event-foreground": "white",
|
||||||
"title-text": "white",
|
"title-text": "white",
|
||||||
|
|
|
@ -59,6 +59,7 @@
|
||||||
"today-foreground": "white",
|
"today-foreground": "white",
|
||||||
"today-circle": "red",
|
"today-circle": "red",
|
||||||
"event-background": "lightgreen",
|
"event-background": "lightgreen",
|
||||||
|
"event-background-private": "darkgreen",
|
||||||
"event-foreground": "black",
|
"event-foreground": "black",
|
||||||
"title-text": "black",
|
"title-text": "black",
|
||||||
"title-background": "darkgreen",
|
"title-background": "darkgreen",
|
||||||
|
|
|
@ -64,6 +64,7 @@
|
||||||
"day-number": "#c5d2b9",
|
"day-number": "#c5d2b9",
|
||||||
"day-number2": "#ccc",
|
"day-number2": "#ccc",
|
||||||
"event-background": "#555",
|
"event-background": "#555",
|
||||||
|
"event-background-private": "#999",
|
||||||
"timeline-border-radius": "20px",
|
"timeline-border-radius": "20px",
|
||||||
"image-corners": "8%",
|
"image-corners": "8%",
|
||||||
"quote-right-margin": "0.1em",
|
"quote-right-margin": "0.1em",
|
||||||
|
|
|
@ -67,6 +67,7 @@
|
||||||
"button-selected": "blue",
|
"button-selected": "blue",
|
||||||
"calendar-bg-color": "#0f0d10",
|
"calendar-bg-color": "#0f0d10",
|
||||||
"event-background": "#555",
|
"event-background": "#555",
|
||||||
|
"event-background-private": "#999",
|
||||||
"border-color": "#003366",
|
"border-color": "#003366",
|
||||||
"lines-color": "#ff9900",
|
"lines-color": "#ff9900",
|
||||||
"day-number": "lightblue",
|
"day-number": "lightblue",
|
||||||
|
|
|
@ -133,6 +133,7 @@
|
||||||
"today-foreground": "white",
|
"today-foreground": "white",
|
||||||
"today-circle": "red",
|
"today-circle": "red",
|
||||||
"event-background": "lightblue",
|
"event-background": "lightblue",
|
||||||
|
"event-background-private": "#ccc",
|
||||||
"event-foreground": "white",
|
"event-foreground": "white",
|
||||||
"title-text": "#282c37",
|
"title-text": "#282c37",
|
||||||
"title-background": "#ccc",
|
"title-background": "#ccc",
|
||||||
|
|
|
@ -56,6 +56,7 @@
|
||||||
"today-foreground": "white",
|
"today-foreground": "white",
|
||||||
"today-circle": "red",
|
"today-circle": "red",
|
||||||
"event-background": "yellow",
|
"event-background": "yellow",
|
||||||
|
"event-background-private": "#ccc",
|
||||||
"event-foreground": "white",
|
"event-foreground": "white",
|
||||||
"title-text": "white",
|
"title-text": "white",
|
||||||
"gallery-text-color": "#33390d",
|
"gallery-text-color": "#33390d",
|
||||||
|
|
|
@ -68,6 +68,7 @@
|
||||||
"today-foreground": "white",
|
"today-foreground": "white",
|
||||||
"today-circle": "red",
|
"today-circle": "red",
|
||||||
"event-background": "lightblue",
|
"event-background": "lightblue",
|
||||||
|
"event-background-private": "#ccc",
|
||||||
"event-foreground": "white",
|
"event-foreground": "white",
|
||||||
"title-text": "#282c37",
|
"title-text": "#282c37",
|
||||||
"title-background": "#ccc",
|
"title-background": "#ccc",
|
||||||
|
|
|
@ -61,6 +61,7 @@
|
||||||
"place-color": "#0481f5",
|
"place-color": "#0481f5",
|
||||||
"event-color": "#0481f5",
|
"event-color": "#0481f5",
|
||||||
"event-background": "#00014a",
|
"event-background": "#00014a",
|
||||||
|
"event-background-private": "darkpurple",
|
||||||
"quote-right-margin": "0",
|
"quote-right-margin": "0",
|
||||||
"line-spacing": "180%",
|
"line-spacing": "180%",
|
||||||
"header-font": "'solidaric'",
|
"header-font": "'solidaric'",
|
||||||
|
|
|
@ -63,6 +63,7 @@
|
||||||
"today-foreground": "white",
|
"today-foreground": "white",
|
||||||
"today-circle": "red",
|
"today-circle": "red",
|
||||||
"event-background": "#444",
|
"event-background": "#444",
|
||||||
|
"event-background-private": "#888",
|
||||||
"event-foreground": "white",
|
"event-foreground": "white",
|
||||||
"title-text": "white",
|
"title-text": "white",
|
||||||
"title-background": "#ff42a0",
|
"title-background": "#ff42a0",
|
||||||
|
|
|
@ -87,6 +87,7 @@
|
||||||
"place-color": "#0481f5",
|
"place-color": "#0481f5",
|
||||||
"event-color": "#0481f5",
|
"event-color": "#0481f5",
|
||||||
"event-background": "#00014a",
|
"event-background": "#00014a",
|
||||||
|
"event-background-private": "darkpurple",
|
||||||
"quote-right-margin": "0",
|
"quote-right-margin": "0",
|
||||||
"line-spacing": "180%",
|
"line-spacing": "180%",
|
||||||
"*font-family": "'Montserrat-Regular'",
|
"*font-family": "'Montserrat-Regular'",
|
||||||
|
|
|
@ -77,6 +77,7 @@
|
||||||
"today-foreground": "#eeeeee",
|
"today-foreground": "#eeeeee",
|
||||||
"today-circle": "red",
|
"today-circle": "red",
|
||||||
"event-background": "lightblue",
|
"event-background": "lightblue",
|
||||||
|
"event-background-private": "lightgrey",
|
||||||
"event-foreground": "#eeeeee",
|
"event-foreground": "#eeeeee",
|
||||||
"title-text": "#282c37",
|
"title-text": "#282c37",
|
||||||
"title-background": "#ccc",
|
"title-background": "#ccc",
|
||||||
|
|
|
@ -65,6 +65,7 @@
|
||||||
"day-number": "#ffc4bc",
|
"day-number": "#ffc4bc",
|
||||||
"day-number2": "#aaa",
|
"day-number2": "#aaa",
|
||||||
"event-background": "#12435f",
|
"event-background": "#12435f",
|
||||||
|
"event-background-private": "darkblue",
|
||||||
"timeline-border-radius": "20px",
|
"timeline-border-radius": "20px",
|
||||||
"time-color": "#ffc4bc",
|
"time-color": "#ffc4bc",
|
||||||
"place-color": "#ffc4bc",
|
"place-color": "#ffc4bc",
|
||||||
|
|
|
@ -137,6 +137,7 @@ def _htmlCalendarDay(personCache: {}, cssCache: {}, translate: {},
|
||||||
postId = None
|
postId = None
|
||||||
senderName = ''
|
senderName = ''
|
||||||
senderActor = None
|
senderActor = None
|
||||||
|
eventIsPublic = True
|
||||||
# get the time place and description
|
# get the time place and description
|
||||||
for ev in eventPost:
|
for ev in eventPost:
|
||||||
if ev['type'] == 'Event':
|
if ev['type'] == 'Event':
|
||||||
|
@ -147,6 +148,9 @@ def _htmlCalendarDay(personCache: {}, cssCache: {}, translate: {},
|
||||||
datetime.strptime(ev['startTime'],
|
datetime.strptime(ev['startTime'],
|
||||||
"%Y-%m-%dT%H:%M:%S%z")
|
"%Y-%m-%dT%H:%M:%S%z")
|
||||||
eventTime = eventDate.strftime("%H:%M").strip()
|
eventTime = eventDate.strftime("%H:%M").strip()
|
||||||
|
if 'public' in ev:
|
||||||
|
if ev['public'] is True:
|
||||||
|
eventIsPublic = True
|
||||||
if ev.get('sender'):
|
if ev.get('sender'):
|
||||||
# get display name from sending actor
|
# get display name from sending actor
|
||||||
if ev.get('sender'):
|
if ev.get('sender'):
|
||||||
|
@ -188,33 +192,36 @@ def _htmlCalendarDay(personCache: {}, cssCache: {}, translate: {},
|
||||||
translate['Delete this event'] + '" src="/' + \
|
translate['Delete this event'] + '" src="/' + \
|
||||||
'icons/delete.png" /></a></td>\n'
|
'icons/delete.png" /></a></td>\n'
|
||||||
|
|
||||||
|
eventClass = 'calendar__day__event'
|
||||||
|
if eventIsPublic:
|
||||||
|
eventClass = 'calendar__day__event__public'
|
||||||
if eventTime and eventDescription and eventPlace:
|
if eventTime and eventDescription and eventPlace:
|
||||||
calendarStr += \
|
calendarStr += \
|
||||||
'<tr><td class="calendar__day__time"><b>' + eventTime + \
|
'<tr><td class="calendar__day__time"><b>' + eventTime + \
|
||||||
'</b></td><td class="calendar__day__event">' + \
|
'</b></td><td class="' + eventClass + '">' + \
|
||||||
'<span class="place">' + \
|
'<span class="place">' + \
|
||||||
eventPlace + '</span><br>' + eventDescription + \
|
eventPlace + '</span><br>' + eventDescription + \
|
||||||
'</td>' + deleteButtonStr + '</tr>\n'
|
'</td>' + deleteButtonStr + '</tr>\n'
|
||||||
elif eventTime and eventDescription and not eventPlace:
|
elif eventTime and eventDescription and not eventPlace:
|
||||||
calendarStr += \
|
calendarStr += \
|
||||||
'<tr><td class="calendar__day__time"><b>' + eventTime + \
|
'<tr><td class="calendar__day__time"><b>' + eventTime + \
|
||||||
'</b></td><td class="calendar__day__event">' + \
|
'</b></td><td class="' + eventClass + '">' + \
|
||||||
eventDescription + '</td>' + deleteButtonStr + '</tr>\n'
|
eventDescription + '</td>' + deleteButtonStr + '</tr>\n'
|
||||||
elif not eventTime and eventDescription and not eventPlace:
|
elif not eventTime and eventDescription and not eventPlace:
|
||||||
calendarStr += \
|
calendarStr += \
|
||||||
'<tr><td class="calendar__day__time">' + \
|
'<tr><td class="calendar__day__time">' + \
|
||||||
'</td><td class="calendar__day__event">' + \
|
'</td><td class="' + eventClass + '">' + \
|
||||||
eventDescription + '</td>' + deleteButtonStr + '</tr>\n'
|
eventDescription + '</td>' + deleteButtonStr + '</tr>\n'
|
||||||
elif not eventTime and eventDescription and eventPlace:
|
elif not eventTime and eventDescription and eventPlace:
|
||||||
calendarStr += \
|
calendarStr += \
|
||||||
'<tr><td class="calendar__day__time"></td>' + \
|
'<tr><td class="calendar__day__time"></td>' + \
|
||||||
'<td class="calendar__day__event"><span class="place">' + \
|
'<td class="' + eventClass + '"><span class="place">' + \
|
||||||
eventPlace + '</span><br>' + eventDescription + \
|
eventPlace + '</span><br>' + eventDescription + \
|
||||||
'</td>' + deleteButtonStr + '</tr>\n'
|
'</td>' + deleteButtonStr + '</tr>\n'
|
||||||
elif eventTime and not eventDescription and eventPlace:
|
elif eventTime and not eventDescription and eventPlace:
|
||||||
calendarStr += \
|
calendarStr += \
|
||||||
'<tr><td class="calendar__day__time"><b>' + eventTime + \
|
'<tr><td class="calendar__day__time"><b>' + eventTime + \
|
||||||
'</b></td><td class="calendar__day__event">' + \
|
'</b></td><td class="' + eventClass + '">' + \
|
||||||
'<span class="place">' + \
|
'<span class="place">' + \
|
||||||
eventPlace + '</span></td>' + \
|
eventPlace + '</span></td>' + \
|
||||||
deleteButtonStr + '</tr>\n'
|
deleteButtonStr + '</tr>\n'
|
||||||
|
|
Loading…
Reference in New Issue