stable
Alejandro Alonso 2014-07-22 14:47:35 +02:00
commit 5f801bd424
14 changed files with 344 additions and 50 deletions

View File

@ -63,6 +63,8 @@ configure = ($routeProvider, $locationProvider, $httpProvider, $provide) ->
$routeProvider.when("/project/:pslug/admin/project-values/us-status", $routeProvider.when("/project/:pslug/admin/project-values/us-status",
{templateUrl: "/partials/admin-project-values-us-status.html"}) {templateUrl: "/partials/admin-project-values-us-status.html"})
$routeProvider.when("/project/:pslug/admin/memberships",
{templateUrl: "/partials/admin-memberships.html"})
# Auth # Auth
$routeProvider.when("/login", {templateUrl: "/partials/login.html"}) $routeProvider.when("/login", {templateUrl: "/partials/login.html"})
$routeProvider.when("/register", {templateUrl: "/partials/register.html"}) $routeProvider.when("/register", {templateUrl: "/partials/register.html"})

View File

@ -0,0 +1,157 @@
###
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014 David Barragán Merino <bameda@dbarragan.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# File: modules/admin/project-profile.coffee
###
taiga = @.taiga
mixOf = @.taiga.mixOf
module = angular.module("taigaAdmin")
#############################################################################
## Project Memberships Controller
#############################################################################
class MembershipsController extends mixOf(taiga.Controller, taiga.PageMixin)
@.$inject = [
"$scope",
"$rootScope",
"$tgRepo",
"$tgConfirm",
"$tgResources",
"$routeParams",
"$q",
"$location"
]
constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, @location) ->
_.bindAll(@)
@scope.sectionName = "Memberships"
promise = @.loadInitialData()
promise.then null, ->
console.log "FAIL" #TODO
loadProject: ->
return @rs.projects.get(@scope.projectId).then (project) =>
@scope.project = project
return project
loadMembers: ->
return @rs.memberships.list(@scope.projectId).then (data) =>
@scope.memberships = data.models
return data
loadInitialData: ->
promise = @repo.resolve({pslug: @params.pslug}).then (data) =>
@scope.projectId = data.project
return data
return promise.then(=> @.loadProject())
.then(=> @.loadMembers())
module.controller("MembershipsController", MembershipsController)
#############################################################################
## Member Avatar Directive
#############################################################################
MembershipsMemberAvatarDirective = ($log) ->
template = _.template("""
<figure class="avatar">
<img src="<%= imgurl %>" alt="<%- full_name %>">
<figcaption>
<span class="name"><%- full_name %></span>
<span class="email"><%- email %></span>
</figcaption>
</figure>
""")
render = (member) ->
ctx = {
full_name: if member.full_name then member.full_name else "------"
email: member.email
imgurl: if member.photo then member.photo else "http://thecodeplayer.com/u/uifaces/12.jpg"
}
return template(ctx)
link = ($scope, $el, $attrs) ->
if not $attrs.tgMembershipsMemberAvatar?
return $log.error "MembershipsMemberAvatarDirective: the directive need a member"
member = $scope.$eval($attrs.tgMembershipsMemberAvatar)
html = render(member)
$el.html(html)
return {
link: link
}
module.directive("tgMembershipsMemberAvatar", ["$log", MembershipsMemberAvatarDirective])
#############################################################################
## Member Actions Directive
#############################################################################
MembershipsMemberActionsDirective = ($log) ->
activedTemplate = _.template("""
<div class="active">
Active
</div>
<a class="delete" href="">
<span class="icon icon-delete"></span>
</a>
""")
pendingTemplate = _.template("""
<a class="pending" href="">
Pending
<span class="icon icon-reload"></span>
</a>
<a class="delete" href="">
<span class="icon icon-delete"></span>
</a>
""")
render = (member) ->
if member.user
return activedTemplate()
return pendingTemplate()
link = ($scope, $el, $attrs) ->
if not $attrs.tgMembershipsMemberActions?
return $log.error "MembershipsMemberActionsDirective: the directive need a member"
member = $scope.$eval($attrs.tgMembershipsMemberActions)
html = render(member)
$el.html(html)
return {
link: link
}
module.directive("tgMembershipsMemberActions", ["$log", MembershipsMemberActionsDirective])

View File

@ -51,14 +51,13 @@ urls = {
"invitation": "/invitation/:token", "invitation": "/invitation/:token",
"profile": "/:user", "profile": "/:user",
"project": "/project/:project", "project": "/project/:project",
"project-backlog": "/project/:project/backlog", "project-backlog": "/project/:project/backlog",
"project-taskboard": "/project/:project/taskboard/:sprint", "project-taskboard": "/project/:project/taskboard/:sprint",
"project-kanban": "/project/:project/kanban", "project-kanban": "/project/:project/kanban",
"project-issues": "/project/:project/issues", "project-issues": "/project/:project/issues",
"project-search": "/project/:project/search", "project-search": "/project/:project/search",
"project-issues-detail": "/project/:project/issues/:ref",
"project-issues-detail-edit": "/project/:project/issues/:ref/edit",
"project-userstories-detail": "/project/:project/us/:ref", "project-userstories-detail": "/project/:project/us/:ref",
"project-userstories-detail-edit": "/project/:project/us/:ref/edit", "project-userstories-detail-edit": "/project/:project/us/:ref/edit",
@ -66,12 +65,16 @@ urls = {
"project-tasks-detail": "/project/:project/tasks/:ref", "project-tasks-detail": "/project/:project/tasks/:ref",
"project-tasks-detail-edit": "/project/:project/tasks/:ref/edit", "project-tasks-detail-edit": "/project/:project/tasks/:ref/edit",
"project-issues-detail": "/project/:project/issues/:ref",
"project-issues-detail-edit": "/project/:project/issues/:ref/edit",
# Admin # Admin
"project-admin-home": "/project/:project/admin/project-profile/details", "project-admin-home": "/project/:project/admin/project-profile/details",
"project-admin-project-profile-details": "/project/:project/admin/project-profile/details", "project-admin-project-profile-details": "/project/:project/admin/project-profile/details",
"project-admin-project-profile-default-values": "/project/:project/admin/project-profile/default-values", "project-admin-project-profile-default-values": "/project/:project/admin/project-profile/default-values",
"project-admin-project-profile-features": "/project/:project/admin/project-profile/features" "project-admin-project-profile-features": "/project/:project/admin/project-profile/features",
"project-admin-project-values-us-status": "/project/:project/admin/project-values/us-status" "project-admin-project-values-us-status": "/project/:project/admin/project-values/us-status",
"project-admin-memberships": "/project/:project/admin/memberships"
} }
init = ($log, $navurls) -> init = ($log, $navurls) ->

View File

@ -106,6 +106,7 @@ module.run([
"$log", "$log",
"$tgResources", "$tgResources",
"$tgProjectsResourcesProvider", "$tgProjectsResourcesProvider",
"$tgMembershipsResourcesProvider",
"$tgSprintsResourcesProvider", "$tgSprintsResourcesProvider",
"$tgUserstoriesResourcesProvider", "$tgUserstoriesResourcesProvider",
"$tgTasksResourcesProvider", "$tgTasksResourcesProvider",

View File

@ -0,0 +1,41 @@
###
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014 David Barragán Merino <bameda@dbarragan.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# File: modules/resources/memberships.coffee
###
taiga = @.taiga
resourceProvider = ($repo) ->
service = {}
service.get = (id) ->
return $repo.queryOne("memberships", id)
service.list = (projectId, filters) ->
params = {project: projectId}
params = _.extend({}, params, filters or {})
return $repo.queryPaginated("memberships", params)
return (instance) ->
instance.memberships = service
module = angular.module("taigaResources")
module.factory("$tgMembershipsResourcesProvider", ["$tgRepo", resourceProvider])

View File

@ -1,18 +1,20 @@
extends layout extends dummy-layout
block head block head
title Taiga Project management web application with scrum in mind! title Taiga Project management web application with scrum in mind!
block content block content
div.wrapper div.wrapper(ng-controller="MembershipsController as ctrl",
sidebar.menu-secondary.sidebar ng-init="section='admin'")
sidebar.menu-secondary.sidebar(tg-admin-navigation="memberships")
include views/modules/admin-menu include views/modules/admin-menu
section.main.admin-membership section.main.admin-membership
header header
include views/components/mainTitle include views/components/mainTitle
a.button.button-green(title="Add New US" href="")
span.text + New role a.button.button-green(title="Add new member" href="")
span.text + New member
include views/modules/admin/admin-membership-table include views/modules/admin/admin-membership-table

View File

@ -0,0 +1,18 @@
extends layout
block head
title Taiga Project management web application with scrum in mind!
block content
div.wrapper(tg-project-us-status, ng-controller="ProjectValuesController as ctrl",
ng-init="section='admin'")
sidebar.menu-secondary.sidebar(tg-admin-navigation="project-values")
include views/modules/admin-menu
section.main.admin-roles
header
include views/components/mainTitle
p.total Notifications By Mail
include views/modules/user-settings/mail-notifications-table

View File

@ -1,6 +1,26 @@
div.popover.select-color div.popover.select-color
ul ul
- for (var z = 0; z < 21; z++) li.color(style="background: #fce94f")
li.color li.color(style="background: #edd400")
li.color(style="background: #c4a000")
li.color(style="background: #8ae234")
li.color(style="background: #73d216")
li.color(style="background: #4e9a06")
li.color(style="background: #d3d7cf")
li.color(style="background: #fcaf3e")
li.color(style="background: #f57900")
li.color(style="background: #ce5c00")
li.color(style="background: #729fcf")
li.color(style="background: #3465a4")
li.color(style="background: #204a87")
li.color(style="background: #888a85")
li.color(style="background: #ad7fa8")
li.color(style="background: #75507b")
li.color(style="background: #5c3566")
li.color(style="background: #ef2929")
li.color(style="background: #cc0000")
li.color(style="background: #a40000")
li.color(style="background: #2e3436")
input(type="text", placeholder="personalized colors", ng-model="status.color") input(type="text", placeholder="personalized colors", ng-model="status.color")
div.selected-color(style="background-color: {{ status.color }}") div.selected-color(style="background-color: {{ status.color }}")

View File

@ -8,15 +8,15 @@ section.admin-menu
a(href="", tg-nav="project-admin-project-profile-details:project=project.slug") a(href="", tg-nav="project-admin-project-profile-details:project=project.slug")
span.title Project profile span.title Project profile
span.icon.icon-arrow-right span.icon.icon-arrow-right
li#adminmenu-project-values
a(href="", tg-nav="project-admin-project-values-us-status:project=project.slug")
span.title Project values
span.icon.icon-arrow-right
li#adminmenu-memberships li#adminmenu-memberships
a(href="") a(href="" tg-nav="project-admin-memberships:project=project.slug")
span.title Memberships span.title Memberships
span.icon.icon-arrow-right span.icon.icon-arrow-right
li#adminmenu-roles li#adminmenu-roles
a(href="") a(href="")
span.title Roles span.title Roles
span.icon.icon-arrow-right span.icon.icon-arrow-right
li#adminmenu-project-values
a(href="", tg-nav="project-admin-project-values-us-status:project=project.slug")
span.title Project values
span.icon.icon-arrow-right

View File

@ -4,44 +4,15 @@ section.admin-membership-table.basic-table
div.header-admin Admin div.header-admin Admin
div.header-role Role div.header-role Role
div.header-status Status div.header-status Status
div.row
div.row-member
figure.avatar
img(alt="username" src="http://thecodeplayer.com/u/uifaces/12.jpg")
figcaption
span.name Pilar
span.email pilar.estaban@secuoyas.com
div.row-admin
input(type="checkbox", id="is-admin")
label(for="is-admin") Is admin?
div.row-role
select
option UX
option Front
option Back
div.row-status
div.active Active
a(href="#").delete
span.icon.icon-delete
div.row div.row(ng-repeat="member in memberships")
div.row-member div.row-member(tg-memberships-member-avatar="member")
figure.avatar
img(alt="username" src="http://thecodeplayer.com/u/uifaces/12.jpg")
figcaption
span.name Pilar
span.email pilar.estaban@secuoyas.com
div.row-admin div.row-admin
input(type="checkbox", id="is-admin") input(type="checkbox", id="is-admin" ng-model="member.is_admin")
label(for="is-admin") Is admin? label(for="is-admin") Is admin?
div.row-role div.row-role
select select(ng-model="member.role")
option UX option UX
option Front option Front
option Back option Back
div.row-status div.row-status(tg-memberships-member-actions="member")
a(href="#").pending
| Pending
span.icon.icon-reload
a(href="#").delete
span.icon.icon-delete

View File

@ -0,0 +1,27 @@
section.mail-notifications-table
div.mail-notifications-table-header
div.mail-notifications-table-row
div.mail-notifications-table-project
span Project
div.mail-notifications-table-all
span Receive All
div.mail-notifications-table-involved
span Only Involved
div.mail-notifications-table-none
span No notifications
div.mail-notifications-table-body
div.mail-notifications-table-row
div.mail-notifications-table-project
span Decathlon
div.mail-notifications-table-all
fieldset
input(type="radio", name="mail-notifications", id="notifications-all")
label(for="notifications-all") All
div.mail-notifications-table-involved
fieldset
input(type="radio", name="mail-notifications", id="notifications-involved")
label(for="notifications-involved") Involved
div.mail-notifications-table-none
fieldset
input(type="radio", name="mail-notifications", id="notifications-none")
label(for="notifications-none") None

View File

@ -74,6 +74,9 @@ $prefix-for-spec: true;
@import 'modules/admin/default-values'; @import 'modules/admin/default-values';
@import 'modules/admin/project-values'; @import 'modules/admin/project-values';
//Modules user Settings
@import 'modules/user-settings/mail-notifications-table';
//Layout //Layout
@import 'layout/base'; @import 'layout/base';
@import 'layout/login'; @import 'layout/login';

View File

@ -0,0 +1,49 @@
.mail-notifications-table {
.mail-notifications-table-row {
@include table-flex(stretch, center, flex, row, wrap, center);
border-bottom: 1px solid $whitish;
}
.mail-notifications-table-header {
@extend %bold;
border-bottom: 2px solid $gray-light;
}
.mail-notifications-table-project ,
.mail-notifications-table-all,
.mail-notifications-table-involved,
.mail-notifications-table-none {
padding: 1rem;
}
.mail-notifications-table-project {
@include table-flex-child(3, 0, 0);
}
.mail-notifications-table-all,
.mail-notifications-table-involved,
.mail-notifications-table-none {
@include table-flex-child(1, 0, 0);
}
input {
display: none;
&:checked {
+label {
@include transition(background .3s linear);
background: $green-taiga;
}
}
}
label {
background: $gray-light;
border-radius: 5px;
color: $white;
display: block;
padding: .5rem;
&:hover {
@include transition(background .3s linear);
background: $fresh-taiga;
cursor: pointer;
}
}
}