Prevent crashes with empty projects
author Chris Han
()
committer Chris Han
()
commit b230a765cf9a2132f49139f822f4f1e6a986c6ed
tree 1f714dbad351fdd927246529b385f661a43322e4
parent c8f1f3ab22e204f8e15ebaf8977ffbc5ce4b7083
Prevent crashes with empty projects

This disables or hides pretty much all links - shortlog, log, commit,
commitdiff, tree, snapshot, etc - for an empty project with no commits.
None of those actions make any sense if the project is empty. There are
still outstanding crashes if the user crafts a url manually to directly
access a page for a project, but since that won't happen nearly as often
it's not quite as high a priority.

This also extracts the nav links at the top of each page into a shared
template, so we only need to check if a commit exists in one place.
24 files changed:
include/controller/Controller_Heads.class.php
include/controller/Controller_Search.class.php
include/controller/Controller_Tag.class.php
include/controller/Controller_Tags.class.php
include/git/Project.class.php
templates/blame.tpl
templates/blob.tpl
templates/blobdiff.tpl
templates/commit.tpl
templates/commitdiff.tpl
templates/heads.tpl
templates/history.tpl
templates/log.tpl
templates/nav.tpl [ new file with mode 0644 ]
templates/project.tpl
templates/projectlist.tpl
templates/search.tpl
templates/searchfiles.tpl
templates/shortlog.tpl
templates/shortloglist.tpl
templates/tag.tpl
templates/tags.tpl
templates/title.tpl
templates/tree.tpl
comments