Skip to content

Commit ba0173a

Browse files
authored
Merge branch 'main' into auto-merge_webUI
2 parents 402b6a0 + b65ad70 commit ba0173a

35 files changed

+119
-53
lines changed

assets/favicon.svg

Lines changed: 31 additions & 0 deletions
Loading

build/generate-images.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {fileURLToPath} from 'url';
88
const {readFile, writeFile} = fs.promises;
99
const __dirname = dirname(fileURLToPath(import.meta.url));
1010
const logoFile = resolve(__dirname, '../assets/logo.svg');
11+
const faviconFile = resolve(__dirname, '../assets/favicon.svg');
1112

1213
function exit(err) {
1314
if (err) console.error(err);
@@ -68,15 +69,17 @@ async function generate(svg, outputFile, {size, bg}) {
6869

6970
async function main() {
7071
const gitea = process.argv.slice(2).includes('gitea');
71-
const svg = await readFile(logoFile, 'utf8');
72+
const logoSvg = await readFile(logoFile, 'utf8');
73+
const faviconSvg = await readFile(faviconFile, 'utf8');
7274

7375
await Promise.all([
74-
generate(svg, resolve(__dirname, '../public/img/logo.svg'), {size: 32}),
75-
generate(svg, resolve(__dirname, '../public/img/logo.png'), {size: 512}),
76-
generate(svg, resolve(__dirname, '../public/img/favicon.png'), {size: 180}),
77-
generate(svg, resolve(__dirname, '../public/img/avatar_default.png'), {size: 200}),
78-
generate(svg, resolve(__dirname, '../public/img/apple-touch-icon.png'), {size: 180, bg: true}),
79-
gitea && generate(svg, resolve(__dirname, '../public/img/gitea.svg'), {size: 32}),
76+
generate(logoSvg, resolve(__dirname, '../public/img/logo.svg'), {size: 32}),
77+
generate(logoSvg, resolve(__dirname, '../public/img/logo.png'), {size: 512}),
78+
generate(faviconSvg, resolve(__dirname, '../public/img/favicon.svg'), {size: 32}),
79+
generate(faviconSvg, resolve(__dirname, '../public/img/favicon.png'), {size: 180}),
80+
generate(logoSvg, resolve(__dirname, '../public/img/avatar_default.png'), {size: 200}),
81+
generate(logoSvg, resolve(__dirname, '../public/img/apple-touch-icon.png'), {size: 180, bg: true}),
82+
gitea && generate(logoSvg, resolve(__dirname, '../public/img/gitea.svg'), {size: 32}),
8083
]);
8184
}
8285

docs/content/doc/advanced/customizing-gitea.en-us.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,15 @@ the url `http://gitea.domain.tld/assets/image.png`.
6060

6161
## Changing the logo
6262

63-
To build a custom logo clone the Gitea source repository, replace `assets/logo.svg` and run
64-
`make generate-images`. This will update below output files which you can then place in `$GITEA_CUSTOM/public/img` on your server:
63+
To build a custom logo and/or favicon clone the Gitea source repository, replace `assets/logo.svg` and/or `assets/favicon.svg` and run
64+
`make generate-images`. `assets/favicon.svg` is used for the favicon only. This will update below output files which you can then place in `$GITEA_CUSTOM/public/img` on your server:
6565

66-
- `public/img/logo.svg` - Used for favicon, site icon, app icon
66+
- `public/img/logo.svg` - Used for site icon, app icon
6767
- `public/img/logo.png` - Used for Open Graph
68-
- `public/img/favicon.png` - Used as fallback for browsers that don't support SVG favicons
6968
- `public/img/avatar_default.png` - Used as the default avatar image
7069
- `public/img/apple-touch-icon.png` - Used on iOS devices for bookmarks
70+
- `public/img/favicon.svg` - Used for favicon
71+
- `public/img/favicon.png` - Used as fallback for browsers that don't support SVG favicons
7172

7273
In case the source image is not in vector format, you can attempt to convert a raster image using tools like [this](https://www.aconvert.com/image/png-to-svg/).
7374

models/db/context.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"code.gitea.io/gitea/modules/setting"
1212

1313
"xorm.io/builder"
14+
"xorm.io/xorm/schemas"
1415
)
1516

1617
// DefaultContext is the default context to run xorm queries in
@@ -175,3 +176,24 @@ func CountByBean(ctx context.Context, bean interface{}) (int64, error) {
175176
func TableName(bean interface{}) string {
176177
return x.TableName(bean)
177178
}
179+
180+
// EstimateCount returns an estimate of total number of rows in table
181+
func EstimateCount(ctx context.Context, bean interface{}) (int64, error) {
182+
e := GetEngine(ctx)
183+
e.Context(ctx)
184+
185+
var rows int64
186+
var err error
187+
tablename := TableName(bean)
188+
switch x.Dialect().URI().DBType {
189+
case schemas.MYSQL:
190+
_, err = e.Context(ctx).SQL("SELECT table_rows FROM information_schema.tables WHERE tables.table_name = ? AND tables.table_schema = ?;", tablename, x.Dialect().URI().DBName).Get(&rows)
191+
case schemas.POSTGRES:
192+
_, err = e.Context(ctx).SQL("SELECT reltuples AS estimate FROM pg_class WHERE relname = ?;", tablename).Get(&rows)
193+
case schemas.MSSQL:
194+
_, err = e.Context(ctx).SQL("sp_spaceused ?;", tablename).Get(&rows)
195+
default:
196+
return e.Context(ctx).Count(tablename)
197+
}
198+
return rows, err
199+
}

models/statistic.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func GetStatistic() (stats Statistic) {
5656
stats.Counter.Repo, _ = repo_model.CountRepositories(db.DefaultContext, repo_model.CountRepositoryOptions{})
5757
stats.Counter.Watch, _ = e.Count(new(repo_model.Watch))
5858
stats.Counter.Star, _ = e.Count(new(repo_model.Star))
59-
stats.Counter.Action, _ = e.Count(new(Action))
59+
stats.Counter.Action, _ = db.EstimateCount(db.DefaultContext, new(Action))
6060
stats.Counter.Access, _ = e.Count(new(access_model.Access))
6161

6262
type IssueCount struct {

options/gitignore/Umbraco

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,14 @@
3939
#ignore umbraco backoffice assest from wwwroot
4040
**/wwwroot/umbraco/
4141

42+
# SQLite files
43+
*.sqlite.db*
44+
4245
#ignore umbraco data/views/settings
4346
**/umbraco/
4447

4548
#include default location for modelsbuilder output
4649
!**/umbraco/models
4750

4851
#include default location for packages
49-
!**/umbraco/Data/packages
52+
!**/umbraco/Data/packages

options/license/Bitstream-Vera

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Copyright Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is a trademark of Bitstream, Inc.
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of the fonts accompanying this license ("Fonts") and associated documentation files (the "Font Software"), to reproduce and distribute the Font Software, including without limitation the rights to use, copy, merge, publish, distribute, and/or sell copies of the Font Software, and to permit persons to whom the Font Software is furnished to do so, subject to the following conditions:
4+
5+
The above copyright and trademark notices and this permission notice shall be included in all copies of one or more of the Font Software typefaces.
6+
7+
The Font Software may be modified, altered, or added to, and in particular the designs of glyphs or characters in the Fonts may be modified and additional glyphs or characters may be added to the Fonts, only if the fonts are renamed to names not containing either the words "Bitstream" or the word "Vera".
8+
9+
This License becomes null and void to the extent applicable to Fonts or Font Software that has been modified and is distributed under the "Bitstream Vera" names.
10+
11+
The Font Software may be sold as part of a larger software package but no copy of one or more of the Font Software typefaces may be sold by itself.
12+
13+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.
14+
15+
Except as contained in this notice, the names of Gnome, the Gnome Foundation, and Bitstream Inc., shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Font Software without prior written authorization from the Gnome Foundation or Bitstream Inc., respectively. For further information, contact: fonts at gnome dot org.

options/locale/locale_cs-CZ.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2323,7 +2323,6 @@ total=Celkem: %d
23232323
dashboard.statistic=Souhrn
23242324
dashboard.operations=Operace údržby
23252325
dashboard.system_status=Status systému
2326-
dashboard.statistic_info=Databáze Gitea obsahuje <b>%d</b> uživatelů, <b>%d</b> organizací, <b>%d</b> veřejných klíčů, <b>%d</b> repozitářů, <b>%d</b> hlídání, <b>%d</b> oblíbení, <b>%d</b> akcí, <b>%d</b> přístupů, <b>%d</b> úkolů, <b>%d</b> komentářů, <b>%d</b> účtů sociálních sítí, <b>%d</b> sledování, <b>%d</b> zrcadel, <b>%d</b> vydání, <b>%d</b> zdrojů ověřování, <b>%d</b> webových háčků, <b>%d</b> milníků, <b>%d</b> štítků, <b>%d</b> háčků, <b>%d</b> týmů, <b>%d</b> úkolů změn, <b>%d</b> příloh.
23272326
dashboard.operation_name=Název operace
23282327
dashboard.operation_switch=Přepnout
23292328
dashboard.operation_run=Spustit

options/locale/locale_de-DE.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2360,7 +2360,6 @@ total=Gesamt: %d
23602360
dashboard.statistic=Übersicht
23612361
dashboard.operations=Wartungsoperationen
23622362
dashboard.system_status=System-Status
2363-
dashboard.statistic_info=Giteas Datenbank hat <b>%d</b> Benutzer, <b>%d</b> Organisationen, <b>%d</b> öffentliche Schlüssel, <b>%d</b> Repositorys, <b>%d</b> Beobachtungen, <b>%d</b> Favoriten, <b>%d</b> Aktionen, <b>%d</b> Zugriffe, <b>%d</b> Issues, <b>%d</b> Kommentare, <b>%d</b> Konten sozialer Netzwerke, <b>%d</b> Gefolgte, <b>%d</b> Mirrors, <b>%d</b> Releases, <b>%d</b> Login-Quellen, <b>%d</b> Webhooks, <b>%d</b> Meilensteine, <b>%d</b> Label, <b>%d</b> Hook-Tasks, <b>%d</b> Teams, <b>%d</b> Aktualisierungs-Tasks, <b>%d</b> Anhänge.
23642363
dashboard.operation_name=Name der Operation
23652364
dashboard.operation_switch=Wechseln
23662365
dashboard.operation_run=Ausführen

options/locale/locale_el-GR.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2362,7 +2362,6 @@ total=Σύνολο: %d
23622362
dashboard.statistic=Περίληψη
23632363
dashboard.operations=Λειτουργίες Συντήρησης
23642364
dashboard.system_status=Κατάσταση Συστήματος
2365-
dashboard.statistic_info=Η βάση δεδομένων του Gitea περιέχει <b>%d</b> χρήστες, <b>%d</b> οργανισμούς, <b>%d</b> δημόσια κλειδιά, <b>%d</b> αποθετήρια, <b>%d</b> παρακολουθήσεις, <b>%d</b> αστέρια, <b>%d</b> δράσεις, <b>%d</b> προσβάσεις, <b>%d</b> ζητήματα, <b>%d</b> σχόλια, <b>%d</b> λογαριασμούς κοινωνικών, <b>%d</b> ακόλουθους, <b>%d</b> είδωλα, <b>%d</b> εκδόσεις, <b>%d</b> πηγές ταυτοποίησης, <b>%d</b> webhooks, <b>%d</b> ορόσημα, <b>%d</b> σήματα, <b>%d</b> εργασίες hook, <b>%d</b> ομάδες, <b>%d</b> εργασίες ενημέρωσης, <b>%d</b> συνημμένα.
23662365
dashboard.operation_name=Όνομα Λειτουργίας
23672366
dashboard.operation_switch=Αλλαγή
23682367
dashboard.operation_run=Εκτέλεση

0 commit comments

Comments
 (0)