Monorepo for Tangled tangled.org
2

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>

author
Anirudh Oppiliappan
date (Jun 24, 2026, 5:15 PM +0530) commit 7faeb2aa parent c6896ac3 change-id vkxkuswm
+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 }, ··· 543 544 return map[string]any{ 544 545 "OrderedReactionKinds": models.OrderedReactionKinds, 545 546 // would be great to have ordered maps right about now 546 - "UserSettingsTabs": []tab{ 547 - {"Name": "profile", "Label": "Profile", "Icon": "user"}, 548 - {"Name": "keys", "Label": "Keys", "Icon": "key"}, 549 - {"Name": "emails", "Label": "Emails", "Icon": "mail"}, 550 - {"Name": "notifications", "Label": "Notifications", "Icon": "bell"}, 551 - {"Name": "knots", "Label": "Knots", "Icon": "volleyball"}, 552 - {"Name": "spindles", "Label": "Spindles", "Icon": "spool"}, 553 - {"Name": "sites", "Label": "Sites", "Icon": "globe"}, 554 - }, 547 + "UserSettingsTabs": func() []tab { 548 + tabs := []tab{ 549 + {"Name": "profile", "Label": "Profile", "Icon": "user"}, 550 + {"Name": "keys", "Label": "Keys", "Icon": "key"}, 551 + {"Name": "emails", "Label": "Emails", "Icon": "mail"}, 552 + {"Name": "notifications", "Label": "Notifications", "Icon": "bell"}, 553 + {"Name": "knots", "Label": "Knots", "Icon": "volleyball"}, 554 + {"Name": "spindles", "Label": "Spindles", "Icon": "spool"}, 555 + } 556 + if !p.projectMode { 557 + tabs = append(tabs, tab{"Name": "sites", "Label": "Sites", "Icon": "globe"}) 558 + } 559 + return tabs 560 + }(), 555 561 "RepoSettingsTabs": []tab{ 556 562 {"Name": "general", "Label": "General", "Icon": "sliders-horizontal"}, 557 563 {"Name": "access", "Label": "Access", "Icon": "users"},
+2
appview/pages/pages.go
··· 76 76 db *db.DB 77 77 rdb *cache.Cache 78 78 dev bool 79 + projectMode bool 79 80 embedFS fs.FS 80 81 templateDir string // Path to templates on disk for dev mode 81 82 rctx *markup.RenderContext ··· 97 98 mu: sync.RWMutex{}, 98 99 cache: NewTmplCache[string, *template.Template](), 99 100 dev: config.Core.Dev, 101 + projectMode: config.Project.Enabled, 100 102 avatar: config.Avatar, 101 103 pdsCfg: config.Pds, 102 104 rctx: rctx,
+2
appview/pages/templates/layouts/fragments/topbar.html
··· 17 17 <div class="flex items-center order-4 md:order-5">{{ block "profileDropdown" . }} {{ end }}</div> 18 18 {{ else }} 19 19 <a href="/login">Login</a> 20 + {{ if not projectMode }} 20 21 <span class="text-gray-500 dark:text-gray-400">or</span> 21 22 <a href="/signup" class="btn-create py-0 hover:no-underline hover:text-white flex items-center gap-2"> 22 23 Join now {{ i "arrow-right" "size-4" }} 23 24 </a> 25 + {{ end }} 24 26 {{ end }} 25 27 </div> 26 28 </div>
+2
appview/pages/templates/repo/issues/fragments/newComment.html
··· 112 112 </form> 113 113 {{ else }} 114 114 <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"> 115 + {{ if not projectMode }} 115 116 <a href="/signup" class="btn-create py-0 hover:no-underline hover:text-white flex items-center gap-2"> 116 117 Sign up 117 118 </a> 118 119 <span class="text-gray-500 dark:text-gray-400">or</span> 120 + {{ end }} 119 121 <a href="/login" class="underline">Login</a> 120 122 to add to the discussion 121 123 </div>
+2
appview/pages/templates/repo/pulls/pull.html
··· 602 602 603 603 {{ define "loginPrompt" }} 604 604 <div class="bg-amber-50 dark:bg-amber-900 border border-amber-500 rounded shadow-sm p-2 relative flex gap-2 items-center"> 605 + {{ if not projectMode }} 605 606 <a href="/signup" class="btn-create py-0 hover:no-underline hover:text-white flex items-center gap-2"> 606 607 Sign up 607 608 </a> 608 609 <span class="text-gray-500 dark:text-gray-400">or</span> 610 + {{ end }} 609 611 <a href="/login" class="underline">Login</a> 610 612 to add to the discussion 611 613 </div>
+2
appview/pages/templates/user/login.html
··· 109 109 </div> 110 110 </div> 111 111 {{ end }} 112 + {{ if not projectMode }} 112 113 <p class="text-sm text-gray-500"> 113 114 Don't have an account? <a href="/signup" class="underline">Create an account</a> on Tangled now! 114 115 </p> 116 + {{ end }} 115 117 116 118 <p id="login-msg" class="error w-full"></p> 117 119 {{ end }}