| 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 | * Index page for a repository. |
| 18 | * |
| 19 | * @param repositoryName name of this repository. |
| 20 | * @param? menuEntries menu entries. |
| 21 | * @param breadcrumbs breadcrumbs for this page. |
| 22 | * @param cloneUrl clone URL for this repository. |
| 23 | * @param description description text of the repository. |
| Shawn Pearce | 49b519b | 2012-12-21 21:15:45 -0800 | [diff] [blame] | 24 | * @param? mirroredFromUrl URL this repository is mirrored from. |
| Dave Borowitz | 209d0aa | 2012-12-28 14:28:53 -0800 | [diff] [blame^] | 25 | * @param branches list of branch objects with url and name keys. |
| 26 | * @param? moreBranchesUrl URL to show more branches, if necessary. |
| 27 | * @param tags list of tag objects with url and name keys. |
| 28 | * @param? moreTagsUrl URL to show more branches, if necessary. |
| 29 | * @param? nextUrl URL for the next page of log results. |
| 30 | * @param? previousUrl URL for the previous page of log results. |
| 31 | * @param entries list of log entries; see .logEntry. |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 32 | */ |
| 33 | {template .repositoryIndex} |
| 34 | {call .header} |
| 35 | {param title: $repositoryName /} |
| 36 | {param repositoryName: null /} |
| 37 | {param menuEntries: $menuEntries /} |
| 38 | {param breadcrumbs: $breadcrumbs /} |
| 39 | {/call} |
| 40 | |
| Shawn Pearce | 49b519b | 2012-12-21 21:15:45 -0800 | [diff] [blame] | 41 | {if $description or $mirroredFromUrl} |
| 42 | <div class="repository-description"> |
| 43 | {$description} |
| 44 | {if $mirroredFromUrl} |
| 45 | <div class="repository-mirrored-from"> |
| 46 | {msg desc="Informational text describing source of repository"} |
| Shawn Pearce | e39ce36 | 2012-12-26 17:14:16 -0800 | [diff] [blame] | 47 | mirrored from {$mirroredFromUrl} |
| Shawn Pearce | 49b519b | 2012-12-21 21:15:45 -0800 | [diff] [blame] | 48 | {/msg} |
| 49 | </div> |
| 50 | {/if} |
| 51 | </div> |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 52 | {/if} |
| 53 | |
| 54 | <textarea rows="1" cols="150" class="clone-line" |
| 55 | onclick="this.focus();this.select();" |
| 56 | readonly="readonly"> |
| 57 | git clone {$cloneUrl} |
| 58 | </textarea> |
| 59 | |
| Dave Borowitz | 209d0aa | 2012-12-28 14:28:53 -0800 | [diff] [blame^] | 60 | {if length($entries) and (length($branches) or length($tags))} |
| 61 | <div class="repository-shortlog-wrapper"> |
| 62 | <div class="repository-shortlog"> |
| 63 | {call .logEntries data="all" /} |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 64 | </div> |
| Dave Borowitz | 209d0aa | 2012-12-28 14:28:53 -0800 | [diff] [blame^] | 65 | </div> |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 66 | |
| Dave Borowitz | 209d0aa | 2012-12-28 14:28:53 -0800 | [diff] [blame^] | 67 | <div class="repository-refs"> |
| 68 | {call .branches_ data="all" /} |
| 69 | {call .tags_ data="all" /} |
| 70 | </div> |
| 71 | {elseif length($entries)} |
| 72 | {call .logEntries data="all" /} |
| 73 | {elseif length($branches) or length($tags)} |
| 74 | {call .branches_ data="all" /} |
| 75 | {call .tags_ data="all" /} |
| 76 | {/if} |
| 77 | |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 78 | {call .footer /} |
| 79 | {/template} |
| 80 | |
| 81 | /** |
| Dave Borowitz | 209d0aa | 2012-12-28 14:28:53 -0800 | [diff] [blame^] | 82 | * List of branches. |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 83 | * |
| Dave Borowitz | 209d0aa | 2012-12-28 14:28:53 -0800 | [diff] [blame^] | 84 | * @param? branches list of branch objects with url and name keys. |
| 85 | * @param? moreBranchesUrl URL to show more branches, if necessary. |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 86 | */ |
| Dave Borowitz | 209d0aa | 2012-12-28 14:28:53 -0800 | [diff] [blame^] | 87 | {template .branches_ private="true"} |
| 88 | {if length($branches)} |
| 89 | {call .refList} |
| 90 | {param type: 'Branches' /} |
| 91 | {param refs: $branches /} |
| 92 | {/call} |
| 93 | {if $moreBranchesUrl} |
| 94 | <a href="{$moreBranchesUrl}">{msg desc="link to view more branches"}More...{/msg}</a> |
| 95 | {/if} |
| 96 | {/if} |
| 97 | {/template} |
| 98 | |
| 99 | /** |
| 100 | * List of tags. |
| 101 | * |
| 102 | * @param? tags list of branch objects with url and name keys. |
| 103 | * @param? moreTagsUrl URL to show more tags, if necessary. |
| 104 | */ |
| 105 | {template .tags_ private="true"} |
| 106 | {if length($tags)} |
| 107 | {call .refList} |
| 108 | {param type: 'Tags' /} |
| 109 | {param refs: $tags /} |
| 110 | {/call} |
| 111 | {if $moreTagsUrl} |
| 112 | <a href="{$moreTagsUrl}">{msg desc="link to view more tags"}More...{/msg}</a> |
| 113 | {/if} |
| 114 | {/if} |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 115 | {/template} |