Commit Graph
2280 Commits
Author SHA1 Message Date
David Svantessonandzeripath 366806db32 Fix errors in create org UI regarding team access permission. (#8506) 2019-10-14 19:20:42 +01:00
guillep2kandzeripath eb8975dcce Add nofollow to sign in links (#8509) 2019-10-14 18:43:48 +01:00
Lunny XiaoandGitHub f2a3abc683 Move migrating repository from frontend to backend (#6200)
* move migrating to backend

* add loading image when migrating and fix tests

* fix format

* fix lint

* add redis task queue support and improve docs

* add redis vendor

* fix vet

* add database migrations and fix app.ini sample

* add comments for task section on app.ini.sample

* Update models/migrations/v84.go

Co-Authored-By: lunny <[email protected]>

* Update models/repo.go

Co-Authored-By: lunny <[email protected]>

* move migrating to backend

* add loading image when migrating and fix tests

* fix fmt

* add redis task queue support and improve docs

* fix fixtures

* fix fixtures

* fix duplicate function on index.js

* fix tests

* rename repository statuses

* check if repository is being create when SSH request

* fix lint

* fix template

* some improvements

* fix template

* unified migrate options

* fix lint

* fix loading page

* refactor

* When gitea restart, don't restart the running tasks because we may have servel gitea instances, that may break the migration

* fix js

* Update models/repo.go

Co-Authored-By: guillep2k <[email protected]>

* Update docs/content/doc/advanced/config-cheat-sheet.en-us.md

Co-Authored-By: guillep2k <[email protected]>

* fix tests

* rename ErrTaskIsNotExist to ErrTaskDoesNotExist

* delete release after add one on tests to make it run happy

* fix tests

* fix tests

* improve codes

* fix lint

* fix lint

* fix migrations
2019-10-13 21:23:14 +08:00
Lauris BHandzeripath 772241b324 Latvian translation for home page (#8468) 2019-10-11 22:32:52 +01:00
spaepsandtechknowlogick 633cd7f473 Add home template italian translation (#8352)
It was just missing
2019-10-11 13:04:59 -04:00
Lunny XiaoandGitHub 7ad46cc116 fix template bug on mirror repository setting page (#8438) 2019-10-09 21:09:02 +08:00
Lauris BHandtechknowlogick 28d5347cf3 Singular form for files that has only one line (#8416) 2019-10-07 19:38:41 -04:00
silverwindandtechknowlogick 08896cd9f6 add file line count info on UI (#8396)
Also reworked the header to remove the filename (which is redundant with
the file path above) and made the header a flexbox with a monospace
font.

Fixes: https://github.com/go-gitea/gitea/issues/8170
2019-10-07 00:59:17 -04:00
Lunny XiaoandLauris BH bd41a04a56 Add extra user information when migrating release (#8331)
* add extra user information when migrating release

* add migrations

* fix tests
2019-10-05 14:09:27 +03:00
guillep2kandLunny Xiao fb7c23f911 Fix editor commit to new branch if PR disabled (#8375) 2019-10-05 10:09:19 +08:00
Mario Lubenkaandtechknowlogick f92a0b68fe Bugfix for image compare and minor improvements to image compare (#8289)
* Resolve error when comparing images

Signed-off-by: Mario Lubenka <[email protected]>

* Check blob existence instead of git-ls when checking if file exists

Signed-off-by: Mario Lubenka <[email protected]>

* Show file metadata also when a file was newly added

Signed-off-by: Mario Lubenka <[email protected]>

* Fixes error in commit view

Signed-off-by: Mario Lubenka <[email protected]>

* Excludes assigning path and image infos for compare routers to service package

Signed-off-by: Mario Lubenka <[email protected]>

* Removes nil default and fixes import order

Signed-off-by: Mario Lubenka <[email protected]>

* Adds missing comments

Signed-off-by: Mario Lubenka <[email protected]>

* Moves methods for assigning compare data to context into repo router package

Signed-off-by: Mario Lubenka <[email protected]>

* Show image compare for deleted images as well. Simplify check if image should be displayed

Signed-off-by: Mario Lubenka <[email protected]>
2019-10-04 15:58:54 -04:00
jaqraandAntoine GIRARD 1a2d7207ea Make 100% width issues page left menu and add reponame as title attribute (#8359) 2019-10-04 09:18:46 +02:00
NorwinandAntoine GIRARD 9543aeaf84 readd .markdown class to all markup renderers (#8357)
fixes #8299, a regression from 867f46f.
unlike it's name suggests, the .markdown class is needed for most markup types.
a future refactor should rename this class to something more generic
2019-10-03 18:54:33 +02:00
David SvantessonandLunny Xiao 90ab3056eb Api: advanced settings for repository (external wiki, issue tracker etc.) (#7756)
* Add API for Repo Advanced Settings of wiki and issue tracker

Signed-off-by: David Svantesson <[email protected]>

* Add some integration tests for tracker and wiki settings through API

* Should return StatusUnprocessableEntity in case of invalid API values.

* Add tests for invalid URLs for external tracker and wiki.

* Do not set inital values if they are default of type

* Make issue tracker and wiki units separate structures in Repository API structure.

Signed-off-by: David Svantesson <[email protected]>

* Fix comment of structures

Signed-off-by: David Svantesson <[email protected]>

* Rewrite API to use struct for setting tracker and wiki settings.

* LetOnlyContributorsTrackTime -> AllowOnlyContributorsToTrackTime
2019-10-02 17:30:41 +08:00
Lunny XiaoandGitHub 7ff783b732 Move mirror to a standalone package from models (#7486)
* move mirror to a standalone package

* fix mirror address in template

* fix tests

* fix lint

* fix comment

* fix tests

* fix tests

* fix vendor

* fix fmt

* fix lint

* remove wrong file submitted

* fix conflict

* remove unrelated changes

* fix go mod

* fix tests

* clean go mod

* make vendor work

* make vendor work

* fix tests

* remove duplicated test
2019-10-01 21:40:17 +08:00
David SvantessonandLunny Xiao 36bcd4cd6b API endpoint for searching teams. (#8108)
* Api endpoint for searching teams.

Signed-off-by: dasv <[email protected]>

* Move API to /orgs/:org/teams/search

Signed-off-by: David Svantesson <[email protected]>

* Regenerate swagger

Signed-off-by: David Svantesson <[email protected]>

* Fix search is Get

Signed-off-by: David Svantesson <[email protected]>

* Add test for search team API.

Signed-off-by: David Svantesson <[email protected]>

* Update routers/api/v1/org/team.go

grammar

Co-Authored-By: Richard Mahn <[email protected]>

* Fix review comments

Signed-off-by: David Svantesson <[email protected]>

* Fix some issues in repo collaboration team search, after changes in this PR.

Signed-off-by: David Svantesson <[email protected]>

* Remove teamUser which is not used and replace with actual user id.

Signed-off-by: David Svantesson <[email protected]>

* Remove unused search variable UserIsAdmin.

* Add paging to team search.

* Re-genereate swagger

Signed-off-by: David Svantesson <[email protected]>

* Fix review comments

Signed-off-by: David Svantesson <[email protected]>

* fix

* Regenerate swagger
2019-10-01 13:32:28 +08:00
Elias NorbergandLauris BH 8a45070f62 Fix pull request commit status in user dashboard list (#8321) 2019-09-30 12:16:29 +03:00
Elias NorbergandLunny Xiao 49547ea158 Show correct commit status in PR list (#8316)
* Use correct index when fetching commit status

Signed-off-by: Elias Norberg <[email protected]>

* Compare against base repo to avoid mismatch when merging from fork

Signed-off-by: Elias Norberg <[email protected]>
2019-09-30 09:07:43 +08:00
David SvantessonandLauris BH 9c2a58456a Fix repo_admin_change_team_access always checked in org settings (#8319)
Signed-off-by: David Svantesson <[email protected]>
2019-09-30 02:20:27 +03:00
David SvantessonandLunny Xiao 730065a3dc Do only show teams access for organization repositories, not for personal repositories (#8265)
Signed-off-by: David Svantesson <[email protected]>
2019-09-24 09:30:40 +08:00
David SvantessonandLauris BH a0e88dfc2e Add teams to repo on collaboration page. (#8045)
* Add teams to repo on collaboration page.

Signed-off-by: David Svantesson <[email protected]>

* Add option for repository admins to change teams access to repo.

Signed-off-by: David Svantesson <[email protected]>

* Add comment for functions

Signed-off-by: David Svantesson <[email protected]>

* Make RepoAdminChangeTeamAccess default false in xorm and make it default checked in template instead.

Signed-off-by: David Svantesson <[email protected]>

* Make proper language strings and fix error redirection.

* Add unit tests for adding and deleting team from repository.

Signed-off-by: David Svantesson <[email protected]>

* Add database migration

Signed-off-by: David Svantesson <[email protected]>

* Fix redirect

Signed-off-by: David Svantesson <[email protected]>

* Fix locale string mismatch.

Signed-off-by: David Svantesson <[email protected]>

* Move team access mode text logic to template.

* Move collaborator access mode text logic to template.
2019-09-23 23:08:03 +03:00
guillep2kandLunny Xiao 14efd3fb34 Change link on issue milestone (#8246)
* Change link on issue milestone

* Fix the sidebar link for milestone
2019-09-20 22:05:05 +08:00
guillep2kandtechknowlogick 2a2b46c62e Reference issues from pull requests and other issues (#8137)
* Update ref comment

* Generate comment on simple ref

* Make fmt + remove unneeded repo load

* Add TODO comments

* Add ref-check in issue creation; re-arrange template

* Make unit tests pass; rearrange code

* Make fmt

* Filter out xref comment if user can't see the referencing issue

* Add TODOs

* Add cross reference

* Rearrange code; add cross-repository references

* Striketrhough obsolete references

* Remove unnecesary TODO

* Add "not supported" note

* Support for edits and deletes, and issue title

* Revert changes to go.mod

* Fix fmt

* Add support for xref from API

* Add first integration test

* Add integration tests

* Correct formatting

* Fix add comment test

* Add migration

* Remove outdated comments; fix typo

* Some code refactoring and rearranging

* Rename findCrossReferences to createCrossReferences

* Delete xrefs when repository is deleted

* Corrections as suggested by @lafriks

* Prepare for merge

* Fix log for errors
2019-09-20 01:45:38 -04:00
jaqraandLauris BH 28362195a0 Add 'Mentioning you' group to /issues page (#8201) 2019-09-18 10:24:44 +03:00
Lunny XiaoandLauris BH 04ca7f0047 Refuse merge until all required status checks success (#7481)
* refuse merge until ci successfully

* deny merge request when required status checkes not succeed on merge Post and API

* add database migration for added columns on protected_branch

* fix migration

* fix protected branch check bug

* fix protected branch settings

* remove duplicated code on check pull request's required commit statuses pass

* remove unused codes

* fix migration

* add newline for template file

* fix go mod

* rename function name and some other fixes

* fix template

* fix bug pull view

* remove go1.12 wrong dependencies

* add administrator bypass when protected branch status check enabled

* fix bug

* improve the codes
2019-09-18 08:39:45 +03:00
Mario LubenkaandLunny Xiao a37236314c Adds side-by-side diff for images (#6784)
* Adds side-by-side diff for images

Signed-off-by: Mario Lubenka <[email protected]>

* Explain blank imports

Signed-off-by: Mario Lubenka <[email protected]>

* Use complete word for width and height labels on image compare

Signed-off-by: Mario Lubenka <[email protected]>

* Update index.css from master

Signed-off-by: Mario Lubenka <[email protected]>

* Moves ImageInfo to git commit file

Signed-off-by: Mario Lubenka <[email protected]>

* Assign ImageInfo function for template and sets correct target for BeforeSourcePath

Signed-off-by: Mario Lubenka <[email protected]>

* Adds missing comment

Signed-off-by: Mario Lubenka <[email protected]>

* Return error if ImageInfo failed

Signed-off-by: Mario Lubenka <[email protected]>

* Avoid template panic when ImageInfo failed for some reason

Signed-off-by: Mario Lubenka <[email protected]>

* Show file size on image diff

Signed-off-by: Mario Lubenka <[email protected]>

* Removes unused helper function

Signed-off-by: Mario Lubenka <[email protected]>

* Reverts copyright year change

Signed-off-by: Mario Lubenka <[email protected]>

* Close file reader

Signed-off-by: Mario Lubenka <[email protected]>

* Update commit.go

Sets correct data key

* Moves reader.Close() up a few lines

* Updates index.css

* Updates CSS file

Signed-off-by: Mario Lubenka <[email protected]>

* Transfers adjustments for image compare to compare.go file

Signed-off-by: Mario Lubenka <[email protected]>

* Adjusts variable name

Signed-off-by: Mario Lubenka <[email protected]>

* Apply lesshint recommendations

Signed-off-by: Mario Lubenka <[email protected]>

* Do not show old image on image compare if it is not in index of base commit

Signed-off-by: Mario Lubenka <[email protected]>

* Change file size text

Signed-off-by: Mario Lubenka <[email protected]>
2019-09-16 17:03:22 +08:00
techknowlogickandAntoine GIRARD 7a8e299c7c migrate gplus to google oauth2 provider (#7885)
* migrate gplus to google oauth2 provider. this still provides support for old gplus connections.

* Update models/oauth2.go

Co-Authored-By: Antoine GIRARD <[email protected]>

* make vendor
2019-09-14 12:02:39 +02:00
jaqraandLauris BH 0c47fe2d77 [fix #7384] make show private icon when repo avatar set (#8144) 2019-09-13 07:15:26 +03:00
techknowlogickandGitHub 2837563147 oauth2 with remote Gitea - Fix #8093 (#8149) 2019-09-12 22:15:36 -04:00
jaqraandLauris BH d0ad47bd5d apply emoji on dashboard issue list labels (#8156) 2019-09-12 13:00:55 +03:00
jaqraandLauris BH 59b194f4d1 Move ref (branch or tag) location on issue list page (#8157)
* Move ref (branch or tag) location on issue list page

* Make looks better

* move branch label also on milestone/{id} page

* [/issues page] Add milestone, Add Ref, Fix Assignees

* [repo issues page] reorder tasks, milestone and ref
2019-09-12 12:31:36 +03:00
jaqraandLauris BH 7e17424c7e Make link last commit massages in repository home page and commit tables (#8006)
* Make link last commit massages in repository home page and commit tables

* Use RenderCommitMessageLink instead surround with a

* deleted __debug_bin file

* Exclude email to link from latest commit title

* Exclude email processor from commit table

Co-Authored-By: mrsdizzie <[email protected]>

* Add class parameter to a html element creator functions.
Make links underline dashed that are not commit

* fix tests

* Show dashed underline when also not hovered
2019-09-10 12:03:30 +03:00
WGHandLauris BH 6ddd3b0b47 Implement webhook branch filter (#7791)
* Fix validate() function to handle errors in embedded anon structs

* Implement webhook branch filter

See #2025, #3998.
2019-09-09 08:48:21 +03:00
0118b6aaf8 Add option to initialize repository with labels (#6061)
* Add optional label sets on repo creation

* Fix CRLF

* Instead of hardcoding default, make it the helper

* Move label set init out of repo init

Add a new error for the router
Combine router label init with repo creation label init

Signed-off-by: jolheiser <[email protected]>

* Add issue labels to Swagger for repo creation

Signed-off-by: jolheiser <[email protected]>

* Update models/issue_label.go

Co-Authored-By: Lauris BH <[email protected]>

* Update models/issue_label.go

Co-Authored-By: guillep2k <[email protected]>
2019-09-08 11:28:40 +03:00
pmdematagodaandLauris BH 5e32c16ac3 1148: Take up the full width when viewing the diff in split view. (#8114)
This replicates how the commit view works in split view.
2019-09-07 14:17:42 +03:00
Lunny Xiaoandtechknowlogick c03d75fbd5 Move git diff codes from models to services/gitdiff (#7889)
* move git diff codes from models to services/gitdiff

* fix template

* fix test

* fix template
2019-09-05 22:20:09 -04:00
micwandAntoine GIRARD 63c40796ef Display description of 'make this repo private' as help text, not as tooltip (#8097) 2019-09-05 11:13:51 +02:00
David SvantessonandLunny Xiao 1f951cdeba Add API endpoint for accessing repo topics (#7963)
* Create API endpoints for repo topics.

Signed-off-by: David Svantesson <[email protected]>

* Generate swagger

Signed-off-by: David Svantesson <[email protected]>

* Add documentation to functions

Signed-off-by: David Svantesson <[email protected]>

* Grammar fix

Signed-off-by: David Svantesson <[email protected]>

* Fix function comment

Signed-off-by: David Svantesson <[email protected]>

* Can't use FindTopics when looking for a single repo topic, as it doesnt use exact match

Signed-off-by: David Svantesson <[email protected]>

* Add PUT ​/repos​/{owner}​/{repo}​/topics and remove GET ​/repos​/{owner}​/{repo}​/topics

* Ignore if topic is sent twice in same request, refactoring.

Signed-off-by: David Svantesson <[email protected]>

* Fix topic dropdown with api changes.

Signed-off-by: David Svantesson <[email protected]>

* Style fix

Signed-off-by: David Svantesson <[email protected]>

* Update API documentation

Signed-off-by: David Svantesson <[email protected]>

* Better way to handle duplicate topics in slice

Signed-off-by: David Svantesson <[email protected]>

* Make response element TopicName an array of strings, instead of using an array of TopicName

Signed-off-by: David Svantesson <[email protected]>

* Add test cases for API Repo Topics.

Signed-off-by: David Svantesson <[email protected]>

* Fix format of tests

Signed-off-by: David Svantesson <[email protected]>

* Fix comments

Signed-off-by: David Svantesson <[email protected]>

* Fix unit tests after adding some more topics to the test fixture.

Signed-off-by: David Svantesson <[email protected]>

* Update models/topic.go

Limit multiple if else if ...

Co-Authored-By: Antoine GIRARD <[email protected]>

* Engine as first parameter in function

Co-Authored-By: Antoine GIRARD <[email protected]>

* Replace magic numbers with http status code constants.

Signed-off-by: David Svantesson <[email protected]>

* Fix variable scope

Signed-off-by: David Svantesson <[email protected]>

* Test one read with login and one with token

Signed-off-by: David Svantesson <[email protected]>

* Add some more tests

Signed-off-by: David Svantesson <[email protected]>

* Apply suggestions from code review

Use empty struct for efficiency

Co-Authored-By: Lauris BH <[email protected]>

* Add test case to check access for user with write access

Signed-off-by: David Svantesson <[email protected]>

* Fix access, repo admin required to change topics

Signed-off-by: David Svantesson <[email protected]>

* Correct first test to be without token

Signed-off-by: David Svantesson <[email protected]>

* Any repo reader should be able to access topics.

* No need for string pointer

Signed-off-by: David Svantesson <[email protected]>
2019-09-03 23:46:24 +08:00
Lunny XiaoandLauris BH 6ed22ffd16 Add merged commit id on pull view when it's merged (#8062) 2019-09-03 09:29:36 +03:00
032c90e7c5 Add tooltip for the visibility checkbox in /repo/create (#8025)
* Add tooltip for the visibility checkbox in /repo/create

* Change the tooltip wording

* Update options/locale/locale_en-US.ini

Co-Authored-By: Lauris BH <[email protected]>
2019-09-02 18:29:04 -04:00
Gary KimandLauris BH f1c414882c Add Ability for User to Customize Email Notification Frequency (#7813)
* Add Backend Logic for Toggling Email Notification

This commit adds the backend logic for
allowing users to enable or disable email
notifications. The implementation ensures
that only issue notification emails get disabled
and important emails are still sent regardless
of the setting.

The UI to toggle this setting has not yet been
implemented.

* Add UI and complete user email notification enable

This commit completes the functionality to allow
users to disable their own email notifications.

Signed-off-by: Gary Kim <[email protected]>

* Add Third Option for Only Email on Mention

Signed-off-by: Gary Kim <[email protected]>

* Readd NOT NULL to new preference string

Signed-off-by: Gary Kim <[email protected]>

* Add Tests and Rewrite Comment

Signed-off-by: Gary Kim <[email protected]>

* Allow admin to set default email frequency

Signed-off-by: Gary Kim <[email protected]>

* Add new config option to docs

Signed-off-by: Gary Kim <[email protected]>

* Fix a few mistakes

Signed-off-by: Gary Kim <[email protected]>

* Only update required columns

Signed-off-by: Gary Kim <[email protected]>

* Simplify an error check

Signed-off-by: Gary Kim <[email protected]>

* Make email_notification_preference column in DB be VARCHAR(20)

Signed-off-by: Gary Kim <[email protected]>

* Handle errors

Signed-off-by: Gary Kim <[email protected]>

* Update models/migrations/v93.go

Co-Authored-By: Lauris BH <[email protected]>
2019-08-29 17:05:42 +03:00
jaqraandAntoine GIRARD 13388258a4 Changed black to white for (read) number label on issue list (#8000)
* Changed black color to blue for read number label on issue list page

* Change color to white
2019-08-28 12:20:52 +02:00
Antoine GIRARDandGitHub 256b178176 Update swagger to 0.20.1 (#8010)
* update swagger to 0.20.1

* fiw swagger version for validate
2019-08-28 08:55:22 +02:00
Lunny Xiaoandtechknowlogick 5616356a0b keep blame view buttons sequence consistent with normal view when view a file (#8007) 2019-08-27 22:23:18 -04:00
Gary Kimandtechknowlogick 541fab196f Fix adding default Telegram webhook (#7972)
* Fix adding default Telegram webhook

Fixes #7932

Signed-off-by: Gary Kim <[email protected]>

* Run goimports

Signed-off-by: Gary Kim <[email protected]>
2019-08-26 18:59:10 -04:00
Richard MahnandAntoine GIRARD bb5f7cdae6 Adds details about what tags can use the Git tags API (#7989) 2019-08-26 21:52:04 +02:00
Antoine GIRARDandGitHub 954fe0e4e0 swagger/fix: []string are not enum by swagger definition (#7916)
* []string are not enum by swagger definition

* apply suggestion of @guillep2k

* re-generate swagger file
2019-08-26 20:13:10 +02:00
Mike SchwörerandAntoine GIRARD 042089fbaf API method to list all commits of a repository (#6408)
* Added API endpoint ListAllCommits (/repos/{owner}/{repo}/git/commits)

Signed-off-by: Mike Schwörer <[email protected]>

* Fixed failing drone build

Signed-off-by: Mike Schwörer <[email protected]>

* Implemented requested changes (PR reviews)

Signed-off-by: Mike Schwörer <[email protected]>

* gofmt

Signed-off-by: Mike Schwörer <[email protected]>

* Changed api route from "/repos/{owner}/{repo}/git/commits" to "/repos/{owner}/{repo}/commits"

* Removed unnecessary line

* better error message when git repo is empty

* make generate-swagger

* fixed removed return

* Update routers/api/v1/repo/commits.go

Co-Authored-By: Lauris BH <[email protected]>

* Update routers/api/v1/repo/commits.go

Co-Authored-By: Lauris BH <[email protected]>

* go fmt

* Refactored common code into ToCommit()

* made toCommit not exported

* added check for userCache == nil
2019-08-26 16:09:10 +02:00
6543andLauris BH 5409dec8fd [Branch View] show "New Pull Request" Button only if posible (#7977)
* add check Commits Ahead is gt 0

* code format
to start drone-ci test again
and formate code is also nice :)
2019-08-26 13:47:41 +03:00
David SvantessonandLauris BH c9546d4cdd Include description in repository search. (#7942)
* Add description in repository search.

Signed-off-by: David Svantesson <[email protected]>

* Refactor SearchRepositoryByName with a general function SearchRepository

Signed-off-by: David Svantesson <[email protected]>

* Allow to specify if description shall be included in API repo search.

Signed-off-by: David Svantesson <[email protected]>

* Add new app.ini setting for whether to search within repo description.

Signed-off-by: David Svantesson <[email protected]>

* Search keyword in description (if setting enabled) on:
 - Explore page
 - Organization profile page
 - User profile page
 - Admin repo page

Do not search keyword in description on:
 - Any non-keyword search (not relevant)
 - Incremental search (uses API)

Signed-off-by: David Svantesson <[email protected]>

* Put parameters related to keyword directly after it

Signed-off-by: David Svantesson <[email protected]>

* Add test cases for including (and not including) repository description in search.

Signed-off-by: David Svantesson <[email protected]>

* Rename test function from TestSearchRepositoryByName to TestSearchRepository.

Signed-off-by: David Svantesson <[email protected]>

* Make setting SEARCH_REPO_DESCRIPTION default to true

Signed-off-by: David Svantesson <[email protected]>
2019-08-25 20:06:36 +03:00