diff --git a/models/repo_statistic.go b/models/repo_statistic.go index 02bc569b0..9184ab4ec 100755 --- a/models/repo_statistic.go +++ b/models/repo_statistic.go @@ -132,9 +132,9 @@ func GetRepoStatisticByDateAndRepoId(date string, repoId int64) (*RepoStatistic, } -func GetRepoStatisticByDate(date string) ([]*RepoStatistic, error) { +func GetRepoStatisticByDate(date string, repoId int64) ([]*RepoStatistic, error) { repoStatistics := make([]*RepoStatistic, 0) - err := xStatistic.Where("date = ?", date).Find(&repoStatistics) + err := xStatistic.Where("date = ? and repo_id=?", date, repoId).Find(&repoStatistics) return repoStatistics, err } diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index d29740037..a722ea671 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -755,6 +755,7 @@ unit_disabled = The site administrator has disabled this repository section. language_other = Other datasets = Datasets datasets.desc = Enable Dataset +cloudbrain_helper=Use GPU/NPU resources to open notebooks, model training tasks, etc. debug=Debug stop=Stop diff --git a/options/locale/locale_zh-CN.ini b/options/locale/locale_zh-CN.ini index bcc8a2ef6..e89c3dcde 100755 --- a/options/locale/locale_zh-CN.ini +++ b/options/locale/locale_zh-CN.ini @@ -757,6 +757,7 @@ unit_disabled=站点管理员已禁用此项目单元。 language_other=其它 datasets=数据集 datasets.desc=数据集功能 +cloudbrain_helper=使用GPU/NPU资源,开启Notebook、模型训练任务等 debug=调试 stop=停止 diff --git a/public/img/git-logo.svg b/public/img/git-logo.svg new file mode 100644 index 000000000..70e6ab484 --- /dev/null +++ b/public/img/git-logo.svg @@ -0,0 +1,41 @@ + + + + + + + + + + + + + diff --git a/routers/org/members.go b/routers/org/members.go old mode 100644 new mode 100755 diff --git a/routers/repo/repo_statistic.go b/routers/repo/repo_statistic.go index 2de22a1ee..6dbdc1ca2 100755 --- a/routers/repo/repo_statistic.go +++ b/routers/repo/repo_statistic.go @@ -115,7 +115,7 @@ func RepoStatisticDaily(date string) { } dayBeforeDate := t.AddDate(0, 0, -1).Format("2006-01-02") - repoStatisticsBefore, err := models.GetRepoStatisticByDate(dayBeforeDate) + repoStatisticsBefore, err := models.GetRepoStatisticByDate(dayBeforeDate, repo.ID) if err != nil { log.Error("get data of day before the date failed ", err) diff --git a/routers/repo/view.go b/routers/repo/view.go old mode 100644 new mode 100755 index 9477b27dd..f85ab07cf --- a/routers/repo/view.go +++ b/routers/repo/view.go @@ -243,6 +243,11 @@ func renderDirectory(ctx *context.Context, treeLink string) { ctx.Data["ReadmeInList"] = true ctx.Data["ReadmeExist"] = true ctx.Data["FileIsSymlink"] = readmeFile.isSymlink + ctx.Data["ReadmeName"] = readmeFile.name + + if ctx.Repo.CanEnableEditor() { + ctx.Data["CanEditFile"] = true + } dataRc, err := readmeFile.blob.DataAsync() if err != nil { diff --git a/routers/routes/routes.go b/routers/routes/routes.go index 7e7d0642a..a4b8f8aa1 100755 --- a/routers/routes/routes.go +++ b/routers/routes/routes.go @@ -311,7 +311,7 @@ func RegisterRoutes(m *macaron.Macaron) { m.Head("/", func() string { return "" }) - m.Get("/", routers.Dashboard) + m.Get("/", routers.Home) m.Get("/dashboard", routers.Dashboard) m.Group("/explore", func() { m.Get("", func(ctx *context.Context) { @@ -615,6 +615,11 @@ func RegisterRoutes(m *macaron.Macaron) { //reqRepoBlockChainWriter := context.RequireRepoWriter(models.UnitTypeBlockChain) // ***** START: Organization ***** + m.Group("/org", func() { + m.Group("/:org", func() { + m.Get("/members", org.Members) + }, context.OrgAssignment()) + }) m.Group("/org", func() { m.Group("", func() { m.Get("/create", org.Create) @@ -625,7 +630,7 @@ func RegisterRoutes(m *macaron.Macaron) { m.Get("/dashboard", user.Dashboard) m.Get("/^:type(issues|pulls)$", user.Issues) m.Get("/milestones", reqMilestonesDashboardPageEnabled, user.Milestones) - m.Get("/members", org.Members) + //m.Get("/members", org.Members) m.Post("/members/action/:action", org.MembersAction) m.Get("/teams", org.Teams) diff --git a/routers/user/auth.go b/routers/user/auth.go index 44c5ad97d..16af84b66 100755 --- a/routers/user/auth.go +++ b/routers/user/auth.go @@ -544,7 +544,7 @@ func handleSignInFull(ctx *context.Context, u *models.User, remember bool, obeyR if err := models.UpdateUserCols(u, "language"); err != nil { log.Error(fmt.Sprintf("Error updating user language [user: %d, locale: %s]", u.ID, u.Language)) - return setting.AppSubURL + "/" + return setting.AppSubURL + "/dashboard" } } else { // Language setting of the user use the one previously set @@ -562,7 +562,7 @@ func handleSignInFull(ctx *context.Context, u *models.User, remember bool, obeyR u.SetLastLogin() if err := models.UpdateUserCols(u, "last_login_unix"); err != nil { ctx.ServerError("UpdateUserCols", err) - return setting.AppSubURL + "/" + return setting.AppSubURL + "/dashboard" } if redirectTo := ctx.GetCookie("redirect_to"); len(redirectTo) > 0 && !util.IsExternalURL(redirectTo) { @@ -574,9 +574,9 @@ func handleSignInFull(ctx *context.Context, u *models.User, remember bool, obeyR } if obeyRedirect { - ctx.Redirect(setting.AppSubURL + "/") + ctx.Redirect(setting.AppSubURL + "/dashboard") } - return setting.AppSubURL + "/" + return setting.AppSubURL + "/dashboard" } // SignInOAuth handles the OAuth2 login buttons diff --git a/templates/base/head_navbar.tmpl b/templates/base/head_navbar.tmpl index c22cb9fa7..57df408c9 100755 --- a/templates/base/head_navbar.tmpl +++ b/templates/base/head_navbar.tmpl @@ -7,6 +7,14 @@ +
+
+ + + +
+ + {{if .IsSigned}} {{.i18n.Tr "index"}} diff --git a/templates/org/home.tmpl b/templates/org/home.tmpl old mode 100644 new mode 100755 index a81e8ac17..ad5a8e02d --- a/templates/org/home.tmpl +++ b/templates/org/home.tmpl @@ -38,11 +38,12 @@

{{.i18n.Tr "org.people"}} - {{if .IsOrganizationMember}} - - {{end}} + + + +

{{$isMember := .IsOrganizationMember}} diff --git a/templates/org/navber.tmpl b/templates/org/navber.tmpl index 9ff92845e..7bb2ff69c 100755 --- a/templates/org/navber.tmpl +++ b/templates/org/navber.tmpl @@ -3,10 +3,10 @@ {{svg "octicon-home" 16}} {{$.i18n.Tr "org.home"}} + + {{svg "octicon-organization" 16}} {{$.i18n.Tr "org.people"}} + {{if or ($.IsOrganizationMember) ($.IsOrganizationOwner)}} - - {{svg "octicon-organization" 16}} {{$.i18n.Tr "org.people"}} - {{svg "octicon-jersey" 16}} {{$.i18n.Tr "org.teams"}} @@ -23,10 +23,10 @@ {{svg "octicon-home" 16}} {{$.i18n.Tr "org.home"}} {{end}} + + {{svg "octicon-organization" 16}} {{$.i18n.Tr "org.people"}} + {{if or ($.IsOrganizationMember) ($.IsOrganizationOwner)}} - - {{svg "octicon-organization" 16}} {{$.i18n.Tr "org.people"}} - {{svg "octicon-jersey" 16}} {{$.i18n.Tr "org.teams"}} diff --git a/templates/repo/activity.tmpl b/templates/repo/activity.tmpl index 41f6be643..58da09e90 100644 --- a/templates/repo/activity.tmpl +++ b/templates/repo/activity.tmpl @@ -2,8 +2,18 @@
{{template "repo/header" .}}
-

{{.DateFrom}} - {{.DateUntil}} -
+
+
+ +
+
+ {{.DateFrom}} - {{.DateUntil}} +
+
-

+
{{if (or (.Permission.CanRead $.UnitTypeIssues) (.Permission.CanRead $.UnitTypePullRequests))}} diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl index c290de552..6dc4d8ee5 100755 --- a/templates/repo/header.tmpl +++ b/templates/repo/header.tmpl @@ -92,16 +92,27 @@ {{if not .Repository.IsBeingCreated}}