toolbar.tmpl 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <div id="repo-toolbar">
  2. <div class="container">
  3. <nav class="navbar navbar-toolbar navbar-default" role="navigation">
  4. <div class="collapse navbar-collapse">
  5. <ul class="nav navbar-nav">
  6. <li class="{{if .IsRepoToolbarSource}}active{{end}}"><a href="{{.RepoLink}}{{if .BranchName}}{{if ne .BranchName `master`}}/src/{{.BranchName}}{{end}}{{end}}">Source</a></li>
  7. {{if not .IsBareRepo}}
  8. <li class="{{if .IsRepoToolbarCommits}}active{{end}}"><a href="{{.RepoLink}}/commits/{{if .BranchName}}{{.BranchName}}{{else}}master{{end}}">Commits</a></li>
  9. <!-- <li class="{{if .IsRepoToolbarBranches}}active{{end}}"><a href="{{.RepoLink}}/branches">Branches</a></li> -->
  10. <!-- <li class="{{if .IsRepoToolbarPulls}}active{{end}}"><a href="{{.RepoLink}}/pulls">Pull Requests</a></li> -->
  11. <li class="{{if .IsRepoToolbarIssues}}active{{end}}"><a href="{{.RepoLink}}/issues">{{if .Repository.NumOpenIssues}}<span class="badge">{{.Repository.NumOpenIssues}}</span> {{end}}Issues <!--<span class="badge">42</span>--></a></li>
  12. {{if .IsRepoToolbarIssues}}
  13. <li class="tmp">{{if .IsRepoToolbarIssuesList}}
  14. <a href="{{.RepoLink}}/issues/new"><button class="btn btn-primary btn-sm">New Issue</button></a>
  15. <a href="{{.RepoLink}}/issues/milestones"><button class="btn btn-success btn-sm">Milestones</button></a>
  16. {{end}}</li>
  17. {{end}}
  18. <li class="{{if .IsRepoToolbarReleases}}active{{end}}"><a href="{{.RepoLink}}/releases">{{if .Repository.NumTags}}<span class="badge">{{.Repository.NumTags}}</span> {{end}}Releases</a></li>
  19. {{if .IsRepoToolbarReleases}}{{if .IsRepositoryOwner}}{{if not .IsRepoReleaseNew}}
  20. <li class="tmp"><a href="{{.RepoLink}}/releases/new"><button class="btn btn-primary btn-sm">New Release</button></a></li>
  21. {{end}}{{end}}{{end}}
  22. <!-- <li class="dropdown">
  23. <a href="#" class="dropdown-toggle" data-toggle="dropdown">More <b class="caret"></b></a>
  24. <ul class="dropdown-menu">
  25. <li><a href="{{.RepoLink}}/wiki">Wiki</a></li>
  26. </ul>
  27. </li> -->{{end}}
  28. </ul>
  29. <ul class="nav navbar-nav navbar-right">
  30. {{if not .IsBareRepo}}
  31. <!-- <li class="dropdown">
  32. <a href="#" class="dropdown-toggle" data-toggle="dropdown">Statistic <b class="caret"></b></a>
  33. <ul class="dropdown-menu">
  34. <li><a href="#">Graphic</a></li>
  35. <li><a href="#">Pulse</a></li>
  36. <li><a href="#">Network</a></li>
  37. </ul>
  38. </li> -->{{end}}{{if .IsRepositoryAdmin}}
  39. <li class="{{if .IsRepoToolbarSetting}}active{{end}}"><a href="{{.RepoLink}}/settings">Settings</a>
  40. </li>{{end}}
  41. </ul>
  42. </div>
  43. </nav>
  44. </div>
  45. </div>