mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-30 23:53:52 +03:00
Feature: Archive repos (#5009)
This commit is contained in:
parent
6ad834e236
commit
0b510725c9
30 changed files with 437 additions and 244 deletions
|
@ -188,6 +188,7 @@ type Repository struct {
|
||||||
|
|
||||||
IsPrivate bool `xorm:"INDEX"`
|
IsPrivate bool `xorm:"INDEX"`
|
||||||
IsEmpty bool `xorm:"INDEX"`
|
IsEmpty bool `xorm:"INDEX"`
|
||||||
|
IsArchived bool `xorm:"INDEX"`
|
||||||
|
|
||||||
IsMirror bool `xorm:"INDEX"`
|
IsMirror bool `xorm:"INDEX"`
|
||||||
*Mirror `xorm:"-"`
|
*Mirror `xorm:"-"`
|
||||||
|
@ -292,6 +293,7 @@ func (repo *Repository) innerAPIFormat(e Engine, mode AccessMode, isParent bool)
|
||||||
Description: repo.Description,
|
Description: repo.Description,
|
||||||
Private: repo.IsPrivate,
|
Private: repo.IsPrivate,
|
||||||
Empty: repo.IsEmpty,
|
Empty: repo.IsEmpty,
|
||||||
|
Archived: repo.IsArchived,
|
||||||
Size: int(repo.Size / 1024),
|
Size: int(repo.Size / 1024),
|
||||||
Fork: repo.IsFork,
|
Fork: repo.IsFork,
|
||||||
Parent: parent,
|
Parent: parent,
|
||||||
|
@ -2341,6 +2343,13 @@ func CheckRepoStats() {
|
||||||
// ***** END: Repository.NumForks *****
|
// ***** END: Repository.NumForks *****
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetArchiveRepoState sets if a repo is archived
|
||||||
|
func (repo *Repository) SetArchiveRepoState(isArchived bool) (err error) {
|
||||||
|
repo.IsArchived = isArchived
|
||||||
|
_, err = x.Where("id = ?", repo.ID).Cols("is_archived").Update(repo)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// ___________ __
|
// ___________ __
|
||||||
// \_ _____/__________| | __
|
// \_ _____/__________| | __
|
||||||
// | __)/ _ \_ __ \ |/ /
|
// | __)/ _ \_ __ \ |/ /
|
||||||
|
|
|
@ -117,6 +117,7 @@ type RepoSettingForm struct {
|
||||||
EnableTimetracker bool
|
EnableTimetracker bool
|
||||||
AllowOnlyContributorsToTrackTime bool
|
AllowOnlyContributorsToTrackTime bool
|
||||||
EnableIssueDependencies bool
|
EnableIssueDependencies bool
|
||||||
|
IsArchived bool
|
||||||
|
|
||||||
// Admin settings
|
// Admin settings
|
||||||
EnableHealthCheck bool
|
EnableHealthCheck bool
|
||||||
|
|
|
@ -56,7 +56,7 @@ type Repository struct {
|
||||||
|
|
||||||
// CanEnableEditor returns true if repository is editable and user has proper access level.
|
// CanEnableEditor returns true if repository is editable and user has proper access level.
|
||||||
func (r *Repository) CanEnableEditor() bool {
|
func (r *Repository) CanEnableEditor() bool {
|
||||||
return r.Permission.CanWrite(models.UnitTypeCode) && r.Repository.CanEnableEditor() && r.IsViewBranch
|
return r.Permission.CanWrite(models.UnitTypeCode) && r.Repository.CanEnableEditor() && r.IsViewBranch && !r.Repository.IsArchived
|
||||||
}
|
}
|
||||||
|
|
||||||
// CanCreateBranch returns true if repository is editable and user has proper access level.
|
// CanCreateBranch returns true if repository is editable and user has proper access level.
|
||||||
|
@ -64,6 +64,15 @@ func (r *Repository) CanCreateBranch() bool {
|
||||||
return r.Permission.CanWrite(models.UnitTypeCode) && r.Repository.CanCreateBranch()
|
return r.Permission.CanWrite(models.UnitTypeCode) && r.Repository.CanCreateBranch()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// RepoMustNotBeArchived checks if a repo is archived
|
||||||
|
func RepoMustNotBeArchived() macaron.Handler {
|
||||||
|
return func(ctx *Context) {
|
||||||
|
if ctx.Repo.Repository.IsArchived {
|
||||||
|
ctx.NotFound("IsArchived", fmt.Errorf(ctx.Tr("repo.archive.title")))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// CanCommitToBranch returns true if repository is editable and user has proper access level
|
// CanCommitToBranch returns true if repository is editable and user has proper access level
|
||||||
// and branch is not protected for push
|
// and branch is not protected for push
|
||||||
func (r *Repository) CanCommitToBranch(doer *models.User) (bool, error) {
|
func (r *Repository) CanCommitToBranch(doer *models.User) (bool, error) {
|
||||||
|
|
|
@ -542,6 +542,10 @@ forks = Forks
|
||||||
pick_reaction = Pick your reaction
|
pick_reaction = Pick your reaction
|
||||||
reactions_more = and %d more
|
reactions_more = and %d more
|
||||||
|
|
||||||
|
archive.title = This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
|
||||||
|
archive.issue.nocomment = This repo is archived. You cannot comment on issues.
|
||||||
|
archive.pull.nocomment = This repo is archived. You cannot comment on pull requests.
|
||||||
|
|
||||||
form.reach_limit_of_creation = You have already reached your limit of %d repositories.
|
form.reach_limit_of_creation = You have already reached your limit of %d repositories.
|
||||||
form.name_reserved = The repository name '%s' is reserved.
|
form.name_reserved = The repository name '%s' is reserved.
|
||||||
form.name_pattern_not_allowed = The pattern '%s' is not allowed in a repository name.
|
form.name_pattern_not_allowed = The pattern '%s' is not allowed in a repository name.
|
||||||
|
@ -1176,6 +1180,18 @@ settings.choose_branch = Choose a branch…
|
||||||
settings.no_protected_branch = There are no protected branches.
|
settings.no_protected_branch = There are no protected branches.
|
||||||
settings.edit_protected_branch = Edit
|
settings.edit_protected_branch = Edit
|
||||||
settings.protected_branch_required_approvals_min = Required approvals cannot be negative.
|
settings.protected_branch_required_approvals_min = Required approvals cannot be negative.
|
||||||
|
settings.archive.button = Archive Repo
|
||||||
|
settings.archive.header = Archive This Repo
|
||||||
|
settings.archive.text = Archiving the repo will make it entirely read-only. It is hidden from the dashboard, cannot be committed to and no issues or pull-requests can be created.
|
||||||
|
settings.archive.success = The repo was successfully archived.
|
||||||
|
settings.archive.error = An error occured while trying to archive the repo. See the log for more details.
|
||||||
|
settings.archive.error_ismirror = You cannot archive a mirrored repo.
|
||||||
|
settings.archive.branchsettings_unavailable = Branch settings are not available if the repo is archived.
|
||||||
|
settings.unarchive.button = Un-Archive Repo
|
||||||
|
settings.unarchive.header = Un-Archive This Repo
|
||||||
|
settings.unarchive.text = Un-Archiving the repo will restore its ability to recieve commits and pushes, as well as new issues and pull-requests.
|
||||||
|
settings.unarchive.success = The repo was successfully un-archived.
|
||||||
|
settings.unarchive.error = An error occured while trying to un-archive the repo. See the log for more details.
|
||||||
|
|
||||||
diff.browse_source = Browse Source
|
diff.browse_source = Browse Source
|
||||||
diff.parent = parent
|
diff.parent = parent
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -629,3 +629,11 @@ footer {
|
||||||
.heatmap-color-5 {
|
.heatmap-color-5 {
|
||||||
background-color: #2f6b1b;
|
background-color: #2f6b1b;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.archived-icon{
|
||||||
|
color: lighten(#000, 70%) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.archived-icon{
|
||||||
|
color: lighten(#000, 70%) !important;
|
||||||
|
}
|
||||||
|
|
|
@ -95,6 +95,12 @@ func HTTP(ctx *context.Context) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Don't allow pushing if the repo is archived
|
||||||
|
if repo.IsArchived && !isPull {
|
||||||
|
ctx.HandleText(http.StatusForbidden, "This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// Only public pull don't need auth.
|
// Only public pull don't need auth.
|
||||||
isPublicPull := !repo.IsPrivate && isPull
|
isPublicPull := !repo.IsPrivate && isPull
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -67,7 +67,7 @@ func Releases(ctx *context.Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
writeAccess := ctx.Repo.CanWrite(models.UnitTypeReleases)
|
writeAccess := ctx.Repo.CanWrite(models.UnitTypeReleases)
|
||||||
ctx.Data["CanCreateRelease"] = writeAccess
|
ctx.Data["CanCreateRelease"] = writeAccess && !ctx.Repo.Repository.IsArchived
|
||||||
|
|
||||||
opts := models.FindReleasesOptions{
|
opts := models.FindReleasesOptions{
|
||||||
IncludeDrafts: writeAccess,
|
IncludeDrafts: writeAccess,
|
||||||
|
|
|
@ -354,6 +354,47 @@ func SettingsPost(ctx *context.Context, form auth.RepoSettingForm) {
|
||||||
ctx.Flash.Success(ctx.Tr("repo.settings.wiki_deletion_success"))
|
ctx.Flash.Success(ctx.Tr("repo.settings.wiki_deletion_success"))
|
||||||
ctx.Redirect(ctx.Repo.RepoLink + "/settings")
|
ctx.Redirect(ctx.Repo.RepoLink + "/settings")
|
||||||
|
|
||||||
|
case "archive":
|
||||||
|
if !ctx.Repo.IsOwner() {
|
||||||
|
ctx.Error(403)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if repo.IsMirror {
|
||||||
|
ctx.Flash.Error(ctx.Tr("repo.settings.archive.error_ismirror"))
|
||||||
|
ctx.Redirect(ctx.Repo.RepoLink + "/settings")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := repo.SetArchiveRepoState(true); err != nil {
|
||||||
|
log.Error(4, "Tried to archive a repo: %s", err)
|
||||||
|
ctx.Flash.Error(ctx.Tr("repo.settings.archive.error"))
|
||||||
|
ctx.Redirect(ctx.Repo.RepoLink + "/settings")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
ctx.Flash.Success(ctx.Tr("repo.settings.archive.success"))
|
||||||
|
|
||||||
|
log.Trace("Repository was archived: %s/%s", ctx.Repo.Owner.Name, repo.Name)
|
||||||
|
ctx.Redirect(ctx.Repo.RepoLink + "/settings")
|
||||||
|
case "unarchive":
|
||||||
|
if !ctx.Repo.IsOwner() {
|
||||||
|
ctx.Error(403)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := repo.SetArchiveRepoState(false); err != nil {
|
||||||
|
log.Error(4, "Tried to unarchive a repo: %s", err)
|
||||||
|
ctx.Flash.Error(ctx.Tr("repo.settings.unarchive.error"))
|
||||||
|
ctx.Redirect(ctx.Repo.RepoLink + "/settings")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
ctx.Flash.Success(ctx.Tr("repo.settings.unarchive.success"))
|
||||||
|
|
||||||
|
log.Trace("Repository was un-archived: %s/%s", ctx.Repo.Owner.Name, repo.Name)
|
||||||
|
ctx.Redirect(ctx.Repo.RepoLink + "/settings")
|
||||||
|
|
||||||
default:
|
default:
|
||||||
ctx.NotFound("", nil)
|
ctx.NotFound("", nil)
|
||||||
}
|
}
|
||||||
|
|
|
@ -151,8 +151,8 @@ func renderDirectory(ctx *context.Context, treeLink string) {
|
||||||
|
|
||||||
// Check permission to add or upload new file.
|
// Check permission to add or upload new file.
|
||||||
if ctx.Repo.CanWrite(models.UnitTypeCode) && ctx.Repo.IsViewBranch {
|
if ctx.Repo.CanWrite(models.UnitTypeCode) && ctx.Repo.IsViewBranch {
|
||||||
ctx.Data["CanAddFile"] = true
|
ctx.Data["CanAddFile"] = !ctx.Repo.Repository.IsArchived
|
||||||
ctx.Data["CanUploadFile"] = setting.Repository.Upload.Enabled
|
ctx.Data["CanUploadFile"] = setting.Repository.Upload.Enabled && !ctx.Repo.Repository.IsArchived
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -203,7 +203,7 @@ func renderWikiPage(ctx *context.Context, isViewPage bool) (*git.Repository, *gi
|
||||||
// Wiki renders single wiki page
|
// Wiki renders single wiki page
|
||||||
func Wiki(ctx *context.Context) {
|
func Wiki(ctx *context.Context) {
|
||||||
ctx.Data["PageIsWiki"] = true
|
ctx.Data["PageIsWiki"] = true
|
||||||
ctx.Data["CanWriteWiki"] = ctx.Repo.CanWrite(models.UnitTypeWiki)
|
ctx.Data["CanWriteWiki"] = ctx.Repo.CanWrite(models.UnitTypeWiki) && !ctx.Repo.Repository.IsArchived
|
||||||
|
|
||||||
if !ctx.Repo.Repository.HasWiki() {
|
if !ctx.Repo.Repository.HasWiki() {
|
||||||
ctx.Data["Title"] = ctx.Tr("repo.wiki")
|
ctx.Data["Title"] = ctx.Tr("repo.wiki")
|
||||||
|
@ -246,7 +246,7 @@ func WikiPages(ctx *context.Context) {
|
||||||
|
|
||||||
ctx.Data["Title"] = ctx.Tr("repo.wiki.pages")
|
ctx.Data["Title"] = ctx.Tr("repo.wiki.pages")
|
||||||
ctx.Data["PageIsWiki"] = true
|
ctx.Data["PageIsWiki"] = true
|
||||||
ctx.Data["CanWriteWiki"] = ctx.Repo.CanWrite(models.UnitTypeWiki)
|
ctx.Data["CanWriteWiki"] = ctx.Repo.CanWrite(models.UnitTypeWiki) && !ctx.Repo.Repository.IsArchived
|
||||||
|
|
||||||
wikiRepo, commit, err := findWikiRepoCommit(ctx)
|
wikiRepo, commit, err := findWikiRepoCommit(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -492,7 +492,7 @@ func RegisterRoutes(m *macaron.Macaron) {
|
||||||
m.Group("/branches", func() {
|
m.Group("/branches", func() {
|
||||||
m.Combo("").Get(repo.ProtectedBranch).Post(repo.ProtectedBranchPost)
|
m.Combo("").Get(repo.ProtectedBranch).Post(repo.ProtectedBranchPost)
|
||||||
m.Combo("/*").Get(repo.SettingsProtectedBranch).
|
m.Combo("/*").Get(repo.SettingsProtectedBranch).
|
||||||
Post(bindIgnErr(auth.ProtectBranchForm{}), repo.SettingsProtectedBranchPost)
|
Post(bindIgnErr(auth.ProtectBranchForm{}), context.RepoMustNotBeArchived(), repo.SettingsProtectedBranchPost)
|
||||||
}, repo.MustBeNotEmpty)
|
}, repo.MustBeNotEmpty)
|
||||||
|
|
||||||
m.Group("/hooks", func() {
|
m.Group("/hooks", func() {
|
||||||
|
@ -530,13 +530,13 @@ func RegisterRoutes(m *macaron.Macaron) {
|
||||||
})
|
})
|
||||||
}, reqSignIn, context.RepoAssignment(), reqRepoAdmin, context.UnitTypes(), context.RepoRef())
|
}, reqSignIn, context.RepoAssignment(), reqRepoAdmin, context.UnitTypes(), context.RepoRef())
|
||||||
|
|
||||||
m.Get("/:username/:reponame/action/:action", reqSignIn, context.RepoAssignment(), repo.Action)
|
m.Get("/:username/:reponame/action/:action", reqSignIn, context.RepoAssignment(), context.RepoMustNotBeArchived(), repo.Action)
|
||||||
|
|
||||||
m.Group("/:username/:reponame", func() {
|
m.Group("/:username/:reponame", func() {
|
||||||
m.Group("/issues", func() {
|
m.Group("/issues", func() {
|
||||||
m.Combo("/new").Get(context.RepoRef(), repo.NewIssue).
|
m.Combo("/new").Get(context.RepoRef(), repo.NewIssue).
|
||||||
Post(bindIgnErr(auth.CreateIssueForm{}), repo.NewIssuePost)
|
Post(bindIgnErr(auth.CreateIssueForm{}), repo.NewIssuePost)
|
||||||
}, reqRepoIssueReader)
|
}, context.RepoMustNotBeArchived(), reqRepoIssueReader)
|
||||||
// FIXME: should use different URLs but mostly same logic for comments of issue and pull reuqest.
|
// FIXME: should use different URLs but mostly same logic for comments of issue and pull reuqest.
|
||||||
// So they can apply their own enable/disable logic on routers.
|
// So they can apply their own enable/disable logic on routers.
|
||||||
m.Group("/issues", func() {
|
m.Group("/issues", func() {
|
||||||
|
@ -557,24 +557,24 @@ func RegisterRoutes(m *macaron.Macaron) {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
m.Post("/reactions/:action", bindIgnErr(auth.ReactionForm{}), repo.ChangeIssueReaction)
|
m.Post("/reactions/:action", bindIgnErr(auth.ReactionForm{}), repo.ChangeIssueReaction)
|
||||||
})
|
}, context.RepoMustNotBeArchived())
|
||||||
|
|
||||||
m.Post("/labels", reqRepoIssuesOrPullsWriter, repo.UpdateIssueLabel)
|
m.Post("/labels", reqRepoIssuesOrPullsWriter, repo.UpdateIssueLabel)
|
||||||
m.Post("/milestone", reqRepoIssuesOrPullsWriter, repo.UpdateIssueMilestone)
|
m.Post("/milestone", reqRepoIssuesOrPullsWriter, repo.UpdateIssueMilestone)
|
||||||
m.Post("/assignee", reqRepoIssuesOrPullsWriter, repo.UpdateIssueAssignee)
|
m.Post("/assignee", reqRepoIssuesOrPullsWriter, repo.UpdateIssueAssignee)
|
||||||
m.Post("/status", reqRepoIssuesOrPullsWriter, repo.UpdateIssueStatus)
|
m.Post("/status", reqRepoIssuesOrPullsWriter, repo.UpdateIssueStatus)
|
||||||
})
|
}, context.RepoMustNotBeArchived())
|
||||||
m.Group("/comments/:id", func() {
|
m.Group("/comments/:id", func() {
|
||||||
m.Post("", repo.UpdateCommentContent)
|
m.Post("", repo.UpdateCommentContent)
|
||||||
m.Post("/delete", repo.DeleteComment)
|
m.Post("/delete", repo.DeleteComment)
|
||||||
m.Post("/reactions/:action", bindIgnErr(auth.ReactionForm{}), repo.ChangeCommentReaction)
|
m.Post("/reactions/:action", bindIgnErr(auth.ReactionForm{}), repo.ChangeCommentReaction)
|
||||||
})
|
}, context.RepoMustNotBeArchived())
|
||||||
m.Group("/labels", func() {
|
m.Group("/labels", func() {
|
||||||
m.Post("/new", bindIgnErr(auth.CreateLabelForm{}), repo.NewLabel)
|
m.Post("/new", bindIgnErr(auth.CreateLabelForm{}), repo.NewLabel)
|
||||||
m.Post("/edit", bindIgnErr(auth.CreateLabelForm{}), repo.UpdateLabel)
|
m.Post("/edit", bindIgnErr(auth.CreateLabelForm{}), repo.UpdateLabel)
|
||||||
m.Post("/delete", repo.DeleteLabel)
|
m.Post("/delete", repo.DeleteLabel)
|
||||||
m.Post("/initialize", bindIgnErr(auth.InitializeLabelsForm{}), repo.InitializeLabels)
|
m.Post("/initialize", bindIgnErr(auth.InitializeLabelsForm{}), repo.InitializeLabels)
|
||||||
}, reqRepoIssuesOrPullsWriter, context.RepoRef())
|
}, context.RepoMustNotBeArchived(), reqRepoIssuesOrPullsWriter, context.RepoRef())
|
||||||
m.Group("/milestones", func() {
|
m.Group("/milestones", func() {
|
||||||
m.Combo("/new").Get(repo.NewMilestone).
|
m.Combo("/new").Get(repo.NewMilestone).
|
||||||
Post(bindIgnErr(auth.CreateMilestoneForm{}), repo.NewMilestonePost)
|
Post(bindIgnErr(auth.CreateMilestoneForm{}), repo.NewMilestonePost)
|
||||||
|
@ -582,7 +582,7 @@ func RegisterRoutes(m *macaron.Macaron) {
|
||||||
m.Post("/:id/edit", bindIgnErr(auth.CreateMilestoneForm{}), repo.EditMilestonePost)
|
m.Post("/:id/edit", bindIgnErr(auth.CreateMilestoneForm{}), repo.EditMilestonePost)
|
||||||
m.Get("/:id/:action", repo.ChangeMilestonStatus)
|
m.Get("/:id/:action", repo.ChangeMilestonStatus)
|
||||||
m.Post("/delete", repo.DeleteMilestone)
|
m.Post("/delete", repo.DeleteMilestone)
|
||||||
}, reqRepoIssuesOrPullsWriter, context.RepoRef())
|
}, context.RepoMustNotBeArchived(), reqRepoIssuesOrPullsWriter, context.RepoRef())
|
||||||
m.Group("/milestone", func() {
|
m.Group("/milestone", func() {
|
||||||
m.Get("/:id", repo.MilestoneIssuesAndPulls)
|
m.Get("/:id", repo.MilestoneIssuesAndPulls)
|
||||||
}, reqRepoIssuesOrPullsWriter, context.RepoRef())
|
}, reqRepoIssuesOrPullsWriter, context.RepoRef())
|
||||||
|
@ -607,7 +607,7 @@ func RegisterRoutes(m *macaron.Macaron) {
|
||||||
m.Post("/upload-file", repo.UploadFileToServer)
|
m.Post("/upload-file", repo.UploadFileToServer)
|
||||||
m.Post("/upload-remove", bindIgnErr(auth.RemoveUploadFileForm{}), repo.RemoveUploadFileFromServer)
|
m.Post("/upload-remove", bindIgnErr(auth.RemoveUploadFileForm{}), repo.RemoveUploadFileFromServer)
|
||||||
}, context.RepoRef(), repo.MustBeEditable, repo.MustBeAbleToUpload)
|
}, context.RepoRef(), repo.MustBeEditable, repo.MustBeAbleToUpload)
|
||||||
}, reqRepoCodeWriter, repo.MustBeNotEmpty)
|
}, context.RepoMustNotBeArchived(), reqRepoCodeWriter, repo.MustBeNotEmpty)
|
||||||
|
|
||||||
m.Group("/branches", func() {
|
m.Group("/branches", func() {
|
||||||
m.Group("/_new/", func() {
|
m.Group("/_new/", func() {
|
||||||
|
@ -617,7 +617,7 @@ func RegisterRoutes(m *macaron.Macaron) {
|
||||||
}, bindIgnErr(auth.NewBranchForm{}))
|
}, bindIgnErr(auth.NewBranchForm{}))
|
||||||
m.Post("/delete", repo.DeleteBranchPost)
|
m.Post("/delete", repo.DeleteBranchPost)
|
||||||
m.Post("/restore", repo.RestoreBranchPost)
|
m.Post("/restore", repo.RestoreBranchPost)
|
||||||
}, reqRepoCodeWriter, repo.MustBeNotEmpty)
|
}, context.RepoMustNotBeArchived(), reqRepoCodeWriter, repo.MustBeNotEmpty)
|
||||||
|
|
||||||
}, reqSignIn, context.RepoAssignment(), context.UnitTypes())
|
}, reqSignIn, context.RepoAssignment(), context.UnitTypes())
|
||||||
|
|
||||||
|
@ -630,11 +630,11 @@ func RegisterRoutes(m *macaron.Macaron) {
|
||||||
m.Get("/new", repo.NewRelease)
|
m.Get("/new", repo.NewRelease)
|
||||||
m.Post("/new", bindIgnErr(auth.NewReleaseForm{}), repo.NewReleasePost)
|
m.Post("/new", bindIgnErr(auth.NewReleaseForm{}), repo.NewReleasePost)
|
||||||
m.Post("/delete", repo.DeleteRelease)
|
m.Post("/delete", repo.DeleteRelease)
|
||||||
}, reqSignIn, repo.MustBeNotEmpty, reqRepoReleaseWriter, context.RepoRef())
|
}, reqSignIn, repo.MustBeNotEmpty, context.RepoMustNotBeArchived(), reqRepoReleaseWriter, context.RepoRef())
|
||||||
m.Group("/releases", func() {
|
m.Group("/releases", func() {
|
||||||
m.Get("/edit/*", repo.EditRelease)
|
m.Get("/edit/*", repo.EditRelease)
|
||||||
m.Post("/edit/*", bindIgnErr(auth.EditReleaseForm{}), repo.EditReleasePost)
|
m.Post("/edit/*", bindIgnErr(auth.EditReleaseForm{}), repo.EditReleasePost)
|
||||||
}, reqSignIn, repo.MustBeNotEmpty, reqRepoReleaseWriter, func(ctx *context.Context) {
|
}, reqSignIn, repo.MustBeNotEmpty, context.RepoMustNotBeArchived(), reqRepoReleaseWriter, func(ctx *context.Context) {
|
||||||
var err error
|
var err error
|
||||||
ctx.Repo.Commit, err = ctx.Repo.GitRepo.GetBranchCommit(ctx.Repo.Repository.DefaultBranch)
|
ctx.Repo.Commit, err = ctx.Repo.GitRepo.GetBranchCommit(ctx.Repo.Repository.DefaultBranch)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -652,7 +652,7 @@ func RegisterRoutes(m *macaron.Macaron) {
|
||||||
|
|
||||||
m.Group("/:username/:reponame", func() {
|
m.Group("/:username/:reponame", func() {
|
||||||
m.Post("/topics", repo.TopicsPost)
|
m.Post("/topics", repo.TopicsPost)
|
||||||
}, context.RepoAssignment(), reqRepoAdmin)
|
}, context.RepoMustNotBeArchived(), context.RepoAssignment(), reqRepoAdmin)
|
||||||
|
|
||||||
m.Group("/:username/:reponame", func() {
|
m.Group("/:username/:reponame", func() {
|
||||||
m.Group("", func() {
|
m.Group("", func() {
|
||||||
|
@ -672,7 +672,7 @@ func RegisterRoutes(m *macaron.Macaron) {
|
||||||
m.Combo("/:page/_edit").Get(repo.EditWiki).
|
m.Combo("/:page/_edit").Get(repo.EditWiki).
|
||||||
Post(bindIgnErr(auth.NewWikiForm{}), repo.EditWikiPost)
|
Post(bindIgnErr(auth.NewWikiForm{}), repo.EditWikiPost)
|
||||||
m.Post("/:page/delete", repo.DeleteWikiPagePost)
|
m.Post("/:page/delete", repo.DeleteWikiPagePost)
|
||||||
}, reqSignIn, reqRepoWikiWriter)
|
}, context.RepoMustNotBeArchived(), reqSignIn, reqRepoWikiWriter)
|
||||||
}, repo.MustEnableWiki, context.RepoRef())
|
}, repo.MustEnableWiki, context.RepoRef())
|
||||||
|
|
||||||
m.Group("/wiki", func() {
|
m.Group("/wiki", func() {
|
||||||
|
@ -694,14 +694,14 @@ func RegisterRoutes(m *macaron.Macaron) {
|
||||||
m.Get(".diff", repo.DownloadPullDiff)
|
m.Get(".diff", repo.DownloadPullDiff)
|
||||||
m.Get(".patch", repo.DownloadPullPatch)
|
m.Get(".patch", repo.DownloadPullPatch)
|
||||||
m.Get("/commits", context.RepoRef(), repo.ViewPullCommits)
|
m.Get("/commits", context.RepoRef(), repo.ViewPullCommits)
|
||||||
m.Post("/merge", reqRepoPullsWriter, bindIgnErr(auth.MergePullRequestForm{}), repo.MergePullRequest)
|
m.Post("/merge", context.RepoMustNotBeArchived(), reqRepoPullsWriter, bindIgnErr(auth.MergePullRequestForm{}), repo.MergePullRequest)
|
||||||
m.Post("/cleanup", context.RepoRef(), repo.CleanUpPullRequest)
|
m.Post("/cleanup", context.RepoMustNotBeArchived(), context.RepoRef(), repo.CleanUpPullRequest)
|
||||||
m.Group("/files", func() {
|
m.Group("/files", func() {
|
||||||
m.Get("", context.RepoRef(), repo.SetEditorconfigIfExists, repo.SetDiffViewStyle, repo.SetWhitespaceBehavior, repo.ViewPullFiles)
|
m.Get("", context.RepoRef(), repo.SetEditorconfigIfExists, repo.SetDiffViewStyle, repo.SetWhitespaceBehavior, repo.ViewPullFiles)
|
||||||
m.Group("/reviews", func() {
|
m.Group("/reviews", func() {
|
||||||
m.Post("/comments", bindIgnErr(auth.CodeCommentForm{}), repo.CreateCodeComment)
|
m.Post("/comments", bindIgnErr(auth.CodeCommentForm{}), repo.CreateCodeComment)
|
||||||
m.Post("/submit", bindIgnErr(auth.SubmitReviewForm{}), repo.SubmitReview)
|
m.Post("/submit", bindIgnErr(auth.SubmitReviewForm{}), repo.SubmitReview)
|
||||||
})
|
}, context.RepoMustNotBeArchived())
|
||||||
})
|
})
|
||||||
}, repo.MustAllowPulls)
|
}, repo.MustAllowPulls)
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,10 @@
|
||||||
{{range .Repos}}
|
{{range .Repos}}
|
||||||
<div class="item">
|
<div class="item">
|
||||||
<div class="ui header">
|
<div class="ui header">
|
||||||
<a class="name" href="{{.Link}}">{{if or $.PageIsExplore $.PageIsProfileStarList }}{{if .Owner}}{{.Owner.Name}} / {{end}}{{end}}{{.Name}}</a>
|
<a class="name" href="{{.Link}}">
|
||||||
|
{{if or $.PageIsExplore $.PageIsProfileStarList }}{{if .Owner}}{{.Owner.Name}} / {{end}}{{end}}{{.Name}}
|
||||||
|
{{if .IsArchived}}<i class="archive icon archived-icon"></i>{{end}}
|
||||||
|
</a>
|
||||||
{{if .IsPrivate}}
|
{{if .IsPrivate}}
|
||||||
<span class="text gold"><i class="octicon octicon-lock"></i></span>
|
<span class="text gold"><i class="octicon octicon-lock"></i></span>
|
||||||
{{else if .IsFork}}
|
{{else if .IsFork}}
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
<a class="ui tiny basic toggle button" href="?style={{if .IsSplitStyle}}unified{{else}}split{{end}}">{{ if .IsSplitStyle }}{{.i18n.Tr "repo.diff.show_unified_view"}}{{else}}{{.i18n.Tr "repo.diff.show_split_view"}}{{end}}</a>
|
<a class="ui tiny basic toggle button" href="?style={{if .IsSplitStyle}}unified{{else}}split{{end}}">{{ if .IsSplitStyle }}{{.i18n.Tr "repo.diff.show_unified_view"}}{{else}}{{.i18n.Tr "repo.diff.show_split_view"}}{{end}}</a>
|
||||||
{{end}}
|
{{end}}
|
||||||
<a class="ui tiny basic toggle button" data-target="#diff-files">{{.i18n.Tr "repo.diff.show_diff_stats"}}</a>
|
<a class="ui tiny basic toggle button" data-target="#diff-files">{{.i18n.Tr "repo.diff.show_diff_stats"}}</a>
|
||||||
{{if and .PageIsPullFiles $.SignedUserID}}
|
{{if and .PageIsPullFiles $.SignedUserID (not .IsArchived)}}
|
||||||
{{template "repo/diff/new_review" .}}
|
{{template "repo/diff/new_review" .}}
|
||||||
{{end}}
|
{{end}}
|
||||||
</div>
|
</div>
|
||||||
|
@ -27,7 +27,7 @@
|
||||||
<a class="ui tiny basic toggle button" href="?style={{if .IsSplitStyle}}unified{{else}}split{{end}}">{{ if .IsSplitStyle }}{{.i18n.Tr "repo.diff.show_unified_view"}}{{else}}{{.i18n.Tr "repo.diff.show_split_view"}}{{end}}</a>
|
<a class="ui tiny basic toggle button" href="?style={{if .IsSplitStyle}}unified{{else}}split{{end}}">{{ if .IsSplitStyle }}{{.i18n.Tr "repo.diff.show_unified_view"}}{{else}}{{.i18n.Tr "repo.diff.show_split_view"}}{{end}}</a>
|
||||||
{{end}}
|
{{end}}
|
||||||
<a class="ui tiny basic toggle button" data-target="#diff-files">{{.i18n.Tr "repo.diff.show_diff_stats"}}</a>
|
<a class="ui tiny basic toggle button" data-target="#diff-files">{{.i18n.Tr "repo.diff.show_diff_stats"}}</a>
|
||||||
{{if and .PageIsPullFiles $.SignedUserID}}
|
{{if and .PageIsPullFiles $.SignedUserID (not .IsArchived)}}
|
||||||
{{template "repo/diff/new_review" .}}
|
{{template "repo/diff/new_review" .}}
|
||||||
{{end}}
|
{{end}}
|
||||||
</div>
|
</div>
|
||||||
|
@ -194,6 +194,7 @@
|
||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
|
{{if not $.Repository.IsArchived}}
|
||||||
<div id="pull_review_add_comment" class="hide">
|
<div id="pull_review_add_comment" class="hide">
|
||||||
{{template "repo/diff/new_comment" dict "root" .}}
|
{{template "repo/diff/new_comment" dict "root" .}}
|
||||||
</div>
|
</div>
|
||||||
|
@ -215,6 +216,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{{end}}
|
||||||
|
|
||||||
{{if .IsSplitStyle}}
|
{{if .IsSplitStyle}}
|
||||||
<script>
|
<script>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{{if $.root.SignedUserID}}
|
{{if and $.root.SignedUserID (not $.Repository.IsArchived)}}
|
||||||
{{if $.hidden}}
|
{{if $.hidden}}
|
||||||
<button class="comment-form-reply ui green labeled icon tiny button"><i class="reply icon"></i> {{$.root.i18n.Tr "repo.diff.comment.reply"}}</button>
|
<button class="comment-form-reply ui green labeled icon tiny button"><i class="reply icon"></i> {{$.root.i18n.Tr "repo.diff.comment.reply"}}</button>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
|
@ -5,6 +5,11 @@
|
||||||
<div class="ui grid">
|
<div class="ui grid">
|
||||||
<div class="sixteen wide column content">
|
<div class="sixteen wide column content">
|
||||||
{{template "base/alert" .}}
|
{{template "base/alert" .}}
|
||||||
|
{{if .Repository.IsArchived}}
|
||||||
|
<div class="ui warning message">
|
||||||
|
{{.i18n.Tr "repo.archive.title"}}
|
||||||
|
</div>
|
||||||
|
{{end}}
|
||||||
{{if .CanWriteCode}}
|
{{if .CanWriteCode}}
|
||||||
<h4 class="ui top attached header">
|
<h4 class="ui top attached header">
|
||||||
{{.i18n.Tr "repo.quick_guide"}}
|
{{.i18n.Tr "repo.quick_guide"}}
|
||||||
|
@ -35,6 +40,8 @@
|
||||||
{{end}}
|
{{end}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{{if not .Repository.IsArchived}}
|
||||||
<div class="ui divider"></div>
|
<div class="ui divider"></div>
|
||||||
|
|
||||||
<div class="item">
|
<div class="item">
|
||||||
|
@ -57,6 +64,7 @@ git push -u origin master</code></pre>
|
||||||
git push -u origin master</code></pre>
|
git push -u origin master</code></pre>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{{end}}
|
||||||
{{else}}
|
{{else}}
|
||||||
<div class="ui segment center">
|
<div class="ui segment center">
|
||||||
{{.i18n.Tr "repo.empty_message"}}
|
{{.i18n.Tr "repo.empty_message"}}
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
<a href="{{AppSubUrl}}/{{.Owner.Name}}">{{.Owner.Name}}</a>
|
<a href="{{AppSubUrl}}/{{.Owner.Name}}">{{.Owner.Name}}</a>
|
||||||
<div class="divider"> / </div>
|
<div class="divider"> / </div>
|
||||||
<a href="{{$.RepoLink}}">{{.Name}}</a>
|
<a href="{{$.RepoLink}}">{{.Name}}</a>
|
||||||
|
{{if .IsArchived}}<i class="archive icon archived-icon"></i>{{end}}
|
||||||
{{if .IsMirror}}<div class="fork-flag">{{$.i18n.Tr "repo.mirror_from"}} <a target="_blank" rel="noopener noreferrer" href="{{$.Mirror.Address}}">{{$.Mirror.Address}}</a></div>{{end}}
|
{{if .IsMirror}}<div class="fork-flag">{{$.i18n.Tr "repo.mirror_from"}} <a target="_blank" rel="noopener noreferrer" href="{{$.Mirror.Address}}">{{$.Mirror.Address}}</a></div>{{end}}
|
||||||
{{if .IsFork}}<div class="fork-flag">{{$.i18n.Tr "repo.forked_from"}} <a href="{{.BaseRepo.Link}}">{{SubStr .BaseRepo.RelLink 1 -1}}</a></div>{{end}}
|
{{if .IsFork}}<div class="fork-flag">{{$.i18n.Tr "repo.forked_from"}} <a href="{{.BaseRepo.Link}}">{{SubStr .BaseRepo.RelLink 1 -1}}</a></div>{{end}}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -50,6 +50,11 @@
|
||||||
<span id="count_prompt">{{.i18n.Tr "repo.topic.count_prompt"}}</span>
|
<span id="count_prompt">{{.i18n.Tr "repo.topic.count_prompt"}}</span>
|
||||||
<span id="format_prompt">{{.i18n.Tr "repo.topic.format_prompt"}}</span>
|
<span id="format_prompt">{{.i18n.Tr "repo.topic.format_prompt"}}</span>
|
||||||
</div>
|
</div>
|
||||||
|
{{if .Repository.IsArchived}}
|
||||||
|
<div class="ui warning message">
|
||||||
|
{{.i18n.Tr "repo.archive.title"}}
|
||||||
|
</div>
|
||||||
|
{{end}}
|
||||||
{{template "repo/sub_menu" .}}
|
{{template "repo/sub_menu" .}}
|
||||||
<div class="ui stackable secondary menu mobile--margin-between-items mobile--no-negative-margins">
|
<div class="ui stackable secondary menu mobile--margin-between-items mobile--no-negative-margins">
|
||||||
{{if and .PullRequestCtx.Allowed .IsViewBranch}}
|
{{if and .PullRequestCtx.Allowed .IsViewBranch}}
|
||||||
|
|
|
@ -4,12 +4,13 @@
|
||||||
<div class="ui container">
|
<div class="ui container">
|
||||||
<div class="navbar">
|
<div class="navbar">
|
||||||
{{template "repo/issue/navbar" .}}
|
{{template "repo/issue/navbar" .}}
|
||||||
{{if or .CanWriteIssues .CanWritePulls}}
|
{{if and (or .CanWriteIssues .CanWritePulls) (not .Repository.IsArchived)}}
|
||||||
<div class="ui right">
|
<div class="ui right">
|
||||||
<div class="ui green new-label button">{{.i18n.Tr "repo.issues.new_label"}}</div>
|
<div class="ui green new-label button">{{.i18n.Tr "repo.issues.new_label"}}</div>
|
||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
</div>
|
</div>
|
||||||
|
{{if not .Repository.IsArchived}}
|
||||||
<div class="ui new-label segment hide">
|
<div class="ui new-label segment hide">
|
||||||
<form class="ui form" action="{{$.RepoLink}}/labels/new" method="post">
|
<form class="ui form" action="{{$.RepoLink}}/labels/new" method="post">
|
||||||
{{.CsrfTokenHtml}}
|
{{.CsrfTokenHtml}}
|
||||||
|
@ -37,6 +38,7 @@
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
{{end}}
|
||||||
<div class="ui divider"></div>
|
<div class="ui divider"></div>
|
||||||
|
|
||||||
<div class="ui right floated secondary filter menu">
|
<div class="ui right floated secondary filter menu">
|
||||||
|
@ -57,7 +59,7 @@
|
||||||
{{template "base/alert" .}}
|
{{template "base/alert" .}}
|
||||||
<div class="ui black label">{{.i18n.Tr "repo.issues.label_count" .NumLabels}}</div>
|
<div class="ui black label">{{.i18n.Tr "repo.issues.label_count" .NumLabels}}</div>
|
||||||
<div class="label list">
|
<div class="label list">
|
||||||
{{if and (or $.CanWriteIssues $.CanWritePulls) (eq .NumLabels 0)}}
|
{{if and (or $.CanWriteIssues $.CanWritePulls) (eq .NumLabels 0) (not $.Repository.IsArchived) }}
|
||||||
<div class="ui centered grid">
|
<div class="ui centered grid">
|
||||||
<div class="twelve wide column eight wide computer column">
|
<div class="twelve wide column eight wide computer column">
|
||||||
<div class="ui attached left aligned segment">
|
<div class="ui attached left aligned segment">
|
||||||
|
@ -105,7 +107,7 @@
|
||||||
<a class="ui right open-issues" href="{{$.RepoLink}}/issues?labels={{.ID}}"><i class="octicon octicon-issue-opened"></i> {{$.i18n.Tr "repo.issues.label_open_issues" .NumOpenIssues}}</a>
|
<a class="ui right open-issues" href="{{$.RepoLink}}/issues?labels={{.ID}}"><i class="octicon octicon-issue-opened"></i> {{$.i18n.Tr "repo.issues.label_open_issues" .NumOpenIssues}}</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="three wide column">
|
<div class="three wide column">
|
||||||
{{if or $.CanWriteIssues $.CanWritePulls}}
|
{{if and (not $.Repository.IsArchived) (or $.CanWriteIssues $.CanWritePulls)}}
|
||||||
<a class="ui right delete-button" href="#" data-url="{{$.RepoLink}}/labels/delete" data-id="{{.ID}}"><i class="octicon octicon-trashcan"></i> {{$.i18n.Tr "repo.issues.label_delete"}}</a>
|
<a class="ui right delete-button" href="#" data-url="{{$.RepoLink}}/labels/delete" data-id="{{.ID}}"><i class="octicon octicon-trashcan"></i> {{$.i18n.Tr "repo.issues.label_delete"}}</a>
|
||||||
<a class="ui right edit-label-button" href="#" data-id="{{.ID}}" data-title="{{.Name}}" data-description="{{.Description}}" data-color={{.Color}}><i class="octicon octicon-pencil"></i> {{$.i18n.Tr "repo.issues.label_edit"}}</a>
|
<a class="ui right edit-label-button" href="#" data-id="{{.ID}}" data-title="{{.Name}}" data-description="{{.Description}}" data-color={{.Color}}><i class="octicon octicon-pencil"></i> {{$.i18n.Tr "repo.issues.label_edit"}}</a>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
@ -117,7 +119,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{if or $.CanWriteIssues $.CanWritePulls}}
|
{{if and (or .CanWriteIssues .CanWritePulls) (not .Repository.IsArchived)}}
|
||||||
<div class="ui small basic delete modal">
|
<div class="ui small basic delete modal">
|
||||||
<div class="ui icon header">
|
<div class="ui icon header">
|
||||||
<i class="trash icon"></i>
|
<i class="trash icon"></i>
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
<div class="column center aligned">
|
<div class="column center aligned">
|
||||||
{{template "repo/issue/search" .}}
|
{{template "repo/issue/search" .}}
|
||||||
</div>
|
</div>
|
||||||
|
{{if not .Repository.IsArchived}}
|
||||||
<div class="column right aligned">
|
<div class="column right aligned">
|
||||||
{{if .PageIsIssueList}}
|
{{if .PageIsIssueList}}
|
||||||
<a class="ui green button" href="{{.RepoLink}}/issues/new">{{.i18n.Tr "repo.issues.new"}}</a>
|
<a class="ui green button" href="{{.RepoLink}}/issues/new">{{.i18n.Tr "repo.issues.new"}}</a>
|
||||||
|
@ -16,6 +17,7 @@
|
||||||
<a class="ui green button {{if not .PullRequestCtx.Allowed}}disabled{{end}}" href="{{if .PullRequestCtx.Allowed}}{{.PullRequestCtx.BaseRepo.Link}}/compare/{{.Repository.DefaultBranch}}...{{.PullRequestCtx.HeadInfo}}{{end}}">{{.i18n.Tr "repo.pulls.new"}}</a>
|
<a class="ui green button {{if not .PullRequestCtx.Allowed}}disabled{{end}}" href="{{if .PullRequestCtx.Allowed}}{{.PullRequestCtx.BaseRepo.Link}}/compare/{{.Repository.DefaultBranch}}...{{.PullRequestCtx.HeadInfo}}{{end}}">{{.i18n.Tr "repo.pulls.new"}}</a>
|
||||||
{{end}}
|
{{end}}
|
||||||
</div>
|
</div>
|
||||||
|
{{end}}
|
||||||
</div>
|
</div>
|
||||||
<div class="ui divider"></div>
|
<div class="ui divider"></div>
|
||||||
<div id="issue-filters" class="ui stackable grid">
|
<div id="issue-filters" class="ui stackable grid">
|
||||||
|
|
|
@ -9,10 +9,12 @@
|
||||||
<div class="column center aligned">
|
<div class="column center aligned">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
{{if not .Repository.IsArchived}}
|
||||||
<div class="column right aligned">
|
<div class="column right aligned">
|
||||||
<a class="ui grey button" href="{{.RepoLink}}/milestones/{{.MilestoneID}}/edit">{{.i18n.Tr "repo.milestones.edit"}}</a>
|
<a class="ui grey button" href="{{.RepoLink}}/milestones/{{.MilestoneID}}/edit">{{.i18n.Tr "repo.milestones.edit"}}</a>
|
||||||
<a class="ui green button" href="{{.RepoLink}}/issues/new?milestone={{.MilestoneID}}">{{.i18n.Tr "repo.issues.new"}}</a>
|
<a class="ui green button" href="{{.RepoLink}}/issues/new?milestone={{.MilestoneID}}">{{.i18n.Tr "repo.issues.new"}}</a>
|
||||||
</div>
|
</div>
|
||||||
|
{{end}}
|
||||||
</div>
|
</div>
|
||||||
<div class="ui one column stackable grid">
|
<div class="ui one column stackable grid">
|
||||||
<div class="column">
|
<div class="column">
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<div class="ui container">
|
<div class="ui container">
|
||||||
<div class="navbar">
|
<div class="navbar">
|
||||||
{{template "repo/issue/navbar" .}}
|
{{template "repo/issue/navbar" .}}
|
||||||
{{if or .CanWriteIssues .CanWritePulls}}
|
{{if and (or .CanWriteIssues .CanWritePulls) (not .Repository.IsArchived)}}
|
||||||
<div class="ui right">
|
<div class="ui right">
|
||||||
<a class="ui green button" href="{{$.Link}}/new">{{.i18n.Tr "repo.milestones.new"}}</a>
|
<a class="ui green button" href="{{$.Link}}/new">{{.i18n.Tr "repo.milestones.new"}}</a>
|
||||||
</div>
|
</div>
|
||||||
|
@ -67,7 +67,7 @@
|
||||||
{{if .TotalTrackedTime}}<i class="octicon octicon-clock"></i> {{.TotalTrackedTime|Sec2Time}}{{end}}
|
{{if .TotalTrackedTime}}<i class="octicon octicon-clock"></i> {{.TotalTrackedTime|Sec2Time}}{{end}}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
{{if or $.CanWriteIssues $.CanWritePulls}}
|
{{if and (or $.CanWriteIssues $.CanWritePulls) (not $.Repository.IsArchived)}}
|
||||||
<div class="ui right operate">
|
<div class="ui right operate">
|
||||||
<a href="{{$.Link}}/{{.ID}}/edit" data-id={{.ID}} data-title={{.Name}}><i class="octicon octicon-pencil"></i> {{$.i18n.Tr "repo.issues.label_edit"}}</a>
|
<a href="{{$.Link}}/{{.ID}}/edit" data-id={{.ID}} data-title={{.Name}}><i class="octicon octicon-pencil"></i> {{$.i18n.Tr "repo.issues.label_edit"}}</a>
|
||||||
{{if .IsClosed}}
|
{{if .IsClosed}}
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
<div class="column">
|
<div class="column">
|
||||||
{{template "repo/issue/navbar" .}}
|
{{template "repo/issue/navbar" .}}
|
||||||
</div>
|
</div>
|
||||||
|
{{if not .Repository.IsArchived}}
|
||||||
<div class="column right aligned">
|
<div class="column right aligned">
|
||||||
{{if .PageIsIssueList}}
|
{{if .PageIsIssueList}}
|
||||||
<a class="ui green button" href="{{.RepoLink}}/issues/new">{{.i18n.Tr "repo.issues.new"}}</a>
|
<a class="ui green button" href="{{.RepoLink}}/issues/new">{{.i18n.Tr "repo.issues.new"}}</a>
|
||||||
|
@ -13,6 +14,7 @@
|
||||||
<a class="ui green button {{if not .PullRequestCtx.Allowed}}disabled{{end}}" href="{{.RepoLink}}/compare/{{.BranchName | EscapePound}}...{{.PullRequestCtx.HeadInfo | EscapePound}}">{{.i18n.Tr "repo.pulls.new"}}</a>
|
<a class="ui green button {{if not .PullRequestCtx.Allowed}}disabled{{end}}" href="{{.RepoLink}}/compare/{{.BranchName | EscapePound}}...{{.PullRequestCtx.HeadInfo | EscapePound}}">{{.i18n.Tr "repo.pulls.new"}}</a>
|
||||||
{{end}}
|
{{end}}
|
||||||
</div>
|
</div>
|
||||||
|
{{end}}
|
||||||
</div>
|
</div>
|
||||||
<div class="ui divider"></div>
|
<div class="ui divider"></div>
|
||||||
{{if .Issue.IsPull}}
|
{{if .Issue.IsPull}}
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<div class="ui top attached header">
|
<div class="ui top attached header">
|
||||||
<span class="text grey"><a {{if gt .Issue.Poster.ID 0}}href="{{.Issue.Poster.HomeLink}}"{{end}}>{{.Issue.Poster.Name}}</a> {{.i18n.Tr "repo.issues.commented_at" .Issue.HashTag $createdStr | Safe}}</span>
|
<span class="text grey"><a {{if gt .Issue.Poster.ID 0}}href="{{.Issue.Poster.HomeLink}}"{{end}}>{{.Issue.Poster.Name}}</a> {{.i18n.Tr "repo.issues.commented_at" .Issue.HashTag $createdStr | Safe}}</span>
|
||||||
|
{{if not $.Repository.IsArchived}}
|
||||||
<div class="ui right actions">
|
<div class="ui right actions">
|
||||||
{{template "repo/issue/view_content/add_reaction" Dict "ctx" $ "ActionURL" (Printf "%s/issues/%d/reactions" $.RepoLink .Issue.Index) }}
|
{{template "repo/issue/view_content/add_reaction" Dict "ctx" $ "ActionURL" (Printf "%s/issues/%d/reactions" $.RepoLink .Issue.Index) }}
|
||||||
{{if or .IsIssueWriter .IsIssuePoster}}
|
{{if or .IsIssueWriter .IsIssuePoster}}
|
||||||
|
@ -26,6 +27,7 @@
|
||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
</div>
|
</div>
|
||||||
|
{{end}}
|
||||||
</div>
|
</div>
|
||||||
<div class="ui attached segment">
|
<div class="ui attached segment">
|
||||||
<div class="render-content markdown has-emoji">
|
<div class="render-content markdown has-emoji">
|
||||||
|
@ -64,10 +66,19 @@
|
||||||
|
|
||||||
{{ template "repo/issue/view_content/comments" . }}
|
{{ template "repo/issue/view_content/comments" . }}
|
||||||
|
|
||||||
{{if .Issue.IsPull}}
|
{{if and .Issue.IsPull (not $.Repository.IsArchived)}}
|
||||||
{{ template "repo/issue/view_content/pull". }}
|
{{ template "repo/issue/view_content/pull". }}
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
|
{{if .Repository.IsArchived}}
|
||||||
|
<div class="ui warning message">
|
||||||
|
{{if .Issue.IsPull}}
|
||||||
|
{{.i18n.Tr "repo.archive.pull.nocomment"}}
|
||||||
|
{{else}}
|
||||||
|
{{.i18n.Tr "repo.archive.issue.nocomment"}}
|
||||||
|
{{end}}
|
||||||
|
</div>
|
||||||
|
{{else}}
|
||||||
{{if .IsSigned}}
|
{{if .IsSigned}}
|
||||||
<div class="comment form">
|
<div class="comment form">
|
||||||
<a class="avatar" href="{{.SignedUser.HomeLink}}">
|
<a class="avatar" href="{{.SignedUser.HomeLink}}">
|
||||||
|
@ -102,6 +113,7 @@
|
||||||
{{.i18n.Tr "repo.issues.sign_in_require_desc" .SignInLink | Safe}}
|
{{.i18n.Tr "repo.issues.sign_in_require_desc" .SignInLink | Safe}}
|
||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
{{end}}
|
||||||
</ui>
|
</ui>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<div class="ui top attached header">
|
<div class="ui top attached header">
|
||||||
<span class="text grey"><a {{if gt .Poster.ID 0}}href="{{.Poster.HomeLink}}"{{end}}>{{.Poster.Name}}</a> {{$.i18n.Tr "repo.issues.commented_at" .HashTag $createdStr | Safe}}</span>
|
<span class="text grey"><a {{if gt .Poster.ID 0}}href="{{.Poster.HomeLink}}"{{end}}>{{.Poster.Name}}</a> {{$.i18n.Tr "repo.issues.commented_at" .HashTag $createdStr | Safe}}</span>
|
||||||
|
{{if not $.Repository.IsArchived}}
|
||||||
<div class="ui right actions">
|
<div class="ui right actions">
|
||||||
{{if gt .ShowTag 0}}
|
{{if gt .ShowTag 0}}
|
||||||
<div class="item tag">
|
<div class="item tag">
|
||||||
|
@ -30,6 +31,7 @@
|
||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
</div>
|
</div>
|
||||||
|
{{end}}
|
||||||
</div>
|
</div>
|
||||||
<div class="ui attached segment">
|
<div class="ui attached segment">
|
||||||
<div class="render-content markdown has-emoji">
|
<div class="render-content markdown has-emoji">
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<div class="ui segment metas">
|
<div class="ui segment metas">
|
||||||
{{template "repo/issue/branch_selector_field" .}}
|
{{template "repo/issue/branch_selector_field" .}}
|
||||||
|
|
||||||
<div class="ui {{if not .IsIssueWriter}}disabled{{end}} floating jump select-label dropdown">
|
<div class="ui {{if or (not .IsIssueWriter) .Repository.IsArchived}}disabled{{end}} floating jump select-label dropdown">
|
||||||
<span class="text">
|
<span class="text">
|
||||||
<strong>{{.i18n.Tr "repo.issues.new.labels"}}</strong>
|
<strong>{{.i18n.Tr "repo.issues.new.labels"}}</strong>
|
||||||
<span class="octicon octicon-gear"></span>
|
<span class="octicon octicon-gear"></span>
|
||||||
|
@ -27,7 +27,7 @@
|
||||||
|
|
||||||
<div class="ui divider"></div>
|
<div class="ui divider"></div>
|
||||||
|
|
||||||
<div class="ui {{if not .IsIssueWriter}}disabled{{end}} floating jump select-milestone dropdown">
|
<div class="ui {{if or (not .IsIssueWriter) .Repository.IsArchived}}disabled{{end}} floating jump select-milestone dropdown">
|
||||||
<span class="text">
|
<span class="text">
|
||||||
<strong>{{.i18n.Tr "repo.issues.new.milestone"}}</strong>
|
<strong>{{.i18n.Tr "repo.issues.new.milestone"}}</strong>
|
||||||
<span class="octicon octicon-gear"></span>
|
<span class="octicon octicon-gear"></span>
|
||||||
|
@ -68,7 +68,7 @@
|
||||||
<div class="ui divider"></div>
|
<div class="ui divider"></div>
|
||||||
|
|
||||||
<input id="assignee_id" name="assignee_id" type="hidden" value="{{.assignee_id}}">
|
<input id="assignee_id" name="assignee_id" type="hidden" value="{{.assignee_id}}">
|
||||||
<div class="ui {{if not .IsIssueWriter}}disabled{{end}} floating jump select-assignees-modify dropdown">
|
<div class="ui {{if or (not .IsIssueWriter) .Repository.IsArchived}}disabled{{end}} floating jump select-assignees-modify dropdown">
|
||||||
<span class="text">
|
<span class="text">
|
||||||
<strong>{{.i18n.Tr "repo.issues.new.assignees"}}</strong>
|
<strong>{{.i18n.Tr "repo.issues.new.assignees"}}</strong>
|
||||||
<span class="octicon octicon-gear"></span>
|
<span class="octicon octicon-gear"></span>
|
||||||
|
@ -119,7 +119,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{if $.IssueWatch}}
|
{{if and $.IssueWatch (not .Repository.IsArchived)}}
|
||||||
<div class="ui divider"></div>
|
<div class="ui divider"></div>
|
||||||
|
|
||||||
<div class="ui watching">
|
<div class="ui watching">
|
||||||
|
@ -142,7 +142,7 @@
|
||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
{{if .Repository.IsTimetrackerEnabled }}
|
{{if .Repository.IsTimetrackerEnabled }}
|
||||||
{{if .CanUseTimetracker }}
|
{{if and .CanUseTimetracker (not .Repository.IsArchived)}}
|
||||||
<div class="ui divider"></div>
|
<div class="ui divider"></div>
|
||||||
<div class="ui timetrack">
|
<div class="ui timetrack">
|
||||||
<span class="text"><strong>{{.i18n.Tr "repo.issues.tracker"}}</strong></span>
|
<span class="text"><strong>{{.i18n.Tr "repo.issues.tracker"}}</strong></span>
|
||||||
|
@ -223,7 +223,7 @@
|
||||||
{{if .Issue.IsOverdue}}
|
{{if .Issue.IsOverdue}}
|
||||||
<span style="color: red;">{{.i18n.Tr "repo.issues.due_date_overdue"}}</span>
|
<span style="color: red;">{{.i18n.Tr "repo.issues.due_date_overdue"}}</span>
|
||||||
{{end}}
|
{{end}}
|
||||||
{{if .IsIssueWriter}}
|
{{if and .IsIssueWriter (not .Repository.IsArchived)}}
|
||||||
<br/>
|
<br/>
|
||||||
<a style="cursor:pointer;" onclick="toggleDeadlineForm();"><i class="edit icon"></i>{{$.i18n.Tr "repo.issues.due_date_form_edit"}}</a> -
|
<a style="cursor:pointer;" onclick="toggleDeadlineForm();"><i class="edit icon"></i>{{$.i18n.Tr "repo.issues.due_date_form_edit"}}</a> -
|
||||||
<a style="cursor:pointer;" onclick="updateDeadline('');"><i class="remove icon"></i>{{$.i18n.Tr "repo.issues.due_date_form_remove"}}</a>
|
<a style="cursor:pointer;" onclick="updateDeadline('');"><i class="remove icon"></i>{{$.i18n.Tr "repo.issues.due_date_form_remove"}}</a>
|
||||||
|
@ -233,7 +233,7 @@
|
||||||
<p><i>{{.i18n.Tr "repo.issues.due_date_not_set"}}</i></p>
|
<p><i>{{.i18n.Tr "repo.issues.due_date_not_set"}}</i></p>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
{{if .IsIssueWriter}}
|
{{if and .IsIssueWriter (not .Repository.IsArchived)}}
|
||||||
<div {{if ne .Issue.DeadlineUnix 0}} style="display: none;"{{end}} id="deadlineForm">
|
<div {{if ne .Issue.DeadlineUnix 0}} style="display: none;"{{end}} id="deadlineForm">
|
||||||
<form class="ui fluid action input" action="{{AppSubUrl}}/api/v1/repos/{{.Repository.Owner.Name}}/{{.Repository.Name}}/issues/{{.Issue.Index}}" method="post" id="update-issue-deadline-form" onsubmit="setDeadline();return false;">
|
<form class="ui fluid action input" action="{{AppSubUrl}}/api/v1/repos/{{.Repository.Owner.Name}}/{{.Repository.Name}}/issues/{{.Issue.Index}}" method="post" id="update-issue-deadline-form" onsubmit="setDeadline();return false;">
|
||||||
{{$.CsrfTokenHtml}}
|
{{$.CsrfTokenHtml}}
|
||||||
|
@ -278,7 +278,7 @@
|
||||||
<div class="ui black label">#{{.Index}}</div>
|
<div class="ui black label">#{{.Index}}</div>
|
||||||
<a class="title has-emoji" href="{{$.RepoLink}}/issues/{{.Index}}">{{.Title}}</a>
|
<a class="title has-emoji" href="{{$.RepoLink}}/issues/{{.Index}}">{{.Title}}</a>
|
||||||
<div class="ui transparent label right floated">
|
<div class="ui transparent label right floated">
|
||||||
{{if $.CanCreateIssueDependencies}}
|
{{if and $.CanCreateIssueDependencies (not $.Repository.IsArchived)}}
|
||||||
<a class="delete-dependency-button" onclick="deleteDependencyModal({{.ID}}, 'blocking');"
|
<a class="delete-dependency-button" onclick="deleteDependencyModal({{.ID}}, 'blocking');"
|
||||||
data-tooltip="{{$.i18n.Tr "repo.issues.dependency.remove_info"}}" data-inverted="">
|
data-tooltip="{{$.i18n.Tr "repo.issues.dependency.remove_info"}}" data-inverted="">
|
||||||
<i class="delete icon text red"></i>
|
<i class="delete icon text red"></i>
|
||||||
|
@ -304,7 +304,7 @@
|
||||||
<div class="ui black label">#{{.Index}}</div>
|
<div class="ui black label">#{{.Index}}</div>
|
||||||
<a class="title has-emoji" href="{{$.RepoLink}}/issues/{{.Index}}">{{.Title}}</a>
|
<a class="title has-emoji" href="{{$.RepoLink}}/issues/{{.Index}}">{{.Title}}</a>
|
||||||
<div class="ui transparent label right floated">
|
<div class="ui transparent label right floated">
|
||||||
{{if $.CanCreateIssueDependencies}}
|
{{if and $.CanCreateIssueDependencies (not $.IsArchived)}}
|
||||||
<a class="delete-dependency-button" onclick="deleteDependencyModal({{.ID}}, 'blockedBy');"
|
<a class="delete-dependency-button" onclick="deleteDependencyModal({{.ID}}, 'blockedBy');"
|
||||||
data-tooltip="{{$.i18n.Tr "repo.issues.dependency.remove_info"}}" data-inverted="">
|
data-tooltip="{{$.i18n.Tr "repo.issues.dependency.remove_info"}}" data-inverted="">
|
||||||
<i class="delete icon text red"></i>
|
<i class="delete icon text red"></i>
|
||||||
|
@ -316,7 +316,7 @@
|
||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
{{if .CanCreateIssueDependencies}}
|
{{if and .CanCreateIssueDependencies (not .Repository.IsArchived)}}
|
||||||
<div>
|
<div>
|
||||||
<form method="POST" action="{{$.RepoLink}}/issues/{{.Issue.Index}}/dependency/add" id="addDependencyForm">
|
<form method="POST" action="{{$.RepoLink}}/issues/{{.Issue.Index}}/dependency/add" id="addDependencyForm">
|
||||||
{{$.CsrfTokenHtml}}
|
{{$.CsrfTokenHtml}}
|
||||||
|
@ -337,7 +337,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{if .CanCreateIssueDependencies}}
|
{{if and .CanCreateIssueDependencies (not .Repository.IsArchived)}}
|
||||||
<input type="hidden" id="repolink" value="{{$.RepoRelPath}}">
|
<input type="hidden" id="repolink" value="{{$.RepoRelPath}}">
|
||||||
<!-- I know, there is probably a better way to do this -->
|
<!-- I know, there is probably a better way to do this -->
|
||||||
<input type="hidden" id="issueIndex" value="{{.Issue.Index}}"/>
|
<input type="hidden" id="issueIndex" value="{{.Issue.Index}}"/>
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<input value="{{.Issue.Title}}">
|
<input value="{{.Issue.Title}}">
|
||||||
</div>
|
</div>
|
||||||
</h1>
|
</h1>
|
||||||
{{if or .IsIssueWriter .IsIssuePoster}}
|
{{if and (or .IsIssueWriter .IsIssuePoster) (not .Repository.IsArchived)}}
|
||||||
<div class="four wide column">
|
<div class="four wide column">
|
||||||
<div class="edit-zone text right">
|
<div class="edit-zone text right">
|
||||||
<div id="edit-title" class="ui basic green not-in-edit button">{{.i18n.Tr "repo.issues.edit"}}</div>
|
<div id="edit-title" class="ui basic green not-in-edit button">{{.i18n.Tr "repo.issues.edit"}}</div>
|
||||||
|
|
|
@ -4,6 +4,11 @@
|
||||||
{{template "repo/settings/navbar" .}}
|
{{template "repo/settings/navbar" .}}
|
||||||
<div class="ui container">
|
<div class="ui container">
|
||||||
{{template "base/alert" .}}
|
{{template "base/alert" .}}
|
||||||
|
{{if .Repository.IsArchived}}
|
||||||
|
<div class="ui warning message">
|
||||||
|
{{.i18n.Tr "repo.settings.archive.branchsettings_unavailable"}}
|
||||||
|
</div>
|
||||||
|
{{else}}
|
||||||
<h4 class="ui top attached header">
|
<h4 class="ui top attached header">
|
||||||
{{.i18n.Tr "repo.default_branch"}}
|
{{.i18n.Tr "repo.default_branch"}}
|
||||||
</h4>
|
</h4>
|
||||||
|
@ -72,6 +77,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{{end}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{template "base/footer" .}}
|
{{template "base/footer" .}}
|
||||||
|
|
|
@ -325,6 +325,31 @@
|
||||||
<p>{{.i18n.Tr "repo.settings.delete_desc"}}</p>
|
<p>{{.i18n.Tr "repo.settings.delete_desc"}}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{{if not .Repository.IsMirror}}
|
||||||
|
<div class="ui divider"></div>
|
||||||
|
|
||||||
|
<div class="item">
|
||||||
|
<div class="ui right">
|
||||||
|
<button class="ui basic red show-modal button" data-modal="#archive-repo-modal">
|
||||||
|
{{if .Repository.IsArchived}}
|
||||||
|
{{.i18n.Tr "repo.settings.unarchive.button"}}
|
||||||
|
{{else}}
|
||||||
|
{{.i18n.Tr "repo.settings.archive.button"}}
|
||||||
|
{{end}}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
{{if .Repository.IsArchived}}
|
||||||
|
<h5>{{.i18n.Tr "repo.settings.unarchive.header"}}</h5>
|
||||||
|
<p>{{.i18n.Tr "repo.settings.unarchive.text"}}</p>
|
||||||
|
{{else}}
|
||||||
|
<h5>{{.i18n.Tr "repo.settings.archive.header"}}</h5>
|
||||||
|
<p>{{.i18n.Tr "repo.settings.archive.text"}}</p>
|
||||||
|
{{end}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{end}}
|
||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
</div>
|
</div>
|
||||||
|
@ -464,6 +489,36 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
|
{{if not .Repository.IsMirror}}
|
||||||
|
<div class="ui basic modal" id="archive-repo-modal">
|
||||||
|
<div class="ui icon header">
|
||||||
|
{{if .Repository.IsArchived}}
|
||||||
|
{{.i18n.Tr "repo.settings.unarchive.header"}}
|
||||||
|
{{else}}
|
||||||
|
{{.i18n.Tr "repo.settings.archive.header"}}
|
||||||
|
{{end}}
|
||||||
|
</div>
|
||||||
|
<div class="content center">
|
||||||
|
<p>
|
||||||
|
{{if .Repository.IsArchived}}
|
||||||
|
{{.i18n.Tr "repo.settings.unarchive.text"}}
|
||||||
|
{{else}}
|
||||||
|
{{.i18n.Tr "repo.settings.archive.text"}}
|
||||||
|
{{end}}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<form action="{{.Link}}" method="post">
|
||||||
|
{{.CsrfTokenHtml}}
|
||||||
|
<input type="hidden" name="action" value="{{if .Repository.IsArchived}}unarchive{{else}}archive{{end}}">
|
||||||
|
<input type="hidden" name="repo_id" value="{{.Repository.ID}}">
|
||||||
|
<div class="center actions">
|
||||||
|
<div class="ui basic cancel inverted button">{{.i18n.Tr "settings.cancel"}}</div>
|
||||||
|
<button class="ui basic inverted yellow button">{{.i18n.Tr "modal.yes"}}</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
{{end}}
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
{{template "base/footer" .}}
|
{{template "base/footer" .}}
|
||||||
|
|
|
@ -85,6 +85,7 @@
|
||||||
<a :href="suburl + '/' + repo.full_name">
|
<a :href="suburl + '/' + repo.full_name">
|
||||||
<i :class="repoClass(repo)"></i>
|
<i :class="repoClass(repo)"></i>
|
||||||
<strong class="text truncate item-name">${repo.full_name}</strong>
|
<strong class="text truncate item-name">${repo.full_name}</strong>
|
||||||
|
<i v-if="repo.archived" class="archive icon archived-icon"></i>
|
||||||
<span class="ui right text light grey">
|
<span class="ui right text light grey">
|
||||||
${repo.stars_count} <i class="octicon octicon-star rear"></i>
|
${repo.stars_count} <i class="octicon octicon-star rear"></i>
|
||||||
</span>
|
</span>
|
||||||
|
|
Loading…
Reference in a new issue