forgejo/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
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
compare.go Show pull request selection even when unrelated branches (#11239) 2020-05-02 16:06:01 +08:00
download.go
editor.go Handle push rejection in branch and upload (#10854) 2020-03-28 01:13:18 -03:00
editor_test.go
http.go Prevent clones and pushes to disabled wiki (#11131) 2020-04-19 15:26:58 +01:00
issue.go [API] ListIssues add filter for milestones (#10148) 2020-04-30 01:15:39 -03:00
issue_dependency.go
issue_label.go Add Organization Wide Labels (#10814) 2020-04-01 01:14:46 -03:00
issue_label_test.go
issue_lock.go
issue_stopwatch.go
issue_timetrack.go
issue_watch.go
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.go Add a way to mark Conversation (code comment) resolved (#11037) 2020-04-18 10:50:25 -03:00
pull_review.go Add a way to mark Conversation (code comment) resolved (#11037) 2020-04-18 10:50:25 -03:00
release.go Add single release page and latest redirect (#11102) 2020-04-18 11:47:15 -03:00
release_test.go
repo.go Fix orgs not being displayed on create repo form (#11279) 2020-05-03 18:08:24 -03:00
search.go
setting.go
setting_protected_branch.go Prevent merge of outdated PRs on protected branches (#11012) 2020-04-16 22:00:36 -03:00
settings_test.go
topic.go
view.go
webhook.go Add Matrix webhook (#10831) 2020-03-28 15:09:55 +02:00
wiki.go
wiki_test.go