1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-11-22 08:42:32 -05:00
This commit is contained in:
Unknown 2014-05-14 13:04:57 -04:00
parent 16bddd593a
commit b70db61854
4 changed files with 27 additions and 6 deletions

View file

@ -167,6 +167,8 @@ type IssueUser struct {
Uid int64 // User ID.
IssueId int64
RepoId int64
MilestoneId int64
Labels string `xorm:"TEXT"`
IsRead bool
IsAssigned bool
IsMentioned bool

View file

@ -676,10 +676,6 @@ func DeleteRepository(userId, repoId int64, userName string) (err error) {
sess.Rollback()
return err
}
if _, err = sess.Delete(&Issue{RepoId: repoId}); err != nil {
sess.Rollback()
return err
}
if _, err = sess.Delete(&IssueUser{RepoId: repoId}); err != nil {
sess.Rollback()
return err
@ -688,6 +684,28 @@ func DeleteRepository(userId, repoId int64, userName string) (err error) {
sess.Rollback()
return err
}
if _, err = sess.Delete(&Release{RepoId: repoId}); err != nil {
sess.Rollback()
return err
}
// Delete comments.
if err = orm.Iterate(&Issue{RepoId: repoId}, func(idx int, bean interface{}) error {
issue := bean.(*Issue)
if _, err = sess.Delete(&Comment{IssueId: issue.Id}); err != nil {
sess.Rollback()
return err
}
return nil
}); err != nil {
sess.Rollback()
return err
}
if _, err = sess.Delete(&Issue{RepoId: repoId}); err != nil {
sess.Rollback()
return err
}
rawSql := "UPDATE `user` SET num_repos = num_repos - 1 WHERE id = ?"
if _, err = sess.Exec(rawSql, userId); err != nil {

View file

@ -63,6 +63,7 @@ func Issues(ctx *middleware.Context) {
}
mid = mile.Id
}
fmt.Println(mid)
page, _ := base.StrTo(ctx.Query("page")).Int()

View file

@ -19,8 +19,8 @@
{{range .Milestones}}
<div class="list-group-item milestone-item">
<h4 class="title pull-left"><a href="{{$.RepoLink}}/issues?milestone={{.Index}}{{if .IsClosed}}&state=closed{{end}}">{{.Name}}</a></h4>
<span class="issue-open label label-success">{{.NumClosedIssues}}</span>
<span class="issue-close label label-warning">{{.NumOpenIssues}}</span>
<span class="issue-open label label-success">{{.NumOpenIssues}}</span>
<span class="issue-close label label-warning">{{.NumClosedIssues}}</span>
<p class="actions pull-right">
<a href="{{$.RepoLink}}/issues/milestones/{{.Index}}/edit">Edit</a>
{{if .IsClosed}}