feat: settings page

This commit is contained in:
Lucas Colombo
2025-01-22 00:48:56 -03:00
parent 5eb2e10d87
commit 93c89fd96a
28 changed files with 684 additions and 269 deletions

View File

@@ -4,17 +4,29 @@
*Theme for `lucaslabs` internal gitea server.*
## `dark`
> [!IMPORTANT]
> From version `v1.0.0` onwards, `gitea>=1.23` is required.
> In case you're looking for `gitea@1.22.x` support, [`v0.2.2`](https://github.com/lucas-labs/gitea-lugit-theme/releases/tag/v0.2.2)
> is the last version that supports it.
![dark theme](figs/dark.png)
## Preview
## `light`
![repository](figs/repo.png)
![light theme](figs/light.png)
<details>
<summary>Issue Page</summary>
<img src="figs/issue.png" alt="issue" width="100%">
</details>
## `auto`
<details>
<summary>Settings Page</summary>
<img src="figs/settings.png" alt="settings" width="100%">
</details>
Switches between `dark` and `light` automatically based on the user's system preference.
<details>
<summary>PR Page</summary>
<img src="figs/pr.png" alt="pr" width="100%">
</details>
## Usage
@@ -59,32 +71,6 @@ $ npm run serve -- --server ~/gitea/custom
$ npm run serve -- -- --server c:/gitea/custom
```
## Contributing
# Changes in templates
## `home.tmpl`
Here we remove everything (default gitea welcome page). We only keep the logo and the header with the login button.
## `base/head_navbar.tmpl`
The only change here is to make the logo smaller.
```diff
- <img height="30" width="30" src="{{AssetUrlPrefix}}/img/logo.svg" alt="{{ctx.Locale.Tr "logo"}}" aria-hidden="true">
+ <img height="24" src="{{AssetUrlPrefix}}/img/logo.svg" alt="{{ctx.Locale.Tr "logo"}}" aria-hidden="true">
```
## `repo/home.tmpl`
+ adds `<div class="lugit-repo-header-data">...</div>` as a wrapper for the repo header data (description + labels)
+ adds `<div class="lugit-repo-content">` as a wrapper for the repo content (files, commits, branches, etc.)
Later we use css to go from default 1 column layout to 2 column layout more similar to github's design.
```diff
- <div class="ui container {{if .IsBlame}}fluid padded{{end}}>
+ <div class="ui container {{if .IsBlame}}fluid padded{{end}} {{if and (not .IIsViewFile) (not .IsBlame)}}lugit-repo-list-view{{end}}">
```
Adds the class `lugit-repo-list-view` to the container of the repo content (only when we are not viewing a file or in blame view). This allows us to change the layout of the main repo view, except when viewing a file or in blame view.
Please feel free to open an issue or a pull request. Contributions are welcome!