mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-25 11:22:16 +00:00
Fix implementation of repo Home func (#2601)
* Fix implementation of repo Home func * Make fixture changes for testing
This commit is contained in:
parent
bae9cbce9c
commit
1ad902d529
3 changed files with 46 additions and 33 deletions
|
@ -1,43 +1,43 @@
|
|||
-
|
||||
id: 1
|
||||
repo_id: 1
|
||||
type: 1
|
||||
index: 0
|
||||
config: "{}"
|
||||
created_unix: 946684810
|
||||
|
||||
-
|
||||
id: 2
|
||||
repo_id: 1
|
||||
type: 2
|
||||
index: 1
|
||||
config: "{\"EnableTimetracker\":true,\"AllowOnlyContributorsToTrackTime\":true}"
|
||||
created_unix: 946684810
|
||||
|
||||
-
|
||||
id: 3
|
||||
repo_id: 1
|
||||
type: 3
|
||||
index: 2
|
||||
config: "{}"
|
||||
created_unix: 946684810
|
||||
|
||||
-
|
||||
id: 4
|
||||
repo_id: 1
|
||||
type: 4
|
||||
index: 3
|
||||
config: "{}"
|
||||
created_unix: 946684810
|
||||
|
||||
-
|
||||
id: 5
|
||||
id: 2
|
||||
repo_id: 1
|
||||
type: 5
|
||||
index: 4
|
||||
config: "{}"
|
||||
created_unix: 946684810
|
||||
|
||||
-
|
||||
id: 3
|
||||
repo_id: 1
|
||||
type: 1
|
||||
index: 0
|
||||
config: "{}"
|
||||
created_unix: 946684810
|
||||
|
||||
-
|
||||
id: 4
|
||||
repo_id: 1
|
||||
type: 2
|
||||
index: 1
|
||||
config: "{\"EnableTimetracker\":true,\"AllowOnlyContributorsToTrackTime\":true}"
|
||||
created_unix: 946684810
|
||||
|
||||
-
|
||||
id: 5
|
||||
repo_id: 1
|
||||
type: 3
|
||||
index: 2
|
||||
config: "{}"
|
||||
created_unix: 946684810
|
||||
|
||||
-
|
||||
id: 6
|
||||
repo_id: 3
|
||||
|
|
|
@ -60,6 +60,14 @@ func (u *Unit) CanDisable() bool {
|
|||
return true
|
||||
}
|
||||
|
||||
// IsLessThan compares order of two units
|
||||
func (u Unit) IsLessThan(unit Unit) bool {
|
||||
if (u.Type == UnitTypeExternalTracker || u.Type == UnitTypeExternalWiki) && unit.Type != UnitTypeExternalTracker && unit.Type != UnitTypeExternalWiki {
|
||||
return false
|
||||
}
|
||||
return u.Idx < unit.Idx
|
||||
}
|
||||
|
||||
// Enumerate all the units
|
||||
var (
|
||||
UnitCode = Unit{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue