]> source.dussan.org Git - gitea.git/commitdiff
Minor UI improvements: logo alignment, auth map editor, auth name display (#25043)
authorwxiaoguang <wxiaoguang@gmail.com>
Fri, 2 Jun 2023 10:02:20 +0000 (18:02 +0800)
committerGitHub <noreply@github.com>
Fri, 2 Jun 2023 10:02:20 +0000 (18:02 +0800)
Some minor UI improvements together (then no need to review 3 small PRs)

# The Map for auth sources

Close #24826

Now the LDAP and OAuth2 both have multiple line editor for the map (and
it can be resized by the handler)

<details>

![image](https://github.com/go-gitea/gitea/assets/2114189/7eed1618-0d71-4df2-84bd-ca20a06c02db)

![image](https://github.com/go-gitea/gitea/assets/2114189/a94dc6dc-0e3b-4185-bac1-8d16561b8e62)

</details>

# The account link display

Before, the UI is misaligned

This PR fixes the misalignment, remove "float right", and show the auth
source name and auth type (in the tooltip).

And the "active" color is changed from dark red to primary color.

Before:

<details>

![image](https://github.com/go-gitea/gitea/assets/2114189/3bb4a8f2-2f66-4d62-ac96-096f14aeb819)

</details>

After:

<details>

![image](https://github.com/go-gitea/gitea/assets/2114189/05ca46ae-7769-422d-a52a-b7402679cd05)

</details>

# The UI logo alignment

Changed file: `css/base.css`.

Before, there were some "fine tunes", these "fine tunes" only causes
misalignment.

<details>

![image](https://github.com/go-gitea/gitea/assets/2114189/395b03c2-6e8c-4742-abf9-8d548dab908d)

</details>

After this PR:

<details>

![image](https://github.com/go-gitea/gitea/assets/2114189/3339acdc-7391-45bc-b6ec-a5b3bc7830a6)

![image](https://github.com/go-gitea/gitea/assets/2114189/656a7bee-cdfb-4232-aee9-25b76cae8e00)

</details>

templates/admin/auth/edit.tmpl
templates/admin/auth/source/ldap.tmpl
templates/admin/auth/source/oauth.tmpl
templates/user/settings/security/accountlinks.tmpl
web_src/css/base.css

index b81e7b5ff371cc268f6963430f8a0364c0132f55..af9d4c4bc502487856517f5680d1d113e03f5aa7 100644 (file)
                                                </div>
                                                <div class="field">
                                                        <label>{{.locale.Tr "admin.auths.map_group_to_team"}}</label>
-                                                       <input name="group_team_map" value="{{$cfg.GroupTeamMap}}" placeholder='e.g. {"cn=my-group,cn=groups,dc=example,dc=org": {"MyGiteaOrganization": ["MyGiteaTeam1", "MyGiteaTeam2"]}}'>
+                                                       <textarea name="group_team_map" rows="5" placeholder='e.g. {"cn=my-group,cn=groups,dc=example,dc=org": {"MyGiteaOrganization": ["MyGiteaTeam1", "MyGiteaTeam2"]}}'>{{$cfg.GroupTeamMap}}</textarea>
                                                </div>
                                                <div class="ui checkbox">
                                                        <label>{{.locale.Tr "admin.auths.map_group_to_team_removal"}}</label>
                                        </div>
                                        <div class="field">
                                                <label>{{.locale.Tr "admin.auths.oauth2_map_group_to_team"}}</label>
-                                               <input name="oauth2_group_team_map" value="{{$cfg.GroupTeamMap}}" placeholder='e.g. {"Developer": {"MyGiteaOrganization": ["MyGiteaTeam1", "MyGiteaTeam2"]}}'>
+                                               <textarea name="oauth2_group_team_map" rows="5" placeholder='e.g. {"Developer": {"MyGiteaOrganization": ["MyGiteaTeam1", "MyGiteaTeam2"]}}'>{{$cfg.GroupTeamMap}}</textarea>
                                        </div>
                                        <div class="ui checkbox">
                                                <label>{{.locale.Tr "admin.auths.oauth2_map_group_to_team_removal"}}</label>
index 909cf77047fee02a87f2819172cf0a31ea3284ab..26eef890b29fa6dcc10b663ca3f6b1262e3169d3 100644 (file)
                </div>
                <div class="field">
                        <label>{{.locale.Tr "admin.auths.map_group_to_team"}}</label>
-                       <input name="group_team_map" value="{{.group_team_map}}" placeholder='e.g. {"cn=my-group,cn=groups,dc=example,dc=org": {"MyGiteaOrganization": ["MyGiteaTeam1", "MyGiteaTeam2"]}}'>
+                       <textarea name="group_team_map" rows="5" placeholder='e.g. {"cn=my-group,cn=groups,dc=example,dc=org": {"MyGiteaOrganization": ["MyGiteaTeam1", "MyGiteaTeam2"]}}'>{{.group_team_map}}</textarea>
                </div>
                <div class="ui checkbox">
                        <label>{{.locale.Tr "admin.auths.map_group_to_team_removal"}}</label>
index 277ebdb011625e595f1d14212ea9de0abf957c89..a0c5a87d0ff30a9c97df98e6c1f42983ea20e84d 100644 (file)
        </div>
        <div class="field">
                <label>{{.locale.Tr "admin.auths.oauth2_map_group_to_team"}}</label>
-               <input name="oauth2_group_team_map" value="{{.oauth2_group_team_map}}" placeholder='e.g. {"Developer": {"MyGiteaOrganization": ["MyGiteaTeam1", "MyGiteaTeam2"]}}'>
+               <textarea name="oauth2_group_team_map" rows="5" placeholder='e.g. {"Developer": {"MyGiteaOrganization": ["MyGiteaTeam1", "MyGiteaTeam2"]}}'>{{.oauth2_group_team_map}}</textarea>
        </div>
        <div class="ui checkbox">
                <label>{{.locale.Tr "admin.auths.oauth2_map_group_to_team_removal"}}</label>
index 29fbe6832cbd336c3bd98a82aea547e5071390c0..b9f8af34c74265195c0938159897a4fb6c632337 100644 (file)
                </div>
                {{if .AccountLinks}}
                        {{range $loginSource, $provider := .AccountLinks}}
-                               <div class="item">
-                                       <div class="right floated content">
-                                                       <button class="ui red tiny button delete-button" data-modal-id="delete-account-link" data-url="{{AppSubUrl}}/user/settings/security/account_link" data-id="{{$loginSource.ID}}">
-                                                               {{$.locale.Tr "settings.delete_key"}}
-                                                       </button>
-                                       </div>
-                                       <div class="content">
-                                               <strong>{{$provider}}</strong>
-                                               {{if $loginSource.IsActive}}<span class="text red">{{$.locale.Tr "repo.settings.active"}}</span>{{end}}
+                               <div class="item gt-df gt-ac">
+                                       <div class="gt-f1">
+                                               <span data-tooltip-content="{{$provider}}">
+                                                       {{$loginSource.Name}}
+                                                       {{if $loginSource.IsActive}}<span class="text primary">{{$.locale.Tr "repo.settings.active"}}</span>{{end}}
+                                               </span>
                                        </div>
+                                       <button class="ui red tiny button delete-button" data-modal-id="delete-account-link" data-url="{{AppSubUrl}}/user/settings/security/account_link" data-id="{{$loginSource.ID}}">
+                                               {{$.locale.Tr "settings.delete_key"}}
+                                       </button>
                                </div>
                        {{end}}
                {{end}}
index d143b20f81b4473e3279d2c3b76851abd8a5aea1..49bdfed1b74d3d4389e955ceba91ee2aa48dc00b 100644 (file)
@@ -952,18 +952,6 @@ img.ui.avatar,
 .following.bar #navbar {
   width: 100vw;
   min-height: 52px;
-  padding: 0 16px;
-}
-
-@media (max-width: 767px) {
-  .following.bar #navbar {
-    padding-left: 4px;
-    padding-right: 0;
-  }
-}
-
-.following.bar #navbar .brand {
-  margin: 0;
 }
 
 .following.bar #navbar .dropdown .avatar {