Refactor "shortsha" (#26877)

The old code used complex `if` blocks and strange HTML layouts.

<details>


![image](7fbee2b8-d150-4e6b-b67e-83400fa290eb)

</details>

This PR refactors the template code and remove legacy CSS styles. The UI
doesn't change much.



![image](3e195df9-0ab5-4182-bcb2-bb20cad823f2)


![image](f707a49f-be41-4dfe-871f-2869f2230380)
This commit is contained in:
wxiaoguang 2023-09-03 10:58:52 +08:00 committed by GitHub
parent f1fe102c8c
commit fba7150ca9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 16 additions and 93 deletions

View file

@ -1308,9 +1308,13 @@ img.ui.avatar,
.ui .sha.label {
font-family: var(--fonts-monospace);
font-size: 13px;
padding: 6px 10px 4px;
font-weight: var(--font-weight-normal);
margin: 0 6px;
padding: 5px 10px;
}
.ui .sha.label .shortsha {
display: inline-block; /* not sure whether it is still needed */
}
.ui .button.copy-commit-sha {