You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
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>
5 years ago
..
activity.go Add top author stats to activity page (#9615) 5 years ago
attachment.go Move dropzone.js to npm/webpack (#10645) 5 years ago
blame.go make avatar lookup occur at image request (#10540) 5 years ago
branch.go Allow unauthenticated users to compare (#11240) 5 years ago
commit.go Fix potential bugs (#10513) 5 years ago
compare.go Show pull request selection even when unrelated branches (#11239) 5 years ago
download.go Fix download file wrong content-type (#9825) 5 years ago
editor.go Handle push rejection in branch and upload (#10854) 5 years ago
editor_test.go Add Close() method to gogitRepository (#8901) 5 years ago
http.go Prevent clones and pushes to disabled wiki (#11131) 5 years ago
issue.go [API] ListIssues add filter for milestones (#10148) 5 years ago
issue_dependency.go Fix wrong permissions check when issues/prs shared operations (#9885) 5 years ago
issue_label.go Add Organization Wide Labels (#10814) 5 years ago
issue_label_test.go fix go vet error (#3740) 7 years ago
issue_lock.go Implement "conversation lock" for issue comments (#5073) 6 years ago
issue_stopwatch.go Automatically clear stopwatch on merging a PR (#4327) 6 years ago
issue_timetrack.go [API] Extend times API (#9200) 5 years ago
issue_watch.go Fix PR/issue redirects when having external tracker (#9339) 5 years ago
lfs.go Migrate to go-git/go-git v5.0.0 (#10735) 5 years ago
main_test.go Unit tests for wiki routers (#3022) 7 years ago
middlewares.go Add gitea-vet (#10948) 5 years ago
milestone.go move jquery-datetimepicker to npm/webpack (#10713) 5 years ago
pull.go Add a way to mark Conversation (code comment) resolved (#11037) 5 years ago
pull_review.go Add a way to mark Conversation (code comment) resolved (#11037) 5 years ago
release.go Add single release page and latest redirect (#11102) 5 years ago
release_test.go Add Close() method to gogitRepository (#8901) 5 years ago
repo.go Fix orgs not being displayed on create repo form (#11279) 5 years ago
search.go Add detected file language to code search (#10256) 5 years ago
setting.go API endpoint for repo transfer (#9947) 5 years ago
setting_protected_branch.go Prevent merge of outdated PRs on protected branches (#11012) 5 years ago
settings_test.go Stop various tests from adding to the source tree (#9515) 5 years ago
topic.go Add API endpoint for accessing repo topics (#7963) 6 years ago
view.go Show Signer in commit lists and add basic trust (#10425) 5 years ago
webhook.go Add Matrix webhook (#10831) 5 years ago
wiki.go Show Signer in commit lists and add basic trust (#10425) 5 years ago
wiki_test.go Fix wiki raw view on sub path (#10002) 5 years ago