Skip to content

Commit

Permalink
view: Move vote button position and show edit/delete button again
Browse files Browse the repository at this point in the history
  • Loading branch information
doortts committed Sep 24, 2017
1 parent 641d2d0 commit b27f320
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 40 deletions.
2 changes: 1 addition & 1 deletion app/views/board/view.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
@if(StringUtils.isNotBlank(IssueApi.TRANSLATION_API)) {
<button type="button" id="translate" class="icon btn-transparent-with-fontsize-lineheight ml10" data-toggle="tooltip" title="@Messages("button.translation")"><i class="yobicon-lang"></i></button>
}
<span class="hide show-in-mobile-inline">
<span class="">
@if(isAllowed(UserApp.currentUser(), post.asResource(), Operation.UPDATE)) {
<button type="button" class="icon btn-transparent-with-fontsize-lineheight ml10 pt5px" data-toggle="tooltip" title="@Messages("button.edit")" onclick="window.location = '@routes.BoardApp.editPostForm(project.owner, project.name, post.getNumber)'"><i class="yobicon-edit-2"></i></button>
} else {
Expand Down
34 changes: 17 additions & 17 deletions app/views/issue/partial_voters.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,24 @@
<li>@Html(getUserAvatar(UserApp.currentUser, "smaller"))</li>
}

@for(voter <- VoteApp.getVotersForAvatar(issue.voters, numOfAvatars)) {
@if(voter != UserApp.currentUser) {
<li>@Html(getUserAvatar(voter, "smaller"))</li>
@defining(VoteApp.getVotersExceptCurrentUser(issue.voters)) { issueVoters =>
@for(voter <- VoteApp.getVotersForAvatar(issueVoters, numOfAvatars)) {
<li>@Html(getUserAvatar(voter, "smaller"))</li>
}
@if(issueVoters.size > numOfAvatars) {
<li data-toggle="tooltip" data-html="true"
title="
@for(voter <- VoteApp.getVotersForName(issueVoters, numOfAvatars, numOfNames)) {
@voter.name <br>
}
@if(issueVoters.size > numOfAvatars + numOfNames) {
&hellip;
}">
<a href="#voters" data-toggle="modal">
@Messages("issue.voters.more", issueVoters.size - numOfAvatars)
</a>
</li>
}
}
@if(issue.voters.size > numOfAvatars) {
<li data-toggle="tooltip" data-html="true"
title="
@for(voter <- VoteApp.getVotersForName(issue.voters, numOfAvatars, numOfNames)) {
@voter.name <br>
}
@if(issue.voters.size > numOfAvatars + numOfNames) {
&hellip;
}">
<a href="#voters" data-toggle="modal">
@Messages("issue.voters.more", issue.voters.size - numOfAvatars)
</a>
</li>
}
</ul>
</div>
Expand Down
43 changes: 21 additions & 22 deletions app/views/issue/view.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -173,36 +173,35 @@
</button>
}

</div>
</div>

<div id="vote" class="vote-wrap">
@if(issue.voters.size > 0) {
@partial_voters(issue, 3)
}
@if(isResourceCreatable(UserApp.currentUser, issue.asResource(), ResourceType.ISSUE_COMMENT)) {
<a href="@urlToVote" class="@if(issue.isVotedBy(UserApp.currentUser)) {ybtn-watching}" title="@getVoteButtonTitle"
data-request-method="post" data-toggle="tooltip">
<span class="heart"><i class="yobicon-hearts"></i></span>
@if(issue.voters.size > 0) {
<strong class="count">@issue.voters.size</strong>
<div id="vote" class="vote-wrap">
@if(isResourceCreatable(UserApp.currentUser, issue.asResource(), ResourceType.ISSUE_COMMENT)) {
<a href="@urlToVote" class="@if(issue.isVotedBy(UserApp.currentUser)) {ybtn-watching}" title="@getVoteButtonTitle"
data-request-method="post" data-toggle="tooltip">
<span class="heart"><i class="yobicon-hearts"></i></span>
@if(issue.voters.size > 0) {
<strong class="count">@issue.voters.size</strong>
}
</a>
} else {
<span class="ybtn-disabled" style="color: #777;" data-toggle="tooltip" title="@Messages("user.login.alert")" data-login="required">
<span class="heart"><i class="yobicon-hearts"></i></span>
@if(issue.voters.size > 0) {
<strong class="count">@issue.voters.size</strong>
}
</span>
}
</a>
} else {
<span class="ybtn-disabled" style="color: #777;" data-toggle="tooltip" title="@Messages("user.login.alert")" data-login="required">
<span class="heart"><i class="yobicon-hearts"></i></span>
@if(issue.voters.size > 0) {
<strong class="count">@issue.voters.size</strong>
@partial_voters(issue, 3)
}
</span>
}

</div>
</div>
</div>

@if(StringUtils.isNotBlank(IssueApi.TRANSLATION_API)){
<button type="button" id="translate" class="icon btn-transparent-with-fontsize-lineheight ml10" data-toggle="tooltip" title="@Messages("button.translation")"><i class="yobicon-lang"></i></button>
}

<span class="act-row hide show-in-mobile-inline">
<span class="act-row">
@if(isAllowed(UserApp.currentUser(), issue.asResource(), Operation.UPDATE)) {
<button type="button" class="icon btn-transparent-with-fontsize-lineheight ml10 pt5px" data-toggle="tooltip" title="@Messages("button.edit")" onclick="window.location='@routes.IssueApp.editIssueForm(project.owner, project.name, issue.getNumber)'"><i class="yobicon-edit-2"></i></button>
} else {
Expand Down

0 comments on commit b27f320

Please sign in to comment.