Monorepo for Tangled
0

Configure Feed

Select the types of activity you want to include in your feed.

appview/pages: project mode template gates

Signed-off-by: Anirudh Oppiliappan <anirudh@tangled.org>

Anirudh Oppiliappan (May 14, 2026, 1:44 PM +0300) fbfc97a2 12a23f61

+25 -9
+15 -9
appview/pages/funcmap.go
··· 42 42 43 43 func (p *Pages) funcMap() template.FuncMap { 44 44 return template.FuncMap{ 45 + "projectMode": func() bool { return p.projectMode }, 45 46 "split": func(s string) []string { 46 47 return strings.Split(s, "\n") 47 48 }, ··· 486 487 return map[string]any{ 487 488 "OrderedReactionKinds": models.OrderedReactionKinds, 488 489 // would be great to have ordered maps right about now 489 - "UserSettingsTabs": []tab{ 490 - {"Name": "profile", "Icon": "user"}, 491 - {"Name": "keys", "Icon": "key"}, 492 - {"Name": "emails", "Icon": "mail"}, 493 - {"Name": "notifications", "Icon": "bell"}, 494 - {"Name": "knots", "Icon": "volleyball"}, 495 - {"Name": "spindles", "Icon": "spool"}, 496 - {"Name": "sites", "Icon": "globe"}, 497 - }, 490 + "UserSettingsTabs": func() []tab { 491 + tabs := []tab{ 492 + {"Name": "profile", "Icon": "user"}, 493 + {"Name": "keys", "Icon": "key"}, 494 + {"Name": "emails", "Icon": "mail"}, 495 + {"Name": "notifications", "Icon": "bell"}, 496 + {"Name": "knots", "Icon": "volleyball"}, 497 + {"Name": "spindles", "Icon": "spool"}, 498 + } 499 + if !p.projectMode { 500 + tabs = append(tabs, tab{"Name": "sites", "Icon": "globe"}) 501 + } 502 + return tabs 503 + }(), 498 504 "RepoSettingsTabs": []tab{ 499 505 {"Name": "general", "Icon": "sliders-horizontal"}, 500 506 {"Name": "access", "Icon": "users"},
+2
appview/pages/pages.go
··· 48 48 db *db.DB 49 49 rdb *cache.Cache 50 50 dev bool 51 + projectMode bool 51 52 embedFS fs.FS 52 53 templateDir string // Path to templates on disk for dev mode 53 54 rctx *markup.RenderContext ··· 69 70 mu: sync.RWMutex{}, 70 71 cache: NewTmplCache[string, *template.Template](), 71 72 dev: config.Core.Dev, 73 + projectMode: config.Project.Enabled, 72 74 avatar: config.Avatar, 73 75 pdsCfg: config.Pds, 74 76 rctx: rctx,
+2
appview/pages/templates/user/login.html
··· 108 108 </div> 109 109 </div> 110 110 {{ end }} 111 + {{ if not projectMode }} 111 112 <p class="text-sm text-gray-500"> 112 113 Don't have an account? <a href="/signup" class="underline">Create an account</a> on Tangled now! 113 114 </p> 115 + {{ end }} 114 116 115 117 <p id="login-msg" class="error w-full"></p> 116 118 {{ end }}
+2
appview/pages/templates/layouts/fragments/topbar.html
··· 16 16 <div class="flex items-center order-4 md:order-5">{{ block "profileDropdown" . }} {{ end }}</div> 17 17 {{ else }} 18 18 <a href="/login">login</a> 19 + {{ if not projectMode }} 19 20 <span class="text-gray-500 dark:text-gray-400">or</span> 20 21 <a href="/signup" class="btn-create py-0 hover:no-underline hover:text-white flex items-center gap-2"> 21 22 join now {{ i "arrow-right" "size-4" }} 22 23 </a> 24 + {{ end }} 23 25 {{ end }} 24 26 </div> 25 27 </div>
+2
appview/pages/templates/repo/pulls/pull.html
··· 656 656 657 657 {{ define "loginPrompt" }} 658 658 <div class="bg-amber-50 dark:bg-amber-900 border border-amber-500 rounded shadow-sm p-2 relative flex gap-2 items-center"> 659 + {{ if not projectMode }} 659 660 <a href="/signup" class="btn-create py-0 hover:no-underline hover:text-white flex items-center gap-2"> 660 661 sign up 661 662 </a> 662 663 <span class="text-gray-500 dark:text-gray-400">or</span> 664 + {{ end }} 663 665 <a href="/login" class="underline">login</a> 664 666 to add to the discussion 665 667 </div>
+2
appview/pages/templates/repo/issues/fragments/newComment.html
··· 129 129 </form> 130 130 {{ else }} 131 131 <div class="bg-amber-50 dark:bg-amber-900 border border-amber-500 rounded drop-shadow-sm p-6 relative flex gap-2 items-center"> 132 + {{ if not projectMode }} 132 133 <a href="/signup" class="btn-create py-0 hover:no-underline hover:text-white flex items-center gap-2"> 133 134 sign up 134 135 </a> 135 136 <span class="text-gray-500 dark:text-gray-400">or</span> 137 + {{ end }} 136 138 <a href="/login" class="underline">login</a> 137 139 to add to the discussion 138 140 </div>