diff options
author | Unknwon <u@gogs.io> | 2015-08-08 22:43:14 +0800 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-08-08 22:43:14 +0800 |
commit | dea3a8c6a42ea7e4921c0e4beee5d4fd0437dbe5 (patch) | |
tree | 773b28a72cee24e4a02f3d162de8a37a8f912f59 /templates | |
parent | d015d951bd6959f9585d8a83acfe7bba07b7eaad (diff) | |
download | gitea-dea3a8c6a42ea7e4921c0e4beee5d4fd0437dbe5.tar.gz gitea-dea3a8c6a42ea7e4921c0e4beee5d4fd0437dbe5.zip |
WIP: create PR - choose branch
Diffstat (limited to 'templates')
-rw-r--r-- | templates/admin/repo/list.tmpl | 4 | ||||
-rw-r--r-- | templates/repo/header.tmpl | 2 | ||||
-rw-r--r-- | templates/repo/header_old.tmpl | 4 | ||||
-rw-r--r-- | templates/repo/home.tmpl | 9 | ||||
-rw-r--r-- | templates/repo/pulls/compare.tmpl | 51 |
5 files changed, 62 insertions, 8 deletions
diff --git a/templates/admin/repo/list.tmpl b/templates/admin/repo/list.tmpl index 981e2ef72b..5747ccecd2 100644 --- a/templates/admin/repo/list.tmpl +++ b/templates/admin/repo/list.tmpl @@ -17,7 +17,7 @@ <table class="table table-striped"> <thead> <tr> - <th>Id</th> + <th>ID</th> <th>{{.i18n.Tr "admin.repos.owner"}}</th> <th>{{.i18n.Tr "admin.repos.name"}}</th> <th>{{.i18n.Tr "admin.repos.private"}}</th> @@ -30,7 +30,7 @@ <tbody> {{range .Repos}} <tr> - <td>{{.Id}}</td> + <td>{{.ID}}</td> <td><a href="{{AppSubUrl}}/{{.Owner.Name}}">{{.Owner.Name}}</a></td> <td><a href="{{AppSubUrl}}/{{.Owner.Name}}/{{.Name}}">{{.Name}}</a></td> <td><i class="fa fa{{if .IsPrivate}}-check{{end}}-square-o"></i></td> diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl index 514fef6b7b..5598357273 100644 --- a/templates/repo/header.tmpl +++ b/templates/repo/header.tmpl @@ -7,7 +7,7 @@ <div class="divider"> / </div> <a href="{{$.RepoLink}}">{{.Name}}</a> {{if .IsMirror}}<div class="ui label">{{$.i18n.Tr "mirror"}}</div>{{end}} - {{if .IsFork}}<div class="fork-flag">{{$.i18n.Tr "repo.forked_from"}} <a href="{{.ForkRepo.RepoLink}}">{{SubStr .ForkRepo.RepoLink 1 -1}}</a></div>{{end}} + {{if .IsFork}}<div class="fork-flag">{{$.i18n.Tr "repo.forked_from"}} <a href="{{.BaseRepo.RepoLink}}">{{SubStr .BaseRepo.RepoLink 1 -1}}</a></div>{{end}} </div> </h2> <div class="ui right floated secondary menu"> diff --git a/templates/repo/header_old.tmpl b/templates/repo/header_old.tmpl index 420cd12537..ecf9ed3a7f 100644 --- a/templates/repo/header_old.tmpl +++ b/templates/repo/header_old.tmpl @@ -7,7 +7,7 @@ <span class="divider">/</span> <a class="repo text-bold" href="{{$.RepoLink}}">{{.Name}}</a> {{if .IsMirror}}<span class="label label-gray">{{$.i18n.Tr "mirror"}}</span>{{end}} - {{if .IsFork}}<span class="fork-flag">forked from <a href="{{.ForkRepo.RepoLink}}">{{SubStr .ForkRepo.RepoLink 1 -1}}</a></span>{{end}} + {{if .IsFork}}<span class="fork-flag">forked from <a href="{{.BaseRepo.RepoLink}}">{{SubStr .BaseRepo.RepoLink 1 -1}}</a></span>{{end}} </h1> <ul id="repo-header-meta" class="right menu menu-line"> <li id="repo-header-download" class="drop"> @@ -49,7 +49,7 @@ </a> </li> <li id="repo-header-fork"> - <a id="repo-header-fork-btn" {{if or (not $.IsRepositoryAdmin) $.Owner.IsOrganization}}href="{{AppSubUrl}}/repo/fork/{{.Id}}"{{end}}> + <a id="repo-header-fork-btn" {{if or (not $.IsRepositoryAdmin) $.Owner.IsOrganization}}href="{{AppSubUrl}}/repo/fork/{{.ID}}"{{end}}> <button class="btn btn-gray text-bold btn-radius"> <i class="octicon octicon-repo-forked"></i>{{$.i18n.Tr "repo.fork"}} <span class="num">{{.NumForks}}</span> diff --git a/templates/repo/home.tmpl b/templates/repo/home.tmpl index 831a3962d8..0be1b84de7 100644 --- a/templates/repo/home.tmpl +++ b/templates/repo/home.tmpl @@ -9,11 +9,14 @@ <a class="link" href="{{.Repository.Website}}">{{.Repository.Website}}</a> </p> <ul id="repo-file-nav" class="clear menu menu-line"> - <!-- <li> - <a href="#"> + {{if and .IsRepositoryAdmin .Repository.BaseRepo}} + {{ $baseRepo := .Repository.BaseRepo}} + <li> + <a href="{{AppSubUrl}}/{{$baseRepo.Owner.Name}}/{{$baseRepo.Name}}/compare/{{$.BaseDefaultBranch}}...{{$.Owner.Name}}:{{$.BranchName}}"> <button class="btn btn-green btn-small btn-radius" id="repo-compare-btn"><i class="octicon octicon-git-compare"></i></button> </a> - </li> --> + </li> + {{end}} <li id="repo-branch-switch" class="down drop"> <a> <button class="btn btn-gray btn-medium btn-radius"> diff --git a/templates/repo/pulls/compare.tmpl b/templates/repo/pulls/compare.tmpl new file mode 100644 index 0000000000..e6ba81d357 --- /dev/null +++ b/templates/repo/pulls/compare.tmpl @@ -0,0 +1,51 @@ +{{template "base/head" .}} +<div class="repository compare pull"> + {{template "repo/header" .}} + <div class="ui middle page grid body"> + <div class="sixteen wide column page grid"> + <h2 class="ui header"> + {{.i18n.Tr "repo.pulls.compare_changes"}} + <div class="sub header">{{.i18n.Tr "repo.pulls.compare_changes_desc"}}</div> + </h2> + <div class="ui segment choose branch"> + <span class="octicon octicon-git-compare"></span> + <div class="ui floating filter dropdown"> + <div class="ui basic small button"> + <span class="text">base: {{$.BaseBranch}}</span> + <i class="dropdown icon"></i> + </div> + <div class="menu"> + <div class="ui icon search input"> + <i class="filter icon"></i> + <input name="search" placeholder="Filter branch..."> + </div> + <div class="items"> + {{range .Branches}} + <a class="{{if eq $.BaseBranch .}}active selected{{end}} item" href="{{$.RepoLink}}/compare/{{.}}...{{$.SignedUser.Name}}:{{$.HeadBranch}}">{{.}}</a> + {{end}} + </div> + </div> + </div> + ... + <div class="ui floating filter dropdown"> + <div class="ui basic small button"> + <span class="text">compare: {{$.HeadBranch}}</span> + <i class="dropdown icon"></i> + </div> + <div class="menu"> + <div class="ui icon search input"> + <i class="filter icon"></i> + <input name="search" placeholder="Filter branch..."> + </div> + <div class="items"> + {{range .HeadBranches}} + <a class="{{if eq $.HeadBranch .}}active selected{{end}} item" href="{{$.RepoLink}}/compare/{{$.BaseBranch}}...{{$.SignedUser.Name}}:{{.}}">{{.}}</a> + {{end}} + </div> + </div> + </div> + </div> + </div> + </div> +</div> +{{template "base/footer" .}}
\ No newline at end of file |