diff options
author | Unknwon <joe2010xtmf@163.com> | 2014-11-21 10:58:08 -0500 |
---|---|---|
committer | Unknwon <joe2010xtmf@163.com> | 2014-11-21 10:58:08 -0500 |
commit | 55dfe2c97876a8af5db0fb071f002e33fb686128 (patch) | |
tree | c43f8eb741f1dd69b62888202582e4894a5da66d /templates | |
parent | 3c3f7c2a56ba18d7210cc40e33e64da5219ef990 (diff) | |
download | gitea-55dfe2c97876a8af5db0fb071f002e33fb686128.tar.gz gitea-55dfe2c97876a8af5db0fb071f002e33fb686128.zip |
custom avatar upload
Diffstat (limited to 'templates')
-rw-r--r-- | templates/.VERSION | 2 | ||||
-rw-r--r-- | templates/repo/commits_table.tmpl | 8 | ||||
-rw-r--r-- | templates/repo/diff.tmpl | 5 | ||||
-rw-r--r-- | templates/repo/view_list.tmpl | 8 | ||||
-rw-r--r-- | templates/user/dashboard/feeds.tmpl | 2 | ||||
-rw-r--r-- | templates/user/profile.tmpl | 4 | ||||
-rw-r--r-- | templates/user/settings/profile.tmpl | 100 |
7 files changed, 80 insertions, 49 deletions
diff --git a/templates/.VERSION b/templates/.VERSION index 92a14ffc74..5de719a000 100644 --- a/templates/.VERSION +++ b/templates/.VERSION @@ -1 +1 @@ -0.5.8.1119 Beta
\ No newline at end of file +0.5.8.1121 Beta
\ No newline at end of file diff --git a/templates/repo/commits_table.tmpl b/templates/repo/commits_table.tmpl index d48d61a5a7..eb819e387f 100644 --- a/templates/repo/commits_table.tmpl +++ b/templates/repo/commits_table.tmpl @@ -24,7 +24,13 @@ {{$r := List .Commits}} {{range $r}} <tr> - <td class="author"><img class="avatar-20" src="{{AvatarLink .Author.Email}}" alt=""/> {{if .UserName}}<a href="{{AppSubUrl}}/{{.UserName}}">{{.Author.Name}}</a>{{else}}{{.Author.Name}}{{end}}</td> + <td class="author"> + {{if .User}} + <img class="avatar-20" src="{{.User.AvatarLink}}" alt=""/> <a href="{{AppSubUrl}}/{{.User.Name}}">{{.Author.Name}}</a> + {{else}} + <img class="avatar-20" src="{{AvatarLink .Author.Email}}" alt=""/> {{.Author.Name}} + {{end}} + </td> <td class="sha"><a rel="nofollow" class="label label-green" href="{{AppSubUrl}}/{{$username}}/{{$reponame}}/commit/{{.Id}} ">{{SubStr .Id.String 0 10}} </a></td> <td class="message"><span class="text-truncate">{{.Summary}}</span></td> <td class="date">{{TimeSince .Author.When $.Lang}}</td> diff --git a/templates/repo/diff.tmpl b/templates/repo/diff.tmpl index 7c0d1b6bb8..8e6b1b0796 100644 --- a/templates/repo/diff.tmpl +++ b/templates/repo/diff.tmpl @@ -30,10 +30,11 @@ </ul> </span> <p class="author"> - <img class="avatar-30" src="{{AvatarLink .Commit.Author.Email}}" /> {{if .Author}} - <a href="{{AppSubUrl}}/{{.Author}}"><strong>{{.Commit.Author.Name}}</strong></a> + <img class="avatar-30" src="{{.Author.AvatarLink}}" /> + <a href="{{AppSubUrl}}/{{.Author.Name}}"><strong>{{.Commit.Author.Name}}</strong></a> {{else}} + <img class="avatar-30" src="{{AvatarLink .Commit.Author.Email}}" /> <strong>{{.Commit.Author.Name}}</strong> {{end}} <span class="text-grey" id="authored-time">{{TimeSince .Commit.Author.When $.Lang}}</span> diff --git a/templates/repo/view_list.tmpl b/templates/repo/view_list.tmpl index e65d7c1134..d516eac94c 100644 --- a/templates/repo/view_list.tmpl +++ b/templates/repo/view_list.tmpl @@ -3,8 +3,14 @@ <tr> <th colspan="4" class="clear"> <span class="author left"> + {{if .LastCommitUser}} + <img class="avatar-24 radius" src="{{.LastCommitUser.AvatarLink}}" /> + <a href="{{AppSubUrl}}/{{.LastCommitUser.Name}}"><strong>{{.LastCommit.Author.Name}}</strong></a>: + {{else}} <img class="avatar-24 radius" src="{{AvatarLink .LastCommit.Author.Email}}" /> - {{if .LastCommitUser}}<a href="{{AppSubUrl}}/{{.LastCommitUser}}">{{end}}<strong>{{.LastCommit.Author.Name}}</strong>:{{if .LastCommitUser}}</a>{{end}} + <strong>{{.LastCommit.Author.Name}}</strong>: + {{end}} + </span> <span class="last-commit"><a href="{{.RepoLink}}/commit/{{.LastCommit.Id}}" rel="nofollow"> <strong>{{ShortSha .LastCommit.Id.String}}</strong></a> diff --git a/templates/user/dashboard/feeds.tmpl b/templates/user/dashboard/feeds.tmpl index 57c97def2e..834e5f0a56 100644 --- a/templates/user/dashboard/feeds.tmpl +++ b/templates/user/dashboard/feeds.tmpl @@ -1,7 +1,7 @@ {{range .Feeds}} <div class="news clear"> <div class="avatar left"> - <img class="avatar-30" src="{{AvatarLink .GetActEmail}}" alt=""> + <img class="avatar-30" src="{{.ActAvatar}}" alt=""> </div> <div class="content left {{if eq .GetOpType 5}}push-news{{end}} grid-4-5"> <p class="text-bold"> diff --git a/templates/user/profile.tmpl b/templates/user/profile.tmpl index 46bc99bda4..44c2212383 100644 --- a/templates/user/profile.tmpl +++ b/templates/user/profile.tmpl @@ -4,7 +4,11 @@ <div id="user-profile-page" class="container clear"> <div class="grid-1-5 left"> <div> + {{if .Owner.UseCustomAvatar}} + <a href="{{AppSubUrl}}/user/settings" id="profile-avatar" original-title="{{.i18n.Tr "user.change_custom_avatar"}}"> + {{else}} <a href="http://gravatar.com/emails/" id="profile-avatar" original-title="{{.i18n.Tr "user.change_avatar"}}"> + {{end}} <img class="profile-avatar" src="{{.Owner.AvatarLink}}?s=200"title="{{.Owner.Name}}"/> </a> <div class="text-center" id="profile-name"> diff --git a/templates/user/settings/profile.tmpl b/templates/user/settings/profile.tmpl index 5338d295f6..85db6f8951 100644 --- a/templates/user/settings/profile.tmpl +++ b/templates/user/settings/profile.tmpl @@ -11,49 +11,63 @@ <div class="panel-header"> <strong>{{.i18n.Tr "settings.public_profile"}}</strong> </div> - <form class="form form-align panel-body" id="user-profile-form" action="{{AppSubUrl}}/user/settings" method="post"> - {{.CsrfTokenHtml}} - <div class="text-center panel-desc">{{.i18n.Tr "settings.profile_desc"}}</div> - <div class="field"> - <label>{{.i18n.Tr "settings.uid"}}</label> - <label class="text-left">{{.SignedUser.Id}}</label> - </div> - <div class="field"> - <label class="req" for="username">{{.i18n.Tr "username"}}</label> - <input class="ipt ipt-large ipt-radius {{if .Err_UserName}}ipt-error{{end}}" id="username" name="uname" type="text" value="{{.SignedUser.Name}}" data-uname="{{.SignedUser.Name}}" required /> - </div> - <div class="white-popup-block mfp-hide" id="change-username-modal"> - <h1 class="text-red">{{.i18n.Tr "settings.change_username"}}</h1> - <p>{{.i18n.Tr "settings.change_username_desc"}}</p> - <br> - <button class="btn btn-red btn-large btn-radius" id="change-username-submit">{{.i18n.Tr "settings.continue"}}</button> - <button class="btn btn-large btn-radius popup-modal-dismiss">{{.i18n.Tr "settings.cancel"}}</button> - </div> - <div class="field"> - <label for="full-name">{{.i18n.Tr "settings.full_name"}}</label> - <input class="ipt ipt-large ipt-radius {{if .Err_FullName}}ipt-error{{end}}" id="full-name" name="fullname" type="text" value="{{.SignedUser.FullName}}" /> - </div> - <div class="field"> - <label class="req" for="email">{{.i18n.Tr "email"}}</label> - <input class="ipt ipt-large ipt-radius {{if .Err_Email}}ipt-error{{end}}" id="email" name="email" type="email" value="{{.SignedUser.Email}}" required /> - </div> - <div class="field"> - <label for="website">{{.i18n.Tr "settings.website"}}</label> - <input class="ipt ipt-large ipt-radius {{if .Err_Website}}ipt-error{{end}}" id="website" name="website" type="url" value="{{.SignedUser.Website}}" /> - </div> - <div class="field"> - <label for="location">{{.i18n.Tr "settings.location"}}</label> - <input class="ipt ipt-large ipt-radius {{if .Err_Location}}ipt-error{{end}}" id="location" name="location" type="text" value="{{.SignedUser.Location}}" /> - </div> - <div class="field"> - <label for="gravatar-email">Gravatar {{.i18n.Tr "email"}}</label> - <input class="ipt ipt-large ipt-radius {{if .Err_Avatar}}ipt-error{{end}}" id="gravatar-email" name="avatar" type="text" value="{{.SignedUser.AvatarEmail}}" /> - </div> - <div class="field"> - <label></label> - <button class="btn btn-green btn-large btn-radius" id="change-username-btn" href="#change-username-modal">{{.i18n.Tr "settings.update_profile"}}</button> - </div> - </form> + <div class="panel-body"> + <form class="form form-align" id="user-profile-form" action="{{AppSubUrl}}/user/settings" method="post"> + {{.CsrfTokenHtml}} + <div class="text-center panel-desc">{{.i18n.Tr "settings.profile_desc"}}</div> + <div class="field"> + <label>{{.i18n.Tr "settings.uid"}}</label> + <label class="text-left">{{.SignedUser.Id}}</label> + </div> + <div class="field"> + <label class="req" for="username">{{.i18n.Tr "username"}}</label> + <input class="ipt ipt-large ipt-radius {{if .Err_UserName}}ipt-error{{end}}" id="username" name="uname" type="text" value="{{.SignedUser.Name}}" data-uname="{{.SignedUser.Name}}" required /> + </div> + <div class="white-popup-block mfp-hide" id="change-username-modal"> + <h1 class="text-red">{{.i18n.Tr "settings.change_username"}}</h1> + <p>{{.i18n.Tr "settings.change_username_desc"}}</p> + <br> + <button class="btn btn-red btn-large btn-radius" id="change-username-submit">{{.i18n.Tr "settings.continue"}}</button> + <button class="btn btn-large btn-radius popup-modal-dismiss">{{.i18n.Tr "settings.cancel"}}</button> + </div> + <div class="field"> + <label for="full-name">{{.i18n.Tr "settings.full_name"}}</label> + <input class="ipt ipt-large ipt-radius {{if .Err_FullName}}ipt-error{{end}}" id="full-name" name="fullname" type="text" value="{{.SignedUser.FullName}}" /> + </div> + <div class="field"> + <label class="req" for="email">{{.i18n.Tr "email"}}</label> + <input class="ipt ipt-large ipt-radius {{if .Err_Email}}ipt-error{{end}}" id="email" name="email" type="email" value="{{.SignedUser.Email}}" required /> + </div> + <div class="field"> + <label for="website">{{.i18n.Tr "settings.website"}}</label> + <input class="ipt ipt-large ipt-radius {{if .Err_Website}}ipt-error{{end}}" id="website" name="website" type="url" value="{{.SignedUser.Website}}" /> + </div> + <div class="field"> + <label for="location">{{.i18n.Tr "settings.location"}}</label> + <input class="ipt ipt-large ipt-radius {{if .Err_Location}}ipt-error{{end}}" id="location" name="location" type="text" value="{{.SignedUser.Location}}" /> + </div> + <div class="field"> + <label for="gravatar-email">Gravatar {{.i18n.Tr "email"}}</label> + <input class="ipt ipt-large ipt-radius {{if .Err_Avatar}}ipt-error{{end}}" id="gravatar-email" name="avatar" type="text" value="{{.SignedUser.AvatarEmail}}" /> + </div> + <div class="field"> + <label></label> + <button class="btn btn-green btn-large btn-radius" id="change-username-btn" href="#change-username-modal">{{.i18n.Tr "settings.update_profile"}}</button> + </div> + </form> + <hr> + <form class="form form-align" id="user-profile-form" action="{{AppSubUrl}}/user/settings/avatar" method="post" enctype="multipart/form-data"> + {{.CsrfTokenHtml}} + <div class="field"> + <label>{{.i18n.Tr "settings.choose_new_avatar"}}</label> + <input name="avatar" type="file" required /> + </div> + <div class="field"> + <label></label> + <button class="btn btn-green btn-large btn-radius">{{.i18n.Tr "settings.upload_avatar"}}</button> + </div> + </form> + </div> </div> </div> </div> |