0
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-11-30 05:50:50 +01:00
gitea/routers/repo
Kyle Evans 38cd9ba47b
Allow unauthenticated users to compare (#11240)
* routers: make /compare route available to unauthenticated users

Remove some bits of the compare interface if the user isn't signed in.
Notably, they don't need to see the "New Pull Request" button box nor the
hidden form that would fail to submit due to the POST request continuing to
require proper privileges.

Follow-up commits will improve the UI a bit around this, removing some
"Pull Request" verbiage in favor of "Compare."

* ui: home: show "compare" button for unauthenticated users

This change requires pulling in the BaseRepo unconditionally and
recording if the pull request is in-fact not allowed
(.PullRequestCtx.Allowed). If the user isn't allowed to create a pull
request, either because this isn't a fork or same-fork branch PRs aren't
allowed, then we'll name the button "Compare" instead of "Pull Request."

* ui: branch list: use the new Compare language when available

When viewing the branch listing as an unauthenticated user, you'll get
"Pull Request" buttons. use the new "Compare" verbiage instead, which
matches GitHub behavior when you can't issue a pull request from the
branches.

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
2020-05-04 19:44:30 -03:00
..
activity.go
attachment.go Move dropzone.js to npm/webpack (#10645) 2020-03-07 21:06:15 +00:00
blame.go make avatar lookup occur at image request (#10540) 2020-03-27 14:34:39 +02:00
branch.go Allow unauthenticated users to compare (#11240) 2020-05-04 19:44:30 -03:00
commit.go Fix potential bugs (#10513) 2020-02-27 20:10:27 -03:00
compare.go Show pull request selection even when unrelated branches (#11239) 2020-05-02 16:06:01 +08:00
download.go
editor_test.go
editor.go Handle push rejection in branch and upload (#10854) 2020-03-28 01:13:18 -03:00
http.go Prevent clones and pushes to disabled wiki (#11131) 2020-04-19 15:26:58 +01:00
issue_dependency.go
issue_label_test.go
issue_label.go Add Organization Wide Labels (#10814) 2020-04-01 01:14:46 -03:00
issue_lock.go
issue_stopwatch.go
issue_timetrack.go
issue_watch.go
issue.go [API] ListIssues add filter for milestones (#10148) 2020-04-30 01:15:39 -03:00
lfs.go Migrate to go-git/go-git v5.0.0 (#10735) 2020-03-17 12:19:58 -04:00
main_test.go
middlewares.go Add gitea-vet (#10948) 2020-04-05 07:20:50 +01:00
milestone.go move jquery-datetimepicker to npm/webpack (#10713) 2020-03-17 15:08:15 -04:00
pull_review.go Add a way to mark Conversation (code comment) resolved (#11037) 2020-04-18 10:50:25 -03:00
pull.go Add a way to mark Conversation (code comment) resolved (#11037) 2020-04-18 10:50:25 -03:00
release_test.go
release.go Add single release page and latest redirect (#11102) 2020-04-18 11:47:15 -03:00
repo.go Fix orgs not being displayed on create repo form (#11279) 2020-05-03 18:08:24 -03:00
search.go Add detected file language to code search (#10256) 2020-02-20 16:53:55 -03:00
setting_protected_branch.go Prevent merge of outdated PRs on protected branches (#11012) 2020-04-16 22:00:36 -03:00
setting.go
settings_test.go
topic.go
view.go Show Signer in commit lists and add basic trust (#10425) 2020-02-27 16:20:55 -03:00
webhook.go Add Matrix webhook (#10831) 2020-03-28 15:09:55 +02:00
wiki_test.go
wiki.go Show Signer in commit lists and add basic trust (#10425) 2020-02-27 16:20:55 -03:00