tokarchuk/v1.17
Unknown 11 years ago
parent 16bddd593a
commit b70db61854
  1. 2
      models/issue.go
  2. 24
      models/repo.go
  3. 1
      routers/repo/issue.go
  4. 4
      templates/issue/milestone.tmpl

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

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

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

@ -19,8 +19,8 @@
{{range .Milestones}} {{range .Milestones}}
<div class="list-group-item milestone-item"> <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> <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-open label label-success">{{.NumOpenIssues}}</span>
<span class="issue-close label label-warning">{{.NumOpenIssues}}</span> <span class="issue-close label label-warning">{{.NumClosedIssues}}</span>
<p class="actions pull-right"> <p class="actions pull-right">
<a href="{{$.RepoLink}}/issues/milestones/{{.Index}}/edit">Edit</a> <a href="{{$.RepoLink}}/issues/milestones/{{.Index}}/edit">Edit</a>
{{if .IsClosed}} {{if .IsClosed}}

Loading…
Cancel
Save