Add fuller template for gitiles pretty logging Change-Id: Ia8a918a054f522443335cdd7ee3cf6a8992bb0a2
diff --git a/resources/com/google/gitiles/templates/LogDetail.soy b/resources/com/google/gitiles/templates/LogDetail.soy index 13dc7c0..108bbef 100644 --- a/resources/com/google/gitiles/templates/LogDetail.soy +++ b/resources/com/google/gitiles/templates/LogDetail.soy
@@ -260,3 +260,71 @@ {$message} </pre> {/template} + +/** + * Single pretty log entry, similar to --pretty=fuller + */ +{template fullerLogEntry visibility="private" modifies="logEntry" variant="'fuller'"} + {@param abbrevSha: ?} /** abbreviated SHA-1. */ + {@param sha: ?} /** commit SHA-1. */ + {@param url: ?} /** URL to commit detail page. */ + {@param shortMessage: ?} /** short commit message. */ + {@param message: ?} /** list of commit message parts, where each part contains: text: raw text of + the part. url: optional URL that should be linked to from the part. */ + {@param author: ?} /** author information with at least "name" and "relativeTime" keys. */ + {@param committer: ?} /** committer information with at least "time" and "relativeTime" keys. */ + {@param branches: ?} /** list of branches for this entry, with "name" and "url" keys. */ + {@param tags: ?} /** list of tags for this entry, with "name" and "url" keys. */ + {@param diffTree: ?} /** list of changed tree entries with the following keys: changeType: string + matching an org.eclipse.jgit.diff.DiffEntry.ChangeType constant. path: (new) path of the tree + entry. oldPath: old path, only for renames and copies. url: URL to a detail page for the tree + entry. diffUrl: URL to a diff page for the tree entry's diff in this commit. */ + {@param rename: ?} /** if this entry was a rename or a copy of the path, an object containg: + changeType: the change type, "RENAME" or "COPY". oldPath: the old path prior to the rename or + copy. newPath: the new path after the rename or copy. score: the similarity score of the + rename or copy. */ +{call logEntry variant="'full'" data="all" /} + +{if $diffTree and length($diffTree)} + <ul class="DiffTree"> + {for $entry in $diffTree} + <li> + <a href="{$entry.url}">{$entry.path}</a> + {switch $entry.changeType} + {case 'ADD'} + <span class="DiffTree-action DiffTree-action--add"> + {msg desc="Text for a new tree entry"} + [Added - <a href="{$entry.diffUrl}">diff</a>] + {/msg} + </span> + {case 'MODIFY'} + <span class="DiffTree-action DiffTree-action--modify"> + {msg desc="Text for a modified tree entry"} + [<a href="{$entry.diffUrl}">diff</a>] + {/msg} + </span> + {case 'DELETE'} + <span class="DiffTree-action DiffTree-action--delete"> + {msg desc="Text for a deleted tree entry"} + [Deleted - <a href="{$entry.diffUrl}">diff</a>] + {/msg} + </span> + {case 'RENAME'} + <span class="DiffTree-action DiffTree-action--rename"> + {msg desc="Text for a renamed tree entry"} + [Renamed from {$entry.oldPath} - <a href="{$entry.diffUrl}">diff</a>] + {/msg} + </span> + {case 'COPY'} + <span class="DiffTree-action DiffTree-action--copy"> + {msg desc="Text for a copied tree entry"} + [Copied from {$entry.oldPath} - <a href="{$entry.diffUrl}">diff</a>] + {/msg} + </span> + {default} + {/switch} + </li> + {/for} + </ul> +{/if} +{/template}