Skip to content
This repository has been archived by the owner on Sep 12, 2018. It is now read-only.

Commit

Permalink
Merge branch 'enhance/watcher-count' into 'next'
Browse files Browse the repository at this point in the history
from pull-request 1550

* enhance/watcher-count:
  project: add notification setting button at project watch/unwatch menu
  project: show project watcher count
  issue: fix wrong contextual message & key

Reviewed-by: 이응준 <eungjun.yi@navercorp.com>
  • Loading branch information
이응준 committed May 19, 2015
2 parents 23ee28f + 1130559 commit b751c05
Show file tree
Hide file tree
Showing 6 changed files with 97 additions and 47 deletions.
18 changes: 18 additions & 0 deletions app/assets/stylesheets/less/_page.less
Original file line number Diff line number Diff line change
Expand Up @@ -6214,3 +6214,21 @@ div.diff-body[data-outdated="true"] tr:hover .icon-comment {
vertical-align: middle;
}

.watcher-count{
opacity: 0.9 !important;
border: 0 !important;
text-shadow: none;
}

.watch-on {
background-color: #b6da54 !important;
}

.nofocus{
outline:0 !important;
}

.watch-btn > button {
padding: 4px 10px;
}

17 changes: 16 additions & 1 deletion app/assets/stylesheets/less/_yobiUI.less
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ span.issue-label {
}

&.ybtn-small {
padding: 2px 10px !important;
padding: 3px 10px !important;
font-size: 13px !important;
}

Expand Down Expand Up @@ -1355,3 +1355,18 @@ span.issue-label {
padding: 4px 4px 0px 4px;
color: 666;
}

.down-arrow{
&:after {
margin-left: 5px;
display: inline-block;
vertical-align: middle !important;
width: 0;
.transition(all 0.3s ease);
height: 0;
border-top: 4px solid @yobi-inverse;
border-right: 4px solid transparent;
border-left: 4px solid transparent;
content: "";
}
}
4 changes: 2 additions & 2 deletions app/views/issue/view.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@
<button id="watch-button" type="button" class="ybtn @if(issue.getWatchers.contains(UserApp.currentUser())) {ybtn-watching}"
data-toggle="button" data-watching="@if(issue.getWatchers.contains(UserApp.currentUser())){true}else{false}">
@if(issue.getWatchers.contains(UserApp.currentUser())) {
@Messages("project.unwatch")
@Messages("issue.unwatch")
} else {
@Messages("project.watch")
@Messages("issue.watch")
}
</button>
}
Expand Down
97 changes: 54 additions & 43 deletions app/views/project/header.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,24 @@
@import models.enumeration.Operation
@import controllers.UserApp

@watchHelpMessages = {
<div class="pop-content">
<p>@Messages("notification.help")</p>
<ul class="icons-ul">
<li><i class="yobicon-li yobicon-ok"></i>@Messages("notification.help.new")</li>
<li><i class="yobicon-li yobicon-ok"></i>@Messages("notification.help.new.comment")</li>
<li><i class="yobicon-li yobicon-ok"></i>@Messages("notification.help.update.issue")</li>
<li><i class="yobicon-li yobicon-ok"></i>@Messages("notification.help.update.pullrequest")</li>
</ul>
</div>
}

@amIWatching = @{
if(User.isWatching(project)) {
"watch-on"
}
}

<div class="project-header-outer" style="background-image:url(@urlToProjectBG(project))">
<div class="project-header-inner">
<div class="project-header-wrap">
Expand Down Expand Up @@ -94,52 +112,45 @@
}
@if(isAllowed(UserApp.currentUser(), project.asResource(), Operation.WATCH)) {
<li>
<div class="btn-group dropdown watch-btn">
<button class="btn disabled watcher-count nofocus no-border @amIWatching" data-toggle="tooltip" title="@Messages("project.watcher.number")">@project.getWatchingCount</button>
@if(User.isWatching(project)) {
<button class="ybtn ybtn-watching ybtn-small dropdown-toggle" tyle="button" data-toggle="dropdown">
<i class="yobicon-eye"></i> @Messages("project.watching")
</button>
} else {
<button class="ybtn ybtn-small dropdown-toggle" type="button" data-toggle="dropdown">
<i class="yobicon-eye-off"></i> @Messages("project.watch")
</button>
}
<div class="dropdown-menu flat right title">
@if(User.isWatching(project)){
<div class="pop-title">@Messages("project.you.are.watching", project.name)</div>
<div class="pop-content">
<p>@Messages("notification.help")</p>
<ul class="icons-ul">
<li><i class="yobicon-li yobicon-ok"></i>@Messages("notification.help.new")</li>
<li><i class="yobicon-li yobicon-ok"></i>@Messages("notification.help.new.comment")</li>
<li><i class="yobicon-li yobicon-ok"></i>@Messages("notification.help.update.issue")</li>
<li><i class="yobicon-li yobicon-ok"></i>@Messages("notification.help.update.pullrequest")</li>
</ul>
<div class="dropdown-menu flat right title">
<div class="pop-title">@Messages("project.you.are.watching", project.name)</div>
@watchHelpMessages
<div class="pop-content btn-wrap">
<a class="ybtn" href="@routes.UserApp.editUserInfoByTabForm("notifications")#@project.id">
<i class="yobicon-alert2"></i>
@Messages("userinfo.changeNotifications")
</a>
<a class="ybtn ybtn-watching watchBtn" href="@routes.WatchProjectApp.unwatch(project.owner, project.name)">
<i class="yobicon-eye-off"></i>
@Messages("project.unwatch")
</a>
</div>
</div>
<div class="pop-content btn-wrap">
<a class="ybtn
watchBtn " href="@routes.WatchProjectApp.unwatch(project.owner, project.name)">
<i class="yobicon-eye-off"></i>
@Messages("project.unwatch")
</a>
</div>
} else {
<div class="pop-title">@Messages("project.you.are.not.watching", project.name)</div>
<div class="pop-content">
<p>@Messages("notification.will.help")</p>
<ul class="icons-ul">
<li><i class="yobicon-li yobicon-ok"></i>@Messages("notification.help.new")</li>
<li><i class="yobicon-li yobicon-ok"></i>@Messages("notification.help.new.comment")</li>
<li><i class="yobicon-li yobicon-ok"></i>@Messages("notification.help.update.issue")</li>
<li><i class="yobicon-li yobicon-ok"></i>@Messages("notification.help.update.pullrequest")</li>
</ul>
</div>
<div class="pop-content btn-wrap">
<a class="ybtn ybtn-watching watchBtn" href="@routes.WatchProjectApp.watch(project.owner, project.name)">
<i class="yobicon-eye"></i>
@Messages("project.watch")
</a>
<button class="btn nofocus no-border down-arrow" type="button" data-toggle="dropdown">
@Messages("project.unwatch")
</button>
} else {
<div class="dropdown-menu flat right title">
<div class="pop-title">@Messages("project.you.are.not.watching", project.name)</div>
@watchHelpMessages
<div class="pop-content btn-wrap">
<a class="ybtn" href="@routes.UserApp.editUserInfoByTabForm("notifications")#@project.id">
<i class="yobicon-alert2"></i>
@Messages("userinfo.changeNotifications")
</a>
<a class="ybtn ybtn-watching watchBtn" href="@routes.WatchProjectApp.watch(project.owner, project.name)">
<i class="yobicon-eye"></i>
@Messages("project.watch")
</a>
</div>
</div>
}
<button class="btn nofocus no-border down-arrow" type="button" data-toggle="dropdown">
@Messages("project.watch")
</button>
}
</div>
</li>
}
Expand Down
3 changes: 3 additions & 0 deletions conf/messages
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ issue.state.closed = Closed
issue.state.enrolled = Status entered
issue.state.open = Open
issue.unvote.description = Click here if you no longer agree with this issue.
issue.unwatch = unwatch this issue
issue.unwatch.start = You will no longer get notifications about this issue
issue.update.assignee.id = Update assignee
issue.update.attachLabel = Attach label
Expand All @@ -287,6 +288,7 @@ issue.vote = Agree
issue.vote.description = Click here if you agree with this issue.
issue.voters = People who agree with this
issue.voters.more = and {0} others
issue.watch = watch this issue
issue.watch.start =Now you will get notifications about this issue
label = Label
label.add = Add label
Expand Down Expand Up @@ -612,6 +614,7 @@ project.unwatch = Unwatch
project.unwatch.start = Notifications of this project has muted
project.vcs = Repository type
project.watch = Watch
project.watcher.number = number of watcher
project.watching = Watching
project.you.are.not.watching = You are not watching {0} project.
project.you.are.watching = You are watching {0} project.
Expand Down
5 changes: 4 additions & 1 deletion conf/messages.ko-KR
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ issue.state.closed = 닫힘
issue.state.enrolled = 등록
issue.state.open = 열림
issue.unvote.description = 공감을 취소하려면 버튼을 누릅니다.
issue.unwatch = 이슈 그만지켜보기
issue.unwatch.start = 이제 이 이슈에 관한 알림을 받지 않습니다
issue.update.assignee.id = 담당자 변경
issue.update.attachLabel = 라벨 추가
Expand All @@ -287,6 +288,7 @@ issue.vote = 공감
issue.vote.description = 이 이슈에 공감하기 위해 버튼을 누릅니다.
issue.voters = 이 이슈에 공감하는 사람들
issue.voters.more = 외 {0}명
issue.watch = 이슈 지켜보기
issue.watch.start = 이제 이 이슈에 관한 알림을 받습니다
label = 라벨
label.add = 라벨 추가
Expand Down Expand Up @@ -611,7 +613,8 @@ project.transfer.this = 프로젝트를 이관합니다.
project.unwatch = 그만 지켜보기
project.unwatch.start = 프로젝트를 더 이상 지켜보지 않습니다
project.vcs = 코드 저장소 타입
project.watch = 지켜보기
project.watch = 프로젝트 지켜보기
project.watcher.number = 지켜보는 사람 수
project.watching = 지켜보기 중
project.you.are.not.watching = {0} 프로젝트를 지켜보고 있지 않습니다.
project.you.are.watching = {0} 프로젝트를 지켜보는 중입니다.
Expand Down

0 comments on commit b751c05

Please sign in to comment.