Browse Source

Fix #185

pull/201/head
Unknown 11 years ago
parent
commit
b70db61854
  1. 2
      models/issue.go
  2. 24
      models/repo.go
  3. 1
      routers/repo/issue.go
  4. 4
      templates/issue/milestone.tmpl

2
models/issue.go

@ -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

24
models/repo.go

@ -676,15 +676,33 @@ func DeleteRepository(userId, repoId int64, userName string) (err error) {
sess.Rollback()
return err
}
if _, err = sess.Delete(&Issue{RepoId: repoId}); err != nil {
if _, err = sess.Delete(&IssueUser{RepoId: repoId}); err != nil {
sess.Rollback()
return err
}
if _, err = sess.Delete(&IssueUser{RepoId: repoId}); err != nil {
if _, err = sess.Delete(&Milestone{RepoId: repoId}); err != nil {
sess.Rollback()
return err
}
if _, err = sess.Delete(&Milestone{RepoId: repoId}); err != nil {
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
}

1
routers/repo/issue.go

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

4
templates/issue/milestone.tmpl

@ -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}}

Loading…
Cancel
Save