mirror of
https://github.com/go-gitea/gitea.git
synced 2025-11-08 05:02:38 +09:00
Compare commits
11 Commits
v1.6.0-rc2
...
v1.6.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0da8bc9ec0 | ||
|
|
5d69703d3c | ||
|
|
ffc0c7f611 | ||
|
|
8670decafb | ||
|
|
297e619074 | ||
|
|
e9b984e162 | ||
|
|
5995b65175 | ||
|
|
996ce8cc03 | ||
|
|
fe7cef0e1f | ||
|
|
464dcd1b66 | ||
|
|
68938d5dc4 |
165
CHANGELOG.md
165
CHANGELOG.md
@@ -4,29 +4,19 @@ This changelog goes through all the changes that have been made in each release
|
|||||||
without substantial changes to our git log; to see the highlights of what has
|
without substantial changes to our git log; to see the highlights of what has
|
||||||
been added to each release, please refer to the [blog](https://blog.gitea.io).
|
been added to each release, please refer to the [blog](https://blog.gitea.io).
|
||||||
|
|
||||||
## [1.6.0-rc2](https://github.com/go-gitea/gitea/releases/tag/v1.6.0-rc2) - 2018-11-04
|
## [1.6.0](https://github.com/go-gitea/gitea/releases/tag/v1.6.0) - 2018-11-22
|
||||||
* SECURITY
|
|
||||||
* Add CSRF checking to reqToken and add reqToken to admin API routes (#5272) (#5250)
|
|
||||||
* FEATURE
|
|
||||||
* Add comment replies (#5147) (#5104)
|
|
||||||
* BUGFIXES
|
|
||||||
* Fix wrong api request url for instances running in subfolders (#5261) (#5247)
|
|
||||||
* Accept web-command cli flags if web-command is commited (#5245) (#5200)
|
|
||||||
* Reduce join star, repo_topic, topic tables on repo search, to resolve extra columns problem on MSSQL (#5136) (#5229)
|
|
||||||
* Fix data race on migrate repository (#5224) (#5230)
|
|
||||||
* Add secret to all webhook's payload where it has been missing (#5208) (#5199)
|
|
||||||
* Fix sqlite and MSSQL lock (#5210) (#5223) (#5214) (#5218) (#5176) (#5179)
|
|
||||||
* Fix race on updatesize (#5190) (#5215)
|
|
||||||
* Fix filtering issues by tags on main screen issues (#5219) (#3824)
|
|
||||||
* Fix SQL quoting (#5137) (#5117)
|
|
||||||
* Fix regex to support optional end line of old section in diff hunk (#5097) (#5096)
|
|
||||||
|
|
||||||
## [1.6.0-rc1](https://github.com/go-gitea/gitea/releases/tag/v1.6.0-rc1) - 2018-10-17
|
|
||||||
* BREAKING
|
* BREAKING
|
||||||
* Respect email privacy option in user search via API (#4512)
|
* Respect email privacy option in user search via API (#4512)
|
||||||
* Simply remove tidb and deps (#3993)
|
* Simply remove tidb and deps (#3993)
|
||||||
* Swagger.v1.json template (#3572)
|
* Swagger.v1.json template (#3572)
|
||||||
|
* SECURITY
|
||||||
|
* Add CSRF checking to reqToken and add reqToken to admin API routes (#5272) (#5250)
|
||||||
|
* Improve URL validation for external wiki and external issues (#4710)
|
||||||
|
* Make cookies HttpOnly and obey COOKIE_SECURE flag (#4706)
|
||||||
|
* Don't disclose emails of all users when sending out emails (#4664)
|
||||||
|
* Check that repositories can only be migrated to own user or organizations (#4366)
|
||||||
* FEATURE
|
* FEATURE
|
||||||
|
* Add comment replies (#5147) (#5104)
|
||||||
* Pull request review/approval and comment on code (#3748)
|
* Pull request review/approval and comment on code (#3748)
|
||||||
* Added dependencies for issues (#2196) (#2531)
|
* Added dependencies for issues (#2196) (#2531)
|
||||||
* Add the ability to have built in themes in Gitea and provide dark theme arc-green (#4198)
|
* Add the ability to have built in themes in Gitea and provide dark theme arc-green (#4198)
|
||||||
@@ -38,63 +28,6 @@ been added to each release, please refer to the [blog](https://blog.gitea.io).
|
|||||||
* Add push webhook support for mirrored repositories (#4127)
|
* Add push webhook support for mirrored repositories (#4127)
|
||||||
* Add csv file render support defaultly (#4105)
|
* Add csv file render support defaultly (#4105)
|
||||||
* Add Recaptcha functionality to Gitea (#4044)
|
* Add Recaptcha functionality to Gitea (#4044)
|
||||||
* BUGFIXES
|
|
||||||
* Fix release creation via API (#5076)
|
|
||||||
* Remove links from topics in edit mode (#5026)
|
|
||||||
* Fix missing AppSubUrl in few more templates (fixup) (#5021)
|
|
||||||
* Fix missing AppSubUrl in some templates (#5020)
|
|
||||||
* Hide outdated comments in file view (#5017)
|
|
||||||
* Upgrade gopkg.in/testfixtures.v2 (#4999)
|
|
||||||
* Disable debug routes unless PPROF is enabled in configuration (#4995)
|
|
||||||
* Fix user menu item styling (#4985)
|
|
||||||
* Fix layout of the topics editing form (#4971)
|
|
||||||
* Fix null pointer dereference in ParseCommitWithSignature (#4962)
|
|
||||||
* Fix url in discord webhook (#4953)
|
|
||||||
* Detect charset and convert non UTF-8 files for display (#4950)
|
|
||||||
* Make sure to catch the right error so it is displayed on the UI (#4945)
|
|
||||||
* Fix(topics): don't redirect to explore page. (#4938)
|
|
||||||
* Fix bug forget to remove Stopwatch when remove repository (#4928)
|
|
||||||
* Fix bug when repo remained bare if multiple branches pushed in single push (#4923)
|
|
||||||
* Fix: Let's Encrypt configuration settings (#4911)
|
|
||||||
* Fix: Crippled diff (#4726) (#4900)
|
|
||||||
* Fix trimming of markup section names (#4863)
|
|
||||||
* Issues api allow pulls and fix #4832 (#4852)
|
|
||||||
* Do not autocreate directory for new users/orgs (#4828) (#4849)
|
|
||||||
* Fix redirect with non-ascii branch names (#4764) (#4810)
|
|
||||||
* Fix missing release title in webhook (#4783) (#4796)
|
|
||||||
* User shouldn't be able to approve or reject his/her own PR (#4729)
|
|
||||||
* Make sure to reset commit count in the cache on mirror syncing (#4720)
|
|
||||||
* Fixed bug where team with admin privelege type doesn't get any unit (#4719)
|
|
||||||
* Fix incorrect caption of webhook setting (#4701) (#4717)
|
|
||||||
* Allow WIP marker to contains < or > (#4709)
|
|
||||||
* Hide org/create menu item in Dashboard if user has no rights (#4678) (#4680)
|
|
||||||
* Site admin could create repos even MAX_CREATION_LIMIT=0 (#4645)
|
|
||||||
* Fix custom templates being ignored (#4638)
|
|
||||||
* Fix starring icon after semantic ui update (#4628)
|
|
||||||
* Fix Split-View line adjustment (#4622)
|
|
||||||
* Fix integer constant overflows in tests (#4616)
|
|
||||||
* Push whitelist now doesn't apply to branch deletion (#4601) (#4607)
|
|
||||||
* Fix bugs when too many IN variables (#4594)
|
|
||||||
* Fix failure on creating pull request with assignees (#4419) (#4583)
|
|
||||||
* Fix panic issue on update avatar email (#4580) (#4581)
|
|
||||||
* Fix status code label for a successful webhook (#4540)
|
|
||||||
* An inactive user shouldn't be able to be added as a collaborator (#4535)
|
|
||||||
* Don't fail silently if trying to add a collaborator twice (#4533)
|
|
||||||
* Fix incorrect MergeWhitelistTeamIDs check in CanUserMerge function (#4519) (#4525)
|
|
||||||
* Fix out-of-transaction query in removeOrgUser (#4521) (#4522)
|
|
||||||
* Fix migration from older releases (#4495)
|
|
||||||
* Accept 'Data:' in commit graph (#4487)
|
|
||||||
* Update xorm to latest version and fix correct `user` table referencing in sql (#4473)
|
|
||||||
* Relative URLs for LibreJS page (#4460)
|
|
||||||
* Redirect to correct page after using scratch token (#4458)
|
|
||||||
* Fix column droping for MSSQL that need new transaction for that (#4440)
|
|
||||||
* Replace src with raw to fix image paths (#4377)
|
|
||||||
* Add default merge options when creating new repository (#4369)
|
|
||||||
* Fix docker build (#4358)
|
|
||||||
* Fixes repo membership check in API (#4341)
|
|
||||||
* Dep upgrade mysql lib (#4161)
|
|
||||||
* Fix some issues with special chars in branch names (#3767)
|
|
||||||
* Responsive design fixes (#4508)
|
|
||||||
* ENHANCEMENT
|
* ENHANCEMENT
|
||||||
* Fix milestones sorted wrongly (#4987)
|
* Fix milestones sorted wrongly (#4987)
|
||||||
* Allow api to create tags for releases if they don't exist (#4890)
|
* Allow api to create tags for releases if they don't exist (#4890)
|
||||||
@@ -147,15 +80,87 @@ been added to each release, please refer to the [blog](https://blog.gitea.io).
|
|||||||
* Added front-end topics validation (#4316)
|
* Added front-end topics validation (#4316)
|
||||||
* Don't display buttons if there are no system notifications (#4280)
|
* Don't display buttons if there are no system notifications (#4280)
|
||||||
* Issue due date api (#3890)
|
* Issue due date api (#3890)
|
||||||
* SECURITY
|
* BUGFIXES
|
||||||
* Improve URL validation for external wiki and external issues (#4710)
|
* dont' send assign webhooks when creating issue (#5365)
|
||||||
* Make cookies HttpOnly and obey COOKIE_SECURE flag (#4706)
|
* Fix create team, update team missing units (#5188)
|
||||||
* Don't disclose emails of all users when sending out emails (#4664)
|
* Fix file edit change preview functionality (#5300)
|
||||||
* Check that repositories can only be migrated to own user or organizations (#4366)
|
* *ix bug when users have serval teams with different units on different repositories (#5307)
|
||||||
|
* Fix U2F if gitea is configured in subpath (#5302)
|
||||||
|
* Fix markdown image with link (#4675)
|
||||||
|
* Remove maxlines option for file logger (#5282)
|
||||||
|
* Fix wrong api request url for instances running in subfolders (#5261) (#5247)
|
||||||
|
* Accept web-command cli flags if web-command is commited (#5245) (#5200)
|
||||||
|
* Reduce join star, repo_topic, topic tables on repo search, to resolve extra columns problem on MSSQL (#5136) (#5229)
|
||||||
|
* Fix data race on migrate repository (#5224) (#5230)
|
||||||
|
* Add secret to all webhook's payload where it has been missing (#5208) (#5199)
|
||||||
|
* Fix sqlite and MSSQL lock (#5210) (#5223) (#5214) (#5218) (#5176) (#5179)
|
||||||
|
* Fix race on updatesize (#5190) (#5215)
|
||||||
|
* Fix filtering issues by tags on main screen issues (#5219) (#3824)
|
||||||
|
* Fix SQL quoting (#5137) (#5117)
|
||||||
|
* Fix regex to support optional end line of old section in diff hunk (#5097) (#5096)
|
||||||
|
* Fix release creation via API (#5076)
|
||||||
|
* Remove links from topics in edit mode (#5026)
|
||||||
|
* Fix missing AppSubUrl in few more templates (fixup) (#5021)
|
||||||
|
* Fix missing AppSubUrl in some templates (#5020)
|
||||||
|
* Hide outdated comments in file view (#5017)
|
||||||
|
* Upgrade gopkg.in/testfixtures.v2 (#4999)
|
||||||
|
* Disable debug routes unless PPROF is enabled in configuration (#4995)
|
||||||
|
* Fix user menu item styling (#4985)
|
||||||
|
* Fix layout of the topics editing form (#4971)
|
||||||
|
* Fix null pointer dereference in ParseCommitWithSignature (#4962)
|
||||||
|
* Fix url in discord webhook (#4953)
|
||||||
|
* Detect charset and convert non UTF-8 files for display (#4950)
|
||||||
|
* Make sure to catch the right error so it is displayed on the UI (#4945)
|
||||||
|
* Fix(topics): don't redirect to explore page. (#4938)
|
||||||
|
* Fix bug forget to remove Stopwatch when remove repository (#4928)
|
||||||
|
* Fix bug when repo remained bare if multiple branches pushed in single push (#4923)
|
||||||
|
* Fix: Crippled diff (#4726) (#4900)
|
||||||
|
* Fix trimming of markup section names (#4863)
|
||||||
|
* Issues api allow pulls and fix #4832 (#4852)
|
||||||
|
* Do not autocreate directory for new users/orgs (#4828) (#4849)
|
||||||
|
* Fix redirect with non-ascii branch names (#4764) (#4810)
|
||||||
|
* Fix missing release title in webhook (#4783) (#4796)
|
||||||
|
* User shouldn't be able to approve or reject his/her own PR (#4729)
|
||||||
|
* Make sure to reset commit count in the cache on mirror syncing (#4720)
|
||||||
|
* Fixed bug where team with admin privelege type doesn't get any unit (#4719)
|
||||||
|
* Fix incorrect caption of webhook setting (#4701) (#4717)
|
||||||
|
* Allow WIP marker to contains < or > (#4709)
|
||||||
|
* Hide org/create menu item in Dashboard if user has no rights (#4678) (#4680)
|
||||||
|
* Site admin could create repos even MAX_CREATION_LIMIT=0 (#4645)
|
||||||
|
* Fix custom templates being ignored (#4638)
|
||||||
|
* Fix starring icon after semantic ui update (#4628)
|
||||||
|
* Fix Split-View line adjustment (#4622)
|
||||||
|
* Fix integer constant overflows in tests (#4616)
|
||||||
|
* Push whitelist now doesn't apply to branch deletion (#4601) (#4607)
|
||||||
|
* Fix bugs when too many IN variables (#4594)
|
||||||
|
* Fix failure on creating pull request with assignees (#4419) (#4583)
|
||||||
|
* Fix panic issue on update avatar email (#4580) (#4581)
|
||||||
|
* Fix status code label for a successful webhook (#4540)
|
||||||
|
* An inactive user shouldn't be able to be added as a collaborator (#4535)
|
||||||
|
* Don't fail silently if trying to add a collaborator twice (#4533)
|
||||||
|
* Fix incorrect MergeWhitelistTeamIDs check in CanUserMerge function (#4519) (#4525)
|
||||||
|
* Fix out-of-transaction query in removeOrgUser (#4521) (#4522)
|
||||||
|
* Fix migration from older releases (#4495)
|
||||||
|
* Accept 'Data:' in commit graph (#4487)
|
||||||
|
* Update xorm to latest version and fix correct `user` table referencing in sql (#4473)
|
||||||
|
* Relative URLs for LibreJS page (#4460)
|
||||||
|
* Redirect to correct page after using scratch token (#4458)
|
||||||
|
* Fix column droping for MSSQL that need new transaction for that (#4440)
|
||||||
|
* Replace src with raw to fix image paths (#4377)
|
||||||
|
* Add default merge options when creating new repository (#4369)
|
||||||
|
* Fix docker build (#4358)
|
||||||
|
* Fixes repo membership check in API (#4341)
|
||||||
|
* Dep upgrade mysql lib (#4161)
|
||||||
|
* Fix some issues with special chars in branch names (#3767)
|
||||||
|
* Responsive design fixes (#4508)
|
||||||
* TRANSLATION
|
* TRANSLATION
|
||||||
* Fix punctuation in English translation (#4958)
|
* Fix punctuation in English translation (#4958)
|
||||||
* Fix translation (#4355)
|
* Fix translation (#4355)
|
||||||
|
|
||||||
|
## [1.5.3](https://github.com/go-gitea/gitea/releases/tag/v1.5.3) - 2018-10-31
|
||||||
|
* SECURITY
|
||||||
|
* Fix remote command execution vulnerability in upstream library (#5177) (#5196)
|
||||||
|
|
||||||
## [1.5.2](https://github.com/go-gitea/gitea/releases/tag/v1.5.2) - 2018-10-09
|
## [1.5.2](https://github.com/go-gitea/gitea/releases/tag/v1.5.2) - 2018-10-09
|
||||||
* SECURITY
|
* SECURITY
|
||||||
* Enforce token on api routes (#4840) (#4905)
|
* Enforce token on api routes (#4840) (#4905)
|
||||||
|
|||||||
4
Gopkg.lock
generated
4
Gopkg.lock
generated
@@ -11,11 +11,11 @@
|
|||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
branch = "master"
|
branch = "master"
|
||||||
digest = "1:bf4f822f636b99ac7d4f8fa5210a7439bacaf8d1f15d5783956bdd5dd2069bdc"
|
digest = "1:b194da40b41ae99546dfeec5a85f1fec2a6c51350d438e511ef90f4293c6dcd7"
|
||||||
name = "code.gitea.io/sdk"
|
name = "code.gitea.io/sdk"
|
||||||
packages = ["gitea"]
|
packages = ["gitea"]
|
||||||
pruneopts = "NUT"
|
pruneopts = "NUT"
|
||||||
revision = "11c860c8e49a23be26e6d6c6a039a46ad2ae1d27"
|
revision = "4f96d9ac89886e78c50de8c835ebe87461578a5e"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
digest = "1:3fcef06a1a6561955c94af6c7757a6fa37605eb653f0d06ab960e5bb80092195"
|
digest = "1:3fcef06a1a6561955c94af6c7757a6fa37605eb653f0d06ab960e5bb80092195"
|
||||||
|
|||||||
@@ -159,12 +159,13 @@ func (issue *Issue) changeAssignee(sess *xorm.Session, doer *User, assigneeID in
|
|||||||
return fmt.Errorf("createAssigneeComment: %v", err)
|
return fmt.Errorf("createAssigneeComment: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
mode, _ := accessLevel(sess, doer.ID, issue.Repo)
|
// if issue/pull is in the middle of creation - don't call webhook
|
||||||
if issue.IsPull {
|
|
||||||
// if pull request is in the middle of creation - don't call webhook
|
|
||||||
if isCreate {
|
if isCreate {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mode, _ := accessLevel(sess, doer.ID, issue.Repo)
|
||||||
|
if issue.IsPull {
|
||||||
if err = issue.loadPullRequest(sess); err != nil {
|
if err = issue.loadPullRequest(sess); err != nil {
|
||||||
return fmt.Errorf("loadPullRequest: %v", err)
|
return fmt.Errorf("loadPullRequest: %v", err)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ func addMultipleAssignees(x *xorm.Engine) error {
|
|||||||
IsClosed bool `xorm:"INDEX"`
|
IsClosed bool `xorm:"INDEX"`
|
||||||
IsPull bool `xorm:"INDEX"` // Indicates whether is a pull request or not.
|
IsPull bool `xorm:"INDEX"` // Indicates whether is a pull request or not.
|
||||||
NumComments int
|
NumComments int
|
||||||
Ref string
|
|
||||||
|
|
||||||
DeadlineUnix util.TimeStamp `xorm:"INDEX"`
|
DeadlineUnix util.TimeStamp `xorm:"INDEX"`
|
||||||
CreatedUnix util.TimeStamp `xorm:"INDEX created"`
|
CreatedUnix util.TimeStamp `xorm:"INDEX created"`
|
||||||
|
|||||||
@@ -5,6 +5,8 @@
|
|||||||
package migrations
|
package migrations
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
"code.gitea.io/gitea/modules/setting"
|
"code.gitea.io/gitea/modules/setting"
|
||||||
|
|
||||||
"github.com/go-xorm/xorm"
|
"github.com/go-xorm/xorm"
|
||||||
@@ -70,6 +72,13 @@ func removeStaleWatches(x *xorm.Engine) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var issueWatch IssueWatch
|
||||||
|
if exist, err := sess.IsTableExist(&issueWatch); err != nil {
|
||||||
|
return fmt.Errorf("IsExist IssueWatch: %v", err)
|
||||||
|
} else if !exist {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
repoCache := make(map[int64]*Repository)
|
repoCache := make(map[int64]*Repository)
|
||||||
err := x.BufferSize(setting.IterateBufferSize).Iterate(new(Watch),
|
err := x.BufferSize(setting.IterateBufferSize).Iterate(new(Watch),
|
||||||
func(idx int, bean interface{}) error {
|
func(idx int, bean interface{}) error {
|
||||||
|
|||||||
@@ -40,6 +40,14 @@ func (t *Team) getUnits(e Engine) (err error) {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetUnitNames returns the team units names
|
||||||
|
func (t *Team) GetUnitNames() (res []string) {
|
||||||
|
for _, u := range t.Units {
|
||||||
|
res = append(res, Units[u.Type].NameKey)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// HasWriteAccess returns true if team has at least write level access mode.
|
// HasWriteAccess returns true if team has at least write level access mode.
|
||||||
func (t *Team) HasWriteAccess() bool {
|
func (t *Team) HasWriteAccess() bool {
|
||||||
return t.Authorize >= AccessModeWrite
|
return t.Authorize >= AccessModeWrite
|
||||||
@@ -367,6 +375,24 @@ func UpdateTeam(t *Team, authChanged bool) (err error) {
|
|||||||
return fmt.Errorf("update: %v", err)
|
return fmt.Errorf("update: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// update units for team
|
||||||
|
if len(t.Units) > 0 {
|
||||||
|
for _, unit := range t.Units {
|
||||||
|
unit.TeamID = t.ID
|
||||||
|
}
|
||||||
|
// Delete team-unit.
|
||||||
|
if _, err := sess.
|
||||||
|
Where("team_id=?", t.ID).
|
||||||
|
Delete(new(TeamUnit)); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if _, err = sess.Insert(&t.Units); err != nil {
|
||||||
|
sess.Rollback()
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Update access for team members if needed.
|
// Update access for team members if needed.
|
||||||
if authChanged {
|
if authChanged {
|
||||||
if err = t.getRepositories(sess); err != nil {
|
if err = t.getRepositories(sess); err != nil {
|
||||||
@@ -525,6 +551,16 @@ func getUserTeams(e Engine, orgID, userID int64) (teams []*Team, err error) {
|
|||||||
Find(&teams)
|
Find(&teams)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func getUserRepoTeams(e Engine, orgID, userID, repoID int64) (teams []*Team, err error) {
|
||||||
|
return teams, e.
|
||||||
|
Join("INNER", "team_user", "team_user.team_id = team.id").
|
||||||
|
Join("INNER", "team_repo", "team_repo.team_id = team.id").
|
||||||
|
Where("team.org_id = ?", orgID).
|
||||||
|
And("team_user.uid=?", userID).
|
||||||
|
And("team_repo.repo_id=?", repoID).
|
||||||
|
Find(&teams)
|
||||||
|
}
|
||||||
|
|
||||||
// GetUserTeams returns all teams that user belongs to in given organization.
|
// GetUserTeams returns all teams that user belongs to in given organization.
|
||||||
func GetUserTeams(orgID, userID int64) ([]*Team, error) {
|
func GetUserTeams(orgID, userID int64) ([]*Team, error) {
|
||||||
return getUserTeams(x, orgID, userID)
|
return getUserTeams(x, orgID, userID)
|
||||||
|
|||||||
@@ -364,7 +364,7 @@ func (repo *Repository) getUnitsByUserID(e Engine, userID int64, isAdmin bool) (
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
teams, err := getUserTeams(e, repo.OwnerID, userID)
|
teams, err := getUserRepoTeams(e, repo.OwnerID, userID, repo.ID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,10 @@
|
|||||||
|
|
||||||
package models
|
package models
|
||||||
|
|
||||||
|
import (
|
||||||
|
"strings"
|
||||||
|
)
|
||||||
|
|
||||||
// UnitType is Unit's Type
|
// UnitType is Unit's Type
|
||||||
type UnitType int
|
type UnitType int
|
||||||
|
|
||||||
@@ -137,3 +141,16 @@ var (
|
|||||||
UnitTypeExternalWiki: UnitExternalWiki,
|
UnitTypeExternalWiki: UnitExternalWiki,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// FindUnitTypes give the unit key name and return unit
|
||||||
|
func FindUnitTypes(nameKeys ...string) (res []UnitType) {
|
||||||
|
for _, key := range nameKeys {
|
||||||
|
for t, u := range Units {
|
||||||
|
if strings.EqualFold(key, u.NameKey) {
|
||||||
|
res = append(res, t)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
@@ -25,9 +24,6 @@ type FileLogWriter struct {
|
|||||||
// The opened file
|
// The opened file
|
||||||
Filename string `json:"filename"`
|
Filename string `json:"filename"`
|
||||||
|
|
||||||
Maxlines int `json:"maxlines"`
|
|
||||||
maxlinesCurlines int
|
|
||||||
|
|
||||||
// Rotate at size
|
// Rotate at size
|
||||||
Maxsize int `json:"maxsize"`
|
Maxsize int `json:"maxsize"`
|
||||||
maxsizeCursize int
|
maxsizeCursize int
|
||||||
@@ -69,7 +65,6 @@ func (l *MuxWriter) SetFd(fd *os.File) {
|
|||||||
func NewFileWriter() LoggerInterface {
|
func NewFileWriter() LoggerInterface {
|
||||||
w := &FileLogWriter{
|
w := &FileLogWriter{
|
||||||
Filename: "",
|
Filename: "",
|
||||||
Maxlines: 1000000,
|
|
||||||
Maxsize: 1 << 28, //256 MB
|
Maxsize: 1 << 28, //256 MB
|
||||||
Daily: true,
|
Daily: true,
|
||||||
Maxdays: 7,
|
Maxdays: 7,
|
||||||
@@ -87,7 +82,6 @@ func NewFileWriter() LoggerInterface {
|
|||||||
// config like:
|
// config like:
|
||||||
// {
|
// {
|
||||||
// "filename":"log/gogs.log",
|
// "filename":"log/gogs.log",
|
||||||
// "maxlines":10000,
|
|
||||||
// "maxsize":1<<30,
|
// "maxsize":1<<30,
|
||||||
// "daily":true,
|
// "daily":true,
|
||||||
// "maxdays":15,
|
// "maxdays":15,
|
||||||
@@ -116,15 +110,13 @@ func (w *FileLogWriter) StartLogger() error {
|
|||||||
func (w *FileLogWriter) docheck(size int) {
|
func (w *FileLogWriter) docheck(size int) {
|
||||||
w.startLock.Lock()
|
w.startLock.Lock()
|
||||||
defer w.startLock.Unlock()
|
defer w.startLock.Unlock()
|
||||||
if w.Rotate && ((w.Maxlines > 0 && w.maxlinesCurlines >= w.Maxlines) ||
|
if w.Rotate && ((w.Maxsize > 0 && w.maxsizeCursize >= w.Maxsize) ||
|
||||||
(w.Maxsize > 0 && w.maxsizeCursize >= w.Maxsize) ||
|
|
||||||
(w.Daily && time.Now().Day() != w.dailyOpenDate)) {
|
(w.Daily && time.Now().Day() != w.dailyOpenDate)) {
|
||||||
if err := w.DoRotate(); err != nil {
|
if err := w.DoRotate(); err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "FileLogWriter(%q): %s\n", w.Filename, err)
|
fmt.Fprintf(os.Stderr, "FileLogWriter(%q): %s\n", w.Filename, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
w.maxlinesCurlines++
|
|
||||||
w.maxsizeCursize += size
|
w.maxsizeCursize += size
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -152,15 +144,6 @@ func (w *FileLogWriter) initFd() error {
|
|||||||
}
|
}
|
||||||
w.maxsizeCursize = int(finfo.Size())
|
w.maxsizeCursize = int(finfo.Size())
|
||||||
w.dailyOpenDate = time.Now().Day()
|
w.dailyOpenDate = time.Now().Day()
|
||||||
if finfo.Size() > 0 {
|
|
||||||
content, err := ioutil.ReadFile(w.Filename)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
w.maxlinesCurlines = len(strings.Split(string(content), "\n"))
|
|
||||||
} else {
|
|
||||||
w.maxlinesCurlines = 0
|
|
||||||
}
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
// Copyright 2014 The Gogs Authors. All rights reserved.
|
// Copyright 2014 The Gogs Authors. All rights reserved.
|
||||||
|
// Copyright 2018 The Gitea Authors. All rights reserved.
|
||||||
// Use of this source code is governed by a MIT-style
|
// Use of this source code is governed by a MIT-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
@@ -38,7 +39,16 @@ func (r *Renderer) Link(out *bytes.Buffer, link []byte, title []byte, content []
|
|||||||
link = []byte(mLink)
|
link = []byte(mLink)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(content) > 10 && string(content[0:9]) == "<a href=\"" && bytes.Contains(content[9:], []byte("<img")) {
|
||||||
|
// Image with link case: markdown `[![]()]()`
|
||||||
|
// If the content is an image, then we change the original href around it
|
||||||
|
// which points to itself to a new address "link"
|
||||||
|
rightQuote := bytes.Index(content[9:], []byte("\""))
|
||||||
|
content = bytes.Replace(content, content[9:9+rightQuote], link, 1)
|
||||||
|
out.Write(content)
|
||||||
|
} else {
|
||||||
r.Renderer.Link(out, link, title, content)
|
r.Renderer.Link(out, link, title, content)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// List renders markdown bullet or digit lists to HTML
|
// List renders markdown bullet or digit lists to HTML
|
||||||
@@ -90,13 +100,6 @@ func (r *Renderer) ListItem(out *bytes.Buffer, text []byte, flags int) {
|
|||||||
r.Renderer.ListItem(out, text, flags)
|
r.Renderer.ListItem(out, text, flags)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Note: this section is for purpose of increase performance and
|
|
||||||
// reduce memory allocation at runtime since they are constant literals.
|
|
||||||
var (
|
|
||||||
svgSuffix = []byte(".svg")
|
|
||||||
svgSuffixWithMark = []byte(".svg?")
|
|
||||||
)
|
|
||||||
|
|
||||||
// Image defines how images should be processed to produce corresponding HTML elements.
|
// Image defines how images should be processed to produce corresponding HTML elements.
|
||||||
func (r *Renderer) Image(out *bytes.Buffer, link []byte, title []byte, alt []byte) {
|
func (r *Renderer) Image(out *bytes.Buffer, link []byte, title []byte, alt []byte) {
|
||||||
prefix := r.URLPrefix
|
prefix := r.URLPrefix
|
||||||
@@ -104,22 +107,14 @@ func (r *Renderer) Image(out *bytes.Buffer, link []byte, title []byte, alt []byt
|
|||||||
prefix = util.URLJoin(prefix, "wiki", "raw")
|
prefix = util.URLJoin(prefix, "wiki", "raw")
|
||||||
}
|
}
|
||||||
prefix = strings.Replace(prefix, "/src/", "/raw/", 1)
|
prefix = strings.Replace(prefix, "/src/", "/raw/", 1)
|
||||||
if len(link) > 0 {
|
if len(link) > 0 && !markup.IsLink(link) {
|
||||||
if markup.IsLink(link) {
|
|
||||||
// External link with .svg suffix usually means CI status.
|
|
||||||
// TODO: define a keyword to allow non-svg images render as external link.
|
|
||||||
if bytes.HasSuffix(link, svgSuffix) || bytes.Contains(link, svgSuffixWithMark) {
|
|
||||||
r.Renderer.Image(out, link, title, alt)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
lnk := string(link)
|
lnk := string(link)
|
||||||
lnk = util.URLJoin(prefix, lnk)
|
lnk = util.URLJoin(prefix, lnk)
|
||||||
lnk = strings.Replace(lnk, " ", "+", -1)
|
lnk = strings.Replace(lnk, " ", "+", -1)
|
||||||
link = []byte(lnk)
|
link = []byte(lnk)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
// Put a link around it pointing to itself by default
|
||||||
out.WriteString(`<a href="`)
|
out.WriteString(`<a href="`)
|
||||||
out.Write(link)
|
out.Write(link)
|
||||||
out.WriteString(`">`)
|
out.WriteString(`">`)
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ func TestRender_Images(t *testing.T) {
|
|||||||
|
|
||||||
url := "../../.images/src/02/train.jpg"
|
url := "../../.images/src/02/train.jpg"
|
||||||
title := "Train"
|
title := "Train"
|
||||||
|
href := "https://gitea.io"
|
||||||
result := util.URLJoin(AppSubURL, url)
|
result := util.URLJoin(AppSubURL, url)
|
||||||
|
|
||||||
test(
|
test(
|
||||||
@@ -82,6 +83,9 @@ func TestRender_Images(t *testing.T) {
|
|||||||
test(
|
test(
|
||||||
"[["+title+"|"+url+"]]",
|
"[["+title+"|"+url+"]]",
|
||||||
`<p><a href="`+result+`" rel="nofollow"><img src="`+result+`" title="`+title+`" alt="`+title+`"/></a></p>`)
|
`<p><a href="`+result+`" rel="nofollow"><img src="`+result+`" title="`+title+`" alt="`+title+`"/></a></p>`)
|
||||||
|
test(
|
||||||
|
"[]("+href+")",
|
||||||
|
`<p><a href="`+href+`" rel="nofollow"><img src="`+result+`" alt="`+title+`"/></a></p>`)
|
||||||
}
|
}
|
||||||
|
|
||||||
func testAnswers(baseURLContent, baseURLImages string) []string {
|
func testAnswers(baseURLContent, baseURLImages string) []string {
|
||||||
|
|||||||
@@ -1325,10 +1325,9 @@ func newLogService() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
LogConfigs[i] = fmt.Sprintf(
|
LogConfigs[i] = fmt.Sprintf(
|
||||||
`{"level":%s,"filename":"%s","rotate":%v,"maxlines":%d,"maxsize":%d,"daily":%v,"maxdays":%d}`, level,
|
`{"level":%s,"filename":"%s","rotate":%v,"maxsize":%d,"daily":%v,"maxdays":%d}`, level,
|
||||||
logPath,
|
logPath,
|
||||||
sec.Key("LOG_ROTATE").MustBool(true),
|
sec.Key("LOG_ROTATE").MustBool(true),
|
||||||
sec.Key("MAX_LINES").MustInt(1000000),
|
|
||||||
1<<uint(sec.Key("MAX_SIZE_SHIFT").MustInt(28)),
|
1<<uint(sec.Key("MAX_SIZE_SHIFT").MustInt(28)),
|
||||||
sec.Key("DAILY_ROTATE").MustBool(true),
|
sec.Key("DAILY_ROTATE").MustBool(true),
|
||||||
sec.Key("MAX_DAYS").MustInt(7))
|
sec.Key("MAX_DAYS").MustInt(7))
|
||||||
@@ -1391,10 +1390,9 @@ func NewXORMLogService(disableConsole bool) {
|
|||||||
logPath = path.Join(filepath.Dir(logPath), "xorm.log")
|
logPath = path.Join(filepath.Dir(logPath), "xorm.log")
|
||||||
|
|
||||||
logConfigs = fmt.Sprintf(
|
logConfigs = fmt.Sprintf(
|
||||||
`{"level":%s,"filename":"%s","rotate":%v,"maxlines":%d,"maxsize":%d,"daily":%v,"maxdays":%d}`, level,
|
`{"level":%s,"filename":"%s","rotate":%v,"maxsize":%d,"daily":%v,"maxdays":%d}`, level,
|
||||||
logPath,
|
logPath,
|
||||||
sec.Key("LOG_ROTATE").MustBool(true),
|
sec.Key("LOG_ROTATE").MustBool(true),
|
||||||
sec.Key("MAX_LINES").MustInt(1000000),
|
|
||||||
1<<uint(sec.Key("MAX_SIZE_SHIFT").MustInt(28)),
|
1<<uint(sec.Key("MAX_SIZE_SHIFT").MustInt(28)),
|
||||||
sec.Key("DAILY_ROTATE").MustBool(true),
|
sec.Key("DAILY_ROTATE").MustBool(true),
|
||||||
sec.Key("MAX_DAYS").MustInt(7))
|
sec.Key("MAX_DAYS").MustInt(7))
|
||||||
|
|||||||
@@ -457,7 +457,7 @@ issues.next=Página Siguiente
|
|||||||
issues.open_title=Abierta
|
issues.open_title=Abierta
|
||||||
issues.closed_title=Cerrada
|
issues.closed_title=Cerrada
|
||||||
issues.num_comments=%d comentarios
|
issues.num_comments=%d comentarios
|
||||||
issues.commented_at=`comentado <a href="#%s"> %s`</a>
|
issues.commented_at=`comentado <a href="#%s">%s</a>`
|
||||||
issues.delete_comment_confirm=¿Seguro que deseas eliminar este comentario?
|
issues.delete_comment_confirm=¿Seguro que deseas eliminar este comentario?
|
||||||
issues.no_content=Aún no existe contenido.
|
issues.no_content=Aún no existe contenido.
|
||||||
issues.close_issue=Cerrar
|
issues.close_issue=Cerrar
|
||||||
|
|||||||
@@ -1530,7 +1530,7 @@ function initU2FAuth() {
|
|||||||
}
|
}
|
||||||
u2fApi.ensureSupport()
|
u2fApi.ensureSupport()
|
||||||
.then(function () {
|
.then(function () {
|
||||||
$.getJSON('/user/u2f/challenge').success(function(req) {
|
$.getJSON(suburl + '/user/u2f/challenge').success(function(req) {
|
||||||
u2fApi.sign(req.appId, req.challenge, req.registeredKeys, 30)
|
u2fApi.sign(req.appId, req.challenge, req.registeredKeys, 30)
|
||||||
.then(u2fSigned)
|
.then(u2fSigned)
|
||||||
.catch(function (err) {
|
.catch(function (err) {
|
||||||
@@ -1543,16 +1543,16 @@ function initU2FAuth() {
|
|||||||
});
|
});
|
||||||
}).catch(function () {
|
}).catch(function () {
|
||||||
// Fallback in case browser do not support U2F
|
// Fallback in case browser do not support U2F
|
||||||
window.location.href = "/user/two_factor"
|
window.location.href = suburl + "/user/two_factor"
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
function u2fSigned(resp) {
|
function u2fSigned(resp) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url:'/user/u2f/sign',
|
url: suburl + '/user/u2f/sign',
|
||||||
type:"POST",
|
type: "POST",
|
||||||
headers: {"X-Csrf-Token": csrf},
|
headers: {"X-Csrf-Token": csrf},
|
||||||
data: JSON.stringify(resp),
|
data: JSON.stringify(resp),
|
||||||
contentType:"application/json; charset=utf-8",
|
contentType: "application/json; charset=utf-8",
|
||||||
}).done(function(res){
|
}).done(function(res){
|
||||||
window.location.replace(res);
|
window.location.replace(res);
|
||||||
}).fail(function (xhr, textStatus) {
|
}).fail(function (xhr, textStatus) {
|
||||||
@@ -1565,11 +1565,11 @@ function u2fRegistered(resp) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url:'/user/settings/security/u2f/register',
|
url: suburl + '/user/settings/security/u2f/register',
|
||||||
type:"POST",
|
type: "POST",
|
||||||
headers: {"X-Csrf-Token": csrf},
|
headers: {"X-Csrf-Token": csrf},
|
||||||
data: JSON.stringify(resp),
|
data: JSON.stringify(resp),
|
||||||
contentType:"application/json; charset=utf-8",
|
contentType: "application/json; charset=utf-8",
|
||||||
success: function(){
|
success: function(){
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
},
|
},
|
||||||
@@ -1623,7 +1623,7 @@ function initU2FRegister() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function u2fRegisterRequest() {
|
function u2fRegisterRequest() {
|
||||||
$.post("/user/settings/security/u2f/request_register", {
|
$.post(suburl + "/user/settings/security/u2f/request_register", {
|
||||||
"_csrf": csrf,
|
"_csrf": csrf,
|
||||||
"name": $('#nickname').val()
|
"name": $('#nickname').val()
|
||||||
}).success(function(req) {
|
}).success(function(req) {
|
||||||
|
|||||||
@@ -196,5 +196,6 @@ func ToTeam(team *models.Team) *api.Team {
|
|||||||
Name: team.Name,
|
Name: team.Name,
|
||||||
Description: team.Description,
|
Description: team.Description,
|
||||||
Permission: team.Authorize.String(),
|
Permission: team.Authorize.String(),
|
||||||
|
Units: team.GetUnitNames(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -89,6 +89,20 @@ func CreateTeam(ctx *context.APIContext, form api.CreateTeamOption) {
|
|||||||
Description: form.Description,
|
Description: form.Description,
|
||||||
Authorize: models.ParseAccessMode(form.Permission),
|
Authorize: models.ParseAccessMode(form.Permission),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unitTypes := models.FindUnitTypes(form.Units...)
|
||||||
|
|
||||||
|
if team.Authorize < models.AccessModeOwner {
|
||||||
|
var units = make([]*models.TeamUnit, 0, len(form.Units))
|
||||||
|
for _, tp := range unitTypes {
|
||||||
|
units = append(units, &models.TeamUnit{
|
||||||
|
OrgID: ctx.Org.Organization.ID,
|
||||||
|
Type: tp,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
team.Units = units
|
||||||
|
}
|
||||||
|
|
||||||
if err := models.NewTeam(team); err != nil {
|
if err := models.NewTeam(team); err != nil {
|
||||||
if models.IsErrTeamAlreadyExist(err) {
|
if models.IsErrTeamAlreadyExist(err) {
|
||||||
ctx.Error(422, "", err)
|
ctx.Error(422, "", err)
|
||||||
@@ -127,6 +141,19 @@ func EditTeam(ctx *context.APIContext, form api.EditTeamOption) {
|
|||||||
team.Name = form.Name
|
team.Name = form.Name
|
||||||
team.Description = form.Description
|
team.Description = form.Description
|
||||||
team.Authorize = models.ParseAccessMode(form.Permission)
|
team.Authorize = models.ParseAccessMode(form.Permission)
|
||||||
|
unitTypes := models.FindUnitTypes(form.Units...)
|
||||||
|
|
||||||
|
if team.Authorize < models.AccessModeOwner {
|
||||||
|
var units = make([]*models.TeamUnit, 0, len(form.Units))
|
||||||
|
for _, tp := range unitTypes {
|
||||||
|
units = append(units, &models.TeamUnit{
|
||||||
|
OrgID: ctx.Org.Organization.ID,
|
||||||
|
Type: tp,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
team.Units = units
|
||||||
|
}
|
||||||
|
|
||||||
if err := models.UpdateTeam(team, true); err != nil {
|
if err := models.UpdateTeam(team, true); err != nil {
|
||||||
ctx.Error(500, "EditTeam", err)
|
ctx.Error(500, "EditTeam", err)
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -3,9 +3,7 @@
|
|||||||
<div class="file-body file-code code-view code-diff">
|
<div class="file-body file-code code-view code-diff">
|
||||||
<table>
|
<table>
|
||||||
<tbody>
|
<tbody>
|
||||||
{{with .File}}
|
{{template "repo/diff/section_unified" dict "file" .File "root" $}}
|
||||||
{{template "repo/diff/section_unified" .}}
|
|
||||||
{{end}}
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
<div class="ui top attached tabular menu" data-write="write" data-preview="preview" data-diff="diff">
|
<div class="ui top attached tabular menu" data-write="write" data-preview="preview" data-diff="diff">
|
||||||
<a class="active item" data-tab="write"><i class="octicon octicon-code"></i> {{if .IsNewFile}}{{.i18n.Tr "repo.editor.new_file"}}{{else}}{{.i18n.Tr "repo.editor.edit_file"}}{{end}}</a>
|
<a class="active item" data-tab="write"><i class="octicon octicon-code"></i> {{if .IsNewFile}}{{.i18n.Tr "repo.editor.new_file"}}{{else}}{{.i18n.Tr "repo.editor.edit_file"}}{{end}}</a>
|
||||||
{{if not .IsNewFile}}
|
{{if not .IsNewFile}}
|
||||||
<a class="item" data-tab="preview" data-url="{{AppSubUrl}}/api/v1/markdown" data-context="{{.RepoLink}}/src/{{.BranchNameSubURL | EscapePound}}" data-preview-file-modes="{{.PreviewableFileModes}}"><i class="octicon octicon-eye"></i> {{.i18n.Tr "repo.release.preview"}}</a>
|
<a class="item" data-tab="preview" data-url="{{AppSubUrl}}/api/v1/markdown" data-context="{{.RepoLink}}/src/{{.BranchNameSubURL | EscapePound}}" data-preview-file-modes="{{.PreviewableFileModes}}"><i class="octicon octicon-eye"></i> {{.i18n.Tr "preview"}}</a>
|
||||||
<a class="item" data-tab="diff" data-url="{{.RepoLink}}/_preview/{{.BranchName | EscapePound}}/{{.TreePath | EscapePound}}" data-context="{{.BranchLink}}"><i class="octicon octicon-diff"></i> {{.i18n.Tr "repo.editor.preview_changes"}}</a>
|
<a class="item" data-tab="diff" data-url="{{.RepoLink}}/_preview/{{.BranchName | EscapePound}}/{{.TreePath | EscapePound}}" data-context="{{.BranchLink}}"><i class="octicon octicon-diff"></i> {{.i18n.Tr "repo.editor.preview_changes"}}</a>
|
||||||
{{end}}
|
{{end}}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -6128,6 +6128,22 @@
|
|||||||
"admin"
|
"admin"
|
||||||
],
|
],
|
||||||
"x-go-name": "Permission"
|
"x-go-name": "Permission"
|
||||||
|
},
|
||||||
|
"units": {
|
||||||
|
"type": "array",
|
||||||
|
"enum": [
|
||||||
|
"repo.code",
|
||||||
|
"repo.issues",
|
||||||
|
"repo.ext_issues",
|
||||||
|
"repo.wiki",
|
||||||
|
"repo.pulls",
|
||||||
|
"repo.releases",
|
||||||
|
"repo.ext_wiki"
|
||||||
|
],
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"x-go-name": "Units"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea"
|
"x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea"
|
||||||
@@ -6503,6 +6519,22 @@
|
|||||||
"admin"
|
"admin"
|
||||||
],
|
],
|
||||||
"x-go-name": "Permission"
|
"x-go-name": "Permission"
|
||||||
|
},
|
||||||
|
"units": {
|
||||||
|
"type": "array",
|
||||||
|
"enum": [
|
||||||
|
"repo.code",
|
||||||
|
"repo.issues",
|
||||||
|
"repo.ext_issues",
|
||||||
|
"repo.wiki",
|
||||||
|
"repo.pulls",
|
||||||
|
"repo.releases",
|
||||||
|
"repo.ext_wiki"
|
||||||
|
],
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"x-go-name": "Units"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea"
|
"x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea"
|
||||||
@@ -7550,6 +7582,22 @@
|
|||||||
"owner"
|
"owner"
|
||||||
],
|
],
|
||||||
"x-go-name": "Permission"
|
"x-go-name": "Permission"
|
||||||
|
},
|
||||||
|
"units": {
|
||||||
|
"type": "array",
|
||||||
|
"enum": [
|
||||||
|
"repo.code",
|
||||||
|
"repo.issues",
|
||||||
|
"repo.ext_issues",
|
||||||
|
"repo.wiki",
|
||||||
|
"repo.pulls",
|
||||||
|
"repo.releases",
|
||||||
|
"repo.ext_wiki"
|
||||||
|
],
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"x-go-name": "Units"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea"
|
"x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea"
|
||||||
|
|||||||
7
vendor/code.gitea.io/sdk/gitea/org_team.go
generated
vendored
7
vendor/code.gitea.io/sdk/gitea/org_team.go
generated
vendored
@@ -1,4 +1,5 @@
|
|||||||
// Copyright 2016 The Gogs Authors. All rights reserved.
|
// Copyright 2016 The Gogs Authors. All rights reserved.
|
||||||
|
// Copyright 2018 The Gitea Authors. All rights reserved.
|
||||||
// Use of this source code is governed by a MIT-style
|
// Use of this source code is governed by a MIT-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
@@ -11,6 +12,8 @@ type Team struct {
|
|||||||
Description string `json:"description"`
|
Description string `json:"description"`
|
||||||
// enum: none,read,write,admin,owner
|
// enum: none,read,write,admin,owner
|
||||||
Permission string `json:"permission"`
|
Permission string `json:"permission"`
|
||||||
|
// enum: repo.code,repo.issues,repo.ext_issues,repo.wiki,repo.pulls,repo.releases,repo.ext_wiki
|
||||||
|
Units []string `json:"units"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CreateTeamOption options for creating a team
|
// CreateTeamOption options for creating a team
|
||||||
@@ -20,6 +23,8 @@ type CreateTeamOption struct {
|
|||||||
Description string `json:"description" binding:"MaxSize(255)"`
|
Description string `json:"description" binding:"MaxSize(255)"`
|
||||||
// enum: read,write,admin
|
// enum: read,write,admin
|
||||||
Permission string `json:"permission"`
|
Permission string `json:"permission"`
|
||||||
|
// enum: repo.code,repo.issues,repo.ext_issues,repo.wiki,repo.pulls,repo.releases,repo.ext_wiki
|
||||||
|
Units []string `json:"units"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// EditTeamOption options for editing a team
|
// EditTeamOption options for editing a team
|
||||||
@@ -29,4 +34,6 @@ type EditTeamOption struct {
|
|||||||
Description string `json:"description" binding:"MaxSize(255)"`
|
Description string `json:"description" binding:"MaxSize(255)"`
|
||||||
// enum: read,write,admin
|
// enum: read,write,admin
|
||||||
Permission string `json:"permission"`
|
Permission string `json:"permission"`
|
||||||
|
// enum: repo.code,repo.issues,repo.ext_issues,repo.wiki,repo.pulls,repo.releases,repo.ext_wiki
|
||||||
|
Units []string `json:"units"`
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user