add milestone edit ui

This commit is contained in:
FuXiaoHei 2014-05-12 21:51:22 +08:00
parent 3fe87cba85
commit 1769bb2f26
5 changed files with 75 additions and 3 deletions

View File

@ -187,6 +187,7 @@ func runWeb(*cli.Context) {
r.Post("/issues/:index/assignee", repo.UpdateAssignee) r.Post("/issues/:index/assignee", repo.UpdateAssignee)
r.Get("/issues/milestones", repo.Milestones) r.Get("/issues/milestones", repo.Milestones)
r.Get("/issues/milestones/new", repo.NewMilestones) r.Get("/issues/milestones/new", repo.NewMilestones)
r.Get("/issues/milestones/edit", repo.UpdateMilestones)
r.Post("/comment/:action", repo.Comment) r.Post("/comment/:action", repo.Comment)
r.Get("/releases/new", repo.ReleasesNew) r.Get("/releases/new", repo.ReleasesNew)
}, reqSignIn, middleware.RepoAssignment(true)) }, reqSignIn, middleware.RepoAssignment(true))

View File

@ -498,3 +498,12 @@ func NewMilestones(ctx *middleware.Context) {
ctx.HTML(200, "issue/milestone_new") ctx.HTML(200, "issue/milestone_new")
} }
func UpdateMilestones(ctx *middleware.Context) {
ctx.Data["Title"] = "Update Milestones"
ctx.Data["IsRepoToolbarIssues"] = true
ctx.Data["IsRepoToolbarIssuesList"] = true
ctx.HTML(200, "issue/milestone_edit")
}

View File

@ -23,7 +23,7 @@
<span class="issue-open label label-success">12</span> <span class="issue-open label label-success">12</span>
<span class="issue-close label label-warning">2</span> <span class="issue-close label label-warning">2</span>
<p class="actions pull-right"> <p class="actions pull-right">
<a href="#">Edit</a> <a href="{{.RepoLink}}/issues/milestones/edit">Edit</a>
<a href="#">Open</a> <a href="#">Open</a>
<a href="#">Close</a> <a href="#">Close</a>
<a class="text-danger" href="#">Delete</a> <a class="text-danger" href="#">Delete</a>
@ -37,7 +37,7 @@
<span class="issue-open label label-success">12</span> <span class="issue-open label label-success">12</span>
<span class="issue-close label label-warning">2</span> <span class="issue-close label label-warning">2</span>
<p class="actions pull-right"> <p class="actions pull-right">
<a href="#">Edit</a> <a href="{{.RepoLink}}/issues/milestones/edit">Edit</a>
<a href="#">Open</a> <a href="#">Open</a>
<a href="#">Close</a> <a href="#">Close</a>
<a class="text-danger" href="#">Delete</a> <a class="text-danger" href="#">Delete</a>

View File

@ -0,0 +1,62 @@
{{template "base/head" .}}
{{template "base/navbar" .}}
{{template "repo/nav" .}}
{{template "repo/toolbar" .}}
<div id="body" class="container">
<div id="issue">
<form class="form" action="{{.RepoLink}}/issues/milestones/new" method="post" id="issue-create-form">
{{.CsrfTokenHtml}}
{{template "base/alert" .}}
<div class="col-md-1">
<img class="avatar" src="{{.SignedUser.AvatarLink}}" alt=""/>
</div>
<div class="col-md-8 panel panel-default">
<div class="form-group panel-body">
<input class="form-control input-lg" type="text" name="title" required="required" placeholder="Title" value="{{.title}}" />
</div>
<div class="form-group panel-body">
<div class="md-help pull-right"><!-- todo help link -->
Content with <a href="https://help.github.com/articles/markdown-basics">Markdown</a>
</div>
<ul class="nav nav-tabs" data-init="tabs">
<li class="active issue-write"><a href="#issue-textarea" data-toggle="tab">Write</a></li>
<li class="issue-preview"><a href="#issue-preview" data-toggle="tab" data-ajax="/api/v1/markdown" data-ajax-name="issue-preview" data-ajax-context="{{.RepoLink}}" data-ajax-method="post" data-preview="#issue-preview">Preview</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane" id="issue-textarea">
<div class="form-group">
<textarea class="form-control" name="content" id="issue-content" rows="10" placeholder="Write some content" data-ajax-rel="issue-preview" data-ajax-val="val" data-ajax-field="text">{{.content}}</textarea>
</div>
</div>
<div class="tab-pane issue-preview-content" id="issue-preview">loading...</div>
</div>
</div>
<div class="text-right panel-body">
<div class="form-group">
<input type="hidden" value="id" name="repo-id"/>
<button class="btn-success btn">Create new issue</button>
</div>
</div>
</div>
<div class="col-md-3">
<h4>Milestone Due Date</h4>
<div class="form-group">
<input name="due_date" type="text" class="form-control" id="milestone-due-date">
</div>
</div>
</form>
</div>
</div>
<script src="/js/bootstrap-datepicker.js"></script>
<script>
$(function(){
$('#milestone-due-date').datepicker({
weekStart: 1,
todayBtn: "linked",
calendarWeeks: true,
todayHighlight: true
});
});
</script>
{{template "base/footer" .}}

View File

@ -4,7 +4,7 @@
{{template "repo/toolbar" .}} {{template "repo/toolbar" .}}
<div id="body" class="container"> <div id="body" class="container">
<div id="issue"> <div id="issue">
<form class="form" action="{{.RepoLink}}/issues/new" method="post" id="issue-create-form"> <form class="form" action="{{.RepoLink}}/issues/milestones/new" method="post" id="issue-create-form">
{{.CsrfTokenHtml}} {{.CsrfTokenHtml}}
{{template "base/alert" .}} {{template "base/alert" .}}
<div class="col-md-1"> <div class="col-md-1">