diff options
author | Unknwon <joe2010xtmf@163.com> | 2014-07-26 18:37:18 -0400 |
---|---|---|
committer | Unknwon <joe2010xtmf@163.com> | 2014-07-26 18:37:18 -0400 |
commit | 5e8138341357f367868a32b631495c9d5a286477 (patch) | |
tree | fb36040422534e051ac381cde594ff1a208e4195 /templates | |
parent | 02a81ddb6252d1a08900d548ddb63e41bcb0b8ef (diff) | |
download | gitea-5e8138341357f367868a32b631495c9d5a286477.tar.gz gitea-5e8138341357f367868a32b631495c9d5a286477.zip |
Git installation check, show image in single file view, show short SHA1 instead of 40-length string, complete log module
Diffstat (limited to 'templates')
-rw-r--r-- | templates/org/home.tmpl | 2 | ||||
-rw-r--r-- | templates/repo/home.tmpl | 6 | ||||
-rw-r--r-- | templates/repo/view_file.tmpl | 8 | ||||
-rw-r--r-- | templates/user/dashboard/dashboard.tmpl | 48 | ||||
-rw-r--r-- | templates/user/dashboard/nav.tmpl | 2 | ||||
-rw-r--r-- | templates/user/dashboard/repo_list.tmpl | 12 |
6 files changed, 59 insertions, 19 deletions
diff --git a/templates/org/home.tmpl b/templates/org/home.tmpl index a3c2326230..b6675d3059 100644 --- a/templates/org/home.tmpl +++ b/templates/org/home.tmpl @@ -34,7 +34,7 @@ </div> <h3 class="org-repo-name"><a href="/{{$.Org.Name}}/{{.Name}}">{{.Name}}</a></h3> <p class="org-repo-description">{{.Description}}</p> - <p class="org-repo-update">Updated {{TimeSince .Updated}}</p> + <p class="org-repo-update">Updated {{TimeSince .Updated $.Lang}}</p> </div> {{end}} </div> diff --git a/templates/repo/home.tmpl b/templates/repo/home.tmpl index 1958c40998..5f16a7baf0 100644 --- a/templates/repo/home.tmpl +++ b/templates/repo/home.tmpl @@ -74,7 +74,7 @@ <a href="#"> <button class="btn btn-gray btn-small btn-radius"> <i class="octicon octicon-git-branch"></i> Branch : - <strong id="repo-branch-current">{{.BranchName}}</strong> + <strong id="repo-branch-current">{{if .IsViewBranch}}{{.BranchName}}{{else}}{{ShortSha .BranchName}}{{end}}</strong> </button> </a> <div class="drop-down panel"> @@ -87,7 +87,7 @@ </ul> <ul class="menu menu-vertical switching-list" id="repo-branch-list"> {{range .Branches}} - <li {{if eq . $.BranchName}}class="checked"{{end}}><a href="{{$.RepoLink}}/src/{{.}}"><i class="octicon octicon-check"></i>master</a></li> + <li {{if eq . $.BranchName}}class="checked"{{end}}><a href="{{$.RepoLink}}/src/{{.}}"><i class="octicon octicon-check"></i>{{.}}</a></li> {{end}} </ul> <ul class="menu menu-vertical switching-list" id="repo-tag-list"> @@ -137,7 +137,7 @@ <a class="radius" href="{{.RepoLink}}/pulls"><i class="octicon octicon-git-pull-request"></i>Pull Requests<span class="num right label label-blue label-radius">{{.Repository.NumOpenPulls}}</span></a> </li> <li class="border-bottom"></li> - <li class="head">{{.BranchName}}</li> + <li class="head">{{if .IsViewBranch}}{{.BranchName}}{{else}}{{ShortSha .BranchName}}{{end}}</li> <li> <a class="radius" href="{{.RepoLink}}/commits/{{.BranchName}}"><i class="octicon octicon-history"></i>Commits <span class="num right label label-gray label-radius">{{.CommitsCount}}</span></a> </li> diff --git a/templates/repo/view_file.tmpl b/templates/repo/view_file.tmpl index be54419404..fb05945b9f 100644 --- a/templates/repo/view_file.tmpl +++ b/templates/repo/view_file.tmpl @@ -15,6 +15,14 @@ <div class="{{if .ReadmeExist}}panel-content markdown{{end}} code-view"> {{if .ReadmeExist}} {{.FileContent | Str2html}} + {{else if not .IsFileText}} + <div class="view-raw"> + {{if .IsImageFile}} + <img src="{{.FileLink}}"> + {{else}} + <a href="{{.FileLink}}" rel="nofollow" class="btn btn-gray btn-radius">View Raw</a> + {{end}} + </div> {{else if .FileSize}} <table> <tbody> diff --git a/templates/user/dashboard/dashboard.tmpl b/templates/user/dashboard/dashboard.tmpl index 209a495b58..b472953136 100644 --- a/templates/user/dashboard/dashboard.tmpl +++ b/templates/user/dashboard/dashboard.tmpl @@ -48,7 +48,9 @@ <div id="dashboard-sidebar" class="right grid-1-3"> <ul id="dashboard-sidebar-menu" class="menu menu-line"> <li class="js-tab-nav js-tab-nav-show first" data-tab-target="#dashboard-my-repo"><a href="#">{{.i18n.Tr "repository"}}</a></li> + {{if not .ContextUser.IsOrganization}} <li class="js-tab-nav" data-tab-target="#dashboard-my-org"><a href="#">{{.i18n.Tr "organization"}}</a></li> + {{end}} <li class="js-tab-nav last" data-tab-target="#dashboard-my-mirror"><a href="#">{{.i18n.Tr "mirror"}}</a></li> <li class="drop right"> <button class="btn btn-green text-bold" id="dashboard-new-repo"> @@ -70,26 +72,68 @@ <div class="panel-body"> <ul class="list-no-style"> {{range .Repos}} - {{template "user/dashboard/repo_list" .}} + <li {{if .IsPrivate}}class="private"{{end}}> + <a href="{{$.ContextUser.Name}}/{{.Name}}"> + <i class="octicon octicon-{{if .IsPrivate}}lock{{else if .IsFork}}repo-forked{{else if .IsMirror}}repo-clone{{else}}repo{{end}}"></i> + <span class="repo-name"> + <strong class="repo">{{.Name}}</strong> + </span> + <span class="right repo-star"> + <i class="octicon octicon-star"></i>{{.NumStars}} + </span> + </a> + </li> {{end}} </ul> </div> + {{if not .ContextUser.IsOrganization}} <div class="panel-header repo-contrib-header"> <h4 class="text-bold">{{.i18n.Tr "home.collaborative_repos"}}</h4> </div> <div class="panel-body"> <ul class="list-no-style"> {{range .CollaborativeRepos}} - {{template "user/dashboard/repo_list" .}} + <li {{if .IsPrivate}}class="private"{{end}}> + <a href="{{.Owner.Name}}/{{.Name}}"> + <i class="octicon octicon-{{if .IsPrivate}}lock{{else if .IsFork}}repo-forked{{else if .IsMirror}}repo-clone{{else}}repo{{end}}"></i> + <span class="repo-name"> + <span class="repo-name-prefix">{{.Owner.Name}} / </span> + <strong class="repo">{{.Name}}</strong> + </span> + <span class="right repo-star"> + <i class="octicon octicon-star"></i>{{.NumStars}} + </span> + </a> + </li> {{end}} </ul> </div> + {{end}} </div> + {{if not .ContextUser.IsOrganization}} <div class="panel" id="dashboard-my-org"> <div class="panel-header"> <h4 class="text-bold">{{.i18n.Tr "home.my_orgs"}}</h4> </div> + <div class="panel-body"> + <ul class="list-no-style"> + {{range .ContextUser.Orgs}} + <li> + <a href="/{{.Name}}"> + <i class="octicon octicon-organization"></i> + <span class="repo-name"> + <strong class="repo">{{.Name}}</strong> + </span> + <span class="right repo-star"> + <i class="octicon octicon-repo"></i>{{.NumRepos}} + </span> + </a> + </li> + {{end}} + </ul> + </div> </div> + {{end}} <div class="panel" id="dashboard-my-mirror"> <div class="panel-header"> <h4 class="text-bold">{{.i18n.Tr "home.my_mirrors"}}</h4> diff --git a/templates/user/dashboard/nav.tmpl b/templates/user/dashboard/nav.tmpl index 6064f35692..a2d990fa7d 100644 --- a/templates/user/dashboard/nav.tmpl +++ b/templates/user/dashboard/nav.tmpl @@ -15,7 +15,7 @@ {{.SignedUser.Name}} </a> </li> - {{range .Orgs}} + {{range .ContextUser.Orgs}} <li class="org {{if eq $.ContextUser.Id .Id}}checked{{end}}"> <a href="{{.DashboardLink}}"> <i class="octicon octicon-check"></i> diff --git a/templates/user/dashboard/repo_list.tmpl b/templates/user/dashboard/repo_list.tmpl deleted file mode 100644 index e3d35e8ecc..0000000000 --- a/templates/user/dashboard/repo_list.tmpl +++ /dev/null @@ -1,12 +0,0 @@ -<li {{if .IsPrivate}}class="private"{{end}}> - <a href="{{.Owner.Name}}/{{.Name}}"> - <i class="octicon octicon-{{if .IsPrivate}}lock{{else if .IsFork}}repo-forked{{else if .IsMirror}}repo-clone{{else}}repo{{end}}"></i> - <span class="repo-name"> - <!-- <span class="repo-name-prefix">gogits / </span> --> - <strong class="repo">{{.Name}}</strong> - </span> - <span class="right repo-star"> - <i class="octicon octicon-star"></i>{{.NumStars}} - </span> - </a> -</li>
\ No newline at end of file |