blob: 3b5c9be1b1392a352c54bc5395a0da904ba3f9b7 [file] [log] [blame]
// Copyright 2012 Google Inc. All Rights Reserved.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// See the License for the specific language governing permissions and
// limitations under the License.
import * as common from 'com/google/gitiles/templates/';
import * as objDetail from 'com/google/gitiles/templates/';
* Detail page for a path within a tree.
{template pathDetail stricthtml="false"}
{@param title: ?} /** human-readable name of this path. */
{@param repositoryName: ?} /** name of this repository. */
{@param? menuEntries: ?} /** menu entries. */
{@param? customVariant: ?} /** variant name for custom styling. */
{@param breadcrumbs: ?} /** breadcrumbs for this page. */
{@param type: ?} /** path type, matching one of the constant names defined in
org.eclipse.jgit.lib.FileMode. */
{@param data: ?} /** path data, matching the params for one of .treeDetail, .blobDetail,
.symlinkDetail, or .gitlinkDetail as appropriate. */
{@inject staticUrls: ?}
{if $type == 'REGULAR_FILE' or $type == 'EXECUTABLE_FILE'}
{call common.header data="all"}
{param css: [$staticUrls.PRETTIFY_CSS_URL] /}
{elseif $data.readmeHtml}
{call common.header data="all"}
{param css: [$staticUrls.DOC_CSS_URL, $staticUrls.PRETTIFY_CSS_URL] /}
{call common.header data="all" /}
{switch $type}
{case 'TREE'}
{call objDetail.treeDetail data="$data" /}
{case 'SYMLINK'}
{call symlinkDetail data="$data" /}
{call objDetail.blobDetail data="$data" /}
{call objDetail.blobDetail data="$data" /}
{case 'GITLINK'}
{call gitlinkDetail data="$data" /}
<div class="error">
{msg desc="Error message for an unknown object type"}Object has unknown type.{/msg}
{call common.footer}
{param customVariant: $customVariant /}
* Detail for a symbolic link.
{template symlinkDetail}
{@param target: ?} /** target of this symlink. */
{@param? targetUrl: ?} /** optional URL for the target, if it is within this repo. */
<div class="symlink-detail">
{msg desc="Lead-in text for the symbolic link target."}Symbolic link to{/msg}
{sp}{if $targetUrl}<a href="{$targetUrl}">{$target}</a>{else}{$target}{/if}
* Detail for a git submodule link.
{template gitlinkDetail}
{@param sha: ?} /** submodule commit SHA. */
{@param remoteUrl: ?} /** URL of the remote repository. */
{@param? httpUrl: ?} /** optional HTTP URL pointing to a web-browser-compatible URL of the remote
repository. */
<div class="gitlink-detail">
{msg desc="Lead-in text for the git link URL"}Submodule link to {$sha} of{/msg}
{if $remoteUrl}
{sp}{if $httpUrl}<a href="{$httpUrl}">{$remoteUrl}</a>{else}{$remoteUrl}{/if}
{sp}{msg desc="Text describing an unknown submodule URL"}a submodule with an unknown URL{/msg}