gitea/routers
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
..
admin Users should not be able to prohibit their own login (#10970) 2020-04-06 10:23:15 -04:00
api/v1 API: Add pull review endpoints (#11224) 2020-05-02 03:20:51 +03:00
dev Display ui time with customize time location (#7792) 2019-08-15 22:46:21 +08:00
org Add Organization Wide Labels (#10814) 2020-04-01 01:14:46 -03:00
private Prevent clones and pushes to disabled wiki (#11131) 2020-04-19 15:26:58 +01:00
repo Allow unauthenticated users to compare (#11240) 2020-05-04 19:44:30 -03:00
routes Allow unauthenticated users to compare (#11240) 2020-05-04 19:44:30 -03:00
user Refactor UpdateOAuth2Application (#11034) 2020-04-30 18:50:47 +01:00
utils Handle push rejection message in Merge & Web Editor (#10373) 2020-02-22 15:08:48 +02:00
home.go Add detected file language to code search (#10256) 2020-02-20 16:53:55 -03:00
init.go Language statistics bar for repositories (#8037) 2020-02-11 11:34:17 +02:00
install.go Add support for database schema in PostgreSQL (#8819) 2020-01-20 16:45:14 +01:00
metrics.go Use gitea forked macaron (#7933) 2019-08-23 12:40:29 -04:00
swagger_json.go Add gitea-vet (#10948) 2020-04-05 07:20:50 +01:00