| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 1 | // Copyright 2012 Google Inc. All Rights Reserved. |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 | {namespace gitiles autoescape="contextual"} |
| 15 | |
| 16 | /** |
| 17 | * Detail page showing a shortlog for a commit. |
| 18 | * |
| 19 | * @param title human-readable revision name. |
| 20 | * @param repositoryName name of this repository. |
| 21 | * @param? menuEntries menu entries. |
| 22 | * @param breadcrumbs breadcrumbs for this page. |
| 23 | * @param? tags optional list of tags encountered when peeling this object, with |
| 24 | * keys corresponding to gitiles.tagDetail. |
| 25 | * @param entries list of log entries; see .logEntry. |
| 26 | * @param? nextUrl URL for the next page of results. |
| 27 | * @param? previousUrl URL for the previous page of results. |
| 28 | */ |
| 29 | {template .logDetail} |
| 30 | {call .header data="all" /} |
| 31 | |
| 32 | {if $tags} |
| 33 | {foreach $tag in $tags} |
| 34 | {call gitiles.tagDetail data="$tag" /} |
| 35 | {/foreach} |
| 36 | {/if} |
| 37 | |
| Dave Borowitz | b772cce | 2012-12-28 13:57:22 -0800 | [diff] [blame^] | 38 | {call .logEntries data="all" /} |
| 39 | |
| 40 | {call .footer /} |
| 41 | {/template} |
| 42 | |
| 43 | /** |
| 44 | * List of log entries. |
| 45 | * |
| 46 | * @param entries list of log entries; see .logEntry. |
| 47 | * @param? nextUrl URL for the next page of results. |
| 48 | * @param? previousUrl URL for the previous page of results. |
| 49 | */ |
| 50 | {template .logEntries} |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 51 | {if $previousUrl} |
| 52 | <div class="log-nav"> |
| 53 | <a href="{$previousUrl}">{msg desc="text for previous URL"}« Previous{/msg}</a> |
| 54 | </div> |
| 55 | {/if} |
| 56 | |
| 57 | {if length($entries)} |
| 58 | <ol class="shortlog"> |
| 59 | {foreach $entry in $entries} |
| 60 | <li{if $previousUrl and isFirst($entry)} class="first"{/if}> |
| 61 | {call .logEntry data="$entry" /} |
| 62 | </li> |
| 63 | {/foreach} |
| 64 | </ol> |
| 65 | {else} |
| 66 | <p>{msg desc="informational text for when the log is empty"}No commits.{/msg}</p> |
| 67 | {/if} |
| 68 | |
| 69 | {if $nextUrl} |
| 70 | <div class="log-nav"> |
| 71 | <a href="{$nextUrl}">{msg desc="text for next URL"}Next »{/msg}</a> |
| 72 | </div> |
| 73 | {/if} |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 74 | {/template} |
| 75 | |
| Dave Borowitz | b772cce | 2012-12-28 13:57:22 -0800 | [diff] [blame^] | 76 | |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 77 | /** |
| 78 | * Single shortlog entry. |
| 79 | * |
| 80 | * @param abbrevSha abbreviated SHA-1. |
| 81 | * @param url URL to commit detail page. |
| 82 | * @param shortMessage short commit message. |
| 83 | * @param author author information with at least "name" and "relativeTime" keys. |
| 84 | * @param branches list of branches for this entry, with "name" and "url" keys. |
| 85 | * @param tags list of tags for this entry, with "name" and "url" keys. |
| 86 | */ |
| 87 | {template .logEntry} |
| 88 | <a href="{$url}"> |
| 89 | <span class="sha1">{$abbrevSha}</span> |
| 90 | // nbsp instad of CSS padding/margin because those cause a break in the |
| 91 | // underline. |
| 92 | |
| 93 | {sp}<span class="commit-message">{$shortMessage}</span> |
| 94 | </a> |
| 95 | {sp}<span class="author">{msg desc="commit author name"}by {$author.name}{/msg}</span> |
| 96 | {sp}<span class="time">- {$author.relativeTime}</span> |
| 97 | {if length($branches)} |
| 98 | {foreach $branch in $branches} |
| 99 | {sp}<a href="{$branch.url}" class="branch-label">{$branch.name}</a> |
| 100 | {/foreach} |
| 101 | {/if} |
| 102 | {if length($tags)} |
| 103 | {foreach $tag in $tags} |
| 104 | {sp}<a href="{$tag.url}" class="tag-label">{$tag.name}</a> |
| 105 | {/foreach} |
| 106 | {/if} |
| 107 | {/template} |