From 57897cc8c2c90ab1566a65bcd1eabfd41a906070 Mon Sep 17 00:00:00 2001 From: Sergey Dryabzhinsky Date: Mon, 11 Jun 2018 15:34:26 +0300 Subject: repo: update repository description field to contain more than 256 symbols (#5219) * Update repository description field to contain more than 256 symbols - update repository model - description field now is `TEXT` and limited by 4000 symbols - new migration - add description to html forms - repo creation and repo settings - add translation for description * Update for description field, new features - add autosize (height) for description textarea, new plugin - set max description length to 512 symbols - update locales * Fix migration - typo in var * Update repo description behaviour - add textarea autosize for /repo/create - add symbols counter under description testarea (create/edit) * Fix function definition - it a var * Revert ru-RU locale * Update by review - Use type `varchar(512)` in migration - Remove unused files from autosize plugin * Fix migration - new project paths * Fixes after review 2 - copyright year - format includes - use switch instead of multi-if * Remove unused `default:` option. --- pkg/form/repo.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'pkg/form') diff --git a/pkg/form/repo.go b/pkg/form/repo.go index 5ec2cf7d..a7ab1fa7 100644 --- a/pkg/form/repo.go +++ b/pkg/form/repo.go @@ -26,7 +26,7 @@ type CreateRepo struct { UserID int64 `binding:"Required"` RepoName string `binding:"Required;AlphaDashDot;MaxSize(100)"` Private bool - Description string `binding:"MaxSize(255)"` + Description string `binding:"MaxSize(512)"` AutoInit bool Gitignores string License string @@ -45,7 +45,7 @@ type MigrateRepo struct { RepoName string `json:"repo_name" binding:"Required;AlphaDashDot;MaxSize(100)"` Mirror bool `json:"mirror"` Private bool `json:"private"` - Description string `json:"description" binding:"MaxSize(255)"` + Description string `json:"description" binding:"MaxSize(512)"` } func (f *MigrateRepo) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors { @@ -82,7 +82,7 @@ func (f MigrateRepo) ParseRemoteAddr(user *models.User) (string, error) { type RepoSetting struct { RepoName string `binding:"Required;AlphaDashDot;MaxSize(100)"` - Description string `binding:"MaxSize(255)"` + Description string `binding:"MaxSize(512)"` Website string `binding:"Url;MaxSize(100)"` Branch string Interval int -- cgit v1.2.3