Make the branches dropdown work on new repos page

7db57c4a30497bdb48914a95353fbdb361fb52fe

Tucker McKnight <tucker@pangolin.lan> | Tue Dec 09 2025

Make the branches dropdown work on new repos page
js_templates/helpers/nav.ts:1
Before
1
import path from 'path'
After
1
js_templates/helpers/nav.ts:28
Before
28
After
28
    repoBranchHome: (branchName: string) => {
      return `${rootBasePathBranches}/${slugify(branchName)}`
    },
js_templates/repo.ts:25
Before
25
After
25
          <script>
            window.branches = ${JSON.stringify(repo.branches)};
          </script>
js_templates/repo.ts:42
Before
42
43
44
45
46
47
                          main
                        <ul class="dropdown-menu">
                          <li><a class="dropdown-item" href="#">Action</a></li>
                          <li><a class="dropdown-item" href="#">Another action</a></li>
                          <li><a class="dropdown-item" href="#">Something else here</a></li>
                        </ul>
After
42
43
44
45
46
47
                          ${branch.name}
                        <div class="dropdown-menu">
                          <form class="mx-3 my-1">
                            <input type="text" class="form-control" id="dropdownBranchSearch" placeholder="Search branches...">
                          </form>
                          <div class="dropdown-divider"></div>
                          <ul class="dropdown-branches">
                            ${repo.branches.map((branch) => { return `<li><a class='dropdown-item' href='${nav.repoBranchHome(branch.name)}'>${branch.name}</a></li>`}).join('')}
                          </ul>
                        </div>