mirror of
https://github.com/go-gitea/gitea.git
synced 2025-11-10 15:32:55 +09:00
Compare commits
14 Commits
v1.2.0-rc3
...
v1.2.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
46bb1cf026 | ||
|
|
13013e90f3 | ||
|
|
785ba171f4 | ||
|
|
fb80265b52 | ||
|
|
6fae585d28 | ||
|
|
670562a9c5 | ||
|
|
ed07d8a308 | ||
|
|
74399f333f | ||
|
|
d1cec5ecfa | ||
|
|
73ad7d2ef3 | ||
|
|
5b36379172 | ||
|
|
e38e502e20 | ||
|
|
3cc5b11b0d | ||
|
|
4c9bf91a2c |
346
CHANGELOG.md
346
CHANGELOG.md
@@ -1,59 +1,104 @@
|
||||
# Changelog
|
||||
|
||||
## [1.2.0-rc4](https://github.com/go-gitea/gitea/releases/tag/v1.2.0-rc4) - 2017-09-23
|
||||
* BUILD
|
||||
* Fix release building in Drone CI (#2586, #2579, #2573)
|
||||
|
||||
## [1.2.0-rc3](https://github.com/go-gitea/gitea/releases/tag/v1.2.0-rc3) - 2017-09-21
|
||||
## [1.2.1](https://github.com/go-gitea/gitea/releases/tag/v1.2.1) - 2017-10-16
|
||||
* BUGFIXES
|
||||
* Sync releases table with tags on push and for mirrors (#2459)
|
||||
* Fix adding branch as protected to not allow pushing to it (#2556)
|
||||
* Fix lint, fmt and integration testing errors (#2553)
|
||||
* Remove go version check for make fmt (#2558)
|
||||
* Fix PR, milestone and label functionality if issue unit is disabled (#2710) (#2714)
|
||||
* Fix plain readme didn't render correctly on repo home page (#2705) (#2712)
|
||||
* Fix so that user can still fork his own repository to his organizations (#2699) (#2707)
|
||||
* Fix .netrc authentication (#2700) (#2708)
|
||||
* Fix slice out of bounds error in mailer (#2479) (#2696)
|
||||
|
||||
## [1.2.0](https://github.com/go-gitea/gitea/releases/tag/v1.2.0) - 2017-10-10
|
||||
* SECURITY
|
||||
* Restricting access to fork functionality to users with Code access (#2542)
|
||||
|
||||
## [1.2.0-rc2](https://github.com/go-gitea/gitea/releases/tag/v1.2.0-rc2) - 2017-09-06
|
||||
* BUGFIXES
|
||||
* Fix migration from pre-v15 to 1.2.0 (#2460)
|
||||
* Fix autolink javascript bug
|
||||
* Fix releases to be counted from database not tags (#2389)
|
||||
* fix duplicated feed (#2370)
|
||||
* Set version to 1.2.0-dev
|
||||
|
||||
## [1.2.0-rc1](https://github.com/go-gitea/gitea/releases/tag/v1.2.0-rc1) - 2017-08-25
|
||||
* Sanitation fix from Gogs (#1461)
|
||||
* BREAKING
|
||||
* Rename /forget_password url to /forgot_password (#1219)
|
||||
* SSH keys management URL changed from `/user/settings/ssh` to `/user/settings/keys` (#1293)
|
||||
* FEATURE
|
||||
* API: support '/orgs/:org/repos' (#2047)
|
||||
* Add Gitea Webhook (#1755)
|
||||
* Display all organization from user settings (#1739)
|
||||
* Show commit status icon in commits table (#1688)
|
||||
* Adding #issuecomment to the URL in E-Mail notifications (#1674)
|
||||
* feat: add download count field and unit testing for attachment. (#1512)
|
||||
* Add repo mirror sync API endpoint (#1508)
|
||||
* Add markup package to prepare for org markup format (#1493)
|
||||
* Repo size in admin panel (#1482)
|
||||
* LDAP user synchronization (#1478)
|
||||
* Support for custom html meta (#1423)
|
||||
* [Notifications Step 6] Per issue/PR watch/unwatch (#1410)
|
||||
* Allow ENABLE_OPENID_SIGNUP to depend on DISABLE_REGISTRATION (#1369)
|
||||
* Fix FCGI (over TCP) support (#1368)
|
||||
* Logo: Add task to generate images from SVG and change to new logo (#2194)
|
||||
* Status-API (#1332)
|
||||
* Show user OpenID URIs in their profile (#1314)
|
||||
* Add change-password admin command (#1304)
|
||||
* feat: Only use issue and wiki on repo. (#1297)
|
||||
* Rework SSH key management UI to add GPG (#1293)
|
||||
* Allow push to init a wiki repo (#1279)
|
||||
* GPG commit validation (#1150)
|
||||
* Dockerfile for aarch64 (#1128) (#1130)
|
||||
* Show commit status icon in commits table (#1688)
|
||||
* Additional OAuth2 providers (#1010)
|
||||
* Add units to team (#947)
|
||||
* Batch updates for issues (#926)
|
||||
* GPG commit validation (#1150)
|
||||
* Rework SSH key management UI to add GPG (#1293)
|
||||
* Implement GPG api (#710)
|
||||
* Login via OpenID-2.0 (#618)
|
||||
* Add units to team (#947)
|
||||
* Batch updates for issues (#926)
|
||||
* Add Gitea Webhook (#1755)
|
||||
* API: support '/orgs/:org/repos' (#2047)
|
||||
* Display all organization from user settings (#1739)
|
||||
* LDAP user synchronization (#1478)
|
||||
* Adding #issuecomment to the URL in E-Mail notifications (#1674)
|
||||
* Add download count field and unit testing for attachment. (#1512)
|
||||
* Add repo mirror sync API endpoint (#1508)
|
||||
* Add markup package to prepare for org markup format (#1493)
|
||||
* Support for custom html meta (#1423)
|
||||
* Per issue/PR watch/unwatch (#1410)
|
||||
* Allow ENABLE_OPENID_SIGNUP to depend on DISABLE_REGISTRATION (#1369)
|
||||
* Repo size in admin panel (#1482)
|
||||
* Show user OpenID URIs in their profile (#1314)
|
||||
* Add change-password admin command (#1304)
|
||||
* Only use issue and wiki on repo. (#1297)
|
||||
* Allow push to init a wiki repo (#1279)
|
||||
* ENHANCEMENT
|
||||
* Make time diff translatable (#2057)
|
||||
* Smaller watch, star, and fork buttons (#2052)
|
||||
* Display config file path on admin panel (#2030)
|
||||
* Only show SSH clone URL if signed in (#2169) (#2170)
|
||||
* Only show "No Description" to repo admins (#2167)
|
||||
* Always return valid go-get meta, even if unauthorized (#2010)
|
||||
* Enable assignee e-mail notification (#2003)
|
||||
* Let not-logged-in users view releases (#1999)
|
||||
* No highlighting for .txt files (#1922)
|
||||
* Make side nav on dashboard stackable (#1778)
|
||||
* Setting to disable authorized_keys backup (#1856)
|
||||
* Hide the create organization button (in dashboard/organization section) (#1705)
|
||||
* LFS: Return 404 for unimplemented endpoints (#1330)
|
||||
* Show a link to password reset from user settings requiring a password (#862)
|
||||
* Reserve the "explore" user/org name (#1222)
|
||||
* Send notifications to partecipants in issue comments (#1217)
|
||||
* Improve style of user OpenID setting page (#1324)
|
||||
* Use font-awesome OpenID icon more (#1320)
|
||||
* Use readonly input form to show the validated OpenID URI (#1308)
|
||||
* Add captcha support to OpenID based signup (#1307)
|
||||
* Minor improvements on commit graph UI (#1380)
|
||||
* Mirror sync interval specified as duration string (#1407)
|
||||
* Make issue in commit graph "clickable" (#1392)
|
||||
* Use whole button (commit graph) as link (#1390)
|
||||
* Autofocus on 2fa passcode fields (#1460)
|
||||
* Sort on repo size in admin panel (#1654)
|
||||
* Improve dashboard repo search (#1652)
|
||||
* Use a better default MAX_GIT_DIFF_LINE_CHARACTERS (#1845)
|
||||
* Adds Parent property to the repo API (#1687)
|
||||
* Add configuration option for default permission to create Organizations (#1686)
|
||||
* Remove sha1 hash display in repository table (#1678)
|
||||
* Download files to their original filename (#1676)
|
||||
* Exposes in API the Repo entity's Size and IsBare property (#1668)
|
||||
* Change two factor code entry box from text to number (#1733)
|
||||
* Directly show error if user hit repository limit (#1767)
|
||||
* Generate small and large logos at 4x resolution (#2233)
|
||||
* Tags listed in releases tab (#2389) (#2424)
|
||||
* BUGFIXES
|
||||
* Fix adding branch as protected to not allow pushing to it (#2556)
|
||||
* Orgs: fix org page title when full name is not defined (#1495)
|
||||
* Fix double borders on edit page (#1152) (#1153)
|
||||
* Search bar fixes for #1187 and #1205 (#1207)
|
||||
* Fix upgrade failed after ever rollback (#1194)
|
||||
* Fix FCGI (over TCP) support (#1368)
|
||||
* Backport of migration fixes (#2604) (#2677)
|
||||
* fix panic on gogs webhook creation (#2675) (#2676)
|
||||
* Backport: Fixes 500 error on dashboard when using MSSQL (#2504) (#2662)
|
||||
* Fix go get response if only app URL is custom in configuration (#2634) (#2640)
|
||||
* Fix deletion of unprotected branches (#2630)
|
||||
* Backport of 2611 / Fix doubled issue tab introduced in migration v16 (#2622)
|
||||
* v38 migration used an outdated version of RepoUnit model (#2602)
|
||||
* fix go get subpackage bug (#2584) (#2589)
|
||||
* Backport: Sync releases table with tags on push and for mirrors (#2459) (#2554)
|
||||
* Backport: Restricting access to fork functioanlity to users with Code access (#2542)
|
||||
* Fix migration from pre-v15 to 1.2.0 (#2460) (#2465)
|
||||
* Fix migration from pre-v15 to 1.2.0 (#2460)
|
||||
* fix duplicated feed (#2370) (#2413)
|
||||
* Fix releases to be counted from database not tags (#2389)
|
||||
* Fix missing collabrative repos (#2367) (#2382)
|
||||
* Add more test for login links and fix a bug on action retrieve (#2361)
|
||||
* Fix SQL condition bug in GetFeeds(..) (#2360)
|
||||
@@ -245,131 +290,8 @@
|
||||
* Bug fixed for delete repo failed (#1193)
|
||||
* Fix migration failed when authorized_keys is not exist (#1180)
|
||||
* Fix ini format incomiptable with crowdin (#1177)
|
||||
* ENHANCEMENT
|
||||
* Move 3rd party js/css into `public/vendor` and document sources (#2383)
|
||||
* Prevent conflicting TOTP accounts by adding AppURL to issuer parameter (#2335)
|
||||
* Fix variable name typo (#2327)
|
||||
* Make use of Vue more universal (#2318)
|
||||
* Remove (almost) server side data rendering from repo-search component (#2317)
|
||||
* Add OpenID configuration in install page (#2276)
|
||||
* More tweaks to repo top panel (#2267)
|
||||
* File path tweaks in UI (#2264)
|
||||
* Make SHOW_USER_EMAIL also apply to profiles (#2258)
|
||||
* EnableUnit() -> UnitEnabled() (#2242)
|
||||
* Prevent selection of diff line numbers (#2240)
|
||||
* Generate small and large logos at 4x resolution (#2233)
|
||||
* remove unused variable on makefile (#2225)
|
||||
* No error log entries for repo 404 (#2200)
|
||||
* Add task to generate images from SVG and change to new logo (#2194)
|
||||
* Refactor vue delimeters to use es6 template delimeters (#2171)
|
||||
* Only show SSH clone URL if signed in (#2169) (#2170)
|
||||
* Only show "No Description" to repo admins (#2167)
|
||||
* fix: replace tmp with TMPDIR. (#2152)
|
||||
* Remove unused files (#2124)
|
||||
* Improve org error handling (#2117)
|
||||
* Absolute path for setting.CustomConf (#2085)
|
||||
* Integration tests for issues API (#2059)
|
||||
* Make time diff translatable (#2057)
|
||||
* Smaller watch, star, and fork buttons (#2052)
|
||||
* remove deprecated code for Gogs compitable (#2041)
|
||||
* Display config file path on admin panel (#2030)
|
||||
* Refactor session close as xorm already does everything needed internally (#2020)
|
||||
* Always return valid go-get meta, even if unauthorized (#2010)
|
||||
* Enable assignee e-mail notification (#2003)
|
||||
* Let not-logged-in users view releases (#1999)
|
||||
* SQLite has a query timeout. Hopefully fixes most 'database locked' errors (#1961)
|
||||
* Use monospace font in githook editor (#1958)
|
||||
* Fix import order (#1951)
|
||||
* Gracefully handle bare repositories on API operations. (#1932)
|
||||
* Fix errors caused by force push (#1927)
|
||||
* Display URLs in integration test logs (#1924)
|
||||
* No highlighting for .txt files (#1922)
|
||||
* Set TMPDIR enviroment variable for dump command (#1915)
|
||||
* Cache ctx.User in retrieveFeeds (#1902)
|
||||
* Make `LocalCopyPath` a setting instead of a hard-coded path (#1881)
|
||||
* feat: add check misspelling (#1877)
|
||||
* Fix misspelled variables (#1874)
|
||||
* gofmt (#1868)
|
||||
* Rename misnamed migration (#1867)
|
||||
* Support CRLF when splitting code lines for display (#1862)
|
||||
* feat: add convert less css file step. (#1861)
|
||||
* Prevent accidential selection of line numbers in code view (#1860)
|
||||
* Setting to disable authorized_keys backup (#1856)
|
||||
* Delete Public SSH Key tmp file after calculating fingerprint (#1855)
|
||||
* Remove annoying difference in button heights. (#1853)
|
||||
* Use a better default MAX_GIT_DIFF_LINE_CHARACTERS (#1845)
|
||||
* fix: only run test coverage on master branch. (#1838)
|
||||
* fix: error from mktemp command in MacOS. (#1837)
|
||||
* use writeTmpKeyFile in calcFingerprint (#1828)
|
||||
* ROOT_URL setting use the default as shown in conf/app.ini (#1823)
|
||||
* Make side nav on dashboard stackable (#1778)
|
||||
* Directly show error if user hit repository limit (#1767)
|
||||
* Rename RepoCreationNum -> MaxCreationLimit (#1766)
|
||||
* Add button to admin ui (#1738)
|
||||
* Change two factor code entry box from text to number (#1733)
|
||||
* gofmt (#1710)
|
||||
* Hide the create organization button (in dashboard/organization section) (#1705)
|
||||
* Correct spelling mistakes (#1703)
|
||||
* Adds Parent property to the repo API (#1687)
|
||||
* Add configuration option for default permission to create Organizations (#1686)
|
||||
* Remove sha1 hash display in repository table (#1678)
|
||||
* Download files to their original filename (#1676)
|
||||
* Exposes in API the Repo entity's Size and IsBare property
|
||||
(#1668)
|
||||
* gofmt (#1662)
|
||||
* Sort on repo size in admin panel (#1654)
|
||||
* Improve dashboard repo search (#1652)
|
||||
* Update xorm to latest version (#1651)
|
||||
* Make openid support default false for compitable with v1.1 (#1650)
|
||||
* Send mails as HTML as default. Setting for send as plain text. (#1648)
|
||||
* fix potential lock when sqlite (#1647)
|
||||
* Optimize png images via Google zopflipng [ci skip] (#1639)
|
||||
* Upgrade alpine to v3.5 in Dockerfile (#1633)
|
||||
* remove unused vendor packages (#1620)
|
||||
* markup: microoptimise for many short filenames in directory (#1534)
|
||||
* support health check via / and fix #969 (#1520)
|
||||
* Remove env user salt since no need to use (#1515)
|
||||
* Drop db operations from hook commands (#1514)
|
||||
* Better URL validation (#1507)
|
||||
* Orgs: fix org page title when full name is not defined (#1495)
|
||||
* Migrate WatchInfo struct to api (#1492)
|
||||
* refactor: show command help message. (#1486)
|
||||
* refactor update ssh key use time (#1466)
|
||||
* Autofocus on 2fa passcode fields (#1460)
|
||||
* Set VERSION from git once, in a variable (#1447)
|
||||
* Remove unused mutex field (#1440)
|
||||
* Mirror sync interval specified as duration string (#1407)
|
||||
* Make issue in commit graph "clickable" (#1392)
|
||||
* Use whole button (commit graph) as link (#1390)
|
||||
* Simplify settings pages with item list (#1389)
|
||||
* Minor improvements on commit graph UI (#1380)
|
||||
* Clean-up PostgreSQL Tests (#1361)
|
||||
* refactor: remove workaround after the golang 1.7 release. (#1349)
|
||||
* Delete the useless code (#1335)
|
||||
* Run "make fmt" with go-1.6 (#1333)
|
||||
* LFS: Return 404 for unimplemented endpoints (#1330)
|
||||
* Improve style of user OpenID setting page (#1324)
|
||||
* Use font-awesome OpenID icon more (#1320)
|
||||
* Use readonly input form to show the validated OpenID URI (#1308)
|
||||
* Add captcha support to OpenID based signup (#1307)
|
||||
* Refactor admin/auth/new.tmpl (#1277)
|
||||
* Refactor repo/issue/view_content.tmpl (#1276)
|
||||
* Cleaner ui for admin, repo settings, and user settings page (#1269) (#1270)
|
||||
* Cleaner UI for explore page (#1253) (#1255)
|
||||
* Synced licenses with github repo (#1246)
|
||||
* Synced gitignores with github repo (#1245)
|
||||
* Reserve the "explore" user/org name (#1222)
|
||||
* Send notifications to partecipants in issue comments (#1217)
|
||||
* Simplify RepositoryList.loadAttributes() (#1211)
|
||||
* Move user_follow to separate file (#1210)
|
||||
* Search bar fixes for #1187 and #1205 (#1207)
|
||||
* Fix upgrade failed after ever rollback (#1194)
|
||||
* Fix double borders on edit page (#1152) (#1153)
|
||||
* Reduce conditionals in signin/signup inner forms (#1138)
|
||||
* Show a link to password reset from user settings requiring a password (#862)
|
||||
* SECURITY
|
||||
* Sanitation fix from Gogs (#1461)
|
||||
* TESTING
|
||||
* Integration tests for issues API (#2059)
|
||||
* Add integration tests for signin (#2363)
|
||||
* Add INTERNAL_TOKEN to integration .ini file (#2346)
|
||||
* Add public links check (#2323)
|
||||
@@ -410,6 +332,14 @@
|
||||
* Fix bad grammar and wordiness (#1741)
|
||||
* Make strings translatable (#1188) (#1198)
|
||||
* BUILD
|
||||
* Dockerfile for aarch64 (#1128) (#1130)
|
||||
* backport from v1.2 branch: add secrets for github release (#2588) (#2598)
|
||||
* Add secrets for github release to fix drone failed (#2588)
|
||||
* Backport changes for latest drone (#2586)
|
||||
* Removing .drone.yml.sig (#2579)
|
||||
* Fix drone for tags (#2573) (#2576)
|
||||
* Backport: Remove go version check for make fmt (#2558) (#2561)
|
||||
* Backport: Fix lint, fmt and integration testing errors (#2553)
|
||||
* update latest xorm version to vendor (#2353)
|
||||
* Remove integration test executables on `make clean` (#2340)
|
||||
* refactor(Makefile): allow overriding default go program (#2310)
|
||||
@@ -417,7 +347,6 @@
|
||||
* Use /dev/urandom to create random password (#2298)
|
||||
* update drone sig file. (#2262)
|
||||
* go get github.com/wadey/gocovmerge when needed (#2235)
|
||||
* Update code.gitea.io/git dependency (#2149)
|
||||
* fix typo (#2145)
|
||||
* Revert "Reduce number of layer" (#2086)
|
||||
* Reduce number of layer (#2078)
|
||||
@@ -444,15 +373,14 @@
|
||||
* Add GOFLAGS and EXTRA_GOFLAGS (#1438)
|
||||
* Include formatting check to the `make test` (and thus also `check`) rule (#1366)
|
||||
* DOCS
|
||||
* fix wrong changelog title (#2395)
|
||||
* fix webhook link (#2289)
|
||||
* Improve swagger doc (#2274)
|
||||
* Add changelog of release v1.1.3 (#2252)
|
||||
* Add link to forum in issue template (#2070)
|
||||
* add missing lfs config on example file (#2039)
|
||||
* Add discourse link (#2027)
|
||||
* Fix wording (#2024)
|
||||
* Fix typo (#1974)
|
||||
* [ci skip] add 1.1.2 change log. (#1945)
|
||||
* Swagger docs for list/create forks (#1941)
|
||||
* Update links to Discord server (#1940)
|
||||
* [ci skip] update discord badge. (#1930)
|
||||
@@ -484,7 +412,81 @@
|
||||
* Use sqlite3 database as default for Docker image (#2182)
|
||||
* update drone discord plugin to 0.0.4 version (#1992)
|
||||
* fix typo (#1990)
|
||||
* Applying to become maintainer (#1671)
|
||||
* Move 3rd party js/css into `public/vendor` and document sources (#2383)
|
||||
* Prevent conflicting TOTP accounts by adding AppURL to issuer parameter (#2335)
|
||||
* Fix variable name typo (#2327)
|
||||
* Make use of Vue more universal (#2318)
|
||||
* Remove (almost) server side data rendering from repo-search component (#2317)
|
||||
* Add OpenID configuration in install page (#2276)
|
||||
* More tweaks to repo top panel (#2267)
|
||||
* File path tweaks in UI (#2264)
|
||||
* Make SHOW_USER_EMAIL also apply to profiles (#2258)
|
||||
* EnableUnit() -> UnitEnabled() (#2242)
|
||||
* Prevent selection of diff line numbers (#2240)
|
||||
* Remove unused variable on makefile (#2225)
|
||||
* No error log entries for repo 404 (#2200)
|
||||
* Refactor vue delimeters to use es6 template delimeters (#2171)
|
||||
* Replace tmp with TMPDIR. (#2152)
|
||||
* Remove unused files (#2124)
|
||||
* Improve org error handling (#2117)
|
||||
* Absolute path for setting.CustomConf (#2085)
|
||||
* remove deprecated code for Gogs compitable (#2041)
|
||||
* Refactor session close as xorm already does everything needed internally (#2020)
|
||||
* SQLite has a query timeout. Hopefully fixes most 'database locked' errors (#1961)
|
||||
* Use monospace font in githook editor (#1958)
|
||||
* Fix import order (#1951)
|
||||
* Gracefully handle bare repositories on API operations. (#1932)
|
||||
* Fix errors caused by force push (#1927)
|
||||
* Display URLs in integration test logs (#1924)
|
||||
* Set TMPDIR enviroment variable for dump command (#1915)
|
||||
* Cache ctx.User in retrieveFeeds (#1902)
|
||||
* Make `LocalCopyPath` a setting instead of a hard-coded path (#1881)
|
||||
* Add check misspelling (#1877)
|
||||
* Fix misspelled variables (#1874)
|
||||
* Gofmt (#1868, #1710, #1662)
|
||||
* Rename misnamed migration (#1867)
|
||||
* Support CRLF when splitting code lines for display (#1862)
|
||||
* Add convert less css file step. (#1861)
|
||||
* Prevent accidential selection of line numbers in code view (#1860)
|
||||
* Delete Public SSH Key tmp file after calculating fingerprint (#1855)
|
||||
* Remove annoying difference in button heights. (#1853)
|
||||
* Only run test coverage on master branch. (#1838)
|
||||
* Error from mktemp command in MacOS. (#1837)
|
||||
* Use writeTmpKeyFile in calcFingerprint (#1828)
|
||||
* ROOT_URL setting use the default as shown in conf/app.ini (#1823)
|
||||
* Rename RepoCreationNum -> MaxCreationLimit (#1766)
|
||||
* Add button to admin ui (#1738)
|
||||
* Correct spelling mistakes (#1703)
|
||||
* Make openid support default false for compitable with v1.1 (#1650)
|
||||
* Send mails as HTML as default. Setting for send as plain text. (#1648)
|
||||
* fix potential lock when sqlite (#1647)
|
||||
* Optimize png images via Google zopflipng [ci skip] (#1639)
|
||||
* Upgrade alpine to v3.5 in Dockerfile (#1633)
|
||||
* remove unused vendor packages (#1620)
|
||||
* markup: microoptimise for many short filenames in directory (#1534)
|
||||
* support health check via / and fix #969 (#1520)
|
||||
* Remove env user salt since no need to use (#1515)
|
||||
* Drop db operations from hook commands (#1514)
|
||||
* Better URL validation (#1507)
|
||||
* Migrate WatchInfo struct to api (#1492)
|
||||
* refactor: show command help message. (#1486)
|
||||
* refactor update ssh key use time (#1466)
|
||||
* Set VERSION from git once, in a variable (#1447)
|
||||
* Remove unused mutex field (#1440)
|
||||
* Simplify settings pages with item list (#1389)
|
||||
* Clean-up PostgreSQL Tests (#1361)
|
||||
* refactor: remove workaround after the golang 1.7 release. (#1349)
|
||||
* Delete the useless code (#1335)
|
||||
* Run "make fmt" with go-1.6 (#1333)
|
||||
* Refactor admin/auth/new.tmpl (#1277)
|
||||
* Refactor repo/issue/view_content.tmpl (#1276)
|
||||
* Cleaner ui for admin, repo settings, and user settings page (#1269) (#1270)
|
||||
* Cleaner UI for explore page (#1253) (#1255)
|
||||
* Synced licenses with github repo (#1246)
|
||||
* Synced gitignores with github repo (#1245)
|
||||
* Simplify RepositoryList.loadAttributes() (#1211)
|
||||
* Move user_follow to separate file (#1210)
|
||||
* Reduce conditionals in signin/signup inner forms (#1138)
|
||||
|
||||
## [1.1.3](https://github.com/go-gitea/gitea/releases/tag/v1.1.3) - 2017-08-03
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@ func runHookPreReceive(c *cli.Context) error {
|
||||
log.GitLogger.Fatal(2, "retrieve protected branches information failed")
|
||||
}
|
||||
|
||||
if protectBranch != nil {
|
||||
if protectBranch != nil && protectBranch.IsProtected() {
|
||||
// check and deletion
|
||||
if newCommitID == git.EmptySHA {
|
||||
fail(fmt.Sprintf("branch %s is protected from deletion", branchName), "")
|
||||
|
||||
@@ -17,7 +17,7 @@ import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func assertProtectedBranch(t *testing.T, repoID int64, branchName string, isErr, canPush bool) {
|
||||
func assertProtectedBranch(t *testing.T, repoID int64, branchName string, isErr, isProtected bool) {
|
||||
reqURL := fmt.Sprintf("/api/internal/branch/%d/%s", repoID, url.QueryEscape(branchName))
|
||||
req := NewRequest(t, "GET", reqURL)
|
||||
t.Log(reqURL)
|
||||
@@ -31,14 +31,14 @@ func assertProtectedBranch(t *testing.T, repoID int64, branchName string, isErr,
|
||||
var branch models.ProtectedBranch
|
||||
t.Log(string(resp.Body))
|
||||
assert.NoError(t, json.Unmarshal(resp.Body, &branch))
|
||||
assert.Equal(t, canPush, branch.CanPush)
|
||||
assert.Equal(t, isProtected, branch.IsProtected())
|
||||
}
|
||||
}
|
||||
|
||||
func TestInternal_GetProtectedBranch(t *testing.T) {
|
||||
prepareTestEnv(t)
|
||||
|
||||
assertProtectedBranch(t, 1, "master", false, true)
|
||||
assertProtectedBranch(t, 1, "dev", false, true)
|
||||
assertProtectedBranch(t, 1, "lunny/dev", false, true)
|
||||
assertProtectedBranch(t, 1, "master", false, false)
|
||||
assertProtectedBranch(t, 1, "dev", false, false)
|
||||
assertProtectedBranch(t, 1, "lunny/dev", false, false)
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ func testPullCreate(t *testing.T, session *TestSession, user, repo, branch strin
|
||||
func TestPullCreate(t *testing.T) {
|
||||
prepareTestEnv(t)
|
||||
session := loginUser(t, "user1")
|
||||
testRepoFork(t, session)
|
||||
testRepoFork(t, session, "user2", "repo1", "user1", "repo1")
|
||||
testEditFile(t, session, "user1", "repo1", "master", "README.md")
|
||||
testPullCreate(t, session, "user1", "repo1", "master")
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ func testPullCleanUp(t *testing.T, session *TestSession, user, repo, pullnum str
|
||||
func TestPullMerge(t *testing.T) {
|
||||
prepareTestEnv(t)
|
||||
session := loginUser(t, "user1")
|
||||
testRepoFork(t, session)
|
||||
testRepoFork(t, session, "user2", "repo1", "user1", "repo1")
|
||||
testEditFile(t, session, "user1", "repo1", "master", "README.md")
|
||||
|
||||
resp := testPullCreate(t, session, "user1", "repo1", "master")
|
||||
@@ -61,7 +61,7 @@ func TestPullMerge(t *testing.T) {
|
||||
func TestPullCleanUpAfterMerge(t *testing.T) {
|
||||
prepareTestEnv(t)
|
||||
session := loginUser(t, "user1")
|
||||
testRepoFork(t, session)
|
||||
testRepoFork(t, session, "user2", "repo1", "user1", "repo1")
|
||||
testEditFileToNewBranch(t, session, "user1", "repo1", "master", "feature/test", "README.md")
|
||||
|
||||
resp := testPullCreate(t, session, "user1", "repo1", "feature/test")
|
||||
|
||||
@@ -5,19 +5,24 @@
|
||||
package integrations
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"testing"
|
||||
|
||||
"code.gitea.io/gitea/models"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func testRepoFork(t *testing.T, session *TestSession) *TestResponse {
|
||||
func testRepoFork(t *testing.T, session *TestSession, ownerName, repoName, forkOwnerName, forkRepoName string) *TestResponse {
|
||||
forkOwner := models.AssertExistsAndLoadBean(t, &models.User{Name: forkOwnerName}).(*models.User)
|
||||
|
||||
// Step0: check the existence of the to-fork repo
|
||||
req := NewRequest(t, "GET", "/user1/repo1")
|
||||
req := NewRequestf(t, "GET", "/%s/%s", forkOwnerName, forkRepoName)
|
||||
resp := session.MakeRequest(t, req, http.StatusNotFound)
|
||||
|
||||
// Step1: go to the main page of repo
|
||||
req = NewRequest(t, "GET", "/user2/repo1")
|
||||
req = NewRequestf(t, "GET", "/%s/%s", ownerName, repoName)
|
||||
resp = session.MakeRequest(t, req, http.StatusOK)
|
||||
|
||||
// Step2: click the fork button
|
||||
@@ -31,15 +36,17 @@ func testRepoFork(t *testing.T, session *TestSession) *TestResponse {
|
||||
htmlDoc = NewHTMLParser(t, resp.Body)
|
||||
link, exists = htmlDoc.doc.Find("form.ui.form[action^=\"/repo/fork/\"]").Attr("action")
|
||||
assert.True(t, exists, "The template has changed")
|
||||
_, exists = htmlDoc.doc.Find(fmt.Sprintf(".owner.dropdown .item[data-value=\"%d\"]", forkOwner.ID)).Attr("data-value")
|
||||
assert.True(t, exists, fmt.Sprintf("Fork owner '%s' is not present in select box", forkOwnerName))
|
||||
req = NewRequestWithValues(t, "POST", link, map[string]string{
|
||||
"_csrf": htmlDoc.GetCSRF(),
|
||||
"uid": "1",
|
||||
"repo_name": "repo1",
|
||||
"uid": fmt.Sprintf("%d", forkOwner.ID),
|
||||
"repo_name": forkRepoName,
|
||||
})
|
||||
resp = session.MakeRequest(t, req, http.StatusFound)
|
||||
|
||||
// Step4: check the existence of the forked repo
|
||||
req = NewRequest(t, "GET", "/user1/repo1")
|
||||
req = NewRequestf(t, "GET", "/%s/%s", forkOwnerName, forkRepoName)
|
||||
resp = session.MakeRequest(t, req, http.StatusOK)
|
||||
|
||||
return resp
|
||||
@@ -48,5 +55,19 @@ func testRepoFork(t *testing.T, session *TestSession) *TestResponse {
|
||||
func TestRepoFork(t *testing.T) {
|
||||
prepareTestEnv(t)
|
||||
session := loginUser(t, "user1")
|
||||
testRepoFork(t, session)
|
||||
testRepoFork(t, session, "user2", "repo1", "user1", "repo1")
|
||||
}
|
||||
|
||||
func TestRepoForkToOrg(t *testing.T) {
|
||||
prepareTestEnv(t)
|
||||
session := loginUser(t, "user2")
|
||||
testRepoFork(t, session, "user2", "repo1", "user3", "repo1")
|
||||
|
||||
// Check that no more forking is allowed as user2 owns repository
|
||||
// and user3 organization that owner user2 is also now has forked this repository
|
||||
req := NewRequest(t, "GET", "/user2/repo1")
|
||||
resp := session.MakeRequest(t, req, http.StatusOK)
|
||||
htmlDoc := NewHTMLParser(t, resp.Body)
|
||||
_, exists := htmlDoc.doc.Find("a.ui.button[href^=\"/repo/fork/\"]").Attr("href")
|
||||
assert.False(t, exists, "Forking should not be allowed anymore")
|
||||
}
|
||||
|
||||
@@ -38,6 +38,11 @@ func (protectBranch *ProtectedBranch) BeforeUpdate() {
|
||||
protectBranch.UpdatedUnix = time.Now().Unix()
|
||||
}
|
||||
|
||||
// IsProtected returns if the branch is protected
|
||||
func (protectBranch *ProtectedBranch) IsProtected() bool {
|
||||
return protectBranch.ID > 0
|
||||
}
|
||||
|
||||
// GetProtectedBranchByRepoID getting protected branch by repo ID
|
||||
func GetProtectedBranchByRepoID(RepoID int64) ([]*ProtectedBranch, error) {
|
||||
protectedBranches := make([]*ProtectedBranch, 0)
|
||||
|
||||
@@ -130,6 +130,8 @@ var migrations = []Migration{
|
||||
NewMigration("fix protected branch can push value to false", fixProtectedBranchCanPushValue),
|
||||
// v42 -> v43
|
||||
NewMigration("add tags to releases and sync existing repositories", releaseAddColumnIsTagAndSyncTags),
|
||||
// v44 -> v45
|
||||
NewMigration("remove duplicate unit types", removeDuplicateUnitTypes),
|
||||
}
|
||||
|
||||
// Migrate database to current version
|
||||
|
||||
@@ -10,21 +10,15 @@ import (
|
||||
"github.com/go-xorm/xorm"
|
||||
)
|
||||
|
||||
// UserV15 describes the added field for User
|
||||
type UserV15 struct {
|
||||
KeepEmailPrivate bool
|
||||
AllowCreateOrganization bool
|
||||
}
|
||||
|
||||
// TableName will be invoked by XORM to customrize the table name
|
||||
func (*UserV15) TableName() string {
|
||||
return "user"
|
||||
}
|
||||
|
||||
func createAllowCreateOrganizationColumn(x *xorm.Engine) error {
|
||||
if err := x.Sync2(new(UserV15)); err != nil {
|
||||
type User struct {
|
||||
KeepEmailPrivate bool
|
||||
AllowCreateOrganization bool
|
||||
}
|
||||
|
||||
if err := x.Sync2(new(User)); err != nil {
|
||||
return fmt.Errorf("Sync2: %v", err)
|
||||
} else if _, err = x.Where("type=0").Cols("allow_create_organization").Update(&UserV15{AllowCreateOrganization: true}); err != nil {
|
||||
} else if _, err = x.Where("`type` = 0").Cols("allow_create_organization").Update(&User{AllowCreateOrganization: true}); err != nil {
|
||||
return fmt.Errorf("set allow_create_organization: %v", err)
|
||||
}
|
||||
return nil
|
||||
|
||||
@@ -13,17 +13,6 @@ import (
|
||||
"github.com/go-xorm/xorm"
|
||||
)
|
||||
|
||||
// RepoUnit describes all units of a repository
|
||||
type RepoUnit struct {
|
||||
ID int64
|
||||
RepoID int64 `xorm:"INDEX(s)"`
|
||||
Type int `xorm:"INDEX(s)"`
|
||||
Index int
|
||||
Config map[string]string `xorm:"JSON"`
|
||||
CreatedUnix int64 `xorm:"INDEX CREATED"`
|
||||
Created time.Time `xorm:"-"`
|
||||
}
|
||||
|
||||
// Enumerate all the unit types
|
||||
const (
|
||||
V16UnitTypeCode = iota + 1 // 1 code
|
||||
@@ -37,14 +26,25 @@ const (
|
||||
V16UnitTypeExternalTracker // 9 ExternalTracker
|
||||
)
|
||||
|
||||
// Repo describes a repository
|
||||
type Repo struct {
|
||||
ID int64
|
||||
EnableWiki, EnableExternalWiki, EnableIssues, EnableExternalTracker, EnablePulls bool
|
||||
ExternalWikiURL, ExternalTrackerURL, ExternalTrackerFormat, ExternalTrackerStyle string
|
||||
}
|
||||
|
||||
func addUnitsToTables(x *xorm.Engine) error {
|
||||
// RepoUnit describes all units of a repository
|
||||
type RepoUnit struct {
|
||||
ID int64
|
||||
RepoID int64 `xorm:"INDEX(s)"`
|
||||
Type int `xorm:"INDEX(s)"`
|
||||
Index int
|
||||
Config map[string]interface{} `xorm:"JSON"`
|
||||
CreatedUnix int64 `xorm:"INDEX CREATED"`
|
||||
Created time.Time `xorm:"-"`
|
||||
}
|
||||
|
||||
// Repo describes a repository
|
||||
type Repo struct {
|
||||
ID int64
|
||||
EnableWiki, EnableExternalWiki, EnableIssues, EnableExternalTracker, EnablePulls bool
|
||||
ExternalWikiURL, ExternalTrackerURL, ExternalTrackerFormat, ExternalTrackerStyle string
|
||||
}
|
||||
|
||||
var repos []Repo
|
||||
err := x.Table("repository").Select("*").Find(&repos)
|
||||
if err != nil {
|
||||
@@ -95,7 +95,7 @@ func addUnitsToTables(x *xorm.Engine) error {
|
||||
continue
|
||||
}
|
||||
|
||||
var config = make(map[string]string)
|
||||
var config = make(map[string]interface{})
|
||||
switch i {
|
||||
case V16UnitTypeExternalTracker:
|
||||
config["ExternalTrackerURL"] = repo.ExternalTrackerURL
|
||||
|
||||
@@ -7,16 +7,19 @@ package migrations
|
||||
import (
|
||||
"html"
|
||||
|
||||
"code.gitea.io/gitea/models"
|
||||
|
||||
"github.com/go-xorm/xorm"
|
||||
)
|
||||
|
||||
func unescapeUserFullNames(x *xorm.Engine) (err error) {
|
||||
type User struct {
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
FullName string
|
||||
}
|
||||
|
||||
const batchSize = 100
|
||||
for start := 0; ; start += batchSize {
|
||||
users := make([]*models.User, 0, batchSize)
|
||||
if err := x.Limit(start, batchSize).Find(users); err != nil {
|
||||
users := make([]*User, 0, batchSize)
|
||||
if err := x.Limit(batchSize, start).Find(&users); err != nil {
|
||||
return err
|
||||
}
|
||||
if len(users) == 0 {
|
||||
@@ -24,7 +27,7 @@ func unescapeUserFullNames(x *xorm.Engine) (err error) {
|
||||
}
|
||||
for _, user := range users {
|
||||
user.FullName = html.UnescapeString(user.FullName)
|
||||
if _, err := x.Cols("full_name").Update(user); err != nil {
|
||||
if _, err := x.ID(user.ID).Cols("full_name").Update(user); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,12 +5,26 @@
|
||||
package migrations
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"code.gitea.io/gitea/models"
|
||||
|
||||
"github.com/go-xorm/core"
|
||||
"github.com/go-xorm/xorm"
|
||||
)
|
||||
|
||||
func removeCommitsUnitType(x *xorm.Engine) (err error) {
|
||||
// RepoUnit describes all units of a repository
|
||||
type RepoUnit struct {
|
||||
ID int64
|
||||
RepoID int64 `xorm:"INDEX(s)"`
|
||||
Type int `xorm:"INDEX(s)"`
|
||||
Index int
|
||||
Config core.Conversion `xorm:"TEXT"`
|
||||
CreatedUnix int64 `xorm:"INDEX CREATED"`
|
||||
Created time.Time `xorm:"-"`
|
||||
}
|
||||
|
||||
// Update team unit types
|
||||
const batchSize = 100
|
||||
for start := 0; ; start += batchSize {
|
||||
@@ -33,7 +47,7 @@ func removeCommitsUnitType(x *xorm.Engine) (err error) {
|
||||
}
|
||||
}
|
||||
team.UnitTypes = ut
|
||||
if _, err := x.Id(team.ID).Cols("unit_types").Update(team); err != nil {
|
||||
if _, err := x.ID(team.ID).Cols("unit_types").Update(team); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
69
models/migrations/v44.go
Normal file
69
models/migrations/v44.go
Normal file
@@ -0,0 +1,69 @@
|
||||
// Copyright 2017 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package migrations
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/go-xorm/xorm"
|
||||
)
|
||||
|
||||
func removeDuplicateUnitTypes(x *xorm.Engine) error {
|
||||
// RepoUnit describes all units of a repository
|
||||
type RepoUnit struct {
|
||||
RepoID int64
|
||||
Type int
|
||||
}
|
||||
|
||||
// Enumerate all the unit types
|
||||
const (
|
||||
UnitTypeCode = iota + 1 // 1 code
|
||||
UnitTypeIssues // 2 issues
|
||||
UnitTypePullRequests // 3 PRs
|
||||
UnitTypeReleases // 4 Releases
|
||||
UnitTypeWiki // 5 Wiki
|
||||
UnitTypeExternalWiki // 6 ExternalWiki
|
||||
UnitTypeExternalTracker // 7 ExternalTracker
|
||||
)
|
||||
|
||||
var externalIssueRepoUnits []RepoUnit
|
||||
err := x.Where("type = ?", UnitTypeExternalTracker).Find(&externalIssueRepoUnits)
|
||||
if err != nil {
|
||||
return fmt.Errorf("Query repositories: %v", err)
|
||||
}
|
||||
|
||||
var externalWikiRepoUnits []RepoUnit
|
||||
err = x.Where("type = ?", UnitTypeExternalWiki).Find(&externalWikiRepoUnits)
|
||||
if err != nil {
|
||||
return fmt.Errorf("Query repositories: %v", err)
|
||||
}
|
||||
|
||||
sess := x.NewSession()
|
||||
defer sess.Close()
|
||||
|
||||
if err := sess.Begin(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, repoUnit := range externalIssueRepoUnits {
|
||||
if _, err = sess.Delete(&RepoUnit{
|
||||
RepoID: repoUnit.RepoID,
|
||||
Type: UnitTypeIssues,
|
||||
}); err != nil {
|
||||
return fmt.Errorf("Delete repo unit: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
for _, repoUnit := range externalWikiRepoUnits {
|
||||
if _, err = sess.Delete(&RepoUnit{
|
||||
RepoID: repoUnit.RepoID,
|
||||
Type: UnitTypeWiki,
|
||||
}); err != nil {
|
||||
return fmt.Errorf("Delete repo unit: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
return sess.Commit()
|
||||
}
|
||||
@@ -671,7 +671,7 @@ func (env *accessibleReposEnv) MirrorRepoIDs() ([]int64, error) {
|
||||
Table("repository").
|
||||
Join("INNER", "team_repo", "`team_repo`.repo_id=`repository`.id AND `repository`.is_mirror=?", true).
|
||||
Where(env.cond()).
|
||||
GroupBy("`repository`.id").
|
||||
GroupBy("`repository`.id, `repository`.updated_unix").
|
||||
OrderBy("updated_unix DESC").
|
||||
Cols("`repository`.id").
|
||||
Find(&repoIDs)
|
||||
|
||||
@@ -409,6 +409,21 @@ func (repo *Repository) UnitEnabled(tp UnitType) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// AnyUnitEnabled if this repository has the any of the given units enabled
|
||||
func (repo *Repository) AnyUnitEnabled(tps ...UnitType) bool {
|
||||
if err := repo.getUnits(x); err != nil {
|
||||
log.Warn("Error loading repository (ID: %d) units: %s", repo.ID, err.Error())
|
||||
}
|
||||
for _, unit := range repo.Units {
|
||||
for _, tp := range tps {
|
||||
if unit.Type == tp {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
var (
|
||||
// ErrUnitNotExist organization does not exist
|
||||
ErrUnitNotExist = errors.New("Unit does not exist")
|
||||
@@ -651,6 +666,25 @@ func (repo *Repository) CanBeForked() bool {
|
||||
return !repo.IsBare && repo.UnitEnabled(UnitTypeCode)
|
||||
}
|
||||
|
||||
// CanUserFork returns true if specified user can fork repository.
|
||||
func (repo *Repository) CanUserFork(user *User) (bool, error) {
|
||||
if user == nil {
|
||||
return false, nil
|
||||
}
|
||||
if repo.OwnerID != user.ID && !user.HasForkedRepo(repo.ID) {
|
||||
return true, nil
|
||||
}
|
||||
if err := user.GetOwnedOrganizations(); err != nil {
|
||||
return false, err
|
||||
}
|
||||
for _, org := range user.OwnedOrgs {
|
||||
if repo.OwnerID != org.ID && !org.HasForkedRepo(repo.ID) {
|
||||
return true, nil
|
||||
}
|
||||
}
|
||||
return false, nil
|
||||
}
|
||||
|
||||
// CanEnablePulls returns true if repository meets the requirements of accepting pulls.
|
||||
func (repo *Repository) CanEnablePulls() bool {
|
||||
return !repo.IsMirror && !repo.IsBare
|
||||
|
||||
@@ -194,7 +194,7 @@ func Contexter() macaron.Handler {
|
||||
</body>
|
||||
</html>
|
||||
`, map[string]string{
|
||||
"GoGetImport": path.Join(setting.Domain, setting.AppSubURL, ctx.Link),
|
||||
"GoGetImport": ComposeGoGetImport(ownerName, strings.TrimSuffix(repoName, ".git")),
|
||||
"CloneLink": models.ComposeHTTPSCloneURL(ownerName, repoName),
|
||||
"GoDocDirectory": prefix + "{/dir}",
|
||||
"GoDocFile": prefix + "{/dir}/{file}#L{line}",
|
||||
|
||||
@@ -364,6 +364,11 @@ func RepoAssignment() macaron.Handler {
|
||||
ctx.Data["IsRepositoryAdmin"] = ctx.Repo.IsAdmin()
|
||||
ctx.Data["IsRepositoryWriter"] = ctx.Repo.IsWriter()
|
||||
|
||||
if ctx.Data["CanSignedUserFork"], err = ctx.Repo.Repository.CanUserFork(ctx.User); err != nil {
|
||||
ctx.Handle(500, "CanUserFork", err)
|
||||
return
|
||||
}
|
||||
|
||||
ctx.Data["DisableSSH"] = setting.SSH.Disabled
|
||||
ctx.Data["ExposeAnonSSH"] = setting.SSH.ExposeAnonymous
|
||||
ctx.Data["DisableHTTP"] = setting.Repository.DisableHTTPGit
|
||||
@@ -609,6 +614,15 @@ func CheckUnit(unitType models.UnitType) macaron.Handler {
|
||||
}
|
||||
}
|
||||
|
||||
// CheckAnyUnit will check whether any of the unit types are enabled
|
||||
func CheckAnyUnit(unitTypes ...models.UnitType) macaron.Handler {
|
||||
return func(ctx *Context) {
|
||||
if !ctx.Repo.Repository.AnyUnitEnabled(unitTypes...) {
|
||||
ctx.Handle(404, "CheckAnyUnit", fmt.Errorf("%s: %v", ctx.Tr("units.error.unit_not_allowed"), unitTypes))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// GitHookService checks if repository Git hooks service has been enabled.
|
||||
func GitHookService() macaron.Handler {
|
||||
return func(ctx *Context) {
|
||||
|
||||
@@ -16,6 +16,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"code.gitea.io/gitea/modules/base"
|
||||
"code.gitea.io/gitea/modules/log"
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
|
||||
@@ -41,7 +42,7 @@ func NewMessageFrom(to []string, from, subject, body string) *Message {
|
||||
|
||||
plainBody, err := html2text.FromString(body)
|
||||
if err != nil || setting.MailService.SendAsPlainText {
|
||||
if strings.Contains(body[:100], "<html>") {
|
||||
if strings.Contains(base.TruncateString(body, 100), "<html>") {
|
||||
log.Warn("Mail contains HTML but configured to send as plain text.")
|
||||
}
|
||||
msg.SetBody("text/plain", plainBody)
|
||||
|
||||
@@ -10,6 +10,7 @@ import (
|
||||
"encoding/base64"
|
||||
"fmt"
|
||||
"io"
|
||||
"net"
|
||||
"net/mail"
|
||||
"net/url"
|
||||
"os"
|
||||
@@ -657,6 +658,12 @@ func NewContext() {
|
||||
// This value is empty if site does not have sub-url.
|
||||
AppSubURL = strings.TrimSuffix(url.Path, "/")
|
||||
AppSubURLDepth = strings.Count(AppSubURL, "/")
|
||||
// Check if Domain differs from AppURL domain than update it to AppURL's domain
|
||||
// TODO: Can be replaced with url.Hostname() when minimal GoLang version is 1.8
|
||||
urlHostname := strings.SplitN(url.Host, ":", 2)[0]
|
||||
if urlHostname != Domain && net.ParseIP(urlHostname) == nil {
|
||||
Domain = urlHostname
|
||||
}
|
||||
|
||||
var defaultLocalURL string
|
||||
switch Protocol {
|
||||
|
||||
@@ -20,11 +20,6 @@ func GetProtectedBranchBy(ctx *macaron.Context) {
|
||||
"err": err.Error(),
|
||||
})
|
||||
return
|
||||
} else if protectBranch != nil {
|
||||
ctx.JSON(200, protectBranch)
|
||||
} else {
|
||||
ctx.JSON(200, &models.ProtectedBranch{
|
||||
CanPush: true,
|
||||
})
|
||||
}
|
||||
ctx.JSON(200, protectBranch)
|
||||
}
|
||||
|
||||
@@ -139,19 +139,28 @@ func HTTP(ctx *context.Context) {
|
||||
}
|
||||
|
||||
if authUser == nil {
|
||||
authUser, err = models.GetUserByName(authUsername)
|
||||
isUsernameToken := len(authPasswd) == 0 || authPasswd == "x-oauth-basic"
|
||||
|
||||
if err != nil {
|
||||
if models.IsErrUserNotExist(err) {
|
||||
ctx.HandleText(http.StatusUnauthorized, "invalid credentials")
|
||||
} else {
|
||||
ctx.Handle(http.StatusInternalServerError, "GetUserByName", err)
|
||||
// Assume username is token
|
||||
authToken := authUsername
|
||||
|
||||
if !isUsernameToken {
|
||||
// Assume password is token
|
||||
authToken = authPasswd
|
||||
|
||||
authUser, err = models.GetUserByName(authUsername)
|
||||
if err != nil {
|
||||
if models.IsErrUserNotExist(err) {
|
||||
ctx.HandleText(http.StatusUnauthorized, "invalid credentials")
|
||||
} else {
|
||||
ctx.Handle(http.StatusInternalServerError, "GetUserByName", err)
|
||||
}
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// Assume password is a token.
|
||||
token, err := models.GetAccessTokenBySHA(authPasswd)
|
||||
token, err := models.GetAccessTokenBySHA(authToken)
|
||||
if err != nil {
|
||||
if models.IsErrAccessTokenNotExist(err) || models.IsErrAccessTokenEmpty(err) {
|
||||
ctx.HandleText(http.StatusUnauthorized, "invalid credentials")
|
||||
@@ -161,7 +170,13 @@ func HTTP(ctx *context.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
if authUser.ID != token.UID {
|
||||
if isUsernameToken {
|
||||
authUser, err = models.GetUserByID(token.UID)
|
||||
if err != nil {
|
||||
ctx.Handle(http.StatusInternalServerError, "GetUserByID", err)
|
||||
return
|
||||
}
|
||||
} else if authUser.ID != token.UID {
|
||||
ctx.HandleText(http.StatusUnauthorized, "invalid credentials")
|
||||
return
|
||||
}
|
||||
@@ -170,7 +185,6 @@ func HTTP(ctx *context.Context) {
|
||||
if err = models.UpdateAccessToken(token); err != nil {
|
||||
ctx.Handle(http.StatusInternalServerError, "UpdateAccessToken", err)
|
||||
}
|
||||
|
||||
} else {
|
||||
_, err = models.GetTwoFactorByUID(authUser.ID)
|
||||
|
||||
|
||||
@@ -676,11 +676,16 @@ func ViewIssue(ctx *context.Context) {
|
||||
func getActionIssue(ctx *context.Context) *models.Issue {
|
||||
issue, err := models.GetIssueByIndex(ctx.Repo.Repository.ID, ctx.ParamsInt64(":index"))
|
||||
if err != nil {
|
||||
if models.IsErrIssueNotExist(err) {
|
||||
ctx.Error(404, "GetIssueByIndex")
|
||||
} else {
|
||||
ctx.Handle(500, "GetIssueByIndex", err)
|
||||
}
|
||||
ctx.NotFoundOrServerError("GetIssueByIndex", models.IsErrIssueNotExist, err)
|
||||
return nil
|
||||
}
|
||||
if issue.IsPull && !ctx.Repo.Repository.UnitEnabled(models.UnitTypePullRequests) ||
|
||||
!issue.IsPull && !ctx.Repo.Repository.UnitEnabled(models.UnitTypeIssues) {
|
||||
ctx.Handle(404, "IssueOrPullRequestUnitNotAllowed", nil)
|
||||
return nil
|
||||
}
|
||||
if err = issue.LoadAttributes(); err != nil {
|
||||
ctx.Handle(500, "LoadAttributes", nil)
|
||||
return nil
|
||||
}
|
||||
return issue
|
||||
@@ -705,6 +710,19 @@ func getActionIssues(ctx *context.Context) []*models.Issue {
|
||||
ctx.Handle(500, "GetIssuesByIDs", err)
|
||||
return nil
|
||||
}
|
||||
// Check access rights for all issues
|
||||
issueUnitEnabled := ctx.Repo.Repository.UnitEnabled(models.UnitTypeIssues)
|
||||
prUnitEnabled := ctx.Repo.Repository.UnitEnabled(models.UnitTypePullRequests)
|
||||
for _, issue := range issues {
|
||||
if issue.IsPull && !prUnitEnabled || !issue.IsPull && !issueUnitEnabled {
|
||||
ctx.Handle(404, "IssueOrPullRequestUnitNotAllowed", nil)
|
||||
return nil
|
||||
}
|
||||
if err = issue.LoadAttributes(); err != nil {
|
||||
ctx.Handle(500, "LoadAttributes", nil)
|
||||
return nil
|
||||
}
|
||||
}
|
||||
return issues
|
||||
}
|
||||
|
||||
@@ -840,9 +858,8 @@ func UpdateIssueStatus(ctx *context.Context) {
|
||||
|
||||
// NewComment create a comment for issue
|
||||
func NewComment(ctx *context.Context, form auth.CreateCommentForm) {
|
||||
issue, err := models.GetIssueByIndex(ctx.Repo.Repository.ID, ctx.ParamsInt64(":index"))
|
||||
if err != nil {
|
||||
ctx.NotFoundOrServerError("GetIssueByIndex", models.IsErrIssueNotExist, err)
|
||||
issue := getActionIssue(ctx)
|
||||
if ctx.Written() {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -869,7 +886,7 @@ func NewComment(ctx *context.Context, form auth.CreateCommentForm) {
|
||||
|
||||
if form.Status == "reopen" && issue.IsPull {
|
||||
pull := issue.PullRequest
|
||||
pr, err = models.GetUnmergedPullRequest(pull.HeadRepoID, pull.BaseRepoID, pull.HeadBranch, pull.BaseBranch)
|
||||
pr, err := models.GetUnmergedPullRequest(pull.HeadRepoID, pull.BaseRepoID, pull.HeadBranch, pull.BaseBranch)
|
||||
if err != nil {
|
||||
if !models.IsErrPullRequestNotExist(err) {
|
||||
ctx.Handle(500, "GetUnmergedPullRequest", err)
|
||||
@@ -891,7 +908,7 @@ func NewComment(ctx *context.Context, form auth.CreateCommentForm) {
|
||||
if pr != nil {
|
||||
ctx.Flash.Info(ctx.Tr("repo.pulls.open_unmerged_pull_exists", pr.Index))
|
||||
} else {
|
||||
if err = issue.ChangeStatus(ctx.User, ctx.Repo.Repository, form.Status == "close"); err != nil {
|
||||
if err := issue.ChangeStatus(ctx.User, ctx.Repo.Repository, form.Status == "close"); err != nil {
|
||||
log.Error(4, "ChangeStatus: %v", err)
|
||||
} else {
|
||||
log.Trace("Issue [%d] status changed to closed: %v", issue.ID, issue.IsClosed)
|
||||
@@ -918,7 +935,7 @@ func NewComment(ctx *context.Context, form auth.CreateCommentForm) {
|
||||
return
|
||||
}
|
||||
|
||||
comment, err = models.CreateIssueComment(ctx.User, ctx.Repo.Repository, issue, form.Content, attachments)
|
||||
comment, err := models.CreateIssueComment(ctx.User, ctx.Repo.Repository, issue, form.Content, attachments)
|
||||
if err != nil {
|
||||
ctx.Handle(500, "CreateIssueComment", err)
|
||||
return
|
||||
@@ -988,10 +1005,6 @@ func DeleteComment(ctx *context.Context) {
|
||||
|
||||
// Milestones render milestones page
|
||||
func Milestones(ctx *context.Context) {
|
||||
MustEnableIssues(ctx)
|
||||
if ctx.Written() {
|
||||
return
|
||||
}
|
||||
ctx.Data["Title"] = ctx.Tr("repo.milestones")
|
||||
ctx.Data["PageIsIssueList"] = true
|
||||
ctx.Data["PageIsMilestones"] = true
|
||||
|
||||
@@ -18,10 +18,6 @@ const (
|
||||
|
||||
// Labels render issue's labels page
|
||||
func Labels(ctx *context.Context) {
|
||||
MustEnableIssues(ctx)
|
||||
if ctx.Written() {
|
||||
return
|
||||
}
|
||||
ctx.Data["Title"] = ctx.Tr("repo.labels")
|
||||
ctx.Data["PageIsIssueList"] = true
|
||||
ctx.Data["PageIsLabels"] = true
|
||||
|
||||
@@ -21,10 +21,8 @@ func IssueWatch(c *context.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
issueIndex := c.ParamsInt64("index")
|
||||
issue, err := models.GetIssueByIndex(c.Repo.Repository.ID, issueIndex)
|
||||
if err != nil {
|
||||
c.Handle(http.StatusInternalServerError, "GetIssueByIndex", err)
|
||||
issue := getActionIssue(c)
|
||||
if c.Written() {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -33,6 +31,6 @@ func IssueWatch(c *context.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
url := fmt.Sprintf("%s/issues/%d", c.Repo.RepoLink, issueIndex)
|
||||
url := fmt.Sprintf("%s/issues/%d", c.Repo.RepoLink, issue.Index)
|
||||
c.Redirect(url, http.StatusSeeOther)
|
||||
}
|
||||
|
||||
@@ -61,6 +61,8 @@ func getForkRepository(ctx *context.Context) *models.Repository {
|
||||
ctx.Data["repo_name"] = forkRepo.Name
|
||||
ctx.Data["description"] = forkRepo.Description
|
||||
ctx.Data["IsPrivate"] = forkRepo.IsPrivate
|
||||
canForkToUser := forkRepo.OwnerID != ctx.User.ID && !ctx.User.HasForkedRepo(forkRepo.ID)
|
||||
ctx.Data["CanForkToUser"] = canForkToUser
|
||||
|
||||
if err = forkRepo.GetOwner(); err != nil {
|
||||
ctx.Handle(500, "GetOwner", err)
|
||||
@@ -69,11 +71,23 @@ func getForkRepository(ctx *context.Context) *models.Repository {
|
||||
ctx.Data["ForkFrom"] = forkRepo.Owner.Name + "/" + forkRepo.Name
|
||||
ctx.Data["ForkFromOwnerID"] = forkRepo.Owner.ID
|
||||
|
||||
if err := ctx.User.GetOrganizations(true); err != nil {
|
||||
ctx.Handle(500, "GetOrganizations", err)
|
||||
if err := ctx.User.GetOwnedOrganizations(); err != nil {
|
||||
ctx.Handle(500, "GetOwnedOrganizations", err)
|
||||
return nil
|
||||
}
|
||||
ctx.Data["Orgs"] = ctx.User.Orgs
|
||||
var orgs []*models.User
|
||||
for _, org := range ctx.User.OwnedOrgs {
|
||||
if forkRepo.OwnerID != org.ID && !org.HasForkedRepo(forkRepo.ID) {
|
||||
orgs = append(orgs, org)
|
||||
}
|
||||
}
|
||||
ctx.Data["Orgs"] = orgs
|
||||
|
||||
if canForkToUser {
|
||||
ctx.Data["ContextUser"] = ctx.User
|
||||
} else if len(orgs) > 0 {
|
||||
ctx.Data["ContextUser"] = orgs[0]
|
||||
}
|
||||
|
||||
return forkRepo
|
||||
}
|
||||
@@ -87,7 +101,6 @@ func Fork(ctx *context.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
ctx.Data["ContextUser"] = ctx.User
|
||||
ctx.HTML(200, tplFork)
|
||||
}
|
||||
|
||||
@@ -95,15 +108,16 @@ func Fork(ctx *context.Context) {
|
||||
func ForkPost(ctx *context.Context, form auth.CreateRepoForm) {
|
||||
ctx.Data["Title"] = ctx.Tr("new_fork")
|
||||
|
||||
ctxUser := checkContextUser(ctx, form.UID)
|
||||
if ctx.Written() {
|
||||
return
|
||||
}
|
||||
|
||||
forkRepo := getForkRepository(ctx)
|
||||
if ctx.Written() {
|
||||
return
|
||||
}
|
||||
|
||||
ctxUser := checkContextUser(ctx, form.UID)
|
||||
if ctx.Written() {
|
||||
return
|
||||
}
|
||||
ctx.Data["ContextUser"] = ctxUser
|
||||
|
||||
if ctx.HasError() {
|
||||
|
||||
@@ -93,16 +93,12 @@ func renderDirectory(ctx *context.Context, treeLink string) {
|
||||
if isTextFile {
|
||||
d, _ := ioutil.ReadAll(dataRc)
|
||||
buf = append(buf, d...)
|
||||
newbuf := markup.Render(readmeFile.Name(), buf, treeLink, ctx.Repo.Repository.ComposeMetas())
|
||||
if newbuf != nil {
|
||||
ctx.Data["IsMarkdown"] = true
|
||||
ctx.Data["IsRenderedHTML"] = true
|
||||
if markup.Type(readmeFile.Name()) != "" {
|
||||
ctx.Data["FileContent"] = string(markup.Render(readmeFile.Name(), buf, treeLink, ctx.Repo.Repository.ComposeMetas()))
|
||||
} else {
|
||||
// FIXME This is the only way to show non-markdown files
|
||||
// instead of a broken "View Raw" link
|
||||
ctx.Data["IsMarkdown"] = true
|
||||
newbuf = bytes.Replace(buf, []byte("\n"), []byte(`<br>`), -1)
|
||||
ctx.Data["FileContent"] = string(bytes.Replace(buf, []byte("\n"), []byte(`<br>`), -1))
|
||||
}
|
||||
ctx.Data["FileContent"] = string(newbuf)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -188,15 +184,14 @@ func renderFile(ctx *context.Context, entry *git.TreeEntry, treeLink, rawLink st
|
||||
d, _ := ioutil.ReadAll(dataRc)
|
||||
buf = append(buf, d...)
|
||||
|
||||
tp := markup.Type(blob.Name())
|
||||
isSupportedMarkup := tp != ""
|
||||
// FIXME: currently set IsMarkdown for compatible
|
||||
ctx.Data["IsMarkdown"] = isSupportedMarkup
|
||||
|
||||
readmeExist := isSupportedMarkup || markup.IsReadmeFile(blob.Name())
|
||||
readmeExist := markup.IsReadmeFile(blob.Name())
|
||||
ctx.Data["ReadmeExist"] = readmeExist
|
||||
if readmeExist && isSupportedMarkup {
|
||||
if markup.Type(blob.Name()) != "" {
|
||||
ctx.Data["IsRenderedHTML"] = true
|
||||
ctx.Data["FileContent"] = string(markup.Render(blob.Name(), buf, path.Dir(treeLink), ctx.Repo.Repository.ComposeMetas()))
|
||||
} else if readmeExist {
|
||||
ctx.Data["IsRenderedHTML"] = true
|
||||
ctx.Data["FileContent"] = string(bytes.Replace(buf, []byte("\n"), []byte(`<br>`), -1))
|
||||
} else {
|
||||
// Building code view blocks with line number on server side.
|
||||
var fileContent string
|
||||
|
||||
@@ -167,7 +167,7 @@ func WebHooksNewPost(ctx *context.Context, form auth.NewWebhookForm) {
|
||||
}
|
||||
|
||||
// GogsHooksNewPost response for creating webhook
|
||||
func GogsHooksNewPost(ctx *context.Context, form auth.NewWebhookForm) {
|
||||
func GogsHooksNewPost(ctx *context.Context, form auth.NewGogshookForm) {
|
||||
ctx.Data["Title"] = ctx.Tr("repo.settings.add_webhook")
|
||||
ctx.Data["PageIsSettingsHooks"] = true
|
||||
ctx.Data["PageIsSettingsHooksNew"] = true
|
||||
@@ -361,7 +361,7 @@ func WebHooksEditPost(ctx *context.Context, form auth.NewWebhookForm) {
|
||||
}
|
||||
|
||||
// GogsHooksEditPost response for editing gogs hook
|
||||
func GogsHooksEditPost(ctx *context.Context, form auth.NewWebhookForm) {
|
||||
func GogsHooksEditPost(ctx *context.Context, form auth.NewGogshookForm) {
|
||||
ctx.Data["Title"] = ctx.Tr("repo.settings.update_webhook")
|
||||
ctx.Data["PageIsSettingsHooks"] = true
|
||||
ctx.Data["PageIsSettingsHooksEdit"] = true
|
||||
|
||||
@@ -471,12 +471,13 @@ func RegisterRoutes(m *macaron.Macaron) {
|
||||
m.Get("/:username/:reponame/action/:action", reqSignIn, context.RepoAssignment(), repo.Action)
|
||||
|
||||
m.Group("/:username/:reponame", func() {
|
||||
// FIXME: should use different URLs but mostly same logic for comments of issue and pull reuqest.
|
||||
// So they can apply their own enable/disable logic on routers.
|
||||
m.Group("/issues", func() {
|
||||
m.Combo("/new", repo.MustEnableIssues).Get(context.RepoRef(), repo.NewIssue).
|
||||
Post(bindIgnErr(auth.CreateIssueForm{}), repo.NewIssuePost)
|
||||
|
||||
}, context.CheckUnit(models.UnitTypeIssues))
|
||||
// FIXME: should use different URLs but mostly same logic for comments of issue and pull reuqest.
|
||||
// So they can apply their own enable/disable logic on routers.
|
||||
m.Group("/issues", func() {
|
||||
m.Group("/:index", func() {
|
||||
m.Post("/title", repo.UpdateIssueTitle)
|
||||
m.Post("/content", repo.UpdateIssueContent)
|
||||
@@ -484,21 +485,21 @@ func RegisterRoutes(m *macaron.Macaron) {
|
||||
m.Combo("/comments").Post(bindIgnErr(auth.CreateCommentForm{}), repo.NewComment)
|
||||
})
|
||||
|
||||
m.Post("/labels", repo.UpdateIssueLabel, reqRepoWriter)
|
||||
m.Post("/milestone", repo.UpdateIssueMilestone, reqRepoWriter)
|
||||
m.Post("/assignee", repo.UpdateIssueAssignee, reqRepoWriter)
|
||||
m.Post("/status", repo.UpdateIssueStatus, reqRepoWriter)
|
||||
}, context.CheckUnit(models.UnitTypeIssues))
|
||||
m.Post("/labels", reqRepoWriter, repo.UpdateIssueLabel)
|
||||
m.Post("/milestone", reqRepoWriter, repo.UpdateIssueMilestone)
|
||||
m.Post("/assignee", reqRepoWriter, repo.UpdateIssueAssignee)
|
||||
m.Post("/status", reqRepoWriter, repo.UpdateIssueStatus)
|
||||
})
|
||||
m.Group("/comments/:id", func() {
|
||||
m.Post("", repo.UpdateCommentContent)
|
||||
m.Post("/delete", repo.DeleteComment)
|
||||
}, context.CheckUnit(models.UnitTypeIssues))
|
||||
}, context.CheckAnyUnit(models.UnitTypeIssues, models.UnitTypePullRequests))
|
||||
m.Group("/labels", func() {
|
||||
m.Post("/new", bindIgnErr(auth.CreateLabelForm{}), repo.NewLabel)
|
||||
m.Post("/edit", bindIgnErr(auth.CreateLabelForm{}), repo.UpdateLabel)
|
||||
m.Post("/delete", repo.DeleteLabel)
|
||||
m.Post("/initialize", bindIgnErr(auth.InitializeLabelsForm{}), repo.InitializeLabels)
|
||||
}, reqRepoWriter, context.RepoRef(), context.CheckUnit(models.UnitTypeIssues))
|
||||
}, reqRepoWriter, context.RepoRef(), context.CheckAnyUnit(models.UnitTypeIssues, models.UnitTypePullRequests))
|
||||
m.Group("/milestones", func() {
|
||||
m.Combo("/new").Get(repo.NewMilestone).
|
||||
Post(bindIgnErr(auth.CreateMilestoneForm{}), repo.NewMilestonePost)
|
||||
@@ -506,7 +507,7 @@ func RegisterRoutes(m *macaron.Macaron) {
|
||||
m.Post("/:id/edit", bindIgnErr(auth.CreateMilestoneForm{}), repo.EditMilestonePost)
|
||||
m.Get("/:id/:action", repo.ChangeMilestonStatus)
|
||||
m.Post("/delete", repo.DeleteMilestone)
|
||||
}, reqRepoWriter, context.RepoRef(), context.CheckUnit(models.UnitTypeIssues))
|
||||
}, reqRepoWriter, context.RepoRef(), context.CheckAnyUnit(models.UnitTypeIssues, models.UnitTypePullRequests))
|
||||
|
||||
m.Combo("/compare/*", repo.MustAllowPulls, repo.SetEditorconfigIfExists).
|
||||
Get(repo.CompareAndPullRequest).
|
||||
@@ -573,8 +574,8 @@ func RegisterRoutes(m *macaron.Macaron) {
|
||||
m.Group("", func() {
|
||||
m.Get("/^:type(issues|pulls)$", repo.RetrieveLabels, repo.Issues)
|
||||
m.Get("/^:type(issues|pulls)$/:index", repo.ViewIssue)
|
||||
m.Get("/labels/", repo.RetrieveLabels, repo.Labels)
|
||||
m.Get("/milestones", repo.Milestones)
|
||||
m.Get("/labels/", context.CheckAnyUnit(models.UnitTypeIssues, models.UnitTypePullRequests), repo.RetrieveLabels, repo.Labels)
|
||||
m.Get("/milestones", context.CheckAnyUnit(models.UnitTypeIssues, models.UnitTypePullRequests), repo.Milestones)
|
||||
}, context.RepoRef())
|
||||
|
||||
m.Group("/wiki", func() {
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
</div>
|
||||
{{if .CanBeForked}}
|
||||
<div class="ui compact labeled button" tabindex="0">
|
||||
<a class="ui compact button {{if eq .OwnerID $.SignedUserID}}poping up{{end}}" {{if not (eq .OwnerID $.SignedUserID)}}href="{{AppSubUrl}}/repo/fork/{{.ID}}"{{else}} data-content="{{$.i18n.Tr "repo.fork_from_self"}}" data-position="top center" data-variation="tiny"{{end}}>
|
||||
<a class="ui compact button {{if not $.CanSignedUserFork}}poping up{{end}}" {{if $.CanSignedUserFork}}href="{{AppSubUrl}}/repo/fork/{{.ID}}"{{else}} data-content="{{$.i18n.Tr "repo.fork_from_self"}}" data-position="top center" data-variation="tiny"{{end}}>
|
||||
<i class="octicon octicon-repo-forked"></i>{{$.i18n.Tr "repo.fork"}}
|
||||
</a>
|
||||
<a class="ui basic label" href="{{.Link}}/forks">
|
||||
|
||||
@@ -103,8 +103,8 @@
|
||||
</div>
|
||||
<div class="issue-actions">
|
||||
<div class="ui basic status buttons">
|
||||
<div class="ui green active basic button issue-action" data-action="open" data-url="{{$.Link}}/status">{{.i18n.Tr "repo.issues.action_open"}}</div>
|
||||
<div class="ui red active basic button issue-action" data-action="close" data-url="{{$.Link}}/status">{{.i18n.Tr "repo.issues.action_close"}}</div>
|
||||
<div class="ui green active basic button issue-action" data-action="open" data-url="{{$.RepoLink}}/issues/status">{{.i18n.Tr "repo.issues.action_open"}}</div>
|
||||
<div class="ui red active basic button issue-action" data-action="close" data-url="{{$.RepoLink}}/issues/status">{{.i18n.Tr "repo.issues.action_close"}}</div>
|
||||
</div>
|
||||
|
||||
<div class="ui secondary filter menu floated right">
|
||||
@@ -116,7 +116,7 @@
|
||||
</span>
|
||||
<div class="menu">
|
||||
{{range .Labels}}
|
||||
<div class="item issue-action" data-action="toggle" data-element-id="{{.ID}}" data-url="{{$.Link}}/labels">
|
||||
<div class="item issue-action" data-action="toggle" data-element-id="{{.ID}}" data-url="{{$.RepoLink}}/issues/labels">
|
||||
<span class="octicon {{if eq $.SelectLabels .ID}}octicon-check{{end}}"></span><span class="label color" style="background-color: {{.Color}}"></span> {{.Name | Sanitize}}
|
||||
</div>
|
||||
{{end}}
|
||||
@@ -134,7 +134,7 @@
|
||||
{{.i18n.Tr "repo.issues.action_milestone_no_select"}}
|
||||
</div>
|
||||
{{range .Milestones}}
|
||||
<div class="item issue-action" data-element-id="{{.ID}}" data-url="{{$.Link}}/milestone">
|
||||
<div class="item issue-action" data-element-id="{{.ID}}" data-url="{{$.RepoLink}}/issues/milestone">
|
||||
{{.Name | Sanitize}}
|
||||
</div>
|
||||
{{end}}
|
||||
@@ -152,7 +152,7 @@
|
||||
{{.i18n.Tr "repo.issues.action_assignee_no_select"}}
|
||||
</div>
|
||||
{{range .Assignees}}
|
||||
<div class="item issue-action" data-element-id="{{.ID}}" data-url="{{$.Link}}/assignee">
|
||||
<div class="item issue-action" data-element-id="{{.ID}}" data-url="{{$.RepoLink}}/issues/assignee">
|
||||
<img src="{{.RelAvatarLink}}"> {{.Name}}
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
@@ -19,17 +19,17 @@
|
||||
</span>
|
||||
<i class="dropdown icon"></i>
|
||||
<div class="menu">
|
||||
<div class="item" data-value="{{.SignedUser.ID}}">
|
||||
<img class="ui mini image" src="{{.SignedUser.RelAvatarLink}}">
|
||||
{{.SignedUser.ShortName 20}}
|
||||
</div>
|
||||
{{if .CanForkToUser}}
|
||||
<div class="item" data-value="{{.SignedUser.ID}}">
|
||||
<img class="ui mini image" src="{{.SignedUser.RelAvatarLink}}">
|
||||
{{.SignedUser.ShortName 20}}
|
||||
</div>
|
||||
{{end}}
|
||||
{{range .Orgs}}
|
||||
{{if and (.IsOwnedBy $.SignedUser.ID) (ne .ID $.ForkFromOwnerID)}}
|
||||
<div class="item" data-value="{{.ID}}">
|
||||
<img class="ui mini image" src="{{.RelAvatarLink}}">
|
||||
{{.ShortName 20}}
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="item" data-value="{{.ID}}">
|
||||
<img class="ui mini image" src="{{.RelAvatarLink}}">
|
||||
{{.ShortName 20}}
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -36,8 +36,8 @@
|
||||
{{end}}
|
||||
</h4>
|
||||
<div class="ui attached table segment">
|
||||
<div class="file-view {{if .IsMarkdown}}markdown{{else if .IsTextFile}}code-view{{end}} has-emoji">
|
||||
{{if .IsMarkdown}}
|
||||
<div class="file-view {{if .IsRenderedHTML}}markdown{{else if .IsTextFile}}code-view{{end}} has-emoji">
|
||||
{{if .IsRenderedHTML}}
|
||||
{{if .FileContent}}{{.FileContent | Str2html}}{{end}}
|
||||
{{else if not .IsTextFile}}
|
||||
<div class="view-raw ui center">
|
||||
|
||||
Reference in New Issue
Block a user