Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small improvements to dependency UI #4503

Merged
merged 2 commits into from
Sep 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions options/locale/locale_en-US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -794,6 +794,7 @@ issues.dependency.pr_no_dependencies = This pull request currently doesn't have
issues.dependency.add = Add dependency...
issues.dependency.cancel = Cancel
issues.dependency.remove = Remove
issues.dependency.remove_info = Remove this dependency
issues.dependency.added_dependency = `<a href="%[1]s">%[2]s</a> added a new dependency %[3]s`
issues.dependency.removed_dependency = `<a href="%[1]s">%[2]s</a> removed a dependency %[3]s`
issues.dependency.issue_closing_blockedby = Closing this pull request is blocked by the following issues
Expand Down
2 changes: 1 addition & 1 deletion public/css/index.css

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions public/less/_base.less
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,10 @@ pre, code {
z-index: 10;
}

&.transparent.label {
background-color: transparent;
}

&.menu,
&.vertical.menu,
&.segment {
Expand Down
8 changes: 8 additions & 0 deletions public/less/_repository.less
Original file line number Diff line number Diff line change
Expand Up @@ -743,6 +743,14 @@
margin-right: 5px;
}
}

.ui.depending {
.item.is-closed {
.title {
text-decoration: line-through;
}
}
}
}
.comment.form {
.ui.comments {
Expand Down
88 changes: 36 additions & 52 deletions templates/repo/issue/view_content/sidebar.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -254,84 +254,68 @@
<div class="ui divider"></div>

<div class="ui depending">
<span class="text"><strong>{{.i18n.Tr "repo.issues.dependency.title"}}</strong></span>
<br>
{{if .BlockedByDependencies}}
{{if (and (not .BlockedByDependencies) (not .BlockingDependencies))}}
<span class="text"><strong>{{.i18n.Tr "repo.issues.dependency.title"}}</strong></span>
<br>
<p>{{if .Issue.IsPull}}
{{.i18n.Tr "repo.issues.dependency.pr_no_dependencies"}}
{{else}}
{{.i18n.Tr "repo.issues.dependency.issue_no_dependencies"}}
{{end}}</p>
{{end}}

{{if .BlockingDependencies}}
<span class="text" data-tooltip="{{if .Issue.IsPull}}
{{.i18n.Tr "repo.issues.dependency.issue_closing_blockedby"}}
{{else}}
{{.i18n.Tr "repo.issues.dependency.pr_closing_blockedby"}}
{{end}}" data-inverted="">
{{.i18n.Tr "repo.issues.dependency.blocked_by_short"}}:
{{.i18n.Tr "repo.issues.dependency.pr_close_blocks"}}
{{else}}
{{.i18n.Tr "repo.issues.dependency.issue_close_blocks"}}
{{end}}" data-inverted="">
<strong>{{.i18n.Tr "repo.issues.dependency.blocks_short"}}</strong>
</span>
<div class="ui relaxed divided list">
{{range .BlockedByDependencies}}
<div class="item">
<div class="right floated content">
{{range .BlockingDependencies}}
<div class="item{{if .IsClosed}} is-closed{{end}}">
<div class="ui black label">#{{.Index}}</div>
<a class="title has-emoji" href="{{$.RepoLink}}/issues/{{.Index}}">{{.Title}}</a>
<div class="ui transparent label right floated">
{{if $.CanCreateIssueDependencies}}
<a class="delete-dependency-button" onclick="deleteDependencyModal({{.ID}}, 'blockedBy');">
<a class="delete-dependency-button" onclick="deleteDependencyModal({{.ID}}, 'blocking');"
data-tooltip="{{$.i18n.Tr "repo.issues.dependency.remove_info"}}" data-inverted="">
<i class="delete icon text red"></i>
</a>
{{end}}
{{if .IsClosed}}
<div class="ui red mini label">
<i class="octicon octicon-issue-closed"></i>
</div>
{{else}}
<div class="ui green mini label">
<i class="octicon octicon-issue-opened"></i>
</div>
{{end}}
</div>
<div class="ui black label">#{{.Index}}</div>
<a class="title has-emoji" href="{{$.RepoLink}}/issues/{{.Index}}">{{.Title}}</a>
</div>
{{end}}
</div>
{{end}}

{{if .BlockingDependencies}}
{{if .BlockedByDependencies}}
<span class="text" data-tooltip="{{if .Issue.IsPull}}
{{.i18n.Tr "repo.issues.dependency.pr_close_blocks"}}
{{else}}
{{.i18n.Tr "repo.issues.dependency.issue_close_blocks"}}
{{end}}" data-inverted="">
{{.i18n.Tr "repo.issues.dependency.blocks_short"}}:
{{.i18n.Tr "repo.issues.dependency.issue_closing_blockedby"}}
{{else}}
{{.i18n.Tr "repo.issues.dependency.pr_closing_blockedby"}}
{{end}}" data-inverted="">
<strong>{{.i18n.Tr "repo.issues.dependency.blocked_by_short"}}</strong>
</span>
<div class="ui relaxed divided list">
{{range .BlockingDependencies}}
<div class="item">
<div class="right floated content">
{{range .BlockedByDependencies}}
<div class="item{{if .IsClosed}} is-closed{{end}}">
<div class="ui black label">#{{.Index}}</div>
<a class="title has-emoji" href="{{$.RepoLink}}/issues/{{.Index}}">{{.Title}}</a>
<div class="ui transparent label right floated">
{{if $.CanCreateIssueDependencies}}
<a class="delete-dependency-button" onclick="deleteDependencyModal({{.ID}}, 'blocking');">
<a class="delete-dependency-button" onclick="deleteDependencyModal({{.ID}}, 'blockedBy');"
data-tooltip="{{$.i18n.Tr "repo.issues.dependency.remove_info"}}" data-inverted="">
<i class="delete icon text red"></i>
</a>
{{end}}
{{if .IsClosed}}
<div class="ui red tiny label">
<i class="octicon octicon-issue-closed"></i>
</div>
{{else}}
<div class="ui green mini label">
<i class="octicon octicon-issue-opened"></i>
</div>
{{end}}
</div>
<div class="ui black label">#{{.Index}}</div>
<a class="title has-emoji" href="{{$.RepoLink}}/issues/{{.Index}}">{{.Title}}</a>
</div>
{{end}}
</div>
{{end}}

{{if (and (not .BlockedByDependencies) (not .BlockingDependencies))}}
<p>{{if .Issue.IsPull}}
{{.i18n.Tr "repo.issues.dependency.pr_no_dependencies"}}
{{else}}
{{.i18n.Tr "repo.issues.dependency.issue_no_dependencies"}}
{{end}}</p>
{{end}}

{{if .CanCreateIssueDependencies}}
<div>
<form method="POST" action="{{$.RepoLink}}/issues/{{.Issue.Index}}/dependency/add" id="addDependencyForm">
Expand Down