Commit Graph

27 Commits

Author SHA1 Message Date
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
赵智超 6e4baee91d
ui: fix status label on branches list vertical alignment (#11109)
change status icon for merged PR to git-merge

Signed-off-by: a1012112796 <1012112796@qq.com>
2020-04-17 12:35:12 -04:00
John Olheiser 86fdba177a
Add Octicon SVG spritemap (#10107)
* Add octicon SVG sprite

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

* Static prefix

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

* SVG for all repo icons

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

* make vendor

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

* Swap out octicons

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

* Move octicons to top of less imports

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

* Fix JS

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

* Definitely not a search/replace

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

* Missed regex

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

* Move to more generic calls and webpack

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

* make svg -> make webpack

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

* Remove svg-sprite

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

* Update tests

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

* Missed a test

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

* Remove svg from makefile

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

* Suggestions

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

* Attempt to fix test

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

* Update tests

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

* Revert timetracking test

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

* Swap .octicon for .svg in less

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

* Add aria-hidden

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

* Replace mega-octicon

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

* Fix webpack globbing on Windows

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

* Revert

Co-Authored-By: silverwind <me@silverwind.io>

* Fix octions from upstream

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

* Fix Vue and missed JS function

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

* Add JS helper and PWA

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

* Preload SVG

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

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: techknowlogick <matti@mdranta.net>
2020-02-11 12:02:41 -05:00
Lunny Xiao 3ccd271081
Fix branch page pull request title and link error (#10092)
* Fix branch page pull request title and link error

* Fix ui
2020-02-01 15:54:25 +02:00
zeripath e5d8e2d10c
Branches not at ref commit ID should not be listed as Merged (#9614)
Once a branch has been merged if the commit ID no longer equals that of
the pulls ref commit id don't offer to delete the branch on the pull screen
and don't list it as merged on branches.

Fix #9201

When looking at the pull page we should also get the commits from the refs/pulls/x/head

Fix #9158
2020-01-07 17:06:14 +00:00
Vedran 4f9443cf8e Button tooltip formatting under Branches (#9034)
* Fixes button tooltip formatting under Branches

* Formatting on download button for default branch
2019-11-16 12:03:07 +00:00
6543 733c898a90 [Branch View] Add Included TAG (#8449)
* included message

* add property IsIncluded

* Add Orange Lable
2019-10-14 23:40:17 +01:00
6543 5409dec8fd [Branch View] show "New Pull Request" Button only if posible (#7977)
* add check Commits Ahead is gt 0

* code format
to start drone-ci test again
and formate code is also nice :)
2019-08-26 13:47:41 +03:00
6543 d974c139b4 sugestion to use range .Branches (#7674)
d57973a804
2019-07-30 23:02:58 +08:00
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
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
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
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
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
Harshit Bansal dd006db5a7 Display branch name in delete branch confirmation modal. (#5654)
Fixes: #5630.
2019-01-06 15:08:25 -05:00
nubenum 756eafaaf6 Fix some issues with special chars in branch names (#3767)
Signed-off-by: Robin Durner <github@nubenum.de>
2018-09-17 01:28:23 +03:00
Joel da Rosa 91373901f6 Prevent html entity escaping (#4471) 2018-07-19 18:25:17 +03:00
bugreport0 bac6d05e78 Improve English grammar and consistency. (#3614)
* Start improving English grammar and consistency.

* Apply review comments, push translation further.

* Additional review changes; expand translation.

* Undo team/organization change, further translation.

* Add site administration; review comments; merge.

* Update hardcoded branch protection string tests.

* Update hardcoded branch deletion string test.

* Update another hardcoded translation string test.

* Add my nickname to the list of translators.

* Implement @lafriks review comments.

* Remove (now) unused branch deletion warnings.

* Remove (now) unused branch deletion warnings.
2018-04-19 17:24:31 +03:00
Bwko 38a9cda4bb Remove unnecessary Safe tags (#3778) 2018-04-10 06:43:37 +03:00
Bo-Yi Wu fc265b036f feat: Add branch link in branch list. (#3576) 2018-02-24 23:17:59 +02:00
Lunny Xiao f2e20c81b6 Refactor struct's time to remove unnecessary memory usage (#3142)
* refactor struct's time to remove unnecessary memory usage

* use AsTimePtr simple code

* fix tests

* fix time compare

* fix template on gpg

* use AddDuration instead of Add
2017-12-11 06:37:04 +02:00
Bwko 3ab580c8d6 Add branch overiew page (#2108)
* Add branch overiew page

* fix changed method name on sub menu

* remove unused code
2017-10-26 08:49:16 +08:00