| 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. |
| Dave Borowitz | e16e486 | 2014-06-26 12:23:18 -0700 | [diff] [blame^] | 14 | {namespace gitiles autoescape="strict"} |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 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. |
| Dave Borowitz | 76bbefd | 2014-03-11 16:57:45 -0700 | [diff] [blame] | 22 | * @param? headerVariant variant name for custom header. |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 23 | * @param breadcrumbs breadcrumbs for this page. |
| 24 | * @param? tags optional list of tags encountered when peeling this object, with |
| 25 | * keys corresponding to gitiles.tagDetail. |
| Stefan Zager | d218743 | 2014-02-28 02:23:02 -0800 | [diff] [blame] | 26 | * @param? logEntryVariant variant name for log entry template. |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 27 | * @param entries list of log entries; see .logEntry. |
| 28 | * @param? nextUrl URL for the next page of results. |
| 29 | * @param? previousUrl URL for the previous page of results. |
| 30 | */ |
| 31 | {template .logDetail} |
| 32 | {call .header data="all" /} |
| 33 | |
| 34 | {if $tags} |
| 35 | {foreach $tag in $tags} |
| 36 | {call gitiles.tagDetail data="$tag" /} |
| 37 | {/foreach} |
| 38 | {/if} |
| 39 | |
| Dave Borowitz | b772cce | 2012-12-28 13:57:22 -0800 | [diff] [blame] | 40 | {call .logEntries data="all" /} |
| 41 | |
| 42 | {call .footer /} |
| 43 | {/template} |
| 44 | |
| 45 | /** |
| 46 | * List of log entries. |
| 47 | * |
| Stefan Zager | d218743 | 2014-02-28 02:23:02 -0800 | [diff] [blame] | 48 | * @param? logEntryVariant variant name for log entry template. |
| Michael Moss | 558f864 | 2014-04-15 09:29:21 -0700 | [diff] [blame] | 49 | * @param? logEntryPretty base "pretty" format for the log entry template. |
| Dave Borowitz | b772cce | 2012-12-28 13:57:22 -0800 | [diff] [blame] | 50 | * @param entries list of log entries; see .logEntry. |
| 51 | * @param? nextUrl URL for the next page of results. |
| 52 | * @param? previousUrl URL for the previous page of results. |
| 53 | */ |
| 54 | {template .logEntries} |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 55 | {if $previousUrl} |
| 56 | <div class="log-nav"> |
| 57 | <a href="{$previousUrl}">{msg desc="text for previous URL"}« Previous{/msg}</a> |
| 58 | </div> |
| 59 | {/if} |
| 60 | |
| 61 | {if length($entries)} |
| Michael Moss | 558f864 | 2014-04-15 09:29:21 -0700 | [diff] [blame] | 62 | <ol class="{$logEntryPretty ?: 'default'} log"> |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 63 | {foreach $entry in $entries} |
| 64 | <li{if $previousUrl and isFirst($entry)} class="first"{/if}> |
| Stefan Zager | d218743 | 2014-02-28 02:23:02 -0800 | [diff] [blame] | 65 | {delcall gitiles.logEntry variant="$logEntryVariant ?: 'default'" |
| 66 | data="$entry" /} |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 67 | </li> |
| 68 | {/foreach} |
| 69 | </ol> |
| 70 | {else} |
| 71 | <p>{msg desc="informational text for when the log is empty"}No commits.{/msg}</p> |
| 72 | {/if} |
| 73 | |
| 74 | {if $nextUrl} |
| 75 | <div class="log-nav"> |
| 76 | <a href="{$nextUrl}">{msg desc="text for next URL"}Next »{/msg}</a> |
| 77 | </div> |
| 78 | {/if} |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 79 | {/template} |
| 80 | |
| Dave Borowitz | b772cce | 2012-12-28 13:57:22 -0800 | [diff] [blame] | 81 | |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 82 | /** |
| Michael Moss | 558f864 | 2014-04-15 09:29:21 -0700 | [diff] [blame] | 83 | * Single pretty log entry, similar to --pretty=oneline. |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 84 | * |
| 85 | * @param abbrevSha abbreviated SHA-1. |
| Michael Moss | 558f864 | 2014-04-15 09:29:21 -0700 | [diff] [blame] | 86 | * @param sha commit SHA-1. |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 87 | * @param url URL to commit detail page. |
| 88 | * @param shortMessage short commit message. |
| Michael Moss | 558f864 | 2014-04-15 09:29:21 -0700 | [diff] [blame] | 89 | * @param message list of commit message parts, where each part contains: |
| 90 | * text: raw text of the part. |
| 91 | * url: optional URL that should be linked to from the part. |
| 92 | * @param author author information with at least "name" and "relativeTime" keys. |
| 93 | * @param committer committer information with at least "time" and "relativeTime" keys. |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 94 | * @param branches list of branches for this entry, with "name" and "url" keys. |
| 95 | * @param tags list of tags for this entry, with "name" and "url" keys. |
| Michael Moss | 92bb12f | 2014-05-09 10:55:35 -0700 | [diff] [blame] | 96 | * @param diffTree unused in this variant. |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 97 | */ |
| Michael Moss | 558f864 | 2014-04-15 09:29:21 -0700 | [diff] [blame] | 98 | {deltemplate gitiles.logEntry variant="'oneline'"} |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 99 | <a href="{$url}"> |
| 100 | <span class="sha1">{$abbrevSha}</span> |
| 101 | // nbsp instad of CSS padding/margin because those cause a break in the |
| 102 | // underline. |
| 103 | |
| Michael Moss | 558f864 | 2014-04-15 09:29:21 -0700 | [diff] [blame] | 104 | {sp}<span>{$shortMessage}</span> |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 105 | </a> |
| Dave Borowitz | 9cc6fd7 | 2014-04-07 19:08:29 -0700 | [diff] [blame] | 106 | {sp}<span class="author" title="{$author.email}">{msg desc="commit author name"}by {$author.name}{/msg}</span> |
| 107 | {sp}<span class="time" title="{$author.time}">- {$author.relativeTime}</span> |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 108 | {if length($branches)} |
| 109 | {foreach $branch in $branches} |
| 110 | {sp}<a href="{$branch.url}" class="branch-label">{$branch.name}</a> |
| 111 | {/foreach} |
| 112 | {/if} |
| 113 | {if length($tags)} |
| 114 | {foreach $tag in $tags} |
| 115 | {sp}<a href="{$tag.url}" class="tag-label">{$tag.name}</a> |
| 116 | {/foreach} |
| 117 | {/if} |
| Stefan Zager | d218743 | 2014-02-28 02:23:02 -0800 | [diff] [blame] | 118 | {/deltemplate} |
| Michael Moss | 558f864 | 2014-04-15 09:29:21 -0700 | [diff] [blame] | 119 | |
| 120 | |
| 121 | /** |
| 122 | * Default single log entry (oneline format). |
| 123 | * |
| 124 | * @param abbrevSha abbreviated SHA-1. |
| 125 | * @param sha commit SHA-1. |
| 126 | * @param url URL to commit detail page. |
| 127 | * @param shortMessage short commit message. |
| 128 | * @param message list of commit message parts, where each part contains: |
| 129 | * text: raw text of the part. |
| 130 | * url: optional URL that should be linked to from the part. |
| 131 | * @param author author information with at least "name" and "relativeTime" keys. |
| 132 | * @param committer committer information with at least "time" and "relativeTime" keys. |
| 133 | * @param branches list of branches for this entry, with "name" and "url" keys. |
| 134 | * @param tags list of tags for this entry, with "name" and "url" keys. |
| Michael Moss | 92bb12f | 2014-05-09 10:55:35 -0700 | [diff] [blame] | 135 | * @param diffTree unused in this variant. |
| Michael Moss | 558f864 | 2014-04-15 09:29:21 -0700 | [diff] [blame] | 136 | */ |
| 137 | {deltemplate gitiles.logEntry variant="'default'"} |
| 138 | {delcall gitiles.logEntry variant="'oneline'" data="all" /} |
| 139 | {/deltemplate} |
| 140 | |
| 141 | |
| 142 | /** |
| 143 | * Single pretty log entry, similar to --pretty=full. |
| 144 | * |
| 145 | * @param abbrevSha abbreviated SHA-1. |
| 146 | * @param sha commit SHA-1. |
| 147 | * @param url URL to commit detail page. |
| 148 | * @param shortMessage short commit message. |
| 149 | * @param message list of commit message parts, where each part contains: |
| 150 | * text: raw text of the part. |
| 151 | * url: optional URL that should be linked to from the part. |
| 152 | * @param author author information with at least "name" and "relativeTime" keys. |
| 153 | * @param committer committer information with at least "time" and "relativeTime" keys. |
| 154 | * @param branches list of branches for this entry, with "name" and "url" keys. |
| 155 | * @param tags list of tags for this entry, with "name" and "url" keys. |
| Michael Moss | 92bb12f | 2014-05-09 10:55:35 -0700 | [diff] [blame] | 156 | * @param diffTree unused in this variant. |
| Michael Moss | 558f864 | 2014-04-15 09:29:21 -0700 | [diff] [blame] | 157 | */ |
| 158 | {deltemplate gitiles.logEntry variant="'full'"} |
| 159 | <div class="git-commit"> |
| 160 | <table> |
| 161 | <tr> |
| 162 | <th>{msg desc="Header for commit SHA entry"}commit{/msg}</th> |
| 163 | <td class="sha1"> |
| 164 | <a href="{$url}">{$sha}</a> |
| 165 | </td> |
| 166 | <td> |
| 167 | {if length($branches)} |
| 168 | {foreach $branch in $branches} |
| 169 | {sp}<a href="{$branch.url}" class="branch-label">{$branch.name}</a> |
| 170 | {/foreach} |
| 171 | {/if} |
| 172 | {if length($tags)} |
| 173 | {foreach $tag in $tags} |
| 174 | {sp}<a href="{$tag.url}" class="tag-label">{$tag.name}</a> |
| 175 | {/foreach} |
| 176 | {else} |
| 177 | {sp} |
| 178 | {/if} |
| 179 | </td> |
| 180 | </tr> |
| 181 | <tr> |
| 182 | <th>{msg desc="Header for commit author"}author{/msg}</th> |
| 183 | <td>{call .person_ data="$author" /}</td> |
| 184 | <td>{$author.time}</td> |
| 185 | </tr> |
| 186 | <tr> |
| 187 | <th>{msg desc="Header for committer"}committer{/msg}</th> |
| 188 | <td>{call .person_ data="$committer" /}</td> |
| 189 | <td>{$committer.time}</td> |
| 190 | </tr> |
| 191 | </table> |
| 192 | </div> |
| 193 | <pre class="commit-message"> |
| 194 | {$message} |
| 195 | </pre> |
| 196 | {/deltemplate} |