|
@@ -3,6 +3,13 @@ package models
|
|
|
import (
|
|
import (
|
|
|
"bytes"
|
|
"bytes"
|
|
|
"fmt"
|
|
"fmt"
|
|
|
|
|
+ "gitote/gitote/models/errors"
|
|
|
|
|
+ "gitote/gitote/pkg/avatar"
|
|
|
|
|
+ "gitote/gitote/pkg/bindata"
|
|
|
|
|
+ "gitote/gitote/pkg/markup"
|
|
|
|
|
+ "gitote/gitote/pkg/process"
|
|
|
|
|
+ "gitote/gitote/pkg/setting"
|
|
|
|
|
+ "gitote/gitote/pkg/sync"
|
|
|
"image"
|
|
"image"
|
|
|
_ "image/jpeg"
|
|
_ "image/jpeg"
|
|
|
"image/png"
|
|
"image/png"
|
|
@@ -19,20 +26,11 @@ import (
|
|
|
"github.com/go-xorm/xorm"
|
|
"github.com/go-xorm/xorm"
|
|
|
"github.com/mcuadros/go-version"
|
|
"github.com/mcuadros/go-version"
|
|
|
"github.com/nfnt/resize"
|
|
"github.com/nfnt/resize"
|
|
|
|
|
+ git "gitlab.com/gitote/git-module"
|
|
|
|
|
+ api "gitlab.com/gitote/go-gitote-client"
|
|
|
"gitlab.com/yoginth/cae/zip"
|
|
"gitlab.com/yoginth/cae/zip"
|
|
|
log "gopkg.in/clog.v1"
|
|
log "gopkg.in/clog.v1"
|
|
|
"gopkg.in/ini.v1"
|
|
"gopkg.in/ini.v1"
|
|
|
-
|
|
|
|
|
- git "gitlab.com/gitote/git-module"
|
|
|
|
|
- api "gitlab.com/gitote/go-gitote-client"
|
|
|
|
|
-
|
|
|
|
|
- "gitote/gitote/models/errors"
|
|
|
|
|
- "gitote/gitote/pkg/avatar"
|
|
|
|
|
- "gitote/gitote/pkg/bindata"
|
|
|
|
|
- "gitote/gitote/pkg/markup"
|
|
|
|
|
- "gitote/gitote/pkg/process"
|
|
|
|
|
- "gitote/gitote/pkg/setting"
|
|
|
|
|
- "gitote/gitote/pkg/sync"
|
|
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
// REPO_AVATAR_URL_PREFIX is used to identify a URL is to access repository avatar.
|
|
// REPO_AVATAR_URL_PREFIX is used to identify a URL is to access repository avatar.
|
|
@@ -152,6 +150,7 @@ type Repository struct {
|
|
|
Name string `xorm:"INDEX NOT NULL"`
|
|
Name string `xorm:"INDEX NOT NULL"`
|
|
|
Description string `xorm:"VARCHAR(512)"`
|
|
Description string `xorm:"VARCHAR(512)"`
|
|
|
Website string
|
|
Website string
|
|
|
|
|
+ Donate string
|
|
|
DefaultBranch string
|
|
DefaultBranch string
|
|
|
Size int64 `xorm:"NOT NULL DEFAULT 0"`
|
|
Size int64 `xorm:"NOT NULL DEFAULT 0"`
|
|
|
UseCustomAvatar bool
|
|
UseCustomAvatar bool
|
|
@@ -1404,6 +1403,9 @@ func updateRepository(e Engine, repo *Repository, visibilityChanged bool) (err e
|
|
|
if len(repo.Website) > 255 {
|
|
if len(repo.Website) > 255 {
|
|
|
repo.Website = repo.Website[:255]
|
|
repo.Website = repo.Website[:255]
|
|
|
}
|
|
}
|
|
|
|
|
+ if len(repo.Donate) > 255 {
|
|
|
|
|
+ repo.Donate = repo.Donate[:255]
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
if _, err = e.ID(repo.ID).AllCols().Update(repo); err != nil {
|
|
if _, err = e.ID(repo.ID).AllCols().Update(repo); err != nil {
|
|
|
return fmt.Errorf("update: %v", err)
|
|
return fmt.Errorf("update: %v", err)
|