summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorslene <vslene@gmail.com>2014-03-15 15:28:06 +0800
committerslene <vslene@gmail.com>2014-03-15 15:28:06 +0800
commit06deed820d9f48ecf972c8716b17ad58b91ab9b9 (patch)
treefc94500dd1dd607d1c6470f89abadcba84bbc285 /templates
parente251b9bbca35e01060ac3b2ee0bd836dc7719c19 (diff)
downloadgitea-06deed820d9f48ecf972c8716b17ad58b91ab9b9.tar.gz
gitea-06deed820d9f48ecf972c8716b17ad58b91ab9b9.zip
Add HomeLink and AvatarLink to User model. Please use .SignedUser in template.
Diffstat (limited to 'templates')
-rw-r--r--templates/base/navbar.tmpl4
-rw-r--r--templates/repo/nav.tmpl2
-rw-r--r--templates/user/profile.tmpl33
3 files changed, 25 insertions, 14 deletions
diff --git a/templates/base/navbar.tmpl b/templates/base/navbar.tmpl
index 38fc0a3992..9d5cc07bd3 100644
--- a/templates/base/navbar.tmpl
+++ b/templates/base/navbar.tmpl
@@ -6,8 +6,8 @@
<a class="gogs-nav-item" href="#">Explore</a>
<a class="gogs-nav-item" href="#">Help</a>{{if .IsSigned}}
<a id="gogs-nav-out" class="gogs-nav-item navbar-right navbar-btn btn btn-danger" href="/user/logout/"><i class="fa fa-power-off fa-lg"></i></a>
- <a id="gogs-nav-avatar" class="gogs-nav-item navbar-right" href="/user/{{.SignedUserName}}" data-toggle="tooltip" data-placement="bottom" title="{{.SignedUserName}}">
- <img src="http://1.gravatar.com/avatar/{{.SignedAvatar}}?s=28" alt="user-avatar" title="username"/>
+ <a id="gogs-nav-avatar" class="gogs-nav-item navbar-right" href="{{.SignedUser.HomeLink}}" data-toggle="tooltip" data-placement="bottom" title="{{.SignedUserName}}">
+ <img src="{{.SignedUser.AvatarLink}}?s=28" alt="user-avatar" title="username"/>
</a>
<a class="navbar-right gogs-nav-item" href="/repo/create" data-toggle="tooltip" data-placement="bottom" title="New Repository"><i class="fa fa-plus fa-lg"></i></a>
<a class="navbar-right gogs-nav-item{{if .PageIsUserSetting}} active{{end}}" href="/user/setting" data-toggle="tooltip" data-placement="bottom" title="Setting"><i class="fa fa-cogs fa-lg"></i></a>
diff --git a/templates/repo/nav.tmpl b/templates/repo/nav.tmpl
index 1a9434e860..6637062a84 100644
--- a/templates/repo/nav.tmpl
+++ b/templates/repo/nav.tmpl
@@ -37,6 +37,6 @@
<button type="button" class="btn btn-default"><i class="fa fa-code-fork"></i>Fork&nbsp;&nbsp;{{.Repository.NumForks}}</button>
</div>
</div>
- <h3><i class="fa fa-book fa-lg"></i><a href="/user/{{.Owner.Name}}">{{.Owner.Name}}</a> / {{.Repository.Name}}</h3>
+ <h3><i class="fa fa-book fa-lg"></i><a href="{{.Owner.HomeLink}}">{{.Owner.Name}}</a> / {{.Repository.Name}}</h3>
</div>
</div> \ No newline at end of file
diff --git a/templates/user/profile.tmpl b/templates/user/profile.tmpl
index b04ddbbed7..fd4313efdc 100644
--- a/templates/user/profile.tmpl
+++ b/templates/user/profile.tmpl
@@ -3,10 +3,10 @@
<div id="gogs-body" class="container">
<div id="gogs-user-profile" class="col-md-3">
<div class="profile-avatar text-center">
- <a href="#" class="center-block" data-toggle="tooltip" data-placement="bottom" title="Change Avatar">
- <img id="gogs-user-avatar" src="http://1.gravatar.com/avatar/{{.Owner.Avatar}}?s=200" alt="user-avatar" title="username"/>
+ <a href="{{.Owner.HomeLink}}" class="center-block" data-toggle="tooltip" data-placement="bottom" title="Change Avatar">
+ <img id="gogs-user-avatar" src="{{.Owner.AvatarLink}}?s=200" alt="user-avatar" title="username"/>
</a>
- <span id="gogs-user-name" class="center-block" href="#">{{.Owner.Name}}</span>
+ <span id="gogs-user-name" class="center-block">{{.Owner.Name}}</span>
</div>
<div class="profile-info">
<ul class="list-group">
@@ -19,22 +19,33 @@
{{if .Owner.Website}}
<li class="list-group-item"><i class="fa fa-link"></i><a target="_blank" href="{{.Owner.Website}}">{{.Owner.Website}}</a></li>
{{end}}
- <li class="list-group-item"><i class="fa fa-clock-o"></i>{{.Owner.Created}}</li>
+ <li class="list-group-item"><i class="fa fa-clock-o"></i>Joined on {{DateFormat .Owner.Created "M d, Y"}}</li>
</ul>
</div>
</div>
<div id="gogs-user-activity" class="col-md-9">
<ul class="nav nav-tabs" id="gogs-user-act-tabs" data-init="tabs">
- <li class="active"><a href="#repo" data-toggle="tab"><i class="fa fa-gittip"></i>Repositories</a></li>
- <li><a href="#activity" data-toggle="tab"><i class="fa fa-rss"></i>Public Activity</a></li>
+ <li{{if not .TabName}} class="active"{{end}}><a href="{{.Owner.HomeLink}}"><i class="fa fa-gittip"></i>Repositories</a></li>
+ <li{{if eq .TabName "activity"}} class="active"{{end}}><a href="{{.Owner.HomeLink}}?tab=activity"><i class="fa fa-rss"></i>Public Activity</a></li>
</ul>
<div class="tab-content">
- <div class="tab-pane active" id="repo">repo</div>
- <div class="tab-pane" id="activity">
- {{range .Feeds}}<div>
- <i class="fa fa-{{ActionIcon .OpType}}"></i>{{ActionDesc . | str2html}} {{TimeSince .Created}}
- </div>{{end}}
+ {{if eq .TabName "activity"}}
+ <div class="tab-pane active">
+ <ul class="list-unstyled activity-list">
+ {{range .Feeds}}
+ <li>
+ <i class="icon fa fa-{{ActionIcon .OpType}}"></i>
+ <div class="info"><span class="meta">{{TimeSince .Created}}</span><br>{{ActionDesc . | str2html}}</div>
+ <span class="clearfix"></span>
+ </li>
+ {{else}}
+ <li>Not found any activity</li>
+ {{end}}
+ </ul>
</div>
+ {{else}}
+ <div class="tab-pane active">repo</div>
+ {{end}}
</div>
</div>
</div>