Add message for Empty Repositories The empty repository experience can be confusing, as there is nothing rendered at all. This leads users to wonder if there was a problem rendering or if the repository is truly empty. This change adds a message that is shown to the user in the event that there are no log, branches, nor tags in the repository. Change-Id: I204b5f6090a7750d2ca89e5c36c1661fc3a3ddba
diff --git a/resources/com/google/gitiles/static/base.css b/resources/com/google/gitiles/static/base.css index 2a56084..37a98c4 100644 --- a/resources/com/google/gitiles/static/base.css +++ b/resources/com/google/gitiles/static/base.css
@@ -282,6 +282,11 @@ margin-top: 20px; padding-top: 5px; } +.EmptyRepo-header {} +.EmptyRepo-description { + font-size: 14px; + font-style: italic; +} /* RefList.soy */
diff --git a/resources/com/google/gitiles/templates/RepositoryIndex.soy b/resources/com/google/gitiles/templates/RepositoryIndex.soy index b3178e4..af1af50 100644 --- a/resources/com/google/gitiles/templates/RepositoryIndex.soy +++ b/resources/com/google/gitiles/templates/RepositoryIndex.soy
@@ -88,6 +88,9 @@ {elseif length($branches) or length($tags)} {call .branches_ data="all" /} {call .tags_ data="all" /} +{else} + <h1 class="EmptyRepo-header">Empty Repository</h1> + <p class="EmptyRepo-description">This repository is empty. Push to it to show branches and history.</p> {/if} {call .footer}