create member-stats directive
parent
b7f570ae53
commit
51087393f1
|
@ -137,22 +137,11 @@ TeamFiltersDirective = () ->
|
||||||
module.directive("tgTeamFilters", [TeamFiltersDirective])
|
module.directive("tgTeamFilters", [TeamFiltersDirective])
|
||||||
|
|
||||||
#############################################################################
|
#############################################################################
|
||||||
## Team Members Directive
|
## Team Member Stats Directive
|
||||||
#############################################################################
|
#############################################################################
|
||||||
|
|
||||||
TeamMembersDirective = () ->
|
TeamMemberStatsDirective = () ->
|
||||||
template = """
|
template = """
|
||||||
<div class="row" ng-repeat="user in memberships | filter:filtersQ | filter:{role: filtersRole.id}">
|
|
||||||
<div class="username">
|
|
||||||
<figure class="avatar">
|
|
||||||
<img tg-bo-src="user.photo", tg-bo-alt="user.full_name" />
|
|
||||||
<figcaption>
|
|
||||||
<span class="name" tg-bo-bind="user.full_name"></span>
|
|
||||||
<span class="position" tg-bo-bind="user.role_name"></span>
|
|
||||||
<tg-leave-project ng-if="currentUser"></tg-leave-project>
|
|
||||||
</figcaption>
|
|
||||||
</figure>
|
|
||||||
</div>
|
|
||||||
<div class="attribute">
|
<div class="attribute">
|
||||||
<span class="icon icon-briefcase" ng-style="{'opacity': stats.closed_bugs[user.user]}" ng-class="{'top': stats.closed_bugs[user.user] == 1}"></span>
|
<span class="icon icon-briefcase" ng-style="{'opacity': stats.closed_bugs[user.user]}" ng-class="{'top': stats.closed_bugs[user.user] == 1}"></span>
|
||||||
</div>
|
</div>
|
||||||
|
@ -171,19 +160,67 @@ TeamMembersDirective = () ->
|
||||||
<div class="attribute">
|
<div class="attribute">
|
||||||
<span class="points"></span>
|
<span class="points"></span>
|
||||||
</div>
|
</div>
|
||||||
|
"""
|
||||||
|
return {
|
||||||
|
template: template
|
||||||
|
}
|
||||||
|
|
||||||
|
module.directive("tgTeamMemberStats", TeamMemberStatsDirective)
|
||||||
|
|
||||||
|
#############################################################################
|
||||||
|
## Team Member Directive
|
||||||
|
#############################################################################
|
||||||
|
|
||||||
|
TeamMemberCurrentUserDirective = () ->
|
||||||
|
template = """
|
||||||
|
<div class="row">
|
||||||
|
<div class="username">
|
||||||
|
<figure class="avatar">
|
||||||
|
<img tg-bo-src="currentUser.photo", tg-bo-alt="currentUser.username" />
|
||||||
|
<figcaption>
|
||||||
|
<span class="name" tg-bo-bind="currentUser.username"></span>
|
||||||
|
<div tg-leave-project></div>
|
||||||
|
</figcaption>
|
||||||
|
</figure>
|
||||||
|
</div>
|
||||||
|
<div class="member-stats" tg-team-member-stats></div>
|
||||||
</div>
|
</div>
|
||||||
"""
|
"""
|
||||||
return {
|
return {
|
||||||
link: (scope) ->
|
template: template
|
||||||
if not _.isArray(scope.memberships)
|
scope: {
|
||||||
scope.memberships = [scope.memberships]
|
currentUser: "=currentuser",
|
||||||
|
stats: "="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.directive("tgTeamCurrentUser", TeamMemberCurrentUserDirective)
|
||||||
|
|
||||||
|
#############################################################################
|
||||||
|
## Team Members Directive
|
||||||
|
#############################################################################
|
||||||
|
|
||||||
|
TeamMembersDirective = () ->
|
||||||
|
template = """
|
||||||
|
<div class="row member" ng-repeat="user in memberships | filter:filtersQ | filter:{role: filtersRole.id}">
|
||||||
|
<div class="username">
|
||||||
|
<figure class="avatar">
|
||||||
|
<img tg-bo-src="user.photo", tg-bo-alt="user.full_name" />
|
||||||
|
<figcaption>
|
||||||
|
<span class="name" tg-bo-bind="user.full_name"></span>
|
||||||
|
<span class="position" tg-bo-bind="user.role_name"></span>
|
||||||
|
</figcaption>
|
||||||
|
</figure>
|
||||||
|
</div>
|
||||||
|
<div class="member-stats" tg-team-member-stats></div>
|
||||||
|
</div>
|
||||||
|
"""
|
||||||
|
return {
|
||||||
template: template
|
template: template
|
||||||
scope: {
|
scope: {
|
||||||
memberships: "=",
|
memberships: "=",
|
||||||
filtersQ: "=filtersq",
|
filtersQ: "=filtersq",
|
||||||
filtersRole: "=filtersrole",
|
filtersRole: "=filtersrole",
|
||||||
currentUser: "@currentuser",
|
|
||||||
stats: "="
|
stats: "="
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -208,8 +245,6 @@ LeaveProjectDirective = ($repo, $confirm, $location) ->
|
||||||
console.log "TODO"
|
console.log "TODO"
|
||||||
return {
|
return {
|
||||||
scope: {},
|
scope: {},
|
||||||
restrict: "EA",
|
|
||||||
replace: true,
|
|
||||||
template: template,
|
template: template,
|
||||||
link: link
|
link: link
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,7 +26,7 @@ section.table-team.basic-table
|
||||||
div.popover.attribute-explanation
|
div.popover.attribute-explanation
|
||||||
span How far did you go into this Taiga?
|
span How far did you go into this Taiga?
|
||||||
|
|
||||||
div.hero(tg-team-members, memberships="currentUser" currentuser=true)
|
div.hero(tg-team-current-user, currentuser="currentUser")
|
||||||
|
|
||||||
h2
|
h2
|
||||||
span Team >
|
span Team >
|
||||||
|
|
|
@ -90,7 +90,6 @@
|
||||||
.header-status {
|
.header-status {
|
||||||
@include table-flex-child(1, 50px, 0);
|
@include table-flex-child(1, 50px, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
.check {
|
.check {
|
||||||
background-color: darken($whitish, 10%);
|
background-color: darken($whitish, 10%);
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
|
|
|
@ -5,6 +5,10 @@
|
||||||
.username {
|
.username {
|
||||||
@include table-flex-child(3, 0, 0);
|
@include table-flex-child(3, 0, 0);
|
||||||
}
|
}
|
||||||
|
.member-stats {
|
||||||
|
@include table-flex(stretch, center, flex, row, wrap, flex-start);
|
||||||
|
@include table-flex-child(6, 0, 0);
|
||||||
|
}
|
||||||
.attribute {
|
.attribute {
|
||||||
@include table-flex-child(1, 0, 0);
|
@include table-flex-child(1, 0, 0);
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
Loading…
Reference in New Issue