alifeee / simple-calendar

Extremely simple calendar app
0 stars 0 forks source link

add edit page #5

Closed alifeee closed 5 days ago

alifeee commented 1 week ago

it will look like the normal page, but every box will actually be an <input type="text" id="2024-09-01" name="2024-09-01"> and there will be a form submit button at the bottom.

There should be an /edit/alfie and /edit/gary etc., so that you only see one person's worth of events at once. These links can appear at the top by the list of names.

A CGI script (probably with Python) will receive a POST request from the form (via an password-protected nginx block for the path /edit e.g.,) and:

read the current calendar.yaml
make a backup named the current date and put it in some backups folder
for each non-empty date in the received params from the POST request:
  write a line in the YAML like this:
    '2024-09-02: "event for today"'
  attempt a rebuild of the site
  if successul:
    redirect to the main page
  else:
    return error, meta refresh to the main page

4 should be done first

alifeee commented 1 week ago

to rebuild site (with npm, which can be a pain), see:

https://github.com/alifeee/ringram/blob/b4bb9bdf9ad2f4fec1f90b24c357d7d9afcbbbf2/update.sh#L41-L47

alifeee commented 1 week ago

for Python CGI help, see https://github.com/alifeee/occupation-data/blob/main/pie.cgi

alifeee commented 1 week ago

todo:

alifeee commented 5 days ago

done :)

I should probably rename this repository, especially since I hard-coded the "what is this" to be "my social calendar"

maybe later. maybe never.