From 4bee2a7f603930a23d1f2c31440ee167dc1182ba Mon Sep 17 00:00:00 2001 From: Lucas Colombo Date: Tue, 2 Jan 2024 09:39:26 -0300 Subject: [PATCH] =?UTF-8?q?feat:=20=E2=9C=A8=20update=20to=20gitea=201.21.?= =?UTF-8?q?3=20and=20fix=20some=20issues?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit + update the theme to work with latest gitea + fix some issues with the project view --- README.md | 32 +- dist/public/assets/css/theme-dark.css | 30 +- dist/public/assets/css/theme-light.css | 30 +- dist/templates/base/footer_content.tmpl | 30 -- dist/templates/repo/home.tmpl | 295 +++++++++--------- src/templates/base/footer_content.tmpl | 30 -- src/templates/repo/home.tmpl | 295 +++++++++--------- src/themes/scss/theme/index.scss | 3 +- .../scss/theme/modules/custom/_project.scss | 19 ++ .../theme/modules/custom/_repo-header.scss | 4 +- .../scss/theme/modules/custom/index.scss | 2 + .../theme/modules/custom/repo/_file-list.scss | 25 +- tools/tasks/deploy.js | 1 - 13 files changed, 439 insertions(+), 357 deletions(-) delete mode 100644 dist/templates/base/footer_content.tmpl delete mode 100644 src/templates/base/footer_content.tmpl create mode 100644 src/themes/scss/theme/modules/custom/_project.scss diff --git a/README.md b/README.md index b4a4daf..ce25bc6 100644 --- a/README.md +++ b/README.md @@ -53,4 +53,34 @@ $ npm run serve -- --server path/to/gitea/custom $ npm run serve -- --server ~/gitea/custom # on windows $ npm run serve -- -- --server c:/gitea/custom -``` \ No newline at end of file +``` + + +# 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 +- ++ +``` + +## `repo/home.tmpl` + ++ adds `
...
` as a wrapper for the repo header data (description + labels) ++ adds `
` 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 +-
+``` + +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. diff --git a/dist/public/assets/css/theme-dark.css b/dist/public/assets/css/theme-dark.css index 5017e72..083836b 100644 --- a/dist/public/assets/css/theme-dark.css +++ b/dist/public/assets/css/theme-dark.css @@ -2199,13 +2199,14 @@ --color-expand-button: var(--c-elevation_6); --color-placeholder-text: var(--c-elevation_6); --color-editor-line-highlight: var(--color-primary-light-5); - --color-project-board-bg: var(--color-secondary-light-2); + --color-project-board-bg: var(--c-elevation_2); --color-caret: var(--color-text); --color-reaction-bg: rgba(var(--c-text-rgb), 0.07); --color-reaction-active-bg: var(--color-primary-alpha-40); --color-nav-bg: var(--c-elevation_2); --color-nav-hover-bg: var(--c-elevation_6); --color-label-active-bg: var(--c-elevation_6); + --color-label-text: var(--c-text); --color-accent: var(--color-primary-light-1); --color-small-accent: var(--color-primary-light-5); --color-active-line: var(--c-elevation_5); @@ -2839,6 +2840,8 @@ footer .ui.dropdown .menu { min-width: calc(var(--v-measure_1\.25x) + 6px); padding: 6px; text-align: center; + align-items: center; + justify-content: center; } .header-wrapper .ui.tabular.menu.navbar .item:hover { background-color: var(--c-elevation_4); @@ -2846,6 +2849,7 @@ footer .ui.dropdown .menu { #repo-topics { row-gap: var(--v-measure_\.5x); + margin-top: 0 !important; } .ui.table > tr > td, .ui.table > tbody > tr > td { @@ -2962,6 +2966,21 @@ footer .ui.dropdown .menu { .page-content.repository.file.list > .ui.container.lugit-repo-list-view #topic_edit .field.gt-f1.gt-mr-3 { margin: 0px !important; } +.page-content.repository.file.list > .ui.container.lugit-repo-list-view #topic_edit .field.gt-f1.gt-mr-3 div.fluid.multiple.search.selection.dropdown { + display: flex; + flex-wrap: wrap; + box-shadow: none; + padding: var(--v-measure_\.25x) var(--v-measure_\.5x); +} +.page-content.repository.file.list > .ui.container.lugit-repo-list-view #topic_edit .field.gt-f1.gt-mr-3 div.fluid.multiple.search.selection.dropdown .item { + border: none; +} +.page-content.repository.file.list > .ui.container.lugit-repo-list-view #topic_edit .field.gt-f1.gt-mr-3 div.fluid.multiple.search.selection.dropdown .menu { + top: calc(100% + 1px); +} +.page-content.repository.file.list > .ui.container.lugit-repo-list-view #topic_edit .field.gt-f1.gt-mr-3 .dropdown { + display: none; +} .page-content.repository.file.list > .ui.container.lugit-repo-list-view #topic_edit .field.gt-f1.gt-mr-3 + div { display: flex; column-gap: var(--v-measure_1x); @@ -2973,4 +2992,13 @@ footer .ui.dropdown .menu { } .page-content.repository.file.list > .ui.container.lugit-repo-list-view #repo-topics { margin-top: var(--v-measure_1x) !important; +} + +#project-board .project-column-header .project-column-title .circular.label { + display: flex; + padding: 0 !important; + align-items: center; + justify-content: center; + line-height: 16px; + padding: 0 var(--v-measure_\.25x) !important; } \ No newline at end of file diff --git a/dist/public/assets/css/theme-light.css b/dist/public/assets/css/theme-light.css index e879d42..f5199e6 100644 --- a/dist/public/assets/css/theme-light.css +++ b/dist/public/assets/css/theme-light.css @@ -2199,13 +2199,14 @@ --color-expand-button: var(--c-elevation_6); --color-placeholder-text: var(--c-elevation_6); --color-editor-line-highlight: var(--color-primary-light-5); - --color-project-board-bg: var(--color-secondary-light-2); + --color-project-board-bg: var(--c-elevation_2); --color-caret: var(--color-text); --color-reaction-bg: rgba(var(--c-text-rgb), 0.07); --color-reaction-active-bg: var(--color-primary-alpha-40); --color-nav-bg: var(--c-elevation_2); --color-nav-hover-bg: var(--c-elevation_6); --color-label-active-bg: var(--c-elevation_6); + --color-label-text: var(--c-text); --color-accent: var(--color-primary-light-1); --color-small-accent: var(--color-primary-light-5); --color-active-line: var(--c-elevation_5); @@ -2839,6 +2840,8 @@ footer .ui.dropdown .menu { min-width: calc(var(--v-measure_1\.25x) + 6px); padding: 6px; text-align: center; + align-items: center; + justify-content: center; } .header-wrapper .ui.tabular.menu.navbar .item:hover { background-color: var(--c-elevation_4); @@ -2846,6 +2849,7 @@ footer .ui.dropdown .menu { #repo-topics { row-gap: var(--v-measure_\.5x); + margin-top: 0 !important; } .ui.table > tr > td, .ui.table > tbody > tr > td { @@ -2962,6 +2966,21 @@ footer .ui.dropdown .menu { .page-content.repository.file.list > .ui.container.lugit-repo-list-view #topic_edit .field.gt-f1.gt-mr-3 { margin: 0px !important; } +.page-content.repository.file.list > .ui.container.lugit-repo-list-view #topic_edit .field.gt-f1.gt-mr-3 div.fluid.multiple.search.selection.dropdown { + display: flex; + flex-wrap: wrap; + box-shadow: none; + padding: var(--v-measure_\.25x) var(--v-measure_\.5x); +} +.page-content.repository.file.list > .ui.container.lugit-repo-list-view #topic_edit .field.gt-f1.gt-mr-3 div.fluid.multiple.search.selection.dropdown .item { + border: none; +} +.page-content.repository.file.list > .ui.container.lugit-repo-list-view #topic_edit .field.gt-f1.gt-mr-3 div.fluid.multiple.search.selection.dropdown .menu { + top: calc(100% + 1px); +} +.page-content.repository.file.list > .ui.container.lugit-repo-list-view #topic_edit .field.gt-f1.gt-mr-3 .dropdown { + display: none; +} .page-content.repository.file.list > .ui.container.lugit-repo-list-view #topic_edit .field.gt-f1.gt-mr-3 + div { display: flex; column-gap: var(--v-measure_1x); @@ -2973,4 +2992,13 @@ footer .ui.dropdown .menu { } .page-content.repository.file.list > .ui.container.lugit-repo-list-view #repo-topics { margin-top: var(--v-measure_1x) !important; +} + +#project-board .project-column-header .project-column-title .circular.label { + display: flex; + padding: 0 !important; + align-items: center; + justify-content: center; + line-height: 16px; + padding: 0 var(--v-measure_\.25x) !important; } \ No newline at end of file diff --git a/dist/templates/base/footer_content.tmpl b/dist/templates/base/footer_content.tmpl deleted file mode 100644 index f0a7865..0000000 --- a/dist/templates/base/footer_content.tmpl +++ /dev/null @@ -1,30 +0,0 @@ -
- - -
diff --git a/dist/templates/repo/home.tmpl b/dist/templates/repo/home.tmpl index ee0dd31..5214a3f 100644 --- a/dist/templates/repo/home.tmpl +++ b/dist/templates/repo/home.tmpl @@ -1,165 +1,170 @@ {{template "base/head" .}}
{{template "repo/header" .}} -
- {{template "base/alert" .}} - {{template "repo/code/recently_pushed_new_branches" .}} - {{if and (not .HideRepoInfo) (not .IsBlame)}} -
-
- {{$description := .Repository.DescriptionHTML $.Context}} - {{if $description}}{{$description | RenderCodeBlock}}{{else if .IsRepositoryAdmin}}{{ctx.Locale.Tr "repo.no_desc"}}{{end}} - {{.Repository.Website}} -
- {{if .RepoSearchEnabled}} -