1
1
mirror of https://github.com/go-gitea/gitea synced 2024-07-01 07:35:49 +00:00
Commit Graph

9592 Commits

Author SHA1 Message Date
zeripath
1ae5435e41
Prevent (caught) panic on login (#11590) (#11597)
Backport #11590

Unfortunately when the virtual session is released it requires that the
real session does not exist. This worked fine when sessions were only
saved at the end of request/response cycle however, now sessions are
saved proactively this does not hold.

The result is a caught panic in the logs during every log-in.  This
panic has no significant side-effects but should not occur.

This PR marks the virtual session as released when released and updates
it if the same session is released again.

Signed-off-by: Andrew Thornton <art27@cantab.net>
2020-05-24 18:12:25 +01:00
zeripath
ca61046f9f
Prevent empty query parameter being set on dashboard (#11561) (#11604)
Prevent the dashboard from setting an empty query parameter

Fix #11543

Signed-off-by: Andrew Thornton art27@cantab.net
2020-05-24 17:20:09 +03:00
mrsdizzie
29368309ce
Fix images in wiki edit preview (#11546) (#11602)
Make sure wiki editor sets wiki to true so gitea renders it as a wiki page.

Also change the context data attr for edit form. This looks wrong but everywhere else in our code assumes the urlPrefix to be just the repo url when rendering and manually adds /wiki to the rendered url regardless.

Fixes #11540
2020-05-24 14:01:10 +01:00
zeripath
a777f8ae75
Allow different HardBreaks settings for documents and comments (#11515) (#11599)
GH has different HardBreaks behaviour for markdown comments and documents.

Comments have hard breaks and documents have soft breaks - therefore Gitea's rendering will always be different from GH's if we only provide one setting.

Here we split the setting in to two - one for documents and one for comments and other things.

Signed-off-by: Andrew Thornton art27@cantab.net

Changes to index.js as per @silverwind 
Co-authored-by: silverwind <me@silverwind.io>

Changes to docs as per @guillep2k 
Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
2020-05-24 11:45:56 +01:00
Cirno the Strongest
80853a2238
Enforce transparent background on editor toolbar elements (#11569) (#11583)
Co-authored-by: Lauris BH <lauris@nix.lv>
(cherry picked from commit 38c773d8a5)

Co-authored-by: zeripath <art27@cantab.net>
2020-05-23 19:36:24 -04:00
zeripath
ce958f45cd
Ensure serviceworker is created as /serviceworker.js (#11577) (#11582)
#11538 moved the serviceworker to webbox but unfortunately
created the serviceworker in public/js rather than public/

This PR fixes this, fixing multiple issues with broken js
as a result of that change.

Signed-off-by: Andrew Thornton art27@cantab.net
2020-05-23 21:41:33 +01:00
guillep2k
3b1e114ede
Prevent transferring repos to invisible orgs (#11517) (#11549)
Co-authored-by: Guillermo Prandi <guillep2k@users.noreply.github.com>

Co-authored-by: Guillermo Prandi <guillep2k@users.noreply.github.com>
Co-authored-by: zeripath <art27@cantab.net>
2020-05-22 22:12:20 -04:00
silverwind
573a9c6228
Fix webpack chunk loading with STATIC_URL_PREFIX (#11526) (#11542)
Previously, we had only set __webpack_public_path__ to a path which
caused webpack chunks to be loaded from the current origin which is
incorrect when STATIC_URL_PREFIX points to another origin.

This should fix the issue curretnly seen on gitea.com.
2020-05-22 20:18:44 +01:00
silverwind
d131d53cbb
Close EventSource before unloading the page (#11539) (#11557)
Should eliminate a error in the Firefox console regarding the connection
being interrupted while the page was loading.
2020-05-22 19:30:30 +01:00
L0veSunshine
2a6e6bf0f1
Fix the bug that the emoji don't disappear(#11489) (#11530)
Co-authored-by: John Olheiser <john.olheiser@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2020-05-22 12:36:25 -04:00
silverwind
655def5141
Move serviceworker to workbox and fix SSE interference (#11538) (#11547)
* Move serviceworker to workbox and fix SSE interference

Instead of statically hardcoding every frontend asset, this uses a
type-based approach to cache all js,css and manifest.json requests.

This also fixes the issue that the service worker was interfering with
EventSource because it was unconditionally handling all requests which
this new implementation doesn't.

Fixes: https://github.com/go-gitea/gitea/issues/11092
Fixes: https://github.com/go-gitea/gitea/issues/7372

* rethrow error instead of logging

* await .register

* Revert "rethrow error instead of logging"

This reverts commit 043162ba1f.

* improve comment

* remove JSRenderer

* add version-based cache invalidation

* refactor

* more refactor

* remove comment

* rename item to fit cache name

Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
2020-05-22 12:46:39 -03:00
silverwind
2042cf2cce
Ensure emoji render with regular font-weight (#11541) (#11545)
Emoji characters don't support bold attributes and may do weird things
like rendering monochrome when bolded.
2020-05-22 11:57:13 +01:00
Matthew R. McDougal
7b438b3566
Fix form action template substitutions on admin pages (backport #11519) (#11531)
* Fix form action template substitution on admin dashboard

* Fix form action template substitution on admin monitoring page

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
2020-05-21 23:02:56 -04:00
zeripath
8bde2e9813
API PullReviewComment HTMLPullURL should return the HTMLURL (#11501) (#11533)
Fix #11499

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2020-05-21 19:35:19 +03:00
zeripath
8525a48581
Fix repo-list private and total count bugs (#11500) (#11532)
* Fix repo-list private and total count bugs

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Ensure limited and private org public repos are displayed on "private"

Signed-off-by: Andrew Thornton <art27@cantab.net>

* switch from onlyPrivate to is_private

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Generate swagger

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>

Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
2020-05-21 08:23:20 -05:00
Cirno the Strongest
034492384b
Fix margin for branch-update grid on PR view when update button is not present (#11521) (#11525)
* Fix margin for branch-update grid on PR view when update button is not present

* Move padding to row element

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
(cherry picked from commit ee4e8542c7)

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2020-05-21 06:53:10 +01:00
zeripath
c83bc55b52
TrimSpace when reading InternalToken from a file (#11502) (#11524)
InternalTokens are fixed as alphanum strings therefore TrimSpace from these.
Also use isatty to not add a terminal newline when redirecting generate.

Fix #11498

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: Lauris BH <lauris@nix.lv>

Co-authored-by: Lauris BH <lauris@nix.lv>
2020-05-20 15:42:03 -04:00
Cirno the Strongest
09cc6392f6
Fix selected line color in arc-green (#11492) (#11520)
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
(cherry picked from commit 6da87eda8b)
2020-05-20 19:15:34 +03:00
Cirno the Strongest
b67eafbc21
Use more toned colors for selected line (#11493) (#11511)
Co-authored-by: zeripath <art27@cantab.net>
(cherry picked from commit 7b66400f55)

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2020-05-19 22:50:48 -04:00
silverwind
c1ba480a7a
Tweak reaction buttons (#11496) (#11516)
- Vertical centering using flexbox
- Very slightly decreased size of the boxes

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2020-05-19 18:02:25 -04:00
6543
1197512b2b
Make localstorage read ssh or https correctly (#11483) (#11490)
* Make localstorage read ssh or https correctly

* Update index.js

If not login there is only a "https" button, This commit fix  the "https" button hasn't blue border.

* Keep user selected whether or not to log in

* Update index.js

Co-authored-by: L0veSunshine <xuan199651@gmail.com>
Co-authored-by: zeripath <art27@cantab.net>
2020-05-19 16:03:10 +03:00
Cirno the Strongest
1547ce5669
Fix top margin for bottom attached header (#11480) (#11485)
* Fix top margin for bottom attached header (#11480)

(cherry picked from commit 6b798feaf6)

* restart ci

Co-authored-by: Lauris BH <lauris@nix.lv>
2020-05-19 01:59:07 -04:00
Lauris BH
1aa6176bd8
MySQL instance is needed for all triggers (#11484) 2020-05-18 19:14:28 +03:00
Lauris BH
2289e59bd7
Changelog for v1.12.0-rc1 (#11462) 2020-05-18 16:04:04 +03:00
Lauris BH
6e75bc013e
Fix comment box styling and cancelling (#11463) (#11464) (#11469) (#11467)
* Fix styling of resolved code comment box (#11463)

Co-authored-by: Lauris BH <lauris@nix.lv>

* Fix .comment-code-cloud not being removed when cancelling new code comment (#11464)

* Fix footer padding for comment code reply form on issue event view (#11469)

Co-authored-by: Cirno the Strongest <1447794+CirnoT@users.noreply.github.com>
2020-05-18 10:17:35 +01:00
6543
087719cb8d
Ensure public repositories in private organizations are visible and fix admin organizations list (#11465) (#11474)
* Ensure that we can see public repositories in private organization

Fix #10144 (Again)

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Fix Admin users and organizations page

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Update models/repo_list.go

Co-authored-by: Lauris BH <lauris@nix.lv>

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
2020-05-18 07:21:00 +01:00
6543
bbd9bebcc3
Fix "Unknown task: git_fsck" error on admin dashboard (#11468) (#11471)
* Fix "Unknown task: git_fsck" error on admin dashboard (#11468)

* Update .drone.yml

Co-authored-by: zeripath <art27@cantab.net>
2020-05-18 06:31:49 +01:00
GiteaBot
fb43fbe0aa [skip ci] Updated translations via Crowdin 2020-05-17 15:36:19 +00:00
Cirno the Strongest
17f652a91c
Increase width for authors on commit view (#11441)
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
2020-05-17 18:35:07 +03:00
GiteaBot
580f73ad79 [skip ci] Updated translations via Crowdin 2020-05-17 14:16:15 +00:00
silverwind
97cabf39cd
Change tab width for .go files to 4 (#11455)
* Change tab width for .go files to 4

I thing 8-wide tabs are kind of archaic and inconsisten with template
files which already use 4-wide.

Also did some misc cleanups in the .editorconfig files.

* add css

Co-authored-by: Lauris BH <lauris@nix.lv>
2020-05-17 17:14:36 +03:00
GiteaBot
4e302baa4c [skip ci] Updated translations via Crowdin 2020-05-17 12:44:33 +00:00
zeripath
76053ac31a
Whenever the ctx.Session is updated, release it to save it before sending the redirect (#11456)
Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: Lauris BH <lauris@nix.lv>
2020-05-17 15:43:29 +03:00
GiteaBot
50932ce8af [skip ci] Updated translations via Crowdin 2020-05-17 11:11:07 +00:00
6543
7d9946f989
Docs: add AlpineLinux packages (#11446)
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
2020-05-17 14:09:56 +03:00
Lauris BH
75918d9dc6
Fix translation to be compatible with crowdin (#11453) 2020-05-17 12:18:59 +03:00
zeripath
c642cd0676
Allow all members of private orgs to see public repos (#11442)
* Allow all members of private orgs to see public repos

Fix #10144

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Update models/repo_list.go

Co-authored-by: Lauris BH <lauris@nix.lv>
2020-05-17 16:22:17 +08:00
zeripath
a0d35fb6ad
Forcibly clean and destroy the session on logout (#11447)
Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2020-05-17 14:05:11 +08:00
GiteaBot
5cf224abe3 [skip ci] Updated translations via Crowdin 2020-05-17 00:49:40 +00:00
6543
84bcb3451a
Check Push permissions on IsUserAllowedToUpdate (#11448) 2020-05-16 20:48:30 -04:00
GiteaBot
dcb0cf7470 [skip ci] Updated translations via Crowdin 2020-05-16 23:33:25 +00:00
zeripath
9a2e47b23a
Refactor Cron and merge dashboard tasks (#10745)
* Refactor Cron and merge dashboard tasks

* Merge Cron and Dashboard tasks
* Make every cron task report a system notice on completion
* Refactor the creation of these tasks
* Ensure that execution counts of tasks is correct
* Allow cron tasks to be started from the cron page

* golangci-lint fixes

* Enforce that only one task with the same name can be registered

Signed-off-by: Andrew Thornton <art27@cantab.net>

* fix name check

Signed-off-by: Andrew Thornton <art27@cantab.net>

* as per @guillep2k

* as per @lafriks

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Add git.CommandContext variants

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2020-05-16 19:31:38 -04:00
zeripath
c18144086f
Hide archived repos by default in repo-list (#11440)
As discussed in #11268 hide archived repos by default in the
dashboard repo-list

Signed-off-by: Andrew Thornton <art27@cantab.net>
2020-05-17 01:12:03 +03:00
GiteaBot
aaaaeb7050 [skip ci] Updated translations via Crowdin 2020-05-16 21:07:43 +00:00
L0veSunshine
9cc9e47158
[UI] Adjust CSS details for adding emoticons (#11435)
* Adjust CSS details for added emoticons

* fix lint

* avoid git conflict
2020-05-17 00:06:34 +03:00
zeripath
414c9ee76a
Make API EditIssue and EditPullRequest issue notifications (#11123)
* Make API EditIssue and EditPullRequest issue notifications

Restructure models.UpdateIssueByAPI and EditIssue/EditPullRequest
to issue notifications

Fix #10014

Signed-off-by: Andrew Thornton <art27@cantab.net>

* As per @6543

Signed-off-by: Andrew Thornton <art27@cantab.net>

* update status!

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: John Olheiser <john.olheiser@gmail.com>
Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
2020-05-17 00:05:19 +03:00
zeripath
c86bc8e061
Add paging and archive/private repository filtering to dashboard list (#11321)
* Add archived options to SearchRepository

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Add only-private search

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Add filter options and paging to dashboard repository page

Signed-off-by: Andrew Thornton <art27@cantab.net>

* swagger generate

Signed-off-by: Andrew Thornton <art27@cantab.net>

* fix-swagger-again

Signed-off-by: Andrew Thornton <art27@cantab.net>

* as per @mrsdizzie also remember state

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: Lauris BH <lauris@nix.lv>
2020-05-16 23:07:01 +03:00
guillep2k
c3d9a5f846
Use session for retrieving org teams (#11438)
Co-authored-by: Guillermo Prandi <guillep2k@users.noreply.github.com>
2020-05-16 20:29:29 +01:00
Cirno the Strongest
4744e1e0f7
Fix buttons left-margin (#11427)
Co-authored-by: Lauris BH <lauris@nix.lv>
2020-05-16 20:45:44 +03:00
mrsdizzie
b2b86ea870
Support view individual commit for wiki pages (#11415)
Currently you can see a list of commit history for wiki pages but aren't able to view the commit diff itself. This adds the feature to view an individual commit to a wiki repo.

Closes #8999

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2020-05-16 19:38:40 +03:00