- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 6.2k
Move repository sub menu data loading to the shared file and only display license on repository home page #32686
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
4db395f
              d61ac5d
              3623a5c
              51f4ad8
              48731d4
              52bd341
              ffc5b6c
              File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| // Copyright 2024 The Gitea Authors. All rights reserved. | ||
| // SPDX-License-Identifier: MIT | ||
|  | ||
| package shared | ||
|  | ||
| import ( | ||
| repo_model "code.gitea.io/gitea/models/repo" | ||
| "code.gitea.io/gitea/services/context" | ||
| repo_service "code.gitea.io/gitea/services/repository" | ||
| ) | ||
|  | ||
| func PrepareForLicenses(ctx *context.Context) bool { | ||
| repoLicenses, err := repo_model.GetRepoLicenses(ctx, ctx.Repo.Repository) | ||
| if err != nil { | ||
| ctx.ServerError("GetRepoLicenses", err) | ||
| return false | ||
| } | ||
| ctx.Data["DetectedRepoLicenses"] = repoLicenses.StringList() | ||
| ctx.Data["LicenseFileName"] = repo_service.LicenseFileName | ||
|          | ||
| return true | ||
| } | ||

Uh oh!
There was an error while loading. Please reload this page.