Skip to content

Commit

Permalink
watch: Change project watch options
Browse files Browse the repository at this point in the history
- Turn on watch at project creation and added by member
- Show project watch status at group page
  • Loading branch information
doortts committed Jan 17, 2016
1 parent 9684b12 commit facd4b6
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
17 changes: 17 additions & 0 deletions app/assets/stylesheets/less/_page.less
Original file line number Diff line number Diff line change
Expand Up @@ -6373,3 +6373,20 @@ div.diff-body[data-outdated="true"] tr:hover .icon-comment {
}
}
}

.stats-wrap {
i {
font-size: 16px;
margin-left: 5px;
margin-right: 5px;
}
.yobicon-lightbulb {
&.ramp-on {
color: #B6DA54;
}
&.ramp-off {
color: #DADADA;
}
}
}

2 changes: 2 additions & 0 deletions app/controllers/ProjectApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ public static Result newProject() throws Exception {
RepositoryService.createRepository(project);

saveProjectMenuSetting(project);
Watch.watch(project.asResource());

return redirect(routes.ProjectApp.project(project.owner, project.name));
}
Expand Down Expand Up @@ -840,6 +841,7 @@ public static Result newMember(String ownerId, String projectName) {
if(HttpUtil.isJSONPreferred(request())){
return ok("{}");
}
Watch.watch(newMember, project.asResource());
return redirect(routes.ProjectApp.members(ownerId, projectName));
}

Expand Down
13 changes: 12 additions & 1 deletion app/views/organization/view.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@
}
}

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

@organizationLayout(org.name, utils.MenuType.NONE, org) {
@header(org)
@menu(org)
Expand Down Expand Up @@ -117,7 +123,12 @@ <h3><span id="project-description">@org.descr</span></h3>
</ul>
<p>
@Html(Messages("project.onmember", User.findUsersByProject(project.id).size))
<i class="yobicon-eye yobicon-middle"></i> @Html(Messages("project.onwatching", project.getWatchingCount))
<i class="yobicon-eye"></i> @Html(Messages("project.onwatching", project.getWatchingCount))
@if(User.isWatching(project)) {
<i class="yobicon-lightbulb ramp-on" data-toggle="tooltip" title="@Messages("project.default.group.watching")"></i>
} else {
<i class="yobicon-lightbulb ramp-off" data-toggle="tooltip" title="@Messages("project.you.are.not.watching", "")"></i>
}
</p>
</div>
</div>
Expand Down

0 comments on commit facd4b6

Please sign in to comment.