Monorepo for Tangled tangled.org

tweak styles a bit

Changed files
+18 -19
appview
db
pages
templates
state
+1 -1
appview/db/repos.go
··· 150 func CollaboratingIn(e Execer, collaborator string) ([]Repo, error) { 151 var repos []Repo 152 153 - rows, err := e.Query(`select r.did, r.name, r.knot, r.rkey, r.created from repos r join collaborators c on r.id = c.repo where c.did = ?;`, collaborator) 154 if err != nil { 155 return nil, err 156 }
··· 150 func CollaboratingIn(e Execer, collaborator string) ([]Repo, error) { 151 var repos []Repo 152 153 + rows, err := e.Query(`select r.did, r.name, r.knot, r.rkey, r.description, r.created from repos r join collaborators c on r.id = c.repo where c.did = ?;`, collaborator) 154 if err != nil { 155 return nil, err 156 }
+1 -1
appview/pages/templates/fragments/repoDescription.html
··· 7 {{ end }} 8 9 {{ if .RepoInfo.Roles.IsOwner }} 10 - <button class="bg-gray-100 rounded p-1 mr-1 hover:bg-gray-200 font-mono text-sm" hx-get="/{{ .RepoInfo.FullName }}/description/edit"> 11 edit 12 </button> 13 {{ end }}
··· 7 {{ end }} 8 9 {{ if .RepoInfo.Roles.IsOwner }} 10 + <button class="bg-gray-200 uppercase rounded p-1 ml-1 hover:bg-gray-400 font-mono text-sm" hx-get="/{{ .RepoInfo.FullName }}/description/edit"> 11 edit 12 </button> 13 {{ end }}
+1 -1
appview/pages/templates/repo/index.html
··· 179 <div 180 class="inline-block px-1 select-none after:content-['·']" 181 ></div> 182 - <span class="text-xs rounded-full bg-gray-700 text-white px-2 mx-1/2 inline-flex items-center"> 183 {{ . }} 184 </span> 185 {{ end }}
··· 179 <div 180 class="inline-block px-1 select-none after:content-['·']" 181 ></div> 182 + <span class="text-xs rounded bg-gray-100 font-mono px-2 mx-1/2 inline-flex items-center"> 183 {{ . }} 184 </span> 185 {{ end }}
+14 -10
appview/pages/templates/user/profile.html
··· 48 >{{ .Name }}</a 49 > 50 </div> 51 - <div 52 - id="repo-knot-name" 53 - class="text-gray-600 text-sm font-mono" 54 - > 55 - {{ .Knot }} 56 - </div> 57 </div> 58 {{ else }} 59 <p class="px-6">This user does not have any repos yet.</p> ··· 74 {{ index $.DidHandleMap .Did }}/{{ .Name }} 75 </a> 76 </div> 77 - <div 78 - id="repo-knot-name" 79 - class="text-gray-600 text-sm font-mono" 80 - > 81 {{ .Knot }} 82 </div> 83 </div>
··· 48 >{{ .Name }}</a 49 > 50 </div> 51 + {{ if .Description }} 52 + <div class="text-gray-600 text-sm"> 53 + {{ .Description }} 54 + </div> 55 + {{ end }} 56 + <div class="text-gray-600 text-sm font-mono"> 57 + {{ .Knot }} 58 + </div> 59 </div> 60 {{ else }} 61 <p class="px-6">This user does not have any repos yet.</p> ··· 76 {{ index $.DidHandleMap .Did }}/{{ .Name }} 77 </a> 78 </div> 79 + {{ if .Description }} 80 + <div class="text-gray-600 text-sm"> 81 + {{ .Description }} 82 + </div> 83 + {{ end }} 84 + <div class="text-gray-600 text-sm font-mono"> 85 {{ .Knot }} 86 </div> 87 </div>
-2
appview/state/repo.go
··· 75 } 76 77 user := s.auth.GetUser(r) 78 - 79 s.pages.RepoIndexPage(w, pages.RepoIndexParams{ 80 LoggedInUser: user, 81 RepoInfo: f.RepoInfo(s, user), ··· 1067 func rolesInRepo(s *State, u *auth.User, f *FullyResolvedRepo) pages.RolesInRepo { 1068 if u != nil { 1069 r := s.enforcer.GetPermissionsInRepo(u.Did, f.Knot, f.OwnerSlashRepo()) 1070 - log.Println(r) 1071 return pages.RolesInRepo{r} 1072 } else { 1073 return pages.RolesInRepo{}
··· 75 } 76 77 user := s.auth.GetUser(r) 78 s.pages.RepoIndexPage(w, pages.RepoIndexParams{ 79 LoggedInUser: user, 80 RepoInfo: f.RepoInfo(s, user), ··· 1066 func rolesInRepo(s *State, u *auth.User, f *FullyResolvedRepo) pages.RolesInRepo { 1067 if u != nil { 1068 r := s.enforcer.GetPermissionsInRepo(u.Did, f.Knot, f.OwnerSlashRepo()) 1069 return pages.RolesInRepo{r} 1070 } else { 1071 return pages.RolesInRepo{}
+1 -1
flake.nix
··· 44 inherit (gitignore.lib) gitignoreSource; 45 in { 46 overlays.default = final: prev: let 47 - goModHash = "sha256-tBhwRT3qnTHoAyasYIDwr9+3V+c7VLPY2LJ6A25l1gA="; 48 buildCmdPackage = name: 49 final.buildGoModule { 50 pname = name;
··· 44 inherit (gitignore.lib) gitignoreSource; 45 in { 46 overlays.default = final: prev: let 47 + goModHash = "sha256-k+WeNx9jZ5YGgskCJYiU2mwyz25E0bhFgSg2GDWZXFw="; 48 buildCmdPackage = name: 49 final.buildGoModule { 50 pname = name;
-1
go.mod
··· 21 github.com/ipfs/go-cid v0.4.1 22 github.com/mattn/go-sqlite3 v1.14.24 23 github.com/microcosm-cc/bluemonday v1.0.27 24 - github.com/russross/blackfriday/v2 v2.1.0 25 github.com/sethvargo/go-envconfig v1.1.0 26 github.com/whyrusleeping/cbor-gen v0.2.1-0.20241030202151-b7a6831be65e 27 github.com/yuin/goldmark v1.4.13
··· 21 github.com/ipfs/go-cid v0.4.1 22 github.com/mattn/go-sqlite3 v1.14.24 23 github.com/microcosm-cc/bluemonday v1.0.27 24 github.com/sethvargo/go-envconfig v1.1.0 25 github.com/whyrusleeping/cbor-gen v0.2.1-0.20241030202151-b7a6831be65e 26 github.com/yuin/goldmark v1.4.13
-2
go.sum
··· 229 github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= 230 github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= 231 github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= 232 - github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= 233 - github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= 234 github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= 235 github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= 236 github.com/sethvargo/go-envconfig v1.1.0 h1:cWZiJxeTm7AlCvzGXrEXaSTCNgip5oJepekh/BOQuog=
··· 229 github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= 230 github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= 231 github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= 232 github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= 233 github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= 234 github.com/sethvargo/go-envconfig v1.1.0 h1:cWZiJxeTm7AlCvzGXrEXaSTCNgip5oJepekh/BOQuog=