diff options
author | Sergey Dryabzhinsky <sergey@rusoft.ru> | 2021-06-26 22:53:14 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-26 20:53:14 +0100 |
commit | 22a0636544237bcffb46b36b593a501e77ae02cc (patch) | |
tree | 009c2bcf2b478f45356b8aae59f29091ffc5809f /templates/user/settings/profile.tmpl | |
parent | 19ac575d572af655ab691f829d0b4de38a1f10be (diff) | |
download | gitea-22a0636544237bcffb46b36b593a501e77ae02cc.tar.gz gitea-22a0636544237bcffb46b36b593a501e77ae02cc.zip |
Add Visible modes function from Organisation to Users too (#16069)
You can limit or hide organisations. This pull make it also posible for users
- new strings to translte
- add checkbox to user profile form
- add checkbox to admin user.edit form
- filter explore page user search
- filter api admin and public user searches
- allow admins view "hidden" users
- add app option DEFAULT_USER_VISIBILITY
- rewrite many files to use Visibility field
- check for teams intersection
- fix context output
- right fake 404 if not visible
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'templates/user/settings/profile.tmpl')
-rw-r--r-- | templates/user/settings/profile.tmpl | 59 |
1 files changed, 47 insertions, 12 deletions
diff --git a/templates/user/settings/profile.tmpl b/templates/user/settings/profile.tmpl index 9f07226632..4b860049d8 100644 --- a/templates/user/settings/profile.tmpl +++ b/templates/user/settings/profile.tmpl @@ -47,27 +47,62 @@ <input id="location" name="location" value="{{.SignedUser.Location}}"> </div> - <div class="field"> - <label for="language">{{.i18n.Tr "settings.language"}}</label> - <div class="ui language selection dropdown" id="language"> - <input name="language" type="hidden" value="{{.SignedUser.Language}}"> - {{svg "octicon-triangle-down" 14 "dropdown icon"}} - <div class="text">{{range .AllLangs}}{{if eq $.SignedUser.Language .Lang}}{{.Name}}{{end}}{{end}}</div> - <div class="menu"> - {{range .AllLangs}} - <div class="item{{if eq $.SignedUser.Language .Lang}} active selected{{end}}" data-value="{{.Lang}}">{{.Name}}</div> - {{end}} - </div> + <div class="field"> + <label for="language">{{.i18n.Tr "settings.language"}}</label> + <div class="ui language selection dropdown" id="language"> + <input name="language" type="hidden" value="{{.SignedUser.Language}}"> + {{svg "octicon-triangle-down" 14 "dropdown icon"}} + <div class="text">{{range .AllLangs}}{{if eq $.SignedUser.Language .Lang}}{{.Name}}{{end}}{{end}}</div> + <div class="menu"> + {{range .AllLangs}} + <div class="item{{if eq $.SignedUser.Language .Lang}} active selected{{end}}" data-value="{{.Lang}}">{{.Name}}</div> + {{end}} </div> </div> + </div> + + <div class="ui divider"></div> + <!-- private block --> + + <div class="field"> + <label for="security-private"><strong>{{.i18n.Tr "settings.privacy"}}</strong></label> + </div> + + <div class="inline field {{if .Err_Visibility}}error{{end}}"> + <span class="inline required field"><label for="visibility">{{.i18n.Tr "settings.visibility"}}</label></span> + <div class="ui selection type dropdown"> + {{if .SignedUser.Visibility.IsPublic}} + <input type="hidden" id="visibility" name="visibility" value="0"> + {{end}} + {{if .SignedUser.Visibility.IsLimited}} + <input type="hidden" id="visibility" name="visibility" value="1"> + {{end}} + {{if .SignedUser.Visibility.IsPrivate}} + <input type="hidden" id="visibility" name="visibility" value="2"> + {{end}} + <div class="text"> + {{if .SignedUser.Visibility.IsPublic}}{{.i18n.Tr "settings.visibility.public"}}{{end}} + {{if .SignedUser.Visibility.IsLimited}}{{.i18n.Tr "settings.visibility.limited"}}{{end}} + {{if .SignedUser.Visibility.IsPrivate}}{{.i18n.Tr "settings.visibility.private"}}{{end}} + </div> + {{svg "octicon-triangle-down" 14 "dropdown icon"}} + <div class="menu"> + <div class="item poping up" data-content="{{.i18n.Tr "settings.visibility.public_tooltip"}}" data-value="0">{{.i18n.Tr "settings.visibility.public"}}</div> + <div class="item poping up" data-content="{{.i18n.Tr "settings.visibility.limited_tooltip"}}" data-value="1">{{.i18n.Tr "settings.visibility.limited"}}</div> + <div class="item poping up" data-content="{{.i18n.Tr "settings.visibility.private_tooltip"}}" data-value="2">{{.i18n.Tr "settings.visibility.private"}}</div> + </div> + </div> + </div> <div class="field"> - <label for="keep-activity-private">{{.i18n.Tr "settings.privacy"}}</label> <div class="ui checkbox" id="keep-activity-private"> <label class="poping up" data-content="{{.i18n.Tr "settings.keep_activity_private_popup"}}"><strong>{{.i18n.Tr "settings.keep_activity_private"}}</strong></label> <input name="keep_activity_private" type="checkbox" {{if .SignedUser.KeepActivityPrivate}}checked{{end}}> </div> </div> + + <div class="ui divider"></div> + <div class="field"> <button class="ui green button">{{$.i18n.Tr "settings.update_profile"}}</button> </div> |