Merge pull request #893 from taigaio/us/6/owner-badge

Add badge to project owner
stable
David Barragán Merino 2016-03-01 12:45:38 +01:00
commit d881388648
14 changed files with 83 additions and 29 deletions

View File

@ -6,6 +6,7 @@
### Features ### Features
- Ability to create url custom fields. (thanks to [@astagi](https://github.com/astagi)). - Ability to create url custom fields. (thanks to [@astagi](https://github.com/astagi)).
- Moved from iconfont to SVG sprite icon system and redesign. - Moved from iconfont to SVG sprite icon system and redesign.
- Add badge to project owners
### Misc ### Misc
- Lots of small and not so small bugfixes. - Lots of small and not so small bugfixes.

View File

@ -224,6 +224,7 @@ MembershipsRowAvatarDirective = ($log, $template, $translate) ->
email: if member.user_email then member.user_email else member.email email: if member.user_email then member.user_email else member.email
imgurl: if member.photo then member.photo else "/" + window._version + "/images/unnamed.png" imgurl: if member.photo then member.photo else "/" + window._version + "/images/unnamed.png"
pending: if !member.is_user_active then pending else "" pending: if !member.is_user_active then pending else ""
isOwner: member.is_owner
} }
html = template(ctx) html = template(ctx)

View File

@ -95,6 +95,7 @@ class TeamController extends mixOf(taiga.Controller, taiga.PageMixin)
@scope.issuesEnabled = project.is_issues_activated @scope.issuesEnabled = project.is_issues_activated
@scope.tasksEnabled = project.is_kanban_activated or project.is_backlog_activated @scope.tasksEnabled = project.is_kanban_activated or project.is_backlog_activated
@scope.wikiEnabled = project.is_wiki_activated @scope.wikiEnabled = project.is_wiki_activated
@scope.owner = project.owner.id
return project return project
@ -185,10 +186,11 @@ TeamMemberCurrentUserDirective = () ->
scope: { scope: {
projectId: "=projectid", projectId: "=projectid",
currentUser: "=currentuser", currentUser: "=currentuser",
stats: "=" stats: "=",
issuesEnabled: "=issuesenabled" issuesEnabled: "=issuesenabled",
tasksEnabled: "=tasksenabled" tasksEnabled: "=tasksenabled",
wikiEnabled: "=wikienabled" wikiEnabled: "=wikienabled",
owner: "=owner"
} }
} }
@ -208,10 +210,11 @@ TeamMembersDirective = () ->
memberships: "=", memberships: "=",
filtersQ: "=filtersq", filtersQ: "=filtersq",
filtersRole: "=filtersrole", filtersRole: "=filtersrole",
stats: "=" stats: "=",
issuesEnabled: "=issuesenabled" issuesEnabled: "=issuesenabled",
tasksEnabled: "=tasksenabled" tasksEnabled: "=tasksenabled",
wikiEnabled: "=wikienabled" wikiEnabled: "=wikienabled",
owner: "=owner"
} }
} }

View File

@ -41,6 +41,7 @@
"IOCAINE_TEXT": "Feeling a bit overwhelmed by a task? Make sure others know about it by clicking on Iocaine when editing a task. It's possible to become immune to this (fictional) deadly poison by consuming small amounts over time just as it's possible to get better at what you do by occasionally taking on extra challenges!", "IOCAINE_TEXT": "Feeling a bit overwhelmed by a task? Make sure others know about it by clicking on Iocaine when editing a task. It's possible to become immune to this (fictional) deadly poison by consuming small amounts over time just as it's possible to get better at what you do by occasionally taking on extra challenges!",
"CLIENT_REQUIREMENT": "Client requirement is new requirement that was not previously expected and it is required to be part of the project", "CLIENT_REQUIREMENT": "Client requirement is new requirement that was not previously expected and it is required to be part of the project",
"TEAM_REQUIREMENT": "Team requirement is a requirement that must exist in the project but should have no cost for the client", "TEAM_REQUIREMENT": "Team requirement is a requirement that must exist in the project but should have no cost for the client",
"OWNER": "Project Owner",
"CAPSLOCK_WARNING": "Be careful! You are writing with capital letters and this input is case sensitive.", "CAPSLOCK_WARNING": "Be careful! You are writing with capital letters and this input is case sensitive.",
"FORM_ERRORS": { "FORM_ERRORS": {
"DEFAULT_MESSAGE": "This value seems to be invalid.", "DEFAULT_MESSAGE": "This value seems to be invalid.",

View File

@ -49,16 +49,15 @@
) )
svg.icon.icon-lock svg.icon.icon-lock
use(xlink:href="#icon-lock") use(xlink:href="#icon-lock")
svg.icon.icon-badge(ng-if="project.get('i_am_owner')")
use(xlink:href="#icon-badge")
title(translate="COMMON.OWNER")
p {{ ::project.get('description') | limitTo:300 }} p {{ ::project.get('description') | limitTo:300 }}
span(ng-if="::project.get('description').length > 300") ... span(ng-if="::project.get('description').length > 300") ...
.list-itemtype-project-tags.tag-container(ng-if="::project.get('tags').size")
span.tag(
style='border-left: 5px solid {{::tag.get("color")}};'
tg-repeat="tag in ::project.get('colorized_tags')"
)
span.tag-name {{::tag.get('name')}}
svg.drag.icon.icon-drag svg.drag.icon.icon-drag
use(xlink:href="#icon-drag") use(xlink:href="#icon-drag")

View File

@ -13,6 +13,13 @@
margin: 0; margin: 0;
} }
} }
.icon-lock,
.icon-badge {
@include svg-size();
}
.icon-badge {
margin-left: .5rem;
}
.create-project-btn { .create-project-btn {
margin-right: .25rem; margin-right: .25rem;
padding: .6rem 2.5rem; padding: .6rem 2.5rem;
@ -48,7 +55,7 @@
.list-itemtype-project { .list-itemtype-project {
background: rgba($white, .6); background: rgba($white, .6);
&:hover { &:hover {
background: lighten($primary, 63%); background: rgba($primary-light, .1);
cursor: move; cursor: move;
transition: background .3s; transition: background .3s;
.drag { .drag {

View File

@ -72,3 +72,6 @@ div.wrapper
title="{{::member.get('full_name')}}" title="{{::member.get('full_name')}}"
) )
img(ng-src="{{::member.get('photo')}}", alt="{{::member.get('full_name')}}") img(ng-src="{{::member.get('photo')}}", alt="{{::member.get('full_name')}}")
svg.icon.icon-badge(ng-if="member.get('id') == vm.project.getIn(['owner', 'id'])")
use(xlink:href="#icon-badge")
title(translate="COMMON.OWNER")

View File

@ -2,6 +2,11 @@ figure.avatar
img(src!="<%- imgurl %>", alt!="<%- full_name %>") img(src!="<%- imgurl %>", alt!="<%- full_name %>")
figcaption figcaption
span.name <%- full_name %> span.name <%- full_name %>
<% if (isOwner) { %>
svg.icon.icon-badge
use(xlink:href="#icon-badge")
title(translate="COMMON.OWNER")
<% } %>
div div
span.pending <%- pending %> span.pending <%- pending %>
span.email <%- email %> span.email <%- email %>

View File

@ -35,6 +35,7 @@ section.table-team.basic-table
issuesEnabled="issuesEnabled" issuesEnabled="issuesEnabled"
tasksenabled="tasksEnabled" tasksenabled="tasksEnabled"
wikienabled="wikiEnabled" wikienabled="wikiEnabled"
owner="owner"
ng-if="::currentUser" ng-if="::currentUser"
) )
@ -42,4 +43,14 @@ h2(ng-show="memberships.length")
span(translate="TEAM.SECTION_TITLE_TEAM") span(translate="TEAM.SECTION_TITLE_TEAM")
span {{filtersRole.name || ("TEAM.SECTION_FILTER_ALL" | translate)}} span {{filtersRole.name || ("TEAM.SECTION_FILTER_ALL" | translate)}}
section.table-team.basic-table(tg-team-members, memberships="memberships", stats="stats", filtersq="filtersQ", filtersrole="filtersRole", issuesEnabled="issuesEnabled", tasksenabled="tasksEnabled", wikienabled="wikiEnabled") section.table-team.basic-table(
tg-team-members
memberships="memberships"
stats="stats"
filtersq="filtersQ"
filtersrole="filtersRole"
issuesEnabled="issuesEnabled"
tasksenabled="tasksEnabled"
wikienabled="wikiEnabled"
owner="owner"
)

View File

@ -4,9 +4,13 @@
img(tg-bo-src="currentUser.photo", tg-bo-alt="currentUser.full_name_display") img(tg-bo-src="currentUser.photo", tg-bo-alt="currentUser.full_name_display")
.avatar-data .avatar-data
span.name(tg-bo-bind="currentUser.full_name_display") .name
span(tg-bo-bind="currentUser.full_name_display")
svg.icon.icon-badge(ng-if="currentUser.id == owner")
use(xlink:href="#icon-badge")
title(translate="COMMON.OWNER")
span.position(tg-bo-bind="currentUser.role_name") .position(tg-bo-bind="currentUser.role_name")
div(tg-leave-project="", projectid="{{projectId}}") div(tg-leave-project="", projectid="{{projectId}}")

View File

@ -4,12 +4,21 @@
img(tg-bo-src="user.photo", tg-bo-alt="user.full_name_display") img(tg-bo-src="user.photo", tg-bo-alt="user.full_name_display")
.avatar-data .avatar-data
a.name(tg-nav="user-profile:username=user.username", a.name(
title="{{::user.full_name_display}}") {{::user.full_name_display}} tg-nav="user-profile:username=user.username",
title="{{::user.full_name_display}}"
) {{::user.full_name_display}}
svg.icon.icon-badge(ng-if="user.id == owner")
use(xlink:href="#icon-badge")
title(translate="COMMON.OWNER")
span.position {{::user.role_name}} span.position {{::user.role_name}}
.member-stats(tg-team-member-stats, stats="stats", .member-stats(
user="user.user", tg-team-member-stats
issuesEnabled="issuesEnabled", stats="stats"
tasksenabled="tasksEnabled", user="user.user"
wikienabled="wikiEnabled") issuesEnabled="issuesEnabled"
tasksenabled="tasksEnabled"
wikienabled="wikiEnabled"
)

View File

@ -96,6 +96,7 @@
li { li {
flex-basis: 24%; flex-basis: 24%;
margin-right: .14rem; margin-right: .14rem;
position: relative;
&:nth-child(4n) { &:nth-child(4n) {
margin-right: 0; margin-right: 0;
} }
@ -107,5 +108,10 @@
border-radius: .2rem; border-radius: .2rem;
width: 100%; width: 100%;
} }
.icon-badge {
bottom: 15%;
position: absolute;
right: 15%;
}
} }
} }

View File

@ -100,4 +100,8 @@
.popover { .popover {
@include popover(100%, '', 0, 30px, '', 15px, '', 50%, -5px); @include popover(100%, '', 0, 30px, '', 15px, '', 50%, -5px);
} }
.icon-badge {
position: relative;
top: .15rem;
}
} }

View File

@ -361,9 +361,9 @@
<title>Looking for people</title> <title>Looking for people</title>
<path d="M510.5 3l-159 141.7-207 14.2-19.3 203L0 513.4l125.2 151.2 19.3 208 207 19 159 132.3 159-132.4 207-19 14.5-203L1021 518 896 362.2 876.6 159l-207-19-159-137zm0 250.5c72.3 0 135 56.7 135 132.3 0 75.7-62.7 132.4-135 132.4-72.2 0-134.8-56.7-134.8-127.6 0-71 62.6-127.7 134.8-127.7zm0 331c96.4 0 269.8 47 269.8 127.5v66.2H240.8V712c0-85 178.2-132.4 269.7-132.4z"/> <path d="M510.5 3l-159 141.7-207 14.2-19.3 203L0 513.4l125.2 151.2 19.3 208 207 19 159 132.3 159-132.4 207-19 14.5-203L1021 518 896 362.2 876.6 159l-207-19-159-137zm0 250.5c72.3 0 135 56.7 135 132.3 0 75.7-62.7 132.4-135 132.4-72.2 0-134.8-56.7-134.8-127.6 0-71 62.6-127.7 134.8-127.7zm0 331c96.4 0 269.8 47 269.8 127.5v66.2H240.8V712c0-85 178.2-132.4 269.7-132.4z"/>
</symbol> </symbol>
<symbol id="icon-activity" viewBox="0 0 1024 1024"> <symbol id="icon-badge" viewBox="0 0 1024 1024">
<title>Activity</title> <title>Owner Badge</title>
<path d="M715.5 206.7l117 117-249.3 246.8L379.7 367 3.2 748.6l71.2 68.7L379.7 512l203.5 203.5L903.8 395l117 117V206.7z"/> <path fill="#9dce0a" d="M512.053 24.761l-130.433 173.609-213.936-30.392 30.427 214.125-173.349 130.201 173.349 130.2-30.427 214.123 214.747-30.506 130.064 173.118 129.997-173.027 214.355 30.451-30.588-215.258 172.981-129.922-172.497-129.561 30.458-214.345-214.912 30.53-130.235-173.346z"></path>
</symbol> </symbol>
</defs> </defs>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 64 KiB

After

Width:  |  Height:  |  Size: 64 KiB