mirror of
1
Fork 0

list view: issue, label, milestone

This commit is contained in:
Unknwon 2015-08-09 22:45:38 +08:00
parent 68b9d78386
commit 7372042441
19 changed files with 392 additions and 444 deletions

View File

@ -369,6 +369,7 @@ commits.newer = Newer
issues.new = New Issue issues.new = New Issue
issues.new_label = New Label issues.new_label = New Label
issues.new_label_placeholder = Label name... issues.new_label_placeholder = Label name...
issues.create_label = Create Label
issues.open_tab = %d Open issues.open_tab = %d Open
issues.close_tab = %d Closed issues.close_tab = %d Closed
issues.filter_label = Label issues.filter_label = Label

View File

@ -658,6 +658,14 @@ type Milestone struct {
ClosedDate time.Time ClosedDate time.Time
} }
func (m *Milestone) BeforeUpdate() {
if m.NumIssues > 0 {
m.Completeness = m.NumClosedIssues * 100 / m.NumIssues
} else {
m.Completeness = 0
}
}
func (m *Milestone) AfterSet(colName string, _ xorm.Cell) { func (m *Milestone) AfterSet(colName string, _ xorm.Cell) {
if colName == "deadline" { if colName == "deadline" {
if m.Deadline.Year() == 9999 { if m.Deadline.Year() == 9999 {
@ -804,8 +812,6 @@ func ChangeMilestoneIssueStats(issue *Issue) error {
m.NumClosedIssues-- m.NumClosedIssues--
} }
m.Completeness = m.NumClosedIssues * 100 / m.NumIssues
return UpdateMilestone(m) return UpdateMilestone(m)
} }
@ -827,13 +833,8 @@ func ChangeMilestoneAssign(oldMid, mid int64, issue *Issue) (err error) {
if issue.IsClosed { if issue.IsClosed {
m.NumClosedIssues-- m.NumClosedIssues--
} }
if m.NumIssues > 0 {
m.Completeness = m.NumClosedIssues * 100 / m.NumIssues
} else {
m.Completeness = 0
}
if _, err = sess.Id(m.ID).Cols("num_issues,num_completeness,num_closed_issues").Update(m); err != nil { if _, err = sess.Id(m.ID).AllCols().Update(m); err != nil {
sess.Rollback() sess.Rollback()
return err return err
} }
@ -860,8 +861,7 @@ func ChangeMilestoneAssign(oldMid, mid int64, issue *Issue) (err error) {
return ErrWrongIssueCounter return ErrWrongIssueCounter
} }
m.Completeness = m.NumClosedIssues * 100 / m.NumIssues if _, err = sess.Id(m.ID).AllCols().Update(m); err != nil {
if _, err = sess.Id(m.ID).Cols("num_issues,num_completeness,num_closed_issues").Update(m); err != nil {
sess.Rollback() sess.Rollback()
return err return err
} }

File diff suppressed because one or more lines are too long

View File

@ -20,6 +20,15 @@ func (repo *Repository) IsTagExist(tagName string) bool {
return IsTagExist(repo.Path, tagName) return IsTagExist(repo.Path, tagName)
} }
func (repo *Repository) getTagsReversed() ([]string, error) {
stdout, stderr, err := com.ExecCmdDir(repo.Path, "git", "tag", "-l", "--sort=-v:refname")
if err != nil {
return nil, concatenateError(err, stderr)
}
tags := strings.Split(stdout, "\n")
return tags[:len(tags)-1], nil
}
// GetTags returns all tags of given repository. // GetTags returns all tags of given repository.
func (repo *Repository) GetTags() ([]string, error) { func (repo *Repository) GetTags() ([]string, error) {
if gitVer.AtLeast(MustParseVersion("2.0.0")) { if gitVer.AtLeast(MustParseVersion("2.0.0")) {
@ -33,15 +42,6 @@ func (repo *Repository) GetTags() ([]string, error) {
return tags[:len(tags)-1], nil return tags[:len(tags)-1], nil
} }
func (repo *Repository) getTagsReversed() ([]string, error) {
stdout, stderr, err := com.ExecCmdDir(repo.Path, "git", "tag", "-l", "--sort=-v:refname")
if err != nil {
return nil, errors.New(stderr)
}
tags := strings.Split(stdout, "\n")
return tags[:len(tags)-1], nil
}
func (repo *Repository) CreateTag(tagName, idStr string) error { func (repo *Repository) CreateTag(tagName, idStr string) error {
_, stderr, err := com.ExecCmdDir(repo.Path, "git", "tag", tagName, idStr) _, stderr, err := com.ExecCmdDir(repo.Path, "git", "tag", tagName, idStr)
if err != nil { if err != nil {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -43,6 +43,15 @@ function initRepository() {
// Labels // Labels
if ($('.repository.labels').length > 0) { if ($('.repository.labels').length > 0) {
// Create label
var $new_label_panel = $('.new-label.segment');
$('.new-label.button').click(function () {
$new_label_panel.show();
});
$('.new-label.segment .cancel').click(function () {
$new_label_panel.hide();
});
$('.color-picker').each(function () { $('.color-picker').each(function () {
$(this).minicolors(); $(this).minicolors();
}); });
@ -53,8 +62,7 @@ function initRepository() {
}); });
$('.edit-label-button').click(function () { $('.edit-label-button').click(function () {
$('#label-modal-id').val($(this).data('id')); $('#label-modal-id').val($(this).data('id'));
$('#label-modal-title').val($(this).data('title')); $('.edit-label .new-label-input').val($(this).data('title'));
$('#label-modal-color').val($(this).data('color'))
$('.minicolors-swatch-color').css("background-color", $(this).data('color')); $('.minicolors-swatch-color').css("background-color", $(this).data('color'));
$('.edit-label.modal').modal({ $('.edit-label.modal').modal({
onApprove: function () { onApprove: function () {

File diff suppressed because one or more lines are too long

View File

@ -9,27 +9,25 @@ img {
} }
.full.height { .full.height {
padding: 0; padding: 0;
margin: 0 0 -87px 0; margin: 0 0 -@footer-margin*2 0;
min-height: 100%; min-height: 100%;
} }
.following.bar { .following.bar {
z-index: 900; z-index: 900;
left: 0; left: 0;
width: 100%; width: 100%;
padding: 0.7em 0; padding: 5px 0;
&.light { &.light {
background-color: white; background-color: white;
border-bottom: 1px solid #DDDDDD; border-bottom: 1px solid #DDDDDD;
box-shadow: 0 2px 3px rgba(0, 0, 0, 0.04); box-shadow: 0 2px 3px rgba(0, 0, 0, 0.04);
} }
.ui.secondary.menu {
height: 30px;
}
.column .menu { .column .menu {
margin-top: 0; margin-top: 0;
} }
.brand { .brand {
float: left; float: left;
margin-top: 5px;
margin-right: 5px; margin-right: 5px;
} }
.head.link.item { .head.link.item {
@ -41,7 +39,6 @@ img {
} }
.user.avatar { .user.avatar {
padding: 0; padding: 0;
margin-top: 1px;
} }
.searchbox { .searchbox {
background-color: rgb(244, 244, 244)!important; background-color: rgb(244, 244, 244)!important;
@ -51,7 +48,6 @@ img {
} }
.octicon { .octicon {
width: 16px; width: 16px;
opacity: 1!important;
text-align: center; text-align: center;
} }
} }
@ -68,14 +64,21 @@ img {
color: #d95c5c!important; color: #d95c5c!important;
} }
} }
.message {
text-align: center;
}
} }
footer { footer {
margin-top: @footer-margin!important; margin-top: @footer-margin!important;
height: @footer-margin;
background-color: white; background-color: white;
border-top: 1px solid #d6d6d6; border-top: 1px solid #d6d6d6;
clear: both; clear: both;
width: 100%; width: 100%;
color: #888888; color: #888888;
.container {
padding-top: 10px;
.fa { .fa {
width: 16px; width: 16px;
text-align: center; text-align: center;
@ -93,6 +96,7 @@ footer {
} }
} }
} }
}
.hide { .hide {
display: none; display: none;
@ -108,8 +112,8 @@ footer {
.generate-img(16); .generate-img(16);
.generate-img(@n, @i: 1) when (@i =< @n) { .generate-img(@n, @i: 1) when (@i =< @n) {
.img-@{i} { .img-@{i} {
width: (2px * @i); width: (2px * @i)!important;
height: (2px * @i); height: (2px * @i)!important;
} }
.generate-img(@n, (@i + 1)); .generate-img(@n, (@i + 1));
} }

View File

@ -4,11 +4,11 @@
padding-top: 15px; padding-top: 15px;
padding-bottom: @footer-margin * 3; padding-bottom: @footer-margin * 3;
.head { .head {
height: 75px; height: 40px;
padding-top: 20px;
background-color: #FCFCFC; background-color: #FCFCFC;
.mega-octicon { .mega-octicon {
width: @mega-octicon-width; width: @mega-octicon-width;
font-size: 30px;
} }
a, a,
.fork-flag { .fork-flag {
@ -25,65 +25,13 @@
line-height: 10px; line-height: 10px;
white-space: nowrap; white-space: nowrap;
} }
.button {
margin-left: 10px;
i {
margin-right: 5px;
}
}
.num { .num {
font-weight: bold; font-weight: bold;
} }
.octicon {
height: 5px;
}
}
.navbar {
height: 60px;
padding-top: 20px;
.ui.secondary.menu .item {
margin-left: -10px;
margin-top: -7px;
&>.input {
.new-label-input,
.color-picker {
background-color: white;
border: 1px solid rgba(0,0,0,.15);
}
}
&.input {
margin-right: -7px;
}
.new-label-input {
width: 150px;
}
.color-picker {
height: 35px;
width: auto;
padding-left: 30px;
}
.minicolors-swatch.minicolors-sprite {
top: 10px;
left: 10px;
width: 15px;
height: 15px;
}
&.precolors {
padding-left: 0;
padding-right: 0;
margin-right: 10px;
width: 120px;
.color {
float: left;
width: 15px;
height: 15px;
}
}
}
} }
.filter.menu { .filter.menu {
.label.color { .label.color {
margin-left: 17px; margin-left: 15px;
padding: 0 8px; padding: 0 8px;
} }
.octicon { .octicon {
@ -106,8 +54,8 @@
padding-top: 15px; padding-top: 15px;
} }
.issue.list { .issue.list {
clear: both;
list-style: none; list-style: none;
padding-top: 15px;
>.item { >.item {
padding-top: 15px; padding-top: 15px;
padding-bottom: 10px; padding-bottom: 10px;
@ -140,8 +88,8 @@
} }
.label.list { .label.list {
clear: both;
list-style: none; list-style: none;
padding-top: 15px;
.item { .item {
padding-top: 10px; padding-top: 10px;
padding-bottom: 10px; padding-bottom: 10px;
@ -162,8 +110,8 @@
} }
.milestone.list { .milestone.list {
clear: both;
list-style: none; list-style: none;
padding-top: 15px;
> .item { > .item {
padding-top: 10px; padding-top: 10px;
padding-bottom: 10px; padding-bottom: 10px;
@ -212,67 +160,77 @@
} }
} }
} }
&.new.milestone { // &.new.milestone {
textarea { // textarea {
height: 200px; // height: 200px;
} // }
// }
// &.settings {
// .content {
// padding-left: 20px!important;
// }
// }
} }
&.settings { // .settings .key.list {
.content { // .item:not(:first-child) {
padding-left: 20px!important; // border-top: 1px solid #eaeaea;
} // }
} // .ssh-key-state-indicator {
} // float: left;
// color: gray;
// padding-left: 10px;
// padding-top: 10px;
// &.active {
// color: #6cc644;
// }
// }
// .meta {
// padding-top: 5px;
// }
// .print {
// color: #767676;
// }
// .activity {
// color: #666;
// }
// }
.settings .key.list { .edit-label.modal,
.item:not(:first-child) { .new-label.segment {
border-top: 1px solid #eaeaea; .form {
.column {
padding-right: 0;
} }
.ssh-key-state-indicator { .buttons {
float: left; margin-left: auto;
color: gray; padding-top: 15px;
padding-left: 10px;
padding-top: 10px;
&.active {
color: #6cc644;
} }
} .color.picker.column {
.meta { width: auto;
padding-top: 5px;
}
.print {
color: #767676;
}
.activity {
color: #666;
}
}
.edit-label.modal {
.color-picker { .color-picker {
margin-top: -8px!important;
height: 35px; height: 35px;
width: auto!important; width: auto;
padding-left: 30px!important; padding-left: 30px;
}
} }
.minicolors-swatch.minicolors-sprite { .minicolors-swatch.minicolors-sprite {
top: 1px; top: 10px;
left: 10px; left: 10px;
width: 15px; width: 15px;
height: 15px; height: 15px;
} }
.precolors { .precolors {
margin-bottom: -11px!important; padding-left: 0;
padding-left: 0!important; padding-right: 0;
padding-right: 0!important; margin: 3px 10px auto 10px;
margin-right: 10px!important; width: 120px;
width: 120px!important;
.color { .color {
float: left; float: left;
margin: 0!important;
width: 15px; width: 15px;
height: 15px; height: 15px;
} }
} }
} }
}

View File

@ -1,6 +1,6 @@
</div> </div>
<footer class="ui page grid"> <footer>
<div class="sixteen wide column"> <div class="ui container">
<div class="ui left"> <div class="ui left">
© 2015 Gogs · {{.i18n.Tr "version"}}: {{AppVer}} · {{.i18n.Tr "page"}}: <strong>{{LoadTimes .PageStartTime}}</strong> · {{.i18n.Tr "template"}}: <strong>{{call .TmplLoadTimes}}</strong> © 2015 Gogs · {{.i18n.Tr "version"}}: {{AppVer}} · {{.i18n.Tr "page"}}: <strong>{{LoadTimes .PageStartTime}}</strong> · {{.i18n.Tr "template"}}: <strong>{{call .TmplLoadTimes}}</strong>
</div> </div>

View File

@ -46,15 +46,27 @@
<noscript>Please enable JavaScript in your browser!</noscript> <noscript>Please enable JavaScript in your browser!</noscript>
{{if not .PageIsInstall}} {{if not .PageIsInstall}}
<div class="following bar light"> <div class="following bar light">
<div class="ui page grid"> <div class="ui container">
<div class="column"> <div class="column">
<div class="ui secondary menu">
<img class="img-15 ui image brand" src="{{AppSubUrl}}/img/favicon.png">
<a class="view-ui item {{if .PageIsHome}}active{{end}}" href="{{AppSubUrl}}/">{{if .IsSigned}}{{.i18n.Tr "dashboard"}}{{else}}{{.i18n.Tr "home"}}{{end}}</a>
<a class="view-ui item {{if .PageIsExplore}}active{{end}}" href="{{AppSubUrl}}/explore">{{.i18n.Tr "explore"}}</a>
<a class="view-ui item" target="_blank" href="http://gogs.io/docs">{{.i18n.Tr "help"}}</a>
<!-- <div class="item">
<div class="ui icon input">
<input class="searchbox" type="text" placeholder="{{.i18n.Tr "search_project"}}">
<i class="search icon"></i>
</div>
</div> -->
{{if .IsSigned}} {{if .IsSigned}}
<div class="ui right floated secondary menu"> <div class="right menu">
<a class="view-ui item user avatar poping up" href="{{AppSubUrl}}/{{.SignedUser.Name}}" data-content="{{.SignedUser.Name}}" data-variation="inverted"> <a class="view-ui item user avatar poping up" href="{{AppSubUrl}}/{{.SignedUser.Name}}" data-content="{{.SignedUser.Name}}" data-variation="inverted">
<img class="img-15" src="{{.SignedUser.AvatarLink}}"/> <img class="img-15" src="{{.SignedUser.AvatarLink}}"/>
<span class="sr-only">{{.SignedUser.Name}}</span> <span class="sr-only">{{.SignedUser.Name}}</span>
</a> </a>
<div class="ui pointing dropdown head link jump item"> <div class="ui dropdown head link jump item">
<span class="text"> <span class="text">
<i class="octicon octicon-plus"></i> <i class="octicon octicon-plus"></i>
<i class="dropdown icon"></i> <i class="dropdown icon"></i>
@ -79,17 +91,6 @@
<a class="view-ui item {{if .PageIsSignIn}}active{{end}}" href="{{AppSubUrl}}/user/login"><i class="octicon octicon-sign-in"></i> {{.i18n.Tr "sign_in"}}</a> <a class="view-ui item {{if .PageIsSignIn}}active{{end}}" href="{{AppSubUrl}}/user/login"><i class="octicon octicon-sign-in"></i> {{.i18n.Tr "sign_in"}}</a>
</div> </div>
{{end}} {{end}}
<div class="ui secondary menu">
<img class="img-15 ui image brand" src="{{AppSubUrl}}/img/favicon.png">
<a class="view-ui item {{if .PageIsHome}}active{{end}}" href="{{AppSubUrl}}/">{{if .IsSigned}}{{.i18n.Tr "dashboard"}}{{else}}{{.i18n.Tr "home"}}{{end}}</a>
<a class="view-ui item {{if .PageIsExplore}}active{{end}}" href="{{AppSubUrl}}/explore">{{.i18n.Tr "explore"}}</a>
<a class="view-ui item" target="_blank" href="http://gogs.io/docs">{{.i18n.Tr "help"}}</a>
<!-- <div class="item">
<div class="ui icon input">
<input class="searchbox" type="text" placeholder="{{.i18n.Tr "search_project"}}">
<i class="search icon"></i>
</div>
</div> -->
</div> </div>
</div> </div>
</div> </div>

View File

@ -1,7 +1,6 @@
{{with .Repository}} {{with .Repository}}
<div class="ui middle page head grid"> <div class="ui head container">
<h2 class="ui left"> <div class="ui huge breadcrumb">
<div class="ui breadcrumb">
<i class="mega-octicon octicon-{{if .IsPrivate}}lock{{else if .IsMirror}}repo-clone{{else if .IsFork}}repo-forked{{else}}repo{{end}}"></i> <i class="mega-octicon octicon-{{if .IsPrivate}}lock{{else if .IsMirror}}repo-clone{{else if .IsFork}}repo-forked{{else}}repo{{end}}"></i>
<a href="{{AppSubUrl}}/{{.Owner.Name}}">{{.Owner.Name}}</a> <a href="{{AppSubUrl}}/{{.Owner.Name}}">{{.Owner.Name}}</a>
<div class="divider"> / </div> <div class="divider"> / </div>
@ -9,8 +8,7 @@
{{if .IsMirror}}<div class="ui label">{{$.i18n.Tr "mirror"}}</div>{{end}} {{if .IsMirror}}<div class="ui label">{{$.i18n.Tr "mirror"}}</div>{{end}}
{{if .IsFork}}<div class="fork-flag">{{$.i18n.Tr "repo.forked_from"}} <a href="{{.ForkRepo.RepoLink}}">{{SubStr .ForkRepo.RepoLink 1 -1}}</a></div>{{end}} {{if .IsFork}}<div class="fork-flag">{{$.i18n.Tr "repo.forked_from"}} <a href="{{.ForkRepo.RepoLink}}">{{SubStr .ForkRepo.RepoLink 1 -1}}</a></div>{{end}}
</div> </div>
</h2> <div class="ui right">
<div class="ui right floated secondary menu">
<a class="ui black basic button" href="{{$.RepoLink}}/action/{{if $.IsWatchingRepo}}un{{end}}watch?redirect_to={{$.Link}}"> <a class="ui black basic button" href="{{$.RepoLink}}/action/{{if $.IsWatchingRepo}}un{{end}}watch?redirect_to={{$.Link}}">
<i class="fa fa-eye{{if not $.IsWatchingRepo}}-slash{{end}}"></i> <i class="fa fa-eye{{if not $.IsWatchingRepo}}-slash{{end}}"></i>
{{if $.IsWatchingRepo}}{{$.i18n.Tr "repo.unwatch"}}{{else}}{{$.i18n.Tr "repo.watch"}}{{end}} <span class="num">{{.NumWatches}}</span> {{if $.IsWatchingRepo}}{{$.i18n.Tr "repo.unwatch"}}{{else}}{{$.i18n.Tr "repo.watch"}}{{end}} <span class="num">{{.NumWatches}}</span>
@ -19,7 +17,7 @@
<i class="fa fa-star{{if not $.IsStaringRepo}}-o{{end}}"></i> <i class="fa fa-star{{if not $.IsStaringRepo}}-o{{end}}"></i>
{{if $.IsStaringRepo}}{{$.i18n.Tr "repo.unstar"}}{{else}}{{$.i18n.Tr "repo.star"}}{{end}} <span class="num">{{.NumStars}}</span> {{if $.IsStaringRepo}}{{$.i18n.Tr "repo.unstar"}}{{else}}{{$.i18n.Tr "repo.star"}}{{end}} <span class="num">{{.NumStars}}</span>
</a> </a>
<a class="ui black basic button {{if $.IsRepositoryOwner}}poping up{{end}}" {{if not $.IsRepositoryOwner}}href="{{AppSubUrl}}/repo/fork/{{.Id}}"{{end}} {{if $.IsRepositoryOwner}}data-content="{{$.i18n.Tr "repo.fork_from_self"}}"{{end}}> <a class="ui black basic button {{if $.IsRepositoryOwner}}poping up{{end}}" {{if not $.IsRepositoryOwner}}href="{{AppSubUrl}}/repo/fork/{{.Id}}"{{end}} {{if $.IsRepositoryOwner}}data-content="{{$.i18n.Tr "repo.fork_from_self"}}" data-position="top right"{{end}}>
<i class="octicon octicon-repo-forked"></i> <i class="octicon octicon-repo-forked"></i>
{{$.i18n.Tr "repo.fork"}} <span class="num">{{.NumForks}}</span> {{$.i18n.Tr "repo.fork"}} <span class="num">{{.NumForks}}</span>
</a> </a>

View File

@ -1,5 +0,0 @@
{{if .Flash}}
<div class="sixteen wide center aligned centered column">
{{template "base/alert" .}}
</div>
{{end}}

View File

@ -1,38 +1,41 @@
{{template "base/head" .}} {{template "base/head" .}}
<div class="repository labels"> <div class="repository labels">
{{template "repo/header" .}} {{template "repo/header" .}}
<div class="ui middle page grid body"> <div class="ui container">
<div class="navbar"> <div class="navbar">
{{template "repo/issue/navbar" .}} {{template "repo/issue/navbar" .}}
{{if .IsRepositoryAdmin}} {{if .IsRepositoryAdmin}}
<form class="ui right form" action="{{$.RepoLink}}/labels/new" method="post"> <div class="ui right">
{{.CsrfTokenHtml}} <div class="ui green new-label button">{{.i18n.Tr "repo.issues.new_label"}}</div>
<div class="ui right floated secondary menu">
<div class="input item">
<div class="ui large input">
<input class="new-label-input" name="title" placeholder="{{.i18n.Tr "repo.issues.new_label_placeholder"}}" required>
</div> </div>
</div>
<div class="item">
<div class="ui large input">
<input class="color-picker" name="color" value="#70c24a" required>
</div>
</div>
<div class="item precolors">
{{template "repo/issue/label_precolors"}}
</div>
<button class="ui green button">{{.i18n.Tr "repo.issues.new_label"}}</button>
</div>
</form>
{{end}} {{end}}
</div> </div>
<div class="ui divider"></div> <div class="ui new-label segment hide">
{{template "repo/issue/alert" .}} <form class="ui form" action="{{$.RepoLink}}/labels/new" method="post">
<div class="ui left"> {{.CsrfTokenHtml}}
<div class="ui black label">{{.i18n.Tr "repo.issues.label_count" .NumLabels}}</div> <div class="ui grid">
<div class="five wide column">
<div class="ui small input">
<input class="new-label-input" name="title" placeholder="{{.i18n.Tr "repo.issues.new_label_placeholder"}}" autofocus required>
</div> </div>
</div>
<div class="color picker column">
<input class="color-picker" name="color" value="#70c24a" required>
</div>
<div class="column precolors">
{{template "repo/issue/label_precolors"}}
</div>
<div class="buttons">
<div class="ui blue small basic cancel button">{{.i18n.Tr "repo.milestones.cancel"}}</div>
<button class="ui green small button">{{.i18n.Tr "repo.issues.create_label"}}</button>
</div>
</div>
</form>
</div>
<div class="ui divider"></div>
{{template "base/alert" .}}
<div class="ui black label">{{.i18n.Tr "repo.issues.label_count" .NumLabels}}</div>
<div class="sixteen wide column">
<div class="label list"> <div class="label list">
{{range .Labels}} {{range .Labels}}
<li class="item"> <li class="item">
@ -47,34 +50,27 @@
</div> </div>
</div> </div>
</div> </div>
</div>
{{if .IsRepositoryAdmin}} {{if .IsRepositoryAdmin}}
<div class="ui basic delete modal"> <div class="ui small basic delete modal">
<div class="header"> <div class="ui icon header">
<i class="trash icon"></i>
{{.i18n.Tr "repo.issues.label_deletion"}} {{.i18n.Tr "repo.issues.label_deletion"}}
</div> </div>
<div class="content"> <div class="content">
<div class="image">
<i class="trash icon"></i>
</div>
<div class="description">
<p>{{.i18n.Tr "repo.issues.label_deletion_desc"}}</p> <p>{{.i18n.Tr "repo.issues.label_deletion_desc"}}</p>
</div> </div>
</div>
<div class="actions"> <div class="actions">
<div class="two fluid ui inverted buttons"> <div class="ui red basic inverted cancel button">
<div class="ui red basic inverted button">
<i class="remove icon"></i> <i class="remove icon"></i>
{{.i18n.Tr "modal.no"}} {{.i18n.Tr "modal.no"}}
</div> </div>
<div class="ui green basic inverted positive button"> <div class="ui green basic inverted ok button">
<i class="checkmark icon"></i> <i class="checkmark icon"></i>
{{.i18n.Tr "modal.yes"}} {{.i18n.Tr "modal.yes"}}
</div> </div>
</div> </div>
</div> </div>
</div>
<div class="ui small edit-label modal"> <div class="ui small edit-label modal">
<div class="header"> <div class="header">
@ -84,14 +80,16 @@
<form class="ui edit-label form" action="{{$.RepoLink}}/labels/edit" method="post"> <form class="ui edit-label form" action="{{$.RepoLink}}/labels/edit" method="post">
{{.CsrfTokenHtml}} {{.CsrfTokenHtml}}
<input id="label-modal-id" name="id" type="hidden"> <input id="label-modal-id" name="id" type="hidden">
<div class="inline fields"> <div class="ui grid">
<div class="field"> <div class="five wide column">
<input id="label-modal-title" name="title" placeholder="{{.i18n.Tr "repo.issues.new_label_placeholder"}}" required> <div class="ui small input">
<input class="new-label-input" name="title" placeholder="{{.i18n.Tr "repo.issues.new_label_placeholder"}}" autofocus required>
</div> </div>
<div class="field">
<input id="label-modal-color" class="color-picker" name="color" value="#70c24a" required>
</div> </div>
<div class="field precolors"> <div class="color picker column">
<input class="color-picker" name="color" value="#70c24a" required>
</div>
<div class="column precolors">
{{template "repo/issue/label_precolors"}} {{template "repo/issue/label_precolors"}}
</div> </div>
</div> </div>

View File

@ -1,15 +1,14 @@
{{template "base/head" .}} {{template "base/head" .}}
<div class="repository"> <div class="repository">
{{template "repo/header" .}} {{template "repo/header" .}}
<div class="ui middle page grid body"> <div class="ui container">
<div class="navbar"> <div class="navbar">
{{template "repo/issue/navbar" .}} {{template "repo/issue/navbar" .}}
<div class="ui right floated secondary menu"> <div class="ui right">
<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>
</div> </div>
</div> </div>
<div class="ui divider"></div> <div class="ui divider"></div>
<div class="ui left">
<div class="ui tiny buttons"> <div class="ui tiny buttons">
<a class="ui green basic button {{if not .IsShowClosed}}active{{end}}" href="{{.RepoLink}}/issues?type={{$.ViewType}}&state=open&labels={{.SelectLabels}}&milestone={{.MilestoneID}}"> <a class="ui green basic button {{if not .IsShowClosed}}active{{end}}" href="{{.RepoLink}}/issues?type={{$.ViewType}}&state=open&labels={{.SelectLabels}}&milestone={{.MilestoneID}}">
<i class="octicon octicon-issue-opened"></i> <i class="octicon octicon-issue-opened"></i>
@ -20,9 +19,8 @@
{{.i18n.Tr "repo.issues.close_tab" .IssueStats.ClosedCount}} {{.i18n.Tr "repo.issues.close_tab" .IssueStats.ClosedCount}}
</a> </a>
</div> </div>
</div>
<div class="ui right floated secondary filter menu"> <div class="ui right floated secondary filter menu">
<div class="ui {{if not .Labels}}disabled{{end}} pointing dropdown jump item"> <div class="ui {{if not .Labels}}disabled{{end}} dropdown jump item">
<span class="text"> <span class="text">
{{.i18n.Tr "repo.issues.filter_label"}} {{.i18n.Tr "repo.issues.filter_label"}}
<i class="dropdown icon"></i> <i class="dropdown icon"></i>
@ -34,7 +32,7 @@
{{end}} {{end}}
</div> </div>
</div> </div>
<div class="ui {{if not .Milestones}}disabled{{end}} pointing dropdown jump item"> <div class="ui {{if not .Milestones}}disabled{{end}} dropdown jump item">
<span class="text"> <span class="text">
{{.i18n.Tr "repo.issues.filter_milestone"}} {{.i18n.Tr "repo.issues.filter_milestone"}}
<i class="dropdown icon"></i> <i class="dropdown icon"></i>
@ -46,7 +44,7 @@
{{end}} {{end}}
</div> </div>
</div> </div>
<!-- <div class="ui {{if not .Assignees}}disabled{{end}} pointing dropdown jump item"> <!-- <div class="ui {{if not .Assignees}}disabled{{end}} dropdown jump item">
<span class="text"> <span class="text">
{{.i18n.Tr "repo.issues.filter_assignee"}} {{.i18n.Tr "repo.issues.filter_assignee"}}
<i class="dropdown icon"></i> <i class="dropdown icon"></i>
@ -57,7 +55,7 @@
{{end}} {{end}}
</div> </div>
</div> --> </div> -->
<div class="ui pointing dropdown type jump item"> <div class="ui dropdown type jump item">
<span class="text"> <span class="text">
{{.i18n.Tr "repo.issues.filter_type"}} {{.i18n.Tr "repo.issues.filter_type"}}
<i class="dropdown icon"></i> <i class="dropdown icon"></i>
@ -71,7 +69,6 @@
</div> </div>
</div> </div>
<div class="sixteen wide column">
<div class="issue list"> <div class="issue list">
{{range .Issues}} {{range .Issues}}
{{ $timeStr:= TimeSince .Created $.Lang }} {{ $timeStr:= TimeSince .Created $.Lang }}
@ -124,5 +121,4 @@
</div> </div>
</div> </div>
</div> </div>
</div>
{{template "base/footer" .}} {{template "base/footer" .}}

View File

@ -1,18 +1,17 @@
{{template "base/head" .}} {{template "base/head" .}}
<div class="repository milestones"> <div class="repository milestones">
{{template "repo/header" .}} {{template "repo/header" .}}
<div class="ui middle page grid body"> <div class="ui container">
<div class="navbar"> <div class="navbar">
{{template "repo/issue/navbar" .}} {{template "repo/issue/navbar" .}}
{{if .IsRepositoryAdmin}} {{if .IsRepositoryAdmin}}
<div class="ui right floated secondary menu"> <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>
{{end}} {{end}}
</div> </div>
<div class="ui divider"></div> <div class="ui divider"></div>
{{template "repo/issue/alert" .}} {{template "base/alert" .}}
<div class="ui left">
<div class="ui tiny buttons"> <div class="ui tiny buttons">
<a class="ui green basic button {{if not .IsShowClosed}}active{{end}}" href="{{.RepoLink}}/milestones?state=open"> <a class="ui green basic button {{if not .IsShowClosed}}active{{end}}" href="{{.RepoLink}}/milestones?state=open">
<i class="octicon octicon-milestone"></i> <i class="octicon octicon-milestone"></i>
@ -23,14 +22,12 @@
{{.i18n.Tr "repo.milestones.close_tab" .ClosedCount}} {{.i18n.Tr "repo.milestones.close_tab" .ClosedCount}}
</a> </a>
</div> </div>
</div>
<div class="sixteen wide column">
<div class="milestone list"> <div class="milestone list">
{{range .Milestones}} {{range .Milestones}}
<li class="item"> <li class="item">
<i class="octicon octicon-milestone"></i> <a href="{{$.RepoLink}}/issues?state={{$.State}}&milestone={{.ID}}">{{.Name}}</a> <i class="octicon octicon-milestone"></i> <a href="{{$.RepoLink}}/issues?state={{$.State}}&milestone={{.ID}}">{{.Name}}</a>
<div class="ui right blue progress" data-percent="{{.Completeness}}"> <div class="ui right green progress" data-percent="{{.Completeness}}">
<div class="bar" {{if not .Completeness}}style="background-color: transparent"{{end}}> <div class="bar" {{if not .Completeness}}style="background-color: transparent"{{end}}>
<div class="progress"></div> <div class="progress"></div>
</div> </div>
@ -95,33 +92,26 @@
</div> </div>
</div> </div>
</div> </div>
</div>
{{if .IsRepositoryAdmin}} {{if .IsRepositoryAdmin}}
<div class="ui basic delete modal"> <div class="ui small basic delete modal">
<div class="header"> <div class="ui icon header">
<i class="trash icon"></i>
{{.i18n.Tr "repo.milestones.deletion"}} {{.i18n.Tr "repo.milestones.deletion"}}
</div> </div>
<div class="content"> <div class="content">
<div class="image">
<i class="trash icon"></i>
</div>
<div class="description">
<p>{{.i18n.Tr "repo.milestones.deletion_desc"}}</p> <p>{{.i18n.Tr "repo.milestones.deletion_desc"}}</p>
</div> </div>
</div>
<div class="actions"> <div class="actions">
<div class="two fluid ui inverted buttons"> <div class="ui red basic inverted cancel button">
<div class="ui red basic inverted button">
<i class="remove icon"></i> <i class="remove icon"></i>
{{.i18n.Tr "modal.no"}} {{.i18n.Tr "modal.no"}}
</div> </div>
<div class="ui green basic inverted positive button"> <div class="ui green basic inverted ok button">
<i class="checkmark icon"></i> <i class="checkmark icon"></i>
{{.i18n.Tr "modal.yes"}} {{.i18n.Tr "modal.yes"}}
</div> </div>
</div> </div>
</div> </div>
</div>
{{end}} {{end}}
{{template "base/footer" .}} {{template "base/footer" .}}

View File

@ -1,7 +1,5 @@
<div class="ui left"> <div class="ui compact small menu">
<div class="ui compact menu">
<a class="{{if .PageIsIssueList}}active{{end}} item" href="{{.RepoLink}}/issues">{{.i18n.Tr "repo.issues"}}</a> <a class="{{if .PageIsIssueList}}active{{end}} item" href="{{.RepoLink}}/issues">{{.i18n.Tr "repo.issues"}}</a>
<a class="{{if .PageIsLabels}}active{{end}} item" href="{{.RepoLink}}/labels">{{.i18n.Tr "repo.labels"}}</a> <a class="{{if .PageIsLabels}}active{{end}} item" href="{{.RepoLink}}/labels">{{.i18n.Tr "repo.labels"}}</a>
<a class="{{if .PageIsMilestones}}active{{end}} item" href="{{.RepoLink}}/milestones">{{.i18n.Tr "repo.milestones"}}</a> <a class="{{if .PageIsMilestones}}active{{end}} item" href="{{.RepoLink}}/milestones">{{.i18n.Tr "repo.milestones"}}</a>
</div> </div>
</div>

View File

@ -253,7 +253,7 @@
<h4>Milestone</h4> <h4>Milestone</h4>
{{if .Milestone}} {{if .Milestone}}
<p class="completion{{if eq .Milestone.Completeness 0}} hidden{{end}}"><span style="width:{{.Milestone.Completeness}}%">&nbsp;</span></p> <p class="completion{{if eq .Milestone.Completeness 0}} hidden{{end}}"><span style="width:{{.Milestone.Completeness}}%">&nbsp;</span></p>
<p class="name"><strong><a href="{{$.RepoLink}}/issues?milestone={{.Milestone.Index}}{{if $.Issue.IsClosed}}&state=closed{{end}}">{{.Milestone.Name}}</a></strong></p> <p class="name"><strong><a href="{{$.RepoLink}}/issues?milestone={{.Milestone.ID}}{{if $.Issue.IsClosed}}&state=closed{{end}}">{{.Milestone.Name}}</a></strong></p>
{{else}} {{else}}
<p class="name">No milestone</p> <p class="name">No milestone</p>
{{end}} {{end}}