Monorepo for Tangled tangled.org

appview: allow users to set their preferences for the punchcard being displayed #1077

merged opened by willdot.net targeting master from willdot.net/tangled-fork: punchcard-prefs

This allows users to set their preference for the punchcard.

It allows them to either:

1: Hide their punchcard so that no one can see it 2: Hide all punchcards so that they don't see anyones punchcards

Labels

None yet.

assignee

None yet.

Participants 2
AT URI
at://did:plc:dadhhalkfcq3gucaq25hjqon/sh.tangled.repo.pull/3meygakiwru22
+2 -2
Interdiff #2 โ†’ #3
appview/db/db.go

This file has not been changed.

appview/db/preferences.go

This file has not been changed.

appview/db/profile.go

This file has not been changed.

appview/models/preferences.go

This file has not been changed.

appview/pages/pages.go

This file has not been changed.

appview/pages/templates/layouts/profilebase.html

This file has not been changed.

+2 -2
appview/pages/templates/user/settings/profile.html
··· 68 68 <form hx-post="/profile/punchcard" class="col-span-1 md:col-span-1 md:justify-self-end group flex gap-2 items-stretch"> 69 69 <div> 70 70 <input type="checkbox" id="hideMine" name="hideMine" value="on" {{ if eq true $.PunchcardPreference.HideMine }}checked{{ end }}> 71 - <label for="includeBluesky" class="my-0 py-0 normal-case font-normal">Hide mine</label> 71 + <label for="hideMine" class="my-0 py-0 normal-case font-normal">Hide mine</label> 72 72 </div> 73 73 <div> 74 74 <input type="checkbox" id="hideOthers" name="hideOthers" value="on" {{ if eq true $.PunchcardPreference.HideOthers }}checked{{ end }}> 75 - <label for="includeBluesky" class="my-0 py-0 normal-case font-normal">Hide others from me</label> 75 + <label for="hideOthers" class="my-0 py-0 normal-case font-normal">Hide others from me</label> 76 76 </div> 77 77 <button class="btn flex gap-2 items-center" type="submit"> 78 78 {{ i "check" "size-4" }}
appview/settings/settings.go

This file has not been changed.

appview/state/profile.go

This file has not been changed.

appview/state/router.go

This file has not been changed.

History

5 rounds 3 comments
sign up or login to add to the discussion
1 commit
expand
appview: allow users to set their preferences for the punchcard being displayed
expand 1 comment

thanks for the work on this! this looks good to me in the current state.

pull request successfully merged
1 commit
expand
appview: allow users to set their preferences for the punchcard being displayed
expand 0 comments
1 commit
expand
appview: allow users to set their preferences for the punchcard being displayed
expand 0 comments
1 commit
expand
appview: allow users to set their preferences for the punchcard being displayed
expand 0 comments
1 commit
expand
appview: allow users to set their preferences for the punchcard being displayed
expand 2 comments
  • here: there is no bool type in sqlite! so we will have to use ints here. i tested this locally and it seems that is valid sql and executes fine, but it seems any value can be stored in that column.
  • here: nice, this is super neat

all in all, rest of the code lgtm!

Oh wow, TIL that there isn't a bool type in sqlite ๐Ÿซฃ

I've fixed that so that the field is an integer type with a default of 0 (false) and then added the relevant mapping into the query code to map 0 is false and > 0 is true.

Tested by stuffing random integers manually into the table and appears to work as expected.