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