From e7f050e1c80f9cb68494dd86138d91abd27ed5e3 Mon Sep 17 00:00:00 2001 From: Artur Galyamov Date: Tue, 20 Sep 2022 16:06:41 +0500 Subject: [PATCH] =?UTF-8?q?=D0=9A=D0=BE=D0=BE=D1=80=D0=B4=D0=B8=D0=BD?= =?UTF-8?q?=D0=B0=D1=82=D1=8B=20=D0=BF=D1=80=D0=BE=D0=B5=D0=BA=D1=82=D0=B0?= =?UTF-8?q?=20=D0=BC=D0=BE=D0=B3=D1=83=D1=82=20=D1=81=D0=BE=D0=B4=D0=B5?= =?UTF-8?q?=D1=80=D0=B6=D0=B0=D1=82=D1=8C=20=D0=BC=D0=BD=D0=BE=D0=B6=D0=B5?= =?UTF-8?q?=D1=81=D1=82=D0=B2=D0=BE=20=D0=B7=D0=BD=D0=B0=D1=87=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B9=20#65=20#120?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- models/migrations/v213.go | 6 +++--- models/repo/repo.go | 2 +- options/locale/locale_ru-RU.ini | 2 +- routers/web/repo/setting.go | 2 +- services/forms/repo_form.go | 40 ++++++++++++++++++------------------ templates/repo/settings/options.tmpl | 6 +++--- 6 files changed, 29 insertions(+), 29 deletions(-) diff --git a/models/migrations/v213.go b/models/migrations/v213.go index 0bc3adcabe..f11a0e3387 100644 --- a/models/migrations/v213.go +++ b/models/migrations/v213.go @@ -11,13 +11,13 @@ func addLocationCoordinateToRepo(engine *xorm.Engine) error { tableName := "repository" switch engine.Dialect().URI().DBType { case schemas.POSTGRES: - addColsQuery := fmt.Sprintf("ALTER TABLE \"%s\" ADD COLUMN location_coordinate VARCHAR(20);", tableName) + addColsQuery := fmt.Sprintf("ALTER TABLE \"%s\" ADD COLUMN location_coordinates VARCHAR(1024);", tableName) _, err = engine.Exec(addColsQuery) case schemas.SQLITE: - addColsQuery := fmt.Sprintf("ALTER TABLE \"%s\" ADD COLUMN location_coordinate TEXT;", tableName) + addColsQuery := fmt.Sprintf("ALTER TABLE \"%s\" ADD COLUMN location_coordinates TEXT;", tableName) _, err = engine.Exec(addColsQuery) case schemas.MYSQL: - addColsQuery := fmt.Sprintf("ALTER TABLE `%s` ADD COLUMN location_coordinate VARCHAR(20);", tableName) + addColsQuery := fmt.Sprintf("ALTER TABLE `%s` ADD COLUMN location_coordinates VARCHAR(1024);", tableName) _, err = engine.Exec(addColsQuery) } if err != nil { diff --git a/models/repo/repo.go b/models/repo/repo.go index 52c51d545a..1ffabd6391 100644 --- a/models/repo/repo.go +++ b/models/repo/repo.go @@ -103,7 +103,7 @@ type Repository struct { Resources string `xorm:"TEXT"` Competences string `xorm:"TEXT"` Website string `xorm:"VARCHAR(2048)"` - LocationCoordinate string `xorm:"VARCHAR(20)"` + LocationCoordinates string `xorm:"VARCHAR(1024)"` OriginalServiceType api.GitServiceType `xorm:"index"` OriginalURL string `xorm:"VARCHAR(2048)"` DefaultBranch string diff --git a/options/locale/locale_ru-RU.ini b/options/locale/locale_ru-RU.ini index eec461d65a..77530587e7 100644 --- a/options/locale/locale_ru-RU.ini +++ b/options/locale/locale_ru-RU.ini @@ -1719,7 +1719,7 @@ settings.email_notifications.onmention=Посылать письмо на эл. settings.email_notifications.disable=Отключить почтовые уведомления settings.email_notifications.submit=Установить настройки электронной почты settings.site=Сайт -settings.location_coordinate=Координаты +settings.location_coordinates=Координаты settings.update_settings=Обновить настройки settings.branches.update_default_branch=Обновить ветку по умолчанию settings.advanced_settings=Расширенные настройки diff --git a/routers/web/repo/setting.go b/routers/web/repo/setting.go index d0d3cde190..184ddace6d 100644 --- a/routers/web/repo/setting.go +++ b/routers/web/repo/setting.go @@ -154,7 +154,7 @@ func SettingsPost(ctx *context.Context) { repo.Resources = form.Resources repo.Competences = form.Competences repo.Website = form.Website - repo.LocationCoordinate = form.LocationCoordinate + repo.LocationCoordinates = form.LocationCoordinates repo.IsTemplate = form.Template // Visibility of forked repository is forced sync with base repository. diff --git a/services/forms/repo_form.go b/services/forms/repo_form.go index c11b0f6edd..76fc3f17c9 100644 --- a/services/forms/repo_form.go +++ b/services/forms/repo_form.go @@ -113,26 +113,26 @@ func ParseRemoteAddr(remoteAddr, authUsername, authPassword string) (string, err // RepoSettingForm form for changing repository settings type RepoSettingForm struct { - RepoName string `binding:"Required;AlphaDashDot;MaxSize(100)"` - Description string `binding:"MaxSize(255)"` - Resources string `binding:"MaxSize(1024)"` - Competences string `binding:"MaxSize(1024)"` - Website string `binding:"ValidUrl;MaxSize(255)"` - LocationCoordinate string - Interval string - MirrorAddress string - MirrorUsername string - MirrorPassword string - LFS bool `form:"mirror_lfs"` - LFSEndpoint string `form:"mirror_lfs_endpoint"` - PushMirrorID string - PushMirrorAddress string - PushMirrorUsername string - PushMirrorPassword string - PushMirrorInterval string - Private bool - Template bool - EnablePrune bool + RepoName string `binding:"Required;AlphaDashDot;MaxSize(100)"` + Description string `binding:"MaxSize(255)"` + Resources string `binding:"MaxSize(1024)"` + Competences string `binding:"MaxSize(1024)"` + Website string `binding:"ValidUrl;MaxSize(255)"` + LocationCoordinates string `binding:"MaxSize(1024)"` + Interval string + MirrorAddress string + MirrorUsername string + MirrorPassword string + LFS bool `form:"mirror_lfs"` + LFSEndpoint string `form:"mirror_lfs_endpoint"` + PushMirrorID string + PushMirrorAddress string + PushMirrorUsername string + PushMirrorPassword string + PushMirrorInterval string + Private bool + Template bool + EnablePrune bool // Advanced settings EnableWiki bool diff --git a/templates/repo/settings/options.tmpl b/templates/repo/settings/options.tmpl index dd9973f73f..85e3855d3e 100644 --- a/templates/repo/settings/options.tmpl +++ b/templates/repo/settings/options.tmpl @@ -56,9 +56,9 @@ -
- - +
+ +