Commit Graph
8 Commits
Author SHA1 Message Date
zeripath 7a7f56044a Adopt repositories (#12920)
* Don't automatically delete repository files if they are present

Prior to this PR Gitea would delete any repository files if they are
present during creation or migration. This can in certain circumstances
lead to data-loss and is slightly unpleasant.

This PR provides a mechanism for Gitea to adopt repositories on creation
and otherwise requires an explicit flag for deletion.

PushCreate is slightly different - the create will cause adoption if
that is allowed otherwise it will delete the data if that is allowed.

Signed-off-by: Andrew Thornton <[email protected]>

* Update swagger

Signed-off-by: Andrew Thornton <[email protected]>

* Fix tests and migrate overwrite

Signed-off-by: Andrew Thornton <[email protected]>

* as per @lunny

Only offer to adopt or overwrite if the user can do that.

Allow the site administrator to adopt or overwrite in all
circumstances

Signed-off-by: Andrew Thornton <[email protected]>

* Use setting.Repository.DefaultBranch for the default branch

Signed-off-by: Andrew Thornton <[email protected]>

* Always set setting.Repository.DefaultBranch

Signed-off-by: Andrew Thornton <[email protected]>

* update swagger

Signed-off-by: Andrew Thornton <[email protected]>

* update templates

Signed-off-by: Andrew Thornton <[email protected]>

* ensure repo closed

Signed-off-by: Andrew Thornton <[email protected]>

* Rewrite of adoption as per @6543 and @lunny

Signed-off-by: Andrew Thornton <[email protected]>

* Apply suggestions from code review

* update swagger

Signed-off-by: Andrew Thornton <[email protected]>

* missing not

Signed-off-by: Andrew Thornton <[email protected]>

* add modals and flash reporting

Signed-off-by: Andrew Thornton <[email protected]>

* Make the unadopted page searchable

Signed-off-by: Andrew Thornton <[email protected]>

* Add API

Signed-off-by: Andrew Thornton <[email protected]>

* Fix swagger

Signed-off-by: Andrew Thornton <[email protected]>

* fix swagger

Signed-off-by: Andrew Thornton <[email protected]>

* Handle empty and non-master branched repositories

Signed-off-by: Andrew Thornton <[email protected]>

* placate lint

Signed-off-by: Andrew Thornton <[email protected]>

* remove commented out code

Signed-off-by: Andrew Thornton <[email protected]>

Co-authored-by: techknowlogick <[email protected]>
2020-09-25 07:09:23 +03:00
silverwind eb4db0445b Reindent Less to 2-space (#12602)
Reindent and unify codebase to 2-space indentation.
2020-08-25 22:48:53 +03:00
6543 c86478ec47 [UI] Sortable Tables Header By Click (#7980)
* [UI] Sortable Tables Header By Click

* get rid of padding above header

* restart CI

* fix lint

* convert getArrow JS to SortArrow go func

* addopt SortArrow funct

* suggestions from @silverwind - tablesort.js

Co-authored-by: silverwind <[email protected]>

* Update web_src/js/features/tablesort.js

Co-authored-by: silverwind <[email protected]>

* Update web_src/js/features/tablesort.js

Co-authored-by: silverwind <[email protected]>

Co-authored-by: silverwind <[email protected]>
2020-06-24 23:23:05 +01:00
zeripath fe2cacf5ea Properly truncate system notices (#11714)
* Properly truncate system notices

As noted in #11658 the system notifications list will always suffix
system notices with ... even when the notice is longer than 120
characters.

Instead we should use .text.truncate to auto truncate and make the
notices clickable to view their details.

Signed-off-by: Andrew Thornton <[email protected]>

* As per @CirnoT make table cell clickable

* ensure that pre wraps

Signed-off-by: Andrew Thornton <[email protected]>

Co-authored-by: techknowlogick <[email protected]>
2020-06-02 16:24:18 -04:00
John Olheiser bcd16cec63 Fix admin notices (#10480)
Signed-off-by: jolheiser <[email protected]>
2020-02-26 10:25:54 -06:00
John Olheiser e5944a9521 Change admin dashboard to POST (#10465)
* Add form and convert to POST

* Redirect for flash

Signed-off-by: jolheiser <[email protected]>
2020-02-25 16:54:13 -06:00
silverwind 4e912d2ed8 Disallow leading zeroes in Less (#10407) 2020-02-23 13:48:27 -03:00
Lunny Xiao e4e6d48e30 Move less from public/ to web_src/ so that it will not be packe… (#8908) 2019-11-12 10:22:16 +01:00