1
1
mirror of https://github.com/go-gitea/gitea synced 2024-06-26 05:05:51 +00:00
Commit Graph

1022 Commits

Author SHA1 Message Date
6543
23e8cff08c hide delete/restor button on archived repos (#7658)
close issue #7653
2019-07-29 13:00:43 +08:00
6543
31a1fe175f [Branch View] add download button (#7604)
* add download-button info message

* add overflow-visible css for table colum class

* right colum is always there

* add download button for default branch

* add download button for all other branchs

* resize table colum so two buttons fit in

* code indent avter rebase

* show commit divergence corect
https://github.com/go-gitea/gitea/issues/7625

* changes because of merge master into ...

* optimize if statement for protected branches

* dont downloat a deleted branch - fix error 404
2019-07-29 10:27:05 +08:00
6543
a19138c1d3 [Branch View] Protection Symbole (delete dublicate) (#7624)
* delet protectin symbol on "action column"

* code format
2019-07-27 22:11:14 +08:00
6543
0b1a4c38d9 [Branch View] Delete Table Header (#7622)
* add class trom table header to table body

* remove table header
2019-07-26 12:21:14 +01:00
6543
bebc6a3c77 [Branch View] icons to buttons (#7602)
* add restore-button info message

* branch deltete undo icon to button

* branch deltete icon to button
2019-07-26 01:01:25 +01:00
silverwind
bcbc9f33d7 Fix file header overflow in file and blame views (#7562) 2019-07-23 10:12:09 +08:00
Gary Kim
3cba42c43d Make default branch name link to default branch (#7519)
The default branch's name on the branches page
for a repo was previously simply text and did
not link anywhere.

The name is now a link to the default branch
just like the non-default branch names.

Signed-off-by: Gary Kim <gary@garykim.dev>
2019-07-18 12:39:51 -04:00
Gary Kim
c8aa46d27b Add Extra Info to Branches Page (#7461)
* Add branch protection information to branches page

This change will add a tag on the ui that indicates
whether a branch is protected on the repository
branches page.

Signed-off-by: Gary Kim <gary@garykim.dev>

* Add last commit information to repo branches page

This change adds the ID and commit message of the last
commit on a branch to the branches page for repositories.

Signed-off-by: Gary Kim <gary@garykim.dev>

* Make branch page commit message truncate in css rather then template

The truncating of commit messages shown under branches
in the repository branches page has been moved to using
css rather then the Go template as the template was causing
some issues when the commit messaged had a link when rendered.

This commit also makes the commit message paragraph itself
use flex in order to make managing its elements easier.

Signed-off-by: Gary Kim <gary@garykim.dev>
2019-07-17 16:02:41 -04:00
Richard Mahn
5d3e351864 Fixes #7474 - Handles all redirects for Web UI File CRUD (#7478)
* Fixes #7474 - Handles all redirects for Web UI File CRUD

* Fixes lint errors

* Typo fix

* Adds unit tests for a few helper functions

* Fixes per review

* Fix for new branch creation and to unit test

* Fixes the template used for errors on delete
2019-07-17 14:40:28 -04:00
silverwind
2a1ec31988 Diff: Fix indentation on unhighlighted code (#7435)
There was a missing space before the `nohighlight` class which made the
previous class concatenate wrongly as `wrapnohighlight` in the template.
2019-07-12 16:22:52 +01:00
Gary Kim
072bdfa3f5 Only show "New Pull Request" button if repo allows pulls (#7426)
Signed-off-by: Gary Kim <gary@garykim.dev>
2019-07-11 16:21:16 -04:00
Cherrg
a7b1ba0e3d wiki history improvements (#7391)
* add history comments to detect page delete

Signed-off-by: Michael Gnehr <michael@gnehr.de>

* fix too much history entries
- caused by --follow flag
  - if files with same contents exists

Signed-off-by: Michael Gnehr <michael@gnehr.de>

* style imprevements wiki
- history - wrap long author names

Signed-off-by: Michael Gnehr <michael@gnehr.de>
2019-07-11 22:45:10 +08:00
Cherrg
3c3f74988a ui fixes - compare view and archieved repo issues (#7345)
* add 'repo archived - comment/pull not possible' message

affects #7304

Signed-off-by: Michael Gnehr <michael@gnehr.de>

* add navbar to compare view

Signed-off-by: Michael Gnehr <michael@gnehr.de>

* remove wrong if else

Signed-off-by: Michael Gnehr <michael@gnehr.de>
2019-07-08 20:18:09 +01:00
Cherrg
e5b247ea8e wiki - page revisions list (#7369)
fix #7

* add wiki page revision list

* mobile improvements

* css improvements for long usernames

* split renderWikiPage into 3 functions

Signed-off-by: Michael Gnehr <michael@gnehr.de>
2019-07-08 11:20:22 +03:00
mrsdizzie
1f1ecda541 Display original author and URL information when showing migrated issues/comments (#7352)
* Store original author info for migrated issues and comments

Keep original author name for displaying in Gitea interface and also
store original author user ID for potential future use in linking
accounts from old location.

* Add original_url for repo

Store the original URL for a migrated repo

Clean up migrations/tests

* fix migration

* fix golangci-lint

* make 'make revive' happy also

* Modify templates to use OriginalAuthor if set

Use the original author name in templates if it is set rather than the
user who migrated/currently owns the issues

* formatting fixes

* make generate-swagger

* Use default avatar for imported comments

* Remove no longer used IgnoreIssueAuthor option

* Add OriginalAuthorID to swagger also
2019-07-08 10:14:12 +08:00
Cherrg
362100023c ui - issue view - fix icon position (#7354)
* issue view - fix icon position

- move style from template to css
- add bullets to: key, circle-slash, comment

Signed-off-by: Michael Gnehr <michael@gnehr.de>

* add border to symbols

Signed-off-by: Michael Gnehr <michael@gnehr.de>

* fix circle slash position

Signed-off-by: Michael Gnehr <michael@gnehr.de>

* fix top margin

Signed-off-by: Michael Gnehr <michael@gnehr.de>

* changed mixed space/tab indent to tabindent only

Signed-off-by: Michael Gnehr <michael@gnehr.de>
2019-07-06 18:03:00 -04:00
Cherrg
5b92bc1bec ui - cut timeline length with last element on issue view (#7355)
* cut timeline length with last element on issue view

fix #7304

- lightly enlight dark theme issue timeline color

Signed-off-by: Michael Gnehr <michael@gnehr.de>

* remove new container

Signed-off-by: Michael Gnehr <michael@gnehr.de>
2019-07-06 22:37:46 +01:00
Lunny Xiao
1772c6b94d fix pull view ui merge section (#7335)
* fix pull view ui merge section

* fix tests

* fix tests
2019-07-01 00:08:43 -04:00
Lunny Xiao
ff85dd3e12 Add commit statuses reports on pull request view (#6845)
* Add commit statuses reports on pull view

* Add some translations

* improve the UI

* fix fmt

* fix tests

* add a new test git repo to fix tests

* fix bug when headRepo or headBranch missing

* fix tests

* fix tests

* fix consistency

* fix tests

* fix tests

* change the test repo

* fix tests

* fix tests

* fix migration

* keep db size consistency

* fix translation

* change commit hash status table unique index

* remove unused table

* use char instead varchar

* make hashCommitStatusContext private

* split merge section with status check on pull view ui

* fix tests; fix arc-green theme on pull ui
2019-06-30 08:57:59 +01:00
Cherrg
711f6dc9b0 Fix 7303 - remove unnessesary buttons on archived repos (#7326)
* archived repo - remove
- open/close button on issue list
- assigne person on issue list

Signed-off-by: Michael Gnehr <michael@gnehr.de>

* archived repo - remove
- comment field on issue view
- lock/unlock issue conversation button from sidebar on issue view

Signed-off-by: Michael Gnehr <michael@gnehr.de>

* archived repo - add 'compare commits' button to pull request

+ remove new pull request button from compare view

as the route is still working, and there is no need to be hidden

Signed-off-by: Michael Gnehr <michael@gnehr.de>
2019-06-29 10:18:49 +01:00
Mario Lubenka
7c0f2b9843 Show Pull Request button or status of latest PR in branch list (#6990)
* Show Pull Request button or status of latest PR in branch list

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>

* Do not show pull request button on deleted branches

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>

* Do not show commit divergence on deleted branches

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>

* Use XORMs Get instead of limit

* Links pull request ID and use smaller labels for displaying the pull request status

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>

* Handle error when getting latest pull request

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>

* Indent template

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>

* Check error when loading issue

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>
2019-06-27 22:15:30 +08:00
silverwind
da23041257 fix extra newlines when copying from diff in Firefox (#7288)
* fix extra newlines when copying from diff

See https://bugzilla.mozilla.org/show_bug.cgi?id=1273836

Basically, the <pre><code> seems to add a forced newline that is not
possible to get rid of via CSS, so I replaced it with just a <code>.

Secondly, .lines-type-marker also forced a newline in the copied text,
but that was possible to get rid of via user-select.

Safari still has a extraneous newline in the copied text of unknown
origin, but this should not block stop this PR.

* simplify .line-type-marker

* fix selector

* remove erronous ^^^

* Fix empty split diff

* Fix arc-theme-green

* fix add comment

* ensure line-num is copied too

* Update templates/repo/diff/box.tmpl

Co-Authored-By: zeripath <art27@cantab.net>

* attempt to fix safari via removing <code>

* remove useless whitespace at the end of 'class'

* remove inter-tag whitespace for code <td>s

* more inter-tag removal

* final inter-tag removal

* attempt to fix empty line copy

* move and comment getLineContent

* fix golint

* make background grey for missing added code
2019-06-26 22:35:07 +01:00
zeripath
5908bb1030
Make diff line-marker non-selectable (#7279)
* Make diff line-marker non-selectable
* Move to use data-* as per @mrsdizzie
* fix missing line nums
* Add a minimum-width to force right-align of the line num
* Move line-type-marker into separate column
2019-06-24 21:23:52 +01:00
silverwind
9ce4d89e99 UI: Fix overflow issues in repo (#7190)
- Fix layout overflow in repo file list.
- Fix invisible status icon in file view and commit list. In file view,
  the icon was moved to the left because I could not figure out a proper
  fix because of HTML tables.
- Added title attribute to commit messages.
- Fixed two CSS linter warnings in existing CSS.
- Fixed CI variable check in 'make css'.

Fixes: https://github.com/go-gitea/gitea/issues/7180
2019-06-14 09:32:13 +08:00
Mario Lubenka
311ce2d1d0 Compare branches, commits and tags with each other (#6991)
* Supports tags when comparing commits or branches

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>

* Hide headline when only comparing and don't load unused data

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>

* Merges compare logics to allow comparing branches, commits and tags with eachother

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>

* Display branch or tag instead of commit when used for comparing

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>

* Show pull request form after click on button

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>

* Transfers relevant pull.go changes from master to compare.go

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>

* Fixes error when comparing forks against a commit or tag

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>

* Removes console.log from JavaScript file

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>

* Show icon next to commit reference when comparing branch or tag

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>

* Updates css file

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>

* Fixes import order

* Renames template variable

* Update routers/repo/compare.go

Co-Authored-By: zeripath <art27@cantab.net>

* Update from master

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>

* Allow short-shas in compare

* Renames prInfo to compareInfo

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>

* Check PR permissions only if compare is pull request

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>

* Adjusts comment

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>

* Use compareInfo instead of prInfo
2019-06-07 16:29:29 -04:00
Sergey Dryabzhinsky
3fd18838aa Repository avatars (#6986)
* Repository avatars

- first variant of code from old work for gogs
- add migration 87
- add new option in app.ini
- add en-US locale string
- add new class in repository.less

* Add changed index.css, remove unused template name

* Update en-us doc about configuration options

* Add comments to new functions, add new option to docker app.ini

* Add comment for lint

* Remove variable, not needed

* Fix formatting

* Update swagger api template

* Check if avatar exists

* Fix avatar link/path checks

* Typo

* TEXT column can't have a default value

* Fixes:

- remove old avatar file on upload
- use ID in name of avatar file - users may upload same files
- add simple tests

* Fix fmt check

* Generate PNG instead of "static" GIF

* More informative comment

* Fix error message

* Update avatar upload checks:

- add file size check
- add new option
- update config docs
- add new string to en-us locale

* Fixes:

- use FileHEader field for check file size
- add new test - upload big image

* Fix formatting

* Update comments

* Update log message

* Removed wrong style - not needed

* Use Sync2 to migrate

* Update repos list view

- bigger avatar
- fix html blocks alignment

* A little adjust avatar size

* Use small icons for explore/repo list

* Use new cool avatar preparation func by @lafriks

* Missing changes for new function

* Remove unused import, move imports

* Missed new option definition in app.ini

Add file size check in user/profile avatar upload

* Use smaller field length for Avatar

* Use session to update repo DB data, update DeleteAvatar - use session too

* Fix err variable definition

* As suggested @lafriks - return as soon as possible, code readability
2019-05-29 22:22:26 -04:00
Lunny Xiao
f3d87da3e2 Revert "Bugfix: Align comment label and actions to the right (#7024)" (#7055)
This reverts commit 0c432d26fe.
2019-05-26 12:55:53 -04:00
Mario Lubenka
0c432d26fe Bugfix: Align comment label and actions to the right (#7024)
* Bugfix: Align comment label and actions to the right

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>

* Restores relative position

* CSS autofixer
2019-05-25 16:37:44 +03:00
Vladimir Panteleev
a98e085031 Show git-notes (#6984)
* Show git-notes

* Make git-notes heading text localizable

* Refactor git-notes data fetching to a separate function

* Display the author and time of git notes

* Move note bubble inside the commit bubble

* Revert "Move note bubble inside the commit bubble"

This reverts commit c0951fe0e3.

* Add test for git-notes

* testing ui

* Polish CSS

* Apply suggestions from code review

Co-Authored-By: Lauris BH <lauris@nix.lv>
2019-05-24 10:52:05 +03:00
techknowlogick
5fb1ad7011 Webhook Logs show proper HTTP Method, and allow change HTTP method in form (#6953)
* Fix #6951 - logs show proper HTTP Method, and allow change HTTP method
in form

* enforce POST method for webhook

* set default if method is empty
2019-05-15 20:01:53 +08:00
Xaver Maierhofer
a92ab34493 Fix input size for dependency select (#6913) 2019-05-12 14:10:12 +03:00
Wim
4508380cf7 Show full name if DefaultShowFullName setting activated (#6710)
Adds a new key DEFAULT_SHOW_FULL_NAME (default false) to the [ui] section.
If enabled the full name will be shown (unless it's empty, then
the default username will be used)
2019-05-08 11:41:35 +03:00
Lunny Xiao
13cd28602e Change the color of issues/pulls list, merged is purple and closed is red (#6874) 2019-05-08 10:50:15 +03:00
Lunny Xiao
08069dc465
Improve migrations to support migrating milestones/labels/issues/comments/pullrequests (#6290)
* add migrations

* fix package dependency

* fix lints

* implements migrations except pull requests

* add releases

* migrating releases

* fix bug

* fix lint

* fix migrate releases

* fix tests

* add rollback

* pull request migtations

* fix import

* fix go module vendor

* add tests for upload to gitea

* more migrate options

* fix swagger-check

* fix misspell

* add options on migration UI

* fix log error

* improve UI options on migrating

* add support for username password when migrating from github

* fix tests

* remove comments and fix migrate limitation

* improve error handles

* migrate API will also support migrate milestones/labels/issues/pulls/releases

* fix tests and remove unused codes

* add DownloaderFactory and docs about how to create a new Downloader

* fix misspell

* fix migration docs

* Add hints about migrate options on migration page

* fix tests
2019-05-07 09:12:51 +08:00
Lauris BH
d9d538c8a1
Refactor table width to have more info shown in file list (#6867)
* Refactor table width to have more info shown in file list

* Remove unnecesary semicolon

* Fix tests for changed html structure
2019-05-06 21:43:40 +03:00
mrsdizzie
00b883880d Don't post process commit summary in templates (#6842)
* Don't post process commit summary in templates

Don't run summary through render/post process to avoid it generating
links and breaking certain views where the summary is already expected
to be a link to the commit. For consistancy, disable processing of
summary in all locations.

Fixes #6809

* Do process title on diff page

On second thought, the title is often the only place a pull request
number will exists so do process it on the individual diff page. This
fixes the list view and still gives easy access to the PR link
2019-05-05 15:39:10 -04:00
Simon
a2a006a5d5 Add GET requests to webhook (#6771)
* Add GET requests to webhook

* make fmt

* Handle invalid http method on webhook

* Uppercase http method in webhook

* Rename v85.go to v86.go

* make fmt
2019-05-05 14:09:02 -04:00
Mario Lubenka
55a8e12d85 Number of commits ahead/behind in branch overview (#6695)
* Call Git API to determine divergence of a branch and its base branch

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>

* Show commit divergance in branch list

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>

* Adds missing comment

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>

* Adds test for diverging commits

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>

* Try comparing commits instead of branches

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>

* Removes test as CI can't run it

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>

* Adjusts signature of percentage function to allow providing multiple integers as numerator

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>

* Moves CountDivergingCommits function into repofiles module

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>
2019-05-05 19:25:25 +03:00
Lauris BH
410301f0ee
Improve localization of git activity stats (#6848) 2019-05-04 23:32:37 +03:00
Lauris BH
1fa9662946
Git statistics in Activity tab (#4724)
* Initial implementation for git statistics in Activity tab

* Create top user by commit count endpoint

* Add UI and update src-d/go-git dependency

* Add coloring

* Fix typo

* Move git activity stats data extraction to git module

* Fix message

* Add git code stats test
2019-05-04 15:39:03 +03:00
Joel da Rosa
67c91e1aa1 Order file actions equal to GitHub (#6706) 2019-04-24 12:53:57 +08:00
Mario Lubenka
bc86134759 Show "delete branch" button on closed pull requests (#6570) (#6601)
* Show button to delete a pull request branch after a pull request has been closed (#6570)

Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>

* Update routers/repo/pull.go

Co-Authored-By: saitho <mario.lubenka@googlemail.com>
2019-04-20 23:50:34 +03:00
Mario Lubenka
fcbac38d6f Unifies pagination template usage (#6531) (#6533) 2019-04-20 00:15:19 -04:00
Andrzej Ressel
469d9b7d9a Add option to blame files (#5721) 2019-04-19 22:47:00 -04:00
Daniel Grier
b9d1fb6de3 Add support for MS Teams webhooks (#6632) 2019-04-19 10:18:06 -04:00
Filip Navara
2af67f6044 Improve listing performance by using go-git (#6478)
* Use go-git for tree reading and commit info lookup.

Signed-off-by: Filip Navara <navara@emclient.com>

* Use TreeEntry.IsRegular() instead of ObjectType that was removed.

Signed-off-by: Filip Navara <navara@emclient.com>

* Use the treePath to optimize commit info search.

Signed-off-by: Filip Navara <navara@emclient.com>

* Extract the latest commit at treePath along with the other commits.

Signed-off-by: Filip Navara <navara@emclient.com>

* Fix listing commit info for a directory that was created in one commit and never modified after.

Signed-off-by: Filip Navara <navara@emclient.com>

* Avoid nearly all external 'git' invocations when doing directory listing (.editorconfig code path is still hit).

Signed-off-by: Filip Navara <navara@emclient.com>

* Use go-git for reading blobs.

Signed-off-by: Filip Navara <navara@emclient.com>

* Make SHA1 type alias for plumbing.Hash in go-git.

Signed-off-by: Filip Navara <navara@emclient.com>

* Make Signature type alias for object.Signature in go-git.

Signed-off-by: Filip Navara <navara@emclient.com>

* Fix GetCommitsInfo for repository with only one commit.

Signed-off-by: Filip Navara <navara@emclient.com>

* Fix PGP signature verification.

Signed-off-by: Filip Navara <navara@emclient.com>

* Fix issues with walking commit graph across merges.

Signed-off-by: Filip Navara <navara@emclient.com>

* Fix typo in condition.

Signed-off-by: Filip Navara <navara@emclient.com>

* Speed up loading branch list by keeping the repository reference (and thus all the loaded packfile indexes).

Signed-off-by: Filip Navara <navara@emclient.com>

* Fix lising submodules.

Signed-off-by: Filip Navara <navara@emclient.com>

* Fix build

Signed-off-by: Filip Navara <navara@emclient.com>

* Add back commit cache because of name-rev

Signed-off-by: Filip Navara <navara@emclient.com>

* Fix tests

Signed-off-by: Filip Navara <navara@emclient.com>

* Fix code style

* Fix spelling

* Address PR feedback

Signed-off-by: Filip Navara <navara@emclient.com>

* Update vendor module list

Signed-off-by: Filip Navara <navara@emclient.com>

* Fix getting trees by commit id

Signed-off-by: Filip Navara <navara@emclient.com>

* Fix remaining unit test failures

* Fix GetTreeBySHA

* Avoid running `git name-rev` if not necessary

Signed-off-by: Filip Navara <navara@emclient.com>

* Move Branch code to git module

* Clean up GPG signature verification and fix it for tagged commits

* Address PR feedback (import formatting, copyright headers)

* Make blob lookup by SHA working

* Update tests to use public API

* Allow getting content from any type of object through the blob interface

* Change test to actually expect the object content that is in the GIT repository

* Change one more test to actually expect the object content that is in the GIT repository

* Add comments
2019-04-19 20:17:27 +08:00
techknowlogick
56da256853
Telegram webhook (#4227) 2019-04-18 22:45:02 -04:00
Richard Mahn
2262811e40 Fixes 4762 - Content API for Creating, Updating, Deleting Files (#6314) 2019-04-17 12:06:35 -04:00
zeripath
bdbbd816fc Add more title attributes on shortened names (#6647) 2019-04-17 10:49:56 -04:00
zeripath
450fc9a120
Fix 6655 - there is no need to EscapePound .Link as it is already escaped (#6656)
Signed-off-by: Andrew Thornton <art27@cantab.net>
2019-04-16 22:37:35 +01:00
하윤
83d6e5e3f8 Update UI for topics labels on projects (#6639) 2019-04-15 14:59:30 -04:00
zeripath
b3e757a06c
Correctly adjust mirror url (#6593) 2019-04-12 21:52:57 +01:00
mrsdizzie
3ff0a126e1 Improve issue autolinks (#6273)
* Improve issue autolinks

Update autolinks to match what github does here:

Issue in same repo: #1
Issue in different repo: org/repo#1

Fixes #6264

* Use setting.AppURL when parsing URL

Using setting.AppURL here is a more reliable way of parsing the current
URL and what other functions in this file seem to use.

* Make ComposeMetas always return a valid context

* Add per repository markdown renderers for better context

* Update for use of context metas

Now that we include the user and repo name inside context metas, update
various code and tests for this new logic
2019-04-12 08:53:34 +03:00
Mura Li
3186ef554c Support search operators for commits search (#6479)
* Support searching commits with prefix syntax

For now, support auther: committer:
When more than one prefix is supplied is presented, the result is the union.
When different prefixes are supplied, the result is the intersection.

For example,
"author:alice author:bob"
=> the result is all commits authored by Alice OR Bob

"hello committer:alice"
=> the result is all commits committed by Alice AND has the keyword
'hello' in the message.

Note that there should NOT have any space after the colon(:) of the prefix.
For example,
"author:bill" => correct
"author: bill" => wrong

* Remove unneeded logging

* Add missing files of test repository

* Add missing repo_unit entries to test fixtures

* Update test cases

* Add tooltip for commits search button

* Update tooltip text

I have no idea about how to format it with line breaks.

* Make the usage example more real

* Add a test case

* Add new options struct for SearchCommits

* Prefer len(s) > 0 over s != ""

* Add NewSearchCommitsOptions
2019-04-12 10:28:44 +08:00
Matthias Beckert
5348573fdf Allow admin users to set a repositoires visibility to public, even if FORCE_PRIVATE is to true (#6541) (#6572)
Signed-off-by: Matthias Beckert <beckert.matthias@googlemail.com>
2019-04-11 16:32:42 +08:00
Richard Mahn
2664adf677 Fixes #6514 - New Pull Request on files and pulls pages the same (#6515)
* Fixes #6514 - New Pull Request on files and pulls pages the same
2019-04-09 22:16:29 +01:00
zeripath
89cc7c646d
Prevent server 500 on compare branches with no common history (#6555)
* Prevent 500 if there is no common mergebase
* Prevent creation of PR with no history
2019-04-09 21:45:58 +01:00
mrsdizzie
0bdd81df9d Properly escape release attachment URL (#6512)
Make sure file attachments on a release get a properly escaped URL when
linking.

Fixes #6506
2019-04-05 11:28:10 -04:00
Elias Norberg
bf5af87eef Show last commit status in pull request lists (#6465) 2019-04-02 15:54:29 -04:00
John Olheiser
b04a1d9d63 Add ui class to sub_menu to fix style in arc-green (#6477)
Signed-off-by: jolheiser <john.olheiser@gmail.com>
2019-04-02 08:41:19 +08:00
oscar.lofwenhamn
2019983e77 Make "Ghost" not link to 404 page (#6410)
* Make Ghost not link to 404 page

* Make correct localization label show

* Create and use GetLastEventLabelFake for when a Ghost user has made the action, thus not linking to a user profile
* Add corresponding _fake entries to locale_en-US

* Make Ghost avatar not link to 404 page

* Make Ghost on milestone_issues not link to 404 page
2019-03-27 18:22:39 -04:00
Russell Aunger
b34996a629 Implement Default Webhooks (#4299)
Partially implement #770.
Add "Default Webhooks" page in site admin UI.
Persist to the existing webhooks table, but store with RepoID=0 and OrgID=0.
Upon repo creation, copy the set of default webhooks into the new repo.
2019-03-18 22:33:20 -04:00
John Olheiser
0b94f106f8 Add title attributes to all items in the repo list viewer (#6258) 2019-03-18 22:28:39 -04:00
John Olheiser
c55bdca562 Add same changes from issues page to milestone->issues page (#6328) 2019-03-15 11:50:27 -04:00
John Olheiser
608781f880 Fix fork button (#6223) 2019-03-05 19:48:30 -05:00
stevegt
b257e0456b Add ability to sort issues by due date (#6206) (#6244)
Signed-off-by: Steve Traugott <stevegt@t7a.org>
2019-03-05 09:39:41 -05:00
Lunny Xiao
4a2fbbeb10 fix bug user could change private repository to public when force private enabled. (#6156) 2019-02-22 21:56:05 +00:00
John Olheiser
d26d249748 Minor UI tweaks (#5980)
* Remove all CommitStatus when a repo is deleted

Signed-off-by: jolheiser <john.olheiser@gmail.com>

* Minor UI tweaks (#5782)
Added 'No License' option
Added link and octicon change for external issue trackers
Reset password now notifies right away if the code is invalid

Signed-off-by: jolheiser <john.olheiser@gmail.com>

* More UI tweaks
More info in PR

* Generate stylesheet for arc-green

* Make gofmt work

* Change PR integration since the button is changed

* Rebase

* Generate stylesheet

* UI updates
Made the PR button a "basic" button
Vertically centered the issue checkboxes
Labels will update only once after modal is closed

* Commit to reference related issues
Resolves #5782
Resolves #5861
Addresses original question in #5993

* Change the comment wording since PR button is no longer little and green.

* Revert changes that made Windows work

* Regenerate stylesheet

* Regenerate stylesheets

* make generate-stylesheets

* Update integration again, changed button style

Signed-off-by: jolheiser <john.olheiser@gmail.com>

* Added ID to PR button
Changed integration to use the ID to avoid breaking in the future

* Added missing semi-colons

* Added back distinction between issue actions and filters (overlooked it before)
Moved action button over next to other action dropdowns

* Remove extra tab formatting in list.tmpl

* Remove more formatting from GoLand

* Replace hardcoded "No License" with i18n license helper.
2019-02-19 18:09:47 -05:00
Lanre Adelowo
44114b38e6 Implement "conversation lock" for issue comments (#5073) 2019-02-18 22:55:04 +02:00
John Olheiser
0b72c00fad Allow labels to contain emoji (#6063)
* Add emoji to labels
Minor cleanup of tribute code in footer.tmpl

Signed-off-by: jolheiser <john.olheiser@gmail.com>

* Quick find/replace in other i18n files containing label translations

Signed-off-by: jolheiser <john.olheiser@gmail.com>

* Revert "Quick find/replace in other i18n files containing label translations"

This reverts commit ec3e1a3a17.

* Add style to overwrite emoji height in labels

* Revert Makefile change that makes Windows work
2019-02-16 19:33:09 +02:00
silverwind
ec540294a1 Revert "Fix wrapping long code lines in UI" (#6074)
This reverts commit e5cd80e021.

Fixes: https://github.com/go-gitea/gitea/issues/6064
2019-02-15 02:23:20 -05:00
Zsombor
23414ac2a1 Fix panic: template: repo/issue/list:210: unexpected "=" in operand (#6041) 2019-02-13 10:14:17 +02:00
Luo Yifei
7884353a04 Add the Owner Name to differentiate when merging (#3807) 2019-02-12 10:37:32 +02:00
Lanre Adelowo
9d8178b3ac Add option to close issues via commit on a non master branch (#5992)
* fixes #5957

* add tests to make sure config option is respected

* use already defined struct

* - use migration to make the flag repo wide not for the entire gitea instance
Also note that the config value can still be set so as to be able to control the value for new repositories that are to be created

- fix copy/paste error in copyright header year and rearrange import

- use repo config instead of server config value to determine if a commit should close an issue

- update testsuite

* use global config only when creating a new repository

* allow repo admin toggle feature via UI

* fix typo and improve testcase

* fix fixtures

* add DEFAULT prefix to config value

* fix test
2019-02-10 21:27:19 +02:00
Lanre Adelowo
2e85e70e38 Enhance closed PR and Issue status in the list (#6000)
* working version

* Update options/locale/locale_en-US.ini

Co-Authored-By: adelowo <adelowomailbox@gmail.com>

* update templates
2019-02-08 07:53:58 +00:00
silverwind
acaf5c96fe UI: Repo header tweaks (#5945)
* UI: Repo header tweaks

- Use basic buttons on the header buttons, matching gogs
- Make 'Manage topic' text smaller, remove margin-left with no topics
present
- Move various inline styles to CSS
- Use flexbox on header title and buttons

* fix indentation

* reverse media query wrapping

* fix inconsisten whitespace
2019-02-05 16:59:26 -05:00
Lanre Adelowo
c20034be31 Display the branch name in the commit view (#5950)
* add branch info

* Remove blank lines

* Remove blank lines

* update git dependency
2019-02-05 21:47:01 +00:00
silverwind
2ec9bf9048 UI: Fixes for repo topic editor (#5971)
- Properly hides the edit interface when saving a empty topic list
- Align the Done button with the edit box
2019-02-05 22:40:56 +02:00
Lunny Xiao
bf4badad1d Pull request conflict files detection (#5951)
* add conflict detection

* test pull request conflict files

* fix detection files number

* fix comments
2019-02-05 06:54:49 -05:00
Lanre Adelowo
5390791224 Automatically clear stopwatch on merging a PR (#4327)
* Don't display buttons if there are no notices

* clear stopwatch on merging a PR

* remove redundant gt check

* use ctx.Flash as per @bkcsoft comment

* stop timer on closing issues/PRs too

* updated translation as per review

* redirect to login page after successfully activating account

* remove unrelated changes

* stop timer for issues that are closed via commits too..Not just the 'close' UI button
2019-02-05 13:38:11 +02:00
zeripath
24a36e84cc Issue 5924 fix compare button (#5929)
* Revert #5877

This unfortunately was not the solution.

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Change permission check to create pull requests to CanReadIssuesOrPulls

Signed-off-by: Andrew Thornton <art27@cantab.net>
2019-02-03 19:56:18 -05:00
silverwind
12ee544411 Fix wrapping long code lines in UI (#5927)
Wrapping was initially added in https://github.com/go-gitea/gitea/pull/2789
but it is currently disabled because the rule that applies wrapping to
the wrap class did not have enough CSS specificity.

Resolved the issue by using a general selector that matches all code
boxes. The previous wrap class was removed because it had only been
inconsistenly applied to various code boxes and because I found no easy
way to add classes to code boxes rendered in Markdown.

Also removed a seemingly useless :before on code view and added padding
to restore the spacing.
2019-02-02 16:58:28 +00:00
silverwind
af22df8314 UI: Better support for long repo names (#5932)
* UI: Make long repo names wrap less often

* also adjust news feed column widths
2019-02-02 14:44:33 +02:00
Lanre Adelowo
57a69ef277 don't allow pull requests to be created on an archived repository (#5883)
* don't allow pull requests to be created on an archived repository
Also disable the "PR" button if the repo is archived

* Refuse creating an issue/PR via API calls too
2019-01-30 12:20:40 -05:00
Lanre Adelowo
16678f5255 fix compare button on upstream repo leading to 404 (#5877) 2019-01-29 18:49:07 -05:00
EpicCoder
c62c0b669a UI: Change GPG Validation colors and remove inline CSS; fixes #5404 (#5896) 2019-01-29 18:11:53 -05:00
kekero
3568d426fe New Issue ?body= query (#5851)
* New Issue ?body= query

* Override issue template with body query

* Add documentation for issue body query
2019-01-28 10:23:59 -05:00
Gabriel Silva Simões
5f4a40c4a3 Revert #3711 overwrite of only show "No Description" to repo admins #2167 (#5836)
Revert #3711 overwrite of only show "No Description" to repo admins  #2167 and add tests to prevent accidental overwrite again.
2019-01-27 21:13:15 +00:00
Lauris BH
cd83c2ca05
Fix topics saving internal error and disable for archived repos (#5821) 2019-01-24 12:22:27 +02:00
kolaente
0b510725c9 Feature: Archive repos (#5009) 2019-01-23 13:58:38 -05:00
Lauris BH
075649572d Add the ability to use multiple labels as filters(#5786) 2019-01-22 23:10:38 -05:00
Lanre Adelowo
c212c98463 Fix wording when user is unassigned from an issue (#5769)
Previous Gitea would display that the user had unassigned themselves even if the actor
was not the user. Fixes #4418
2019-01-19 19:16:46 +00:00
zeripath
07802a2bc5 Refactor repo.isBare to repo.isEmpty #5629 (#5714)
* Refactor repo.isBare to repo.isEmpty #5629

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Remove Sync call
2019-01-17 19:01:04 -05:00
Harshit Bansal
1ac8f6fb83 Don't list an issue on its own dependency list UI. (#5658)
Fixes: #4684.
2019-01-15 16:31:35 -05:00
Lanre Adelowo
abb364f442 allow user fork repo even when as a guest.. This will prompt the user to login and if authentication was successful, the user will be redirected to fork the repo (#5690) 2019-01-10 23:25:14 -05:00
gdeverlant
d3dc07f282 Added URL mapping for Release attachments like on github.com (#1707) 2019-01-06 17:37:30 -05:00
Harshit Bansal
dd006db5a7 Display branch name in delete branch confirmation modal. (#5654)
Fixes: #5630.
2019-01-06 15:08:25 -05:00
Harshit Bansal
2c7661a524 Fix wrong text getting saved on editing second comment on an issue. (#5608)
* comments: Fix an incorrent DOM element selection.

This commit fixes a bug that was causing text from previously edited
comment to get saved when two comments were edited one after other.
Text area with id of `#content` isn't unique on the page but it was
being treated as unique by the event handling code.

Fixes: #5581.

* templates: Remove `id` from textarea in commit edit form.

An element is assigned an `id` only if it is unique for the whole page
but in this case there can be multiple textarea so it should have one.
2018-12-31 13:01:20 +01:00
Julian
4a685f8b87 Add rebase with merge commit merge style (#3844) (#4052)
Signed-off-by: Julian Tölle <julian.toelle97@gmail.com>
2018-12-27 12:27:08 +02:00
Jonas Franz
9681c83734 Approvals at Branch Protection (#5350)
* Add branch protection for approvals

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Add required approvals

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Add missing comments and fmt

Signed-off-by: Jonas Franz <info@jonasfranz.software>

* Add type = approval and group by reviewer_id to review

* Prevent users from adding negative review limits

* Add migration for approval whitelists

Signed-off-by: Jonas Franz <info@jonasfranz.software>
2018-12-11 19:28:37 +08:00