From 489c14b218347fb24a1b11d060611cd16e98b32f Mon Sep 17 00:00:00 2001 From: Juanfran Date: Wed, 11 Jun 2014 11:51:07 +0200 Subject: [PATCH 01/64] fix search jade paths --- app/{ => partials}/search.jade | 0 app/{ => partials}/views/modules/search-filter.jade | 0 app/{ => partials}/views/modules/search-in.jade | 0 app/{ => partials}/views/modules/search-result-table.jade | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename app/{ => partials}/search.jade (100%) rename app/{ => partials}/views/modules/search-filter.jade (100%) rename app/{ => partials}/views/modules/search-in.jade (100%) rename app/{ => partials}/views/modules/search-result-table.jade (100%) diff --git a/app/search.jade b/app/partials/search.jade similarity index 100% rename from app/search.jade rename to app/partials/search.jade diff --git a/app/views/modules/search-filter.jade b/app/partials/views/modules/search-filter.jade similarity index 100% rename from app/views/modules/search-filter.jade rename to app/partials/views/modules/search-filter.jade diff --git a/app/views/modules/search-in.jade b/app/partials/views/modules/search-in.jade similarity index 100% rename from app/views/modules/search-in.jade rename to app/partials/views/modules/search-in.jade diff --git a/app/views/modules/search-result-table.jade b/app/partials/views/modules/search-result-table.jade similarity index 100% rename from app/views/modules/search-result-table.jade rename to app/partials/views/modules/search-result-table.jade From ea9b480e4656c0c3a29f3c7e660f9df81ece3c43 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Wed, 11 Jun 2014 12:40:43 +0200 Subject: [PATCH 02/64] First js layout. --- .bowerrc | 3 ++ .gitignore | 2 +- app/coffee/app.coffee | 68 ++++++++++++++++++++++++++ app/coffee/modules/taigaBacklog.coffee | 0 app/coffee/modules/taigaCommon.coffee | 0 app/coffee/services/resources.coffee | 0 app/index.jade | 15 ++++++ app/partials/backlog.jade | 2 +- app/partials/dummy-layout.jade | 2 + bower.json | 68 ++++++++++++++++++++++++++ gulpfile.js | 49 ++++++++++++++----- 11 files changed, 194 insertions(+), 15 deletions(-) create mode 100644 .bowerrc create mode 100644 app/coffee/app.coffee create mode 100644 app/coffee/modules/taigaBacklog.coffee create mode 100644 app/coffee/modules/taigaCommon.coffee create mode 100644 app/coffee/services/resources.coffee create mode 100644 app/index.jade create mode 100644 app/partials/dummy-layout.jade create mode 100644 bower.json diff --git a/.bowerrc b/.bowerrc new file mode 100644 index 00000000..ce4030ae --- /dev/null +++ b/.bowerrc @@ -0,0 +1,3 @@ +{ + "directory" : "app/vendor" +} diff --git a/.gitignore b/.gitignore index a21c5375..a62e5faa 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ .sass-cache/ -bower_components/ dist/ node_modules/ +app/vendor diff --git a/app/coffee/app.coffee b/app/coffee/app.coffee new file mode 100644 index 00000000..d007f18c --- /dev/null +++ b/app/coffee/app.coffee @@ -0,0 +1,68 @@ +# Copyright (C) 2014 Andrey Antukh +# Copyright (C) 2014 Jesús Espino Garcia +# Copyright (C) 2014 David Barragán Merino +# +# 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 . + +@taiga = taiga = {} + +configure = ($routeProvider, $locationProvider, $httpProvider, $provide, $compileProvider, $gmUrlsProvider) -> + $routeProvider.when('/project/:pslug/backlog', {templateUrl: '/partials/backlog.html'}) + $routeProvider.otherwise({redirectTo: '/login'}) + $locationProvider.html5Mode(true); + + defaultHeaders = { + "Content-Type": "application/json" + "Accept-Language": "en" + } + + $httpProvider.defaults.headers.delete = defaultHeaders + $httpProvider.defaults.headers.patch = defaultHeaders + $httpProvider.defaults.headers.post = defaultHeaders + $httpProvider.defaults.headers.put = defaultHeaders + $httpProvider.defaults.headers.get = {} + + # authHttpIntercept = ($q, $location) -> + # return (promise) -> + # return promise.then null, (response) -> + # if response.status == 401 or response.status == 0 + # $location.url("/login?next=#{$location.path()}") + # return $q.reject(response) + # $provide.factory("authHttpIntercept", ["$q", "$location", authHttpIntercept]) + # $httpProvider.responseInterceptors.push('authHttpIntercept') + + +init = ($rootScope) -> + console.log "INIT" + + +configure.$inject = ["$routeProvider", "$locationProvider","$httpProvider"] +init.$inject = ["$rootScope"] + +modules = [ + "ngRoute", + "ngAnimate", + + # Taiga specific modules + # "taigaCommon" +] + + +angular.module("taigaLocalConfig", []).value("localconfig", {}) +module = angular.module("taiga", modules) +module.config(configure) +module.run(init) + + + diff --git a/app/coffee/modules/taigaBacklog.coffee b/app/coffee/modules/taigaBacklog.coffee new file mode 100644 index 00000000..e69de29b diff --git a/app/coffee/modules/taigaCommon.coffee b/app/coffee/modules/taigaCommon.coffee new file mode 100644 index 00000000..e69de29b diff --git a/app/coffee/services/resources.coffee b/app/coffee/services/resources.coffee new file mode 100644 index 00000000..e69de29b diff --git a/app/index.jade b/app/index.jade new file mode 100644 index 00000000..bec62e34 --- /dev/null +++ b/app/index.jade @@ -0,0 +1,15 @@ +doctype html +html(lang="en", ng-app="taiga") + head + meta(charset="utf-8") + title= Taiga + meta(http-equiv="content-type", content="text/html; charset=utf-8") + meta(name="description", content="Taiga Landing page") + meta(name="keywords", content="Agile, Taiga, Management, Github") + meta(name="viewport", content="width=device-width, user-scalable=no") + link(rel="stylesheet", href="/styles/main.css") + body + include partials/views/modules/nav + div.wrapper(ng-view="") + script(src="/js/libs.js?v=#{v}") + script(src="/js/app.js?v=#{v}") diff --git a/app/partials/backlog.jade b/app/partials/backlog.jade index 3f19ede2..2b70d612 100644 --- a/app/partials/backlog.jade +++ b/app/partials/backlog.jade @@ -1,4 +1,4 @@ -extends layout +extends dummy-layout block head title Taiga Project management web application with scrum in mind! diff --git a/app/partials/dummy-layout.jade b/app/partials/dummy-layout.jade new file mode 100644 index 00000000..fdec9a16 --- /dev/null +++ b/app/partials/dummy-layout.jade @@ -0,0 +1,2 @@ +block content + diff --git a/bower.json b/bower.json new file mode 100644 index 00000000..8e687d07 --- /dev/null +++ b/bower.json @@ -0,0 +1,68 @@ +{ + "name": "taiga-layout", + "version": "0.1.0", + "homepage": "https://github.com/taiga.io/taiga-layout", + "authors": [ + { + "name": "Andrey Antukh", + "email": "niwi@niwi.be" + }, + { + "name": "Jesus Espino Garcia", + "email": "jespinog@gmail.com" + }, + { + "name": "David Barragán Merino", + "email": "dbarragan@dbarragan.com" + }, + { + "name": "Xavi Julian", + "email": "xavier.julian@kaleidos.net" + } + ], + "description": "Taiga project management system (frontend)", + "license": "AGPL-3.0", + "repository": { + "type": "git", + "url": "git@github.com:taigaio/taiga-front.git" + }, + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "app/vendor", + "test", + "tests" + ], + "dependencies": { + "lodash": "~2.4.1", + "emoticons": "~0.1.7", + "jquery-flot": "~0.8.2", + "angular": "1.2.17", + "angular-route": "1.2.17", + "angular-animate": "1.2.17", + "angular-sanitize": "1.2.17", + "angular-mocks": "1.2.17", + "kalendae": "~0.4.1", + "checksley": "~0.5.0", + "i18next": "~1.7.1", + "jquery": "~2.1.1", + "select2": "~3.4.5", + "angular-ui-select2": "~0.0.5", + "google-diff-match-patch-js": "~1.0.0", + "underscore.string": "~2.3.3", + "markitup": "~1.1.14", + "jquery-textcomplete": "yuku-t/jquery-textcomplete#~0.1.1", + "flot-orderBars": "emmerich/flot-orderBars", + "moment": "~2.6.0", + "isMobile": "~0.3.1", + "favico.js": "0.3.4", + "Sortable": "~0.1.8" + }, + "resolutions": { + "lodash": "~2.4.1", + "moment": "~2.6.0", + "jquery": "~2.1.1" + }, + "private": true +} diff --git a/gulpfile.js b/gulpfile.js index 5cec1ed4..bc453b2c 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -31,9 +31,22 @@ var paths = { distStyles: "dist/styles", sassMain: "app/styles/main.scss", css: "dist/styles/**/*.css", - images: "app/images/**/*" + images: "app/images/**/*", + coffee: ["app/coffee/*.coffee", "app/coffee/**/*.coffee"] }; +// Ordered list of vendor/external libraries. +var vendorJsLibs = [ + "app/vendor/jquery/dist/jquery.js", + "app/vendor/lodash/dist/lodash.js", + "app/vendor/emoticons/lib/emoticons.js", + "app/vendor/underscore.string/lib/underscore.string.js", + "app/vendor/angular/angular.js", + "app/vendor/angular-route/angular-route.js", + "app/vendor/angular-sanitize/angular-sanitize.js", + "app/vendor/angular-animate/angular-animate.js" +] + //////////////////////////////////////////////////////////////////////////// // Layout/CSS Related tasks //////////////////////////////////////////////////////////////////////////// @@ -45,6 +58,13 @@ gulp.task("jade", function() { .pipe(gulp.dest(paths.dist + "/partials")); }); +gulp.task("template", function() { + return gulp.src(paths.app + "/index.jade") + .pipe(plumber()) + .pipe(jade({pretty: true, locals:{v:(new Date()).getTime()}})) + .pipe(gulp.dest(paths.dist)); +}); + // Sass lint gulp.task("scss-lint", function() { gulp.src([paths.appStyles, "!/**/bourbon/**/*.scss"]) @@ -88,18 +108,18 @@ gulp.task("imagemin", function () { //////////////////////////////////////////////////////////////////////////// gulp.task("coffee", function() { - return gulp.src(coffeeSources) + return gulp.src(paths.coffee) .pipe(plumber()) .pipe(coffee()) .pipe(concat("app.js")) - .pipe(gulp.dest("app/dist/js/")); + .pipe(gulp.dest("dist/js/")); }); gulp.task("jslibs", function() { - return gulp.src(externalSources) + return gulp.src(vendorJsLibs) .pipe(plumber()) .pipe(concat("libs.js")) - .pipe(gulp.dest("app/dist/js/")); + .pipe(gulp.dest("dist/js/")); }); gulp.task("locales", function() { @@ -140,23 +160,22 @@ gulp.task("connect", function() { gulp.task("watch", function() { gulp.watch(paths.jade, ["jade"]); gulp.watch(paths.appStyles, ["scss-lint", "sass", "css"]); + gulp.watch(paths.coffee, ["coffee"]); }); gulp.task("express", function() { var express = require("express"); var app = express(); - app.use("/js", express.static(__dirname + "/app/js")); - app.use("/components", express.static(__dirname + "/app/components")); - app.use("/dist", express.static(__dirname + "/app/dist")); - app.use("/less", express.static(__dirname + "/app/less")); - app.use("/img", express.static(__dirname + "/app/img")); - app.use("/partials", express.static(__dirname + "/app/partials")); - app.use("/fonts", express.static(__dirname + "/app/fonts")); + app.use("/js", express.static(__dirname + "/dist/js")); + app.use("/styles", express.static(__dirname + "/dist/styles")); + app.use("/images", express.static(__dirname + "/dist/images")); + app.use("/partials", express.static(__dirname + "/dist/partials")); + app.use("/fonts", express.static(__dirname + "/dist/fonts")); app.all("/*", function(req, res, next) { // Just send the index.html for other files to support HTML5Mode - res.sendfile("index.html", { root: __dirname + "/app/" }); + res.sendfile("index.html", { root: __dirname + "/dist/" }); }); app.listen(9001); @@ -166,10 +185,14 @@ gulp.task("express", function() { // The default task (called when you run `gulp` from cli) gulp.task("default", [ "jade", + "template", "sass", "css", "copy", + "coffee", + "jslibs", "connect", + "express", "watch" ]); From d8880cd292c9a669066c7fd4d6fc86d78c64ce21 Mon Sep 17 00:00:00 2001 From: Juanfran Date: Wed, 11 Jun 2014 13:23:18 +0200 Subject: [PATCH 03/64] search issues --- app/partials/search-issues.jade | 13 +++++++++++++ .../views/modules/search-result-issues-table.jade | 15 +++++++++++++++ app/styles/components/taskboard-task.scss | 2 +- app/styles/modules/search-result-table.scss | 12 +++++++++++- 4 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 app/partials/search-issues.jade create mode 100644 app/partials/views/modules/search-result-issues-table.jade diff --git a/app/partials/search-issues.jade b/app/partials/search-issues.jade new file mode 100644 index 00000000..9fb74bab --- /dev/null +++ b/app/partials/search-issues.jade @@ -0,0 +1,13 @@ +extends layout + +block head + title Taiga Project management web application with scrum in mind! + +block content + sidebar.menu-secondary.sidebar + include views/modules/search-in + + section.main.search-result + include views/components/mainTitle + include views/modules/search-filter + include views/modules/search-result-issues-table \ No newline at end of file diff --git a/app/partials/views/modules/search-result-issues-table.jade b/app/partials/views/modules/search-result-issues-table.jade new file mode 100644 index 00000000..08362dd3 --- /dev/null +++ b/app/partials/views/modules/search-result-issues-table.jade @@ -0,0 +1,15 @@ +section.search-result-table + div.row.title + div.user-stories.width-6 Issue + div.status.width-2 Status + div.points.width-1 Assigned to + - for (var x = 0; x < 50; x++) + div.row.table-main + div.user-stories.width-6 + div.user-story-name + a(href="") Crear el perfil de usuario Senior en el admin + div.status.width-2 Status + div.points.width-1 + figure.avatar + img(src="http://thecodeplayer.com/u/uifaces/12.jpg", alt="username") + figcaption Pilar \ No newline at end of file diff --git a/app/styles/components/taskboard-task.scss b/app/styles/components/taskboard-task.scss index 74d1edb1..3bbd9a16 100644 --- a/app/styles/components/taskboard-task.scss +++ b/app/styles/components/taskboard-task.scss @@ -38,7 +38,7 @@ margin-right: .5em; } .taskboard-text { - @include table-flex-child($flex-grow: 10, $flex-basis: 50px, $width: 100px); + @include table-flex-child($flex-grow: 10, $flex-basis: 50px); } .icon-edit, .icon-drag-h { diff --git a/app/styles/modules/search-result-table.scss b/app/styles/modules/search-result-table.scss index a0140714..0f5846cd 100644 --- a/app/styles/modules/search-result-table.scss +++ b/app/styles/modules/search-result-table.scss @@ -8,7 +8,7 @@ width: 100%; .row { align-content: stretch; - align-items: stretch; + align-items: center; display: flex; flex-direction: row; flex-wrap: nowrap; @@ -69,4 +69,14 @@ .points { position: relative; } + .avatar { + align-items: center; + display: flex; + img { + flex-basis: 35px; + } + figcaption { + margin-left: 1rem; + } + } } From 86ed95ac49e4699dd99ebff628555f7cb7d1ebd3 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Wed, 11 Jun 2014 12:59:30 +0200 Subject: [PATCH 04/64] Add configuration module and adapt layout for it. --- .gitignore | 1 + app/coffee/config.coffee | 44 +++++++++++++++++++++++++ app/coffee/{app.coffee => taiga.coffee} | 8 ++--- config/main.coffee.example | 7 ++++ gulpfile.js | 4 ++- 5 files changed, 59 insertions(+), 5 deletions(-) create mode 100644 app/coffee/config.coffee rename app/coffee/{app.coffee => taiga.coffee} (94%) create mode 100644 config/main.coffee.example diff --git a/.gitignore b/.gitignore index a62e5faa..11136d4c 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ dist/ node_modules/ app/vendor +config/main.coffee \ No newline at end of file diff --git a/app/coffee/config.coffee b/app/coffee/config.coffee new file mode 100644 index 00000000..5e569821 --- /dev/null +++ b/app/coffee/config.coffee @@ -0,0 +1,44 @@ +# Copyright (C) 2014 Andrey Antukh +# Copyright (C) 2014 Jesús Espino Garcia +# Copyright (C) 2014 David Barragán Merino +# +# 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 . + +class ConfigService + defaults: { + host: "localhost:8000" + scheme: "http" + defaultLanguage: "en" + debug: false + languageOptions: { + "es": "Spanish" + "en": "English" + } + } + + initialize: (localconfig) -> + defaults = _.clone(@.defaults, true) + @.config = _.merge(defaults, localconfig) + + get: (key, defaultValue=null) -> + return @.config[key] || defaultValue + + +init = ($log, localconfig, config) -> + $log.debug("Initializing configuration") + config.initialize(localconfig) + +module = angular.module("taigaConfig", ["taigaLocalConfig"]) +module.service("$tgConfig", ConfigService) +module.run(["$log", "localconfig", "$tgConfig", init]) diff --git a/app/coffee/app.coffee b/app/coffee/taiga.coffee similarity index 94% rename from app/coffee/app.coffee rename to app/coffee/taiga.coffee index d007f18c..39997898 100644 --- a/app/coffee/app.coffee +++ b/app/coffee/taiga.coffee @@ -43,17 +43,17 @@ configure = ($routeProvider, $locationProvider, $httpProvider, $provide, $compil # $httpProvider.responseInterceptors.push('authHttpIntercept') -init = ($rootScope) -> - console.log "INIT" - +init = ($log, $rootScope) -> + $log.debug("Initialize application") configure.$inject = ["$routeProvider", "$locationProvider","$httpProvider"] -init.$inject = ["$rootScope"] +init.$inject = ["$log", "$rootScope"] modules = [ "ngRoute", "ngAnimate", + "taigaConfig" # Taiga specific modules # "taigaCommon" ] diff --git a/config/main.coffee.example b/config/main.coffee.example new file mode 100644 index 00000000..4b23249e --- /dev/null +++ b/config/main.coffee.example @@ -0,0 +1,7 @@ +config = { + host: "localhost:8000" + scheme: "http" + debug: true +} + +angular.module("taigaLocalConfig", []).value("localconfig", config) diff --git a/gulpfile.js b/gulpfile.js index bc453b2c..b8d783f7 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -32,7 +32,9 @@ var paths = { sassMain: "app/styles/main.scss", css: "dist/styles/**/*.css", images: "app/images/**/*", - coffee: ["app/coffee/*.coffee", "app/coffee/**/*.coffee"] + coffee: ["app/coffee/*.coffee", + "config/main.coffee", + "app/coffee/**/*.coffee"] }; // Ordered list of vendor/external libraries. From ab1857e558f5d6e1c099fd726fe58168d81f1717 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Wed, 11 Jun 2014 14:46:44 +0200 Subject: [PATCH 05/64] First attempt of organization for resource module. --- app/coffee/{taiga.coffee => app.coffee} | 6 +- app/coffee/base.coffee | 23 ++ .../{taigaBacklog.coffee => backlog.coffee} | 0 .../{taigaCommon.coffee => common.coffee} | 0 app/coffee/modules/resources/init.coffee | 61 +++++ app/coffee/modules/resources/model.coffee | 239 ++++++++++++++++++ .../modules/resources/repository.coffee | 131 ++++++++++ app/coffee/modules/resources/storage.coffee | 52 ++++ app/coffee/modules/resources/urls.coffee | 45 ++++ app/coffee/services/resources.coffee | 0 gulpfile.js | 5 +- 11 files changed, 555 insertions(+), 7 deletions(-) rename app/coffee/{taiga.coffee => app.coffee} (97%) create mode 100644 app/coffee/base.coffee rename app/coffee/modules/{taigaBacklog.coffee => backlog.coffee} (100%) rename app/coffee/modules/{taigaCommon.coffee => common.coffee} (100%) create mode 100644 app/coffee/modules/resources/init.coffee create mode 100644 app/coffee/modules/resources/model.coffee create mode 100644 app/coffee/modules/resources/repository.coffee create mode 100644 app/coffee/modules/resources/storage.coffee create mode 100644 app/coffee/modules/resources/urls.coffee delete mode 100644 app/coffee/services/resources.coffee diff --git a/app/coffee/taiga.coffee b/app/coffee/app.coffee similarity index 97% rename from app/coffee/taiga.coffee rename to app/coffee/app.coffee index 39997898..530dfecc 100644 --- a/app/coffee/taiga.coffee +++ b/app/coffee/app.coffee @@ -53,12 +53,10 @@ modules = [ "ngRoute", "ngAnimate", - "taigaConfig" - # Taiga specific modules - # "taigaCommon" + "taigaConfig", + "taigaResources", ] - angular.module("taigaLocalConfig", []).value("localconfig", {}) module = angular.module("taiga", modules) module.config(configure) diff --git a/app/coffee/base.coffee b/app/coffee/base.coffee new file mode 100644 index 00000000..04e2d303 --- /dev/null +++ b/app/coffee/base.coffee @@ -0,0 +1,23 @@ +# Copyright (C) 2014 Andrey Antukh +# Copyright (C) 2014 Jesús Espino Garcia +# Copyright (C) 2014 David Barragán Merino +# +# 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 . + +class TaigaBase + +class TaigaService extends TaigaBase + +@.taiga.TaigaBase = TaigaBase +@.taiga.TaigaService = TaigaService diff --git a/app/coffee/modules/taigaBacklog.coffee b/app/coffee/modules/backlog.coffee similarity index 100% rename from app/coffee/modules/taigaBacklog.coffee rename to app/coffee/modules/backlog.coffee diff --git a/app/coffee/modules/taigaCommon.coffee b/app/coffee/modules/common.coffee similarity index 100% rename from app/coffee/modules/taigaCommon.coffee rename to app/coffee/modules/common.coffee diff --git a/app/coffee/modules/resources/init.coffee b/app/coffee/modules/resources/init.coffee new file mode 100644 index 00000000..4db1d1a2 --- /dev/null +++ b/app/coffee/modules/resources/init.coffee @@ -0,0 +1,61 @@ +init = (urls) -> + urls.update({ + "auth": "/api/v1/auth" + "auth-register": "/api/v1/auth/register" + "permissions": "/api/v1/permissions" + "roles": "/api/v1/roles" + "projects": "/api/v1/projects" + "memberships": "/api/v1/memberships" + "milestones": "/api/v1/milestones" + "userstories": "/api/v1/userstories" + "bulk-create-us": "/api/v1/userstories/bulk_create" + "bulk-update-us-order": "/api/v1/userstories/bulk_update_order" + "userstories-restore": "/api/v1/userstories/%s/restore" + "tasks": "/api/v1/tasks" + "bulk-create-tasks": "/api/v1/tasks/bulk_create" + "tasks-restore": "/api/v1/tasks/%s/restore" + "issues": "/api/v1/issues" + "issues-restore": "/api/v1/issues/%s/restore" + "wiki": "/api/v1/wiki" + "wiki-restore": "/api/v1/wiki/%s/restore" + "choices/userstory-statuses": "/api/v1/userstory-statuses" + "choices/userstory-statuses/bulk-update-order": "/api/v1/userstory-statuses/bulk_update_order" + "choices/points": "/api/v1/points" + "choices/points/bulk-update-order": "/api/v1/points/bulk_update_order" + "choices/task-statuses": "/api/v1/task-statuses" + "choices/task-statuses/bulk-update-order": "/api/v1/task-statuses/bulk_update_order" + "choices/issue-statuses": "/api/v1/issue-statuses" + "choices/issue-statuses/bulk-update-order": "/api/v1/issue-statuses/bulk_update_order" + "choices/issue-types": "/api/v1/issue-types" + "choices/issue-types/bulk-update-order": "/api/v1/issue-types/bulk_update_order" + "choices/priorities": "/api/v1/priorities" + "choices/priorities/bulk-update-order": "/api/v1/priorities/bulk_update_order" + "choices/severities": "/api/v1/severities" + "choices/severities/bulk-update-order": "/api/v1/severities/bulk_update_order" + "search": "/api/v1/search" + "sites": "/api/v1/sites" + "project-templates": "/api/v1/project-templates" + "site-members": "/api/v1/site-members" + "site-projects": "/api/v1/site-projects" + "users": "/api/v1/users" + "users-password-recovery": "/api/v1/users/password_recovery" + "users-change-password-from-recovery": "/api/v1/users/change_password_from_recovery" + "users-change-password": "/api/v1/users/change_password" + "resolver": "/api/v1/resolver" + "wiki-attachment": "/media/attachment-files/%s/wikipage/%s" + + # History + "history/userstory": "/api/v1/history/userstory" + "history/issue": "/api/v1/history/issue" + "history/task": "/api/v1/history/task" + "history/wiki": "/api/v1/history/wiki" + + # Attachments + "userstories/attachments": "/api/v1/userstories/attachments" + "issues/attachments": "/api/v1/issues/attachments" + "tasks/attachments": "/api/v1/tasks/attachments" + "wiki/attachments": "/api/v1/wiki/attachments" + }) + +module = angular.module("taigaResources", []) +module.run(["$tgUrls", init]) diff --git a/app/coffee/modules/resources/model.coffee b/app/coffee/modules/resources/model.coffee new file mode 100644 index 00000000..32210861 --- /dev/null +++ b/app/coffee/modules/resources/model.coffee @@ -0,0 +1,239 @@ +# Copyright (C) 2014 Andrey Antukh +# Copyright (C) 2014 Jesús Espino Garcia +# Copyright (C) 2014 David Barragán Merino +# +# 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 . + +class Model + constructor: (name, data, dataTypes) -> + @._attrs = data + @._name = name + @._dataTypes = dataTypes + + @.setAttrs(data) + @.initialize() + + applyCasts: -> + for attrName, castName of @._dataTypes + castMethod = service.casts[castName] + if not castMethod + continue + + @._attrs[attrName] = castMethod(@._attrs[attrName]) + + getIdAttrName: -> + return "id" + + getUrl: -> + return "#{$gmUrls.api(@_name)}/#{@.getAttrs()[@.getIdAttrName()]}" + + getAttrs: (patch=false) -> + if patch + return _.extend({}, @._modifiedAttrs) + return _.extend({}, @._attrs, @._modifiedAttrs) + + setAttrs: (attrs) -> + @._attrs = attrs + @._modifiedAttrs = {} + + @.applyCasts() + @._isModified = false + + setAttr: (name, value) -> + @._modifiedAttrs[name] = value + @._isModified = true + + initialize: () -> + self = @ + + getter = (name) -> + return -> + if typeof(name) == 'string' and name.substr(0,2) == "__" + return self[name] + + if name not in _.keys(self._modifiedAttrs) + return self._attrs[name] + + return self._modifiedAttrs[name] + + setter = (name) -> + return (value) -> + if typeof(name) == 'string' and name.substr(0,2) == "__" + self[name] = value + return + + if self._attrs[name] != value + self._modifiedAttrs[name] = value + self._isModified = true + else + delete self._modifiedAttrs[name] + + return + + _.each @_attrs, (value, name) -> + options = + get: getter(name) + set: setter(name) + enumerable: true + configurable: true + + Object.defineProperty(self, name, options) + + serialize: () -> + data = + "data": _.clone(@_attrs) + "name": @_name + + return JSON.stringify(data) + + isModified: () -> + return this._isModified + + markSaved: () -> + @._isModified = false + @._attrs = @.getAttrs() + @._modifiedAttrs = {} + + revert: () -> + @_modifiedAttrs = {} + @_isModified = false + + @desSerialize = (sdata) -> + ddata = JSON.parse(sdata) + model = new Model(ddata.url, ddata.data) + return model + + +provider = ($q, $http, $gmUrls, $gmStorage) -> + headers = -> + token = $gmStorage.get('token') + if token + return {"Authorization":"Bearer #{token}"} + return {} + + service = {} + service.headers = headers + service.make_model = (name, data, cls=Model, dataTypes={}) -> + return new cls(name, data, dataTypes) + + service.create = (name, data, cls=Model, dataTypes={}, extraParams={}) -> + defered = $q.defer() + + params = { + method: "POST" + url: $gmUrls.api(name) + headers: headers() + data: JSON.stringify(data) + params: extraParams + } + + promise = $http(params) + promise.success (_data, _status) -> + defered.resolve(service.make_model(name, _data, cls, dataTypes)) + + promise.error (data, status) -> + defered.reject(data) + + return defered.promise + + service.remove = (model) -> + defered = $q.defer() + self = @ + + params = + method: "DELETE" + url: @getUrl() + headers: headers() + + promise = $http(params) + promise.success (data, status) -> + defered.resolve(self) + + promise.error (data, status) -> + defered.reject(self) + + return defered.promise + + service.save = (model, extraParams, patch=true) -> + self = @ + defered = $q.defer() + + if not @isModified() and patch + defered.resolve(self) + return defered.promise + + params = + url: @getUrl() + headers: headers(), + + if patch + params.method = "PATCH" + else + params.method = "PUT" + + params.data = JSON.stringify(@.getAttrs(patch)) + + params = _.extend({}, params, extraParams) + + promise = $http(params) + promise.success (data, status) -> + self._isModified = false + self._attrs = _.extend(self.getAttrs(), data) + self._modifiedAttrs = {} + + self.applyCasts() + defered.resolve(self) + + promise.error (data, status) -> + defered.reject(data) + + return defered.promise + + service.refresh = (model) -> + defered = $q.defer() + self = @ + + params = { + method: "GET", + url: @getUrl() + headers: headers() + } + + promise = $http(params) + promise.success (data, status) -> + self._modifiedAttrs = {} + self._attrs = data + self._isModified = false + self.applyCasts() + + defered.resolve(self) + + promise.error (data, status) -> + defered.reject([data, status]) + + return defered.promise + + service.cls = Model + service.casts = { + int: (value) -> + return parseInt(value, 10) + + float: (value) -> + return parseFloat(value, 10) + } + + return service + +module = angular.module("taigaResources") +module.factory("$tgModel", ["$q", "$http", "$tgUrls", "$tgStorage", provider]) diff --git a/app/coffee/modules/resources/repository.coffee b/app/coffee/modules/resources/repository.coffee new file mode 100644 index 00000000..6de5e143 --- /dev/null +++ b/app/coffee/modules/resources/repository.coffee @@ -0,0 +1,131 @@ +# Copyright (C) 2014 Andrey Antukh +# Copyright (C) 2014 Jesús Espino Garcia +# Copyright (C) 2014 David Barragán Merino +# +# 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 . + +taiga = @.taiga + +class RepositoryService extends taiga.TaigaService + @.$inject = ["$http", "$q", "$tgModel", "$tgStorage"] + + constructor: (@http, @q, @model, @storage) -> + super() + + headers: -> + token = @.storage.get('token') + if token + return {"Authorization":"Bearer #{token}"} + return {} + + resolveUrlForModel: (model) -> + idAttrName = model.getIdAttrName() + return "#{@urls.resolve(model.name)}/#{model[idAttrName]}" + + create: (name, data, dataTypes={}, extraParams={}) -> + defered = @q.defer() + + params = { + method: "POST" + url: @urls.resolve(name) + headers: headers() + data: JSON.stringify(data) + params: extraParams + } + + promise = @http(params) + promise.success (_data, _status) => + defered.resolve(@model.make_model(name, _data, null, dataTypes)) + + promise.error (data, status) => + defered.reject(data) + + return defered.promise + + remove: (model) -> + defered = $q.defer() + + params = { + method: "DELETE" + url: @.resolveUrlForModel(model) + headers: @.headers() + } + + promise = @http(params) + promise.success (data, status) -> + defered.resolve(model) + + promise.error (data, status) -> + defered.reject(model) + + return defered.promise + + save: (model, extraParams, patch=true) -> + defered = $q.defer() + + if not model.isModified() and patch + defered.resolve(model) + return defered.promise + + params = { + url: @.resolveUrlForModel(model) + headers: @.headers() + } + + if patch + params.method = "PATCH" + else + params.method = "PUT" + + params.data = JSON.stringify(model.getAttrs(patch)) + params = _.extend({}, params, extraParams) + + promise = @http(params) + promise.success (data, status) => + model._isModified = false + model._attrs = _.extend(model.getAttrs(), data) + model._modifiedAttrs = {} + + model.applyCasts() + defered.resolve(model) + + promise.error (data, status) -> + defered.reject(data) + + return defered.promise + + refresh: (model) -> + defered = $q.defer() + params = { + method: "GET", + url: @.resolveUrlForModel(model) + headers: @.headers() + } + + promise = @http(params) + promise.success (data, status) -> + model._modifiedAttrs = {} + model._attrs = data + model._isModified = false + model.applyCasts() + defered.resolve(model) + + promise.error (data, status) -> + defered.reject(data) + + return defered.promise + + +module = angular.module("taigaResources") +module.service("resources", RepositoryService) diff --git a/app/coffee/modules/resources/storage.coffee b/app/coffee/modules/resources/storage.coffee new file mode 100644 index 00000000..cfdfeada --- /dev/null +++ b/app/coffee/modules/resources/storage.coffee @@ -0,0 +1,52 @@ +# Copyright (C) 2014 Andrey Antukh +# Copyright (C) 2014 Jesús Espino Garcia +# Copyright (C) 2014 David Barragán Merino +# +# 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 . + +taiga = @.taiga + +class StorageService extends taiga.TaigaService + @.$inject = ["$rootScope"] + + constructor: ($rootScope) -> + super() + + get: (key, _default) -> + serializedValue = localStorage.getItem(key) + if serializedValue == null + return _default or null + + return JSON.parse(serializedValue) + + set: (key, val) -> + if _.isObject(key) + _.each key, (val, key) => + @set(key, val) + else + localStorage.setItem(key, JSON.stringify(val)) + + contains: (key) -> + value = @.get(key) + return (value != null) + + remove: (key) -> + localStorage.removeItem(key) + + clear: -> + localStorage.clear() + + +module = angular.module("taigaResources") +module.service("$tgStorage", StorageService) diff --git a/app/coffee/modules/resources/urls.coffee b/app/coffee/modules/resources/urls.coffee new file mode 100644 index 00000000..cdafe076 --- /dev/null +++ b/app/coffee/modules/resources/urls.coffee @@ -0,0 +1,45 @@ +# Copyright (C) 2014 Andrey Antukh +# Copyright (C) 2014 Jesús Espino Garcia +# Copyright (C) 2014 David Barragán Merino +# +# 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 . + +format = (fmt, obj) -> + obj = _.clone(obj) + return fmt.replace /%s/g, (match) -> String(obj.shift()) + +class UrlsService + @.$inject = ["$tgConfig"] + + constructor: (@config) -> + @.urls = {} + @.host = config.get("host") + @.scheme = config.get("scheme") + + update: (urls) -> + @.urls = _.merge(@.urls, urls) + + resolve: -> + args = _.toArray(arguments) + + if args.length == 0 + throw Error("wrong arguments to setUrls") + + name = args.slice(0, 1)[0] + url = format(@.urls[name], args.slice(1)) + return format("%s://%s%s", [@.scheme, @.host, url]) + + +module = angular.module("taigaResources") +module.service('$tgUrls', UrlsService) diff --git a/app/coffee/services/resources.coffee b/app/coffee/services/resources.coffee deleted file mode 100644 index e69de29b..00000000 diff --git a/gulpfile.js b/gulpfile.js index b8d783f7..881ffcc6 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -32,9 +32,8 @@ var paths = { sassMain: "app/styles/main.scss", css: "dist/styles/**/*.css", images: "app/images/**/*", - coffee: ["app/coffee/*.coffee", - "config/main.coffee", - "app/coffee/**/*.coffee"] + coffee: ["app/coffee/**/*.coffee", + "config/main.coffee"] }; // Ordered list of vendor/external libraries. From 38f0af79ee9a3b089e44c1fcf2d0e6a630d9d4a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xavier=20Juli=C3=A1n?= Date: Wed, 11 Jun 2014 16:23:50 +0200 Subject: [PATCH 06/64] fixed gitignore --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 11136d4c..6b0a9a17 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ dist/ node_modules/ app/vendor -config/main.coffee \ No newline at end of file +config/main.coffee +bower_components From 225d655ff2b75024eba4009ef2aed5ab2e3d23d5 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Wed, 11 Jun 2014 14:48:38 +0200 Subject: [PATCH 07/64] Remove duplicated methos in resources/model.coffee --- app/coffee/modules/resources/model.coffee | 97 ----------------------- 1 file changed, 97 deletions(-) diff --git a/app/coffee/modules/resources/model.coffee b/app/coffee/modules/resources/model.coffee index 32210861..86e99b99 100644 --- a/app/coffee/modules/resources/model.coffee +++ b/app/coffee/modules/resources/model.coffee @@ -127,103 +127,6 @@ provider = ($q, $http, $gmUrls, $gmStorage) -> service.make_model = (name, data, cls=Model, dataTypes={}) -> return new cls(name, data, dataTypes) - service.create = (name, data, cls=Model, dataTypes={}, extraParams={}) -> - defered = $q.defer() - - params = { - method: "POST" - url: $gmUrls.api(name) - headers: headers() - data: JSON.stringify(data) - params: extraParams - } - - promise = $http(params) - promise.success (_data, _status) -> - defered.resolve(service.make_model(name, _data, cls, dataTypes)) - - promise.error (data, status) -> - defered.reject(data) - - return defered.promise - - service.remove = (model) -> - defered = $q.defer() - self = @ - - params = - method: "DELETE" - url: @getUrl() - headers: headers() - - promise = $http(params) - promise.success (data, status) -> - defered.resolve(self) - - promise.error (data, status) -> - defered.reject(self) - - return defered.promise - - service.save = (model, extraParams, patch=true) -> - self = @ - defered = $q.defer() - - if not @isModified() and patch - defered.resolve(self) - return defered.promise - - params = - url: @getUrl() - headers: headers(), - - if patch - params.method = "PATCH" - else - params.method = "PUT" - - params.data = JSON.stringify(@.getAttrs(patch)) - - params = _.extend({}, params, extraParams) - - promise = $http(params) - promise.success (data, status) -> - self._isModified = false - self._attrs = _.extend(self.getAttrs(), data) - self._modifiedAttrs = {} - - self.applyCasts() - defered.resolve(self) - - promise.error (data, status) -> - defered.reject(data) - - return defered.promise - - service.refresh = (model) -> - defered = $q.defer() - self = @ - - params = { - method: "GET", - url: @getUrl() - headers: headers() - } - - promise = $http(params) - promise.success (data, status) -> - self._modifiedAttrs = {} - self._attrs = data - self._isModified = false - self.applyCasts() - - defered.resolve(self) - - promise.error (data, status) -> - defered.reject([data, status]) - - return defered.promise - service.cls = Model service.casts = { int: (value) -> From 00b5b759ffe7e1bfb2d304b57c1cf8048e841132 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Wed, 11 Jun 2014 17:05:42 +0200 Subject: [PATCH 08/64] Add http service layer and repository service layer. --- app/coffee/modules/auth.coffee | 67 ++++++++++++++++ app/coffee/modules/resources/http.coffee | 67 ++++++++++++++++ app/coffee/modules/resources/init.coffee | 17 ++++ app/coffee/modules/resources/model.coffee | 15 ++-- .../modules/resources/repository.coffee | 77 +++++++++---------- 5 files changed, 195 insertions(+), 48 deletions(-) create mode 100644 app/coffee/modules/auth.coffee create mode 100644 app/coffee/modules/resources/http.coffee diff --git a/app/coffee/modules/auth.coffee b/app/coffee/modules/auth.coffee new file mode 100644 index 00000000..c8e9fd3c --- /dev/null +++ b/app/coffee/modules/auth.coffee @@ -0,0 +1,67 @@ +# Copyright (C) 2014 Andrey Antukh +# Copyright (C) 2014 Jesús Espino Garcia +# Copyright (C) 2014 David Barragán Merino +# +# 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 . + +taiga = @.taiga + +class AuthService extends taiga.TaigaService + @.$inject = ["$rootScope", "$tgStorage", "$tgModel", "$tgHttp"] + + constructor: (@rootScope, @storage, @model, @http) -> + super() + + getUser: -> + userData = @storage.get("userInfo") + if userData + return @model.make_model("users", userData) + return null + + setUser: (user) -> + @rootScope.auth = user + @rootScope.$broadcast("i18n:change", user.default_language) + @gmStorage.set("userInfo", user.getAttrs()) + + clear: -> + @rootScope.auth = null + @gmStorage.remove("userInfo") + + setToken: (token) -> + @storage.set("token", token) + + getToken: -> + return @storage.get("token") + + login: (username, password) -> + url = @urls.resolve("auth") + + data = { + username: username + password: password + } + + return @http.post(url, data).then (data, status) => + user = @model.make_model("users", data) + @.setToken(data["auth_token"]) + @.setUser(user) + return user + + isAuthenticated: -> + if @.getUser() != null + return true + return false + +module = angular.module("taigaAuth", ["taigaResources"]) +module.service("$tgAuth", AuthService) diff --git a/app/coffee/modules/resources/http.coffee b/app/coffee/modules/resources/http.coffee new file mode 100644 index 00000000..4f0c691f --- /dev/null +++ b/app/coffee/modules/resources/http.coffee @@ -0,0 +1,67 @@ +# Copyright (C) 2014 Andrey Antukh +# Copyright (C) 2014 Jesús Espino Garcia +# Copyright (C) 2014 David Barragán Merino +# +# 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 . + +taiga = @.taiga + +class HttpService extends taiga.TaigaService + @.$inject = ["$http", "$q", "$tgStorage"] + + headers: -> + token = @storage.get('token') + if token + return {"Authorization":"Bearer #{token}"} + return {} + + constructor: (@http, @q, @storage) -> + super() + + request: (options) -> + options.headers = _.merge({}, options.headers or {}, @.headers()) + if _.isPlainObject(options.data) + options.data = JSON.stringify(options.data) + + return @http(options) + + get: (url, params) -> + return @.request({ + method: "GET", + params: params + }) + + post: (url, data, params) -> + options = {method: "POST"} + options.data = data if data + options.params = params if params + return @.request(options) + + put: (url, data, params) -> + options = {method: "PUT"} + options.data = data if data + options.params = params if params + return @.request(options) + + patch: (url, data, params) -> + options = {method: "PATCH"} + options.data = data if data + options.params = params if params + return @.request(options) + + delete: (url, data, params) -> + options = {method: "DELETE"} + options.data = data if data + options.params = params if params + return @.request(options) diff --git a/app/coffee/modules/resources/init.coffee b/app/coffee/modules/resources/init.coffee index 4db1d1a2..662f6310 100644 --- a/app/coffee/modules/resources/init.coffee +++ b/app/coffee/modules/resources/init.coffee @@ -1,3 +1,20 @@ +# Copyright (C) 2014 Andrey Antukh +# Copyright (C) 2014 Jesús Espino Garcia +# Copyright (C) 2014 David Barragán Merino +# +# 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 . + init = (urls) -> urls.update({ "auth": "/api/v1/auth" diff --git a/app/coffee/modules/resources/model.coffee b/app/coffee/modules/resources/model.coffee index 86e99b99..6bdb9b60 100644 --- a/app/coffee/modules/resources/model.coffee +++ b/app/coffee/modules/resources/model.coffee @@ -115,15 +115,16 @@ class Model return model -provider = ($q, $http, $gmUrls, $gmStorage) -> - headers = -> - token = $gmStorage.get('token') - if token - return {"Authorization":"Bearer #{token}"} - return {} +taiga = @.taiga +class ModelService extends taiga.TaigaService + @.$inject = ["$q", "$tgUrls", "$tgStorage", "$tgHttp"] + + constructor: (@q, @urls, @storage, @http) -> + super() + +provider = ($q, $http, $gmUrls, $gmStorage) -> service = {} - service.headers = headers service.make_model = (name, data, cls=Model, dataTypes={}) -> return new cls(name, data, dataTypes) diff --git a/app/coffee/modules/resources/repository.coffee b/app/coffee/modules/resources/repository.coffee index 6de5e143..f6a3a50f 100644 --- a/app/coffee/modules/resources/repository.coffee +++ b/app/coffee/modules/resources/repository.coffee @@ -18,33 +18,20 @@ taiga = @.taiga class RepositoryService extends taiga.TaigaService - @.$inject = ["$http", "$q", "$tgModel", "$tgStorage"] + @.$inject = ["$q", "$tgModel", "$tgStorage", "$tgHttp"] - constructor: (@http, @q, @model, @storage) -> + constructor: (@q, @model, @storage, @http) -> super() - headers: -> - token = @.storage.get('token') - if token - return {"Authorization":"Bearer #{token}"} - return {} - resolveUrlForModel: (model) -> idAttrName = model.getIdAttrName() return "#{@urls.resolve(model.name)}/#{model[idAttrName]}" create: (name, data, dataTypes={}, extraParams={}) -> defered = @q.defer() + url = @urls.resolve(name) - params = { - method: "POST" - url: @urls.resolve(name) - headers: headers() - data: JSON.stringify(data) - params: extraParams - } - - promise = @http(params) + promise = @http.post(url, JSON.stringify(data)) promise.success (_data, _status) => defered.resolve(@model.make_model(name, _data, null, dataTypes)) @@ -55,14 +42,9 @@ class RepositoryService extends taiga.TaigaService remove: (model) -> defered = $q.defer() + url = @.resolveUrlForModel(model) - params = { - method: "DELETE" - url: @.resolveUrlForModel(model) - headers: @.headers() - } - - promise = @http(params) + promise = @http.delete(url) promise.success (data, status) -> defered.resolve(model) @@ -78,20 +60,14 @@ class RepositoryService extends taiga.TaigaService defered.resolve(model) return defered.promise - params = { - url: @.resolveUrlForModel(model) - headers: @.headers() - } + url = @.resolveUrlForModel(model) + data = JSON.stringify(model.getAttrs(patch)) if patch - params.method = "PATCH" + promise = @http.patch(url, data) else - params.method = "PUT" + promise = @http.put(url, data) - params.data = JSON.stringify(model.getAttrs(patch)) - params = _.extend({}, params, extraParams) - - promise = @http(params) promise.success (data, status) => model._isModified = false model._attrs = _.extend(model.getAttrs(), data) @@ -107,13 +83,9 @@ class RepositoryService extends taiga.TaigaService refresh: (model) -> defered = $q.defer() - params = { - method: "GET", - url: @.resolveUrlForModel(model) - headers: @.headers() - } - promise = @http(params) + url = @.resolveUrlForModel(model) + promise = @http.get(url) promise.success (data, status) -> model._modifiedAttrs = {} model._attrs = data @@ -127,5 +99,28 @@ class RepositoryService extends taiga.TaigaService return defered.promise + queryMany: (name, params) -> + url = @urls.resolve(name) + return @http.get(url, params).then (data, status) -> + return _.map(data, (x) -> @model.make_model(name, x)) + + queryOne: (name, id, params) -> + url = @urls.resolve(name) + url = "#{url}/#{id}" if id + + return @http.get(url, params).then (data, status) -> + return @model.make_model(name, data) + + queryPaginated: (name, params) -> + url = @urls.resolve(name) + return @http.get(url, params).then (data, status, headers) -> + headers = headers() + result = {} + result.models = _.map(data, (x) -> @model.make_model(name, x)) + result.count = parseInt(headers["x-pagination-count"], 10) + result.current = parseInt(headers["x-pagination-current"] or 1, 10) + result.paginatedBy = parseInt(headers["x-paginated-by"], 10) + return result + module = angular.module("taigaResources") -module.service("resources", RepositoryService) +module.service("$tgRepo", RepositoryService) From ab03bb9effd2a4e956c1157319c4d8285dcde477 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Wed, 11 Jun 2014 18:24:33 +0200 Subject: [PATCH 09/64] Initial js layout for backlog. --- app/coffee/base.coffee | 3 +- app/coffee/modules/backlog.coffee | 46 ++++++++++++++++ app/coffee/modules/resources/http.coffee | 13 +++-- .../modules/resources/repository.coffee | 17 +++--- app/partials/backlog.jade | 53 ++++++++++--------- .../views/components/backlog-row.jade | 15 ++++++ app/partials/views/modules/backlog-table.jade | 22 ++------ gulpfile.js | 9 +++- 8 files changed, 119 insertions(+), 59 deletions(-) create mode 100644 app/partials/views/components/backlog-row.jade diff --git a/app/coffee/base.coffee b/app/coffee/base.coffee index 04e2d303..99de96df 100644 --- a/app/coffee/base.coffee +++ b/app/coffee/base.coffee @@ -16,8 +16,9 @@ # along with this program. If not, see . class TaigaBase - class TaigaService extends TaigaBase +class TaigaController extends TaigaBase @.taiga.TaigaBase = TaigaBase @.taiga.TaigaService = TaigaService +@.taiga.TaigaController = TaigaController diff --git a/app/coffee/modules/backlog.coffee b/app/coffee/modules/backlog.coffee index e69de29b..7bea08ce 100644 --- a/app/coffee/modules/backlog.coffee +++ b/app/coffee/modules/backlog.coffee @@ -0,0 +1,46 @@ +# Copyright (C) 2014 Andrey Antukh +# Copyright (C) 2014 Jesús Espino Garcia +# Copyright (C) 2014 David Barragán Merino +# +# 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 . + +taiga = @.taiga + +class BacklogController extends taiga.TaigaController + constructor: (@repo) -> + console.log "foo" + + getMilestones: -> + projectId = 1 + return @repo.queryMany("milestones", {project:projectId}).then (milestones) -> + console.log milestones + return milestones + + +BacklogDirective = ($compile) -> + controller: ["$tgRepo", BacklogController] + link: (scope, element, attrs, ctrl) -> + ctrl.getMilestones().then => + console.log "kaka" + + +BacklogTableDirective = ($compile, $templateCache) -> + require: "^tgBacklog" + link: (scope, element, attrs, ctrl) -> + content = $templateCache.get("backlog-row.html") + + +module = angular.module("taiga") +module.directive("tgBacklog", ["$compile", BacklogDirective]) +module.directive("tgBacklogTable", ["$compile", "$templateCache", BacklogTableDirective]) diff --git a/app/coffee/modules/resources/http.coffee b/app/coffee/modules/resources/http.coffee index 4f0c691f..befffefa 100644 --- a/app/coffee/modules/resources/http.coffee +++ b/app/coffee/modules/resources/http.coffee @@ -39,29 +39,34 @@ class HttpService extends taiga.TaigaService get: (url, params) -> return @.request({ method: "GET", + url: url, params: params }) post: (url, data, params) -> - options = {method: "POST"} + options = {method: "POST", url: url} options.data = data if data options.params = params if params return @.request(options) put: (url, data, params) -> - options = {method: "PUT"} + options = {method: "PUT", url: url} options.data = data if data options.params = params if params return @.request(options) patch: (url, data, params) -> - options = {method: "PATCH"} + options = {method: "PATCH", url: url} options.data = data if data options.params = params if params return @.request(options) delete: (url, data, params) -> - options = {method: "DELETE"} + options = {method: "DELETE", url: url} options.data = data if data options.params = params if params return @.request(options) + + +module = angular.module("taigaResources") +module.service("$tgHttp", HttpService) diff --git a/app/coffee/modules/resources/repository.coffee b/app/coffee/modules/resources/repository.coffee index f6a3a50f..cb9f93b4 100644 --- a/app/coffee/modules/resources/repository.coffee +++ b/app/coffee/modules/resources/repository.coffee @@ -18,9 +18,9 @@ taiga = @.taiga class RepositoryService extends taiga.TaigaService - @.$inject = ["$q", "$tgModel", "$tgStorage", "$tgHttp"] + @.$inject = ["$q", "$tgModel", "$tgStorage", "$tgHttp", "$tgUrls"] - constructor: (@q, @model, @storage, @http) -> + constructor: (@q, @model, @storage, @http, @urls) -> super() resolveUrlForModel: (model) -> @@ -98,25 +98,24 @@ class RepositoryService extends taiga.TaigaService return defered.promise - queryMany: (name, params) -> url = @urls.resolve(name) - return @http.get(url, params).then (data, status) -> - return _.map(data, (x) -> @model.make_model(name, x)) + return @http.get(url, params).then (data) => + return _.map(data.data, (x) => @model.make_model(name, x)) queryOne: (name, id, params) -> url = @urls.resolve(name) url = "#{url}/#{id}" if id - return @http.get(url, params).then (data, status) -> + return @http.get(url, params).then (data) => return @model.make_model(name, data) queryPaginated: (name, params) -> url = @urls.resolve(name) - return @http.get(url, params).then (data, status, headers) -> - headers = headers() + return @http.get(url, params).then (data) => + headers = data.headers() result = {} - result.models = _.map(data, (x) -> @model.make_model(name, x)) + result.models = _.map(data.data, (x) => @model.make_model(name, x)) result.count = parseInt(headers["x-pagination-count"], 10) result.current = parseInt(headers["x-pagination-current"] or 1, 10) result.paginatedBy = parseInt(headers["x-paginated-by"], 10) diff --git a/app/partials/backlog.jade b/app/partials/backlog.jade index 2b70d612..21487f80 100644 --- a/app/partials/backlog.jade +++ b/app/partials/backlog.jade @@ -4,30 +4,31 @@ block head title Taiga Project management web application with scrum in mind! block content - sidebar.menu-secondary.extrabar.filters-bar - include views/modules/filters - section.main.backlog - include views/components/mainTitle - include views/components/summary - include views/modules/burndown - div.backlog-menu - a.trans-button(href="", title="Move to Current Sprint") - span.icon.icon-move - span.text Move to current Sprint - a.trans-button(href="", title="Show Filters") - span.icon.icon-filter - span.text Show Filters - a.trans-button(href="", title="Show Tags") - span.icon.icon-tag - span.text Show Tags - include views/components/addnewus - include views/modules/backlog-table - sidebar.menu-secondary.sidebar - include views/modules/sprints - div.lightbox.lightbox_add-new-us - include views/modules/lightbox_add-new-us - div.lightbox.lightbox_add-bulk - include views/modules/lightbox_add-bulk - div.lightbox.lightbox_add-sprint - include views/modules/lightbox_add-sprint + div(tg-backlog) + sidebar.menu-secondary.extrabar.filters-bar + include views/modules/filters + section.main.backlog + include views/components/mainTitle + include views/components/summary + include views/modules/burndown + div.backlog-menu + a.trans-button(href="", title="Move to Current Sprint") + span.icon.icon-move + span.text Move to current Sprint + a.trans-button(href="", title="Show Filters") + span.icon.icon-filter + span.text Show Filters + a.trans-button(href="", title="Show Tags") + span.icon.icon-tag + span.text Show Tags + include views/components/addnewus + include views/modules/backlog-table + sidebar.menu-secondary.sidebar + include views/modules/sprints + div.lightbox.lightbox_add-new-us + include views/modules/lightbox_add-new-us + div.lightbox.lightbox_add-bulk + include views/modules/lightbox_add-bulk + div.lightbox.lightbox_add-sprint + include views/modules/lightbox_add-sprint diff --git a/app/partials/views/components/backlog-row.jade b/app/partials/views/components/backlog-row.jade new file mode 100644 index 00000000..57c00e51 --- /dev/null +++ b/app/partials/views/components/backlog-row.jade @@ -0,0 +1,15 @@ +div.row.table-main + div.user-stories + div.user-story-name + input(type="checkbox", name="") + a(href="") Crear el perfil de usuario Senior en el admin + span.us-settings + a.icon.icon-edit(href="", title="Edit") + a.icon.icon-delete(href="", title="Delete") + div.user-story-tags + - for(var y = 0; y < 3; y++) + include ../components/tag + div.status Status + div.points 12 + div.points 54 + a.icon.icon-drag-v(href="", title="Drag") diff --git a/app/partials/views/modules/backlog-table.jade b/app/partials/views/modules/backlog-table.jade index b0ade700..a3a12cbf 100644 --- a/app/partials/views/modules/backlog-table.jade +++ b/app/partials/views/modules/backlog-table.jade @@ -1,4 +1,4 @@ -section.backlog-table +section.backlog-table(tg-backlog-table) div.row.backlog-table-header div.user-stories User Stories div.status Status @@ -66,19 +66,7 @@ section.backlog-table li a(href="", title="Status 3") Status 3 hr.doom-line - - for (var x = 0; x < 50; x++) - div.row.table-main - div.user-stories - div.user-story-name - input(type="checkbox", name="") - a(href="") Crear el perfil de usuario Senior en el admin - span.us-settings - a.icon.icon-edit(href="", title="Edit") - a.icon.icon-delete(href="", title="Delete") - div.user-story-tags - - for(var y = 0; y < 3; y++) - include ../components/tag - div.status Status - div.points 12 - div.points 54 - a.icon.icon-drag-v(href="", title="Drag") + +// Preloading angular templates parts +script(type="text/ng-template" id="backlog-row.html") + include ../components/backlog-row diff --git a/gulpfile.js b/gulpfile.js index 881ffcc6..678d442f 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -32,8 +32,13 @@ var paths = { sassMain: "app/styles/main.scss", css: "dist/styles/**/*.css", images: "app/images/**/*", - coffee: ["app/coffee/**/*.coffee", - "config/main.coffee"] + coffee: ["app/coffee/app.coffee", + "config/main.coffee", + "app/coffee/*.coffee", + "app/coffee/modules/*.coffee", + "app/coffee/modules/resources/init.coffee", + "app/coffee/modules/resources/*.coffee", + "app/coffee/**/*.coffee"] }; // Ordered list of vendor/external libraries. From cd7068c18a99fe49bb6d282f05856be39e953997 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Wed, 11 Jun 2014 19:33:33 +0200 Subject: [PATCH 10/64] Load main data for render backlog. --- app/coffee/modules/backlog.coffee | 37 ++++++++---- .../modules/resources/repository.coffee | 19 ++++++- app/coffee/modules/resources/resources.coffee | 50 ++++++++++++++++ app/partials/backlog.jade | 57 ++++++++++--------- app/partials/views/modules/backlog-table.jade | 3 - 5 files changed, 125 insertions(+), 41 deletions(-) create mode 100644 app/coffee/modules/resources/resources.coffee diff --git a/app/coffee/modules/backlog.coffee b/app/coffee/modules/backlog.coffee index 7bea08ce..b97733e9 100644 --- a/app/coffee/modules/backlog.coffee +++ b/app/coffee/modules/backlog.coffee @@ -18,27 +18,44 @@ taiga = @.taiga class BacklogController extends taiga.TaigaController - constructor: (@repo) -> - console.log "foo" + constructor: (@scope, @repo, @params, @rs) -> + # Resolve project slug + promise = @repo.resolve({pslug: @params.pslug}).then (data) => + console.log "resolve", data.project + @scope.projectId = data.project + return @rs.getProject(@scope.projectId) - getMilestones: -> - projectId = 1 - return @repo.queryMany("milestones", {project:projectId}).then (milestones) -> - console.log milestones - return milestones + # Load project + promise = promise.then (project) => + @scope.project = project + console.log project + return @rs.getMilestones(@scope.projectId) + + # Load milestones + promise = promise.then (milestones) => + @scope.milestones = milestones + return @rs.getBacklog(@scope.projectId) + + # Load unassigned userstories + promise = promise.then (userstories) => + @scope.userstories = userstories + + # Obviously fail condition + promise.then null, => + console.log "FAIL" BacklogDirective = ($compile) -> - controller: ["$tgRepo", BacklogController] + controller: ["$scope", "$tgRepo", "$routeParams", "$tgResources", BacklogController] link: (scope, element, attrs, ctrl) -> - ctrl.getMilestones().then => - console.log "kaka" BacklogTableDirective = ($compile, $templateCache) -> require: "^tgBacklog" link: (scope, element, attrs, ctrl) -> content = $templateCache.get("backlog-row.html") + scope.$watch "userstories", (userstories) => + console.log "ready to render", userstories module = angular.module("taiga") diff --git a/app/coffee/modules/resources/repository.coffee b/app/coffee/modules/resources/repository.coffee index cb9f93b4..ac689683 100644 --- a/app/coffee/modules/resources/repository.coffee +++ b/app/coffee/modules/resources/repository.coffee @@ -108,7 +108,14 @@ class RepositoryService extends taiga.TaigaService url = "#{url}/#{id}" if id return @http.get(url, params).then (data) => - return @model.make_model(name, data) + return @model.make_model(name, data.data) + + queryOneRaw: (name, id, params) -> + url = @urls.resolve(name) + url = "#{url}/#{id}" if id + + return @http.get(url, params).then (data) => + return data.data queryPaginated: (name, params) -> url = @urls.resolve(name) @@ -121,5 +128,15 @@ class RepositoryService extends taiga.TaigaService result.paginatedBy = parseInt(headers["x-paginated-by"], 10) return result + resolve: (options) -> + params = {} + params.project = options.pslug if options.pslug? + params.us = options.usref if options.usref? + params.task = options.taskref if options.taskref? + params.issue = options.issueref if options.issueref? + params.milestone = options.mlref if options.mlref? + return @.queryOneRaw("resolver", null, params) + + module = angular.module("taigaResources") module.service("$tgRepo", RepositoryService) diff --git a/app/coffee/modules/resources/resources.coffee b/app/coffee/modules/resources/resources.coffee new file mode 100644 index 00000000..7a1a0cdd --- /dev/null +++ b/app/coffee/modules/resources/resources.coffee @@ -0,0 +1,50 @@ +# Copyright (C) 2014 Andrey Antukh +# Copyright (C) 2014 Jesús Espino Garcia +# Copyright (C) 2014 David Barragán Merino +# +# 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 . + +taiga = @.taiga + +class ResourcesService extends taiga.TaigaService + @.$inject = ["$q", "$tgRepo", "$tgUrls", "$tgModel"] + + constructor: (@q, @repo, @urls, @model) -> + super() + + ############################################################################# + # Common + ############################################################################# + + getProject: (projectId) -> + return @repo.queryOne("projects", projectId) + + ############################################################################# + # Backlog + ############################################################################# + + getMilestones: (projectId) -> + return @repo.queryMany("milestones", {project:projectId}).then (milestones) => + for m in milestones + uses = m.user_stories + uses = _.map(uses, (u) => @model.make_model("userstories", u)) + m._attrs.user_stories = uses + return milestones + + getBacklog: (projectId) -> + params = {"project": projectId, "milestone": "null"} + return @repo.queryMany("userstories", params) + +module = angular.module("taigaResources") +module.service("$tgResources", ResourcesService) diff --git a/app/partials/backlog.jade b/app/partials/backlog.jade index 21487f80..f2a641de 100644 --- a/app/partials/backlog.jade +++ b/app/partials/backlog.jade @@ -4,31 +4,34 @@ block head title Taiga Project management web application with scrum in mind! block content - div(tg-backlog) - sidebar.menu-secondary.extrabar.filters-bar - include views/modules/filters - section.main.backlog - include views/components/mainTitle - include views/components/summary - include views/modules/burndown - div.backlog-menu - a.trans-button(href="", title="Move to Current Sprint") - span.icon.icon-move - span.text Move to current Sprint - a.trans-button(href="", title="Show Filters") - span.icon.icon-filter - span.text Show Filters - a.trans-button(href="", title="Show Tags") - span.icon.icon-tag - span.text Show Tags - include views/components/addnewus - include views/modules/backlog-table - sidebar.menu-secondary.sidebar - include views/modules/sprints - div.lightbox.lightbox_add-new-us - include views/modules/lightbox_add-new-us - div.lightbox.lightbox_add-bulk - include views/modules/lightbox_add-bulk - div.lightbox.lightbox_add-sprint - include views/modules/lightbox_add-sprint + sidebar.menu-secondary.extrabar.filters-bar + include views/modules/filters + section.main.backlog(tg-backlog) + include views/components/mainTitle + include views/components/summary + include views/modules/burndown + div.backlog-menu + a.trans-button(href="", title="Move to Current Sprint") + span.icon.icon-move + span.text Move to current Sprint + a.trans-button(href="", title="Show Filters") + span.icon.icon-filter + span.text Show Filters + a.trans-button(href="", title="Show Tags") + span.icon.icon-tag + span.text Show Tags + include views/components/addnewus + include views/modules/backlog-table + sidebar.menu-secondary.sidebar + include views/modules/sprints + div.lightbox.lightbox_add-new-us + include views/modules/lightbox_add-new-us + div.lightbox.lightbox_add-bulk + include views/modules/lightbox_add-bulk + div.lightbox.lightbox_add-sprint + include views/modules/lightbox_add-sprint + + // Preloading angular templates parts + script(type="text/ng-template" id="backlog-row.html") + include views/components/backlog-row diff --git a/app/partials/views/modules/backlog-table.jade b/app/partials/views/modules/backlog-table.jade index a3a12cbf..75381651 100644 --- a/app/partials/views/modules/backlog-table.jade +++ b/app/partials/views/modules/backlog-table.jade @@ -67,6 +67,3 @@ section.backlog-table(tg-backlog-table) a(href="", title="Status 3") Status 3 hr.doom-line -// Preloading angular templates parts -script(type="text/ng-template" id="backlog-row.html") - include ../components/backlog-row From 139010a2fc8c49c2a4104b117ff852546c088f73 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Thu, 12 Jun 2014 10:20:09 +0200 Subject: [PATCH 11/64] Minor reorganization on resources modules. --- app/coffee/app.coffee | 2 + app/coffee/modules/auth.coffee | 4 +- app/coffee/modules/backlog.coffee | 2 +- .../init.coffee => resources.coffee} | 33 ++++++++++++ app/coffee/modules/resources/resources.coffee | 50 ------------------- 5 files changed, 38 insertions(+), 53 deletions(-) rename app/coffee/modules/{resources/init.coffee => resources.coffee} (76%) delete mode 100644 app/coffee/modules/resources/resources.coffee diff --git a/app/coffee/app.coffee b/app/coffee/app.coffee index 530dfecc..7e75d6ca 100644 --- a/app/coffee/app.coffee +++ b/app/coffee/app.coffee @@ -55,6 +55,8 @@ modules = [ "taigaConfig", "taigaResources", + + "taigaBacklog", ] angular.module("taigaLocalConfig", []).value("localconfig", {}) diff --git a/app/coffee/modules/auth.coffee b/app/coffee/modules/auth.coffee index c8e9fd3c..e189946e 100644 --- a/app/coffee/modules/auth.coffee +++ b/app/coffee/modules/auth.coffee @@ -32,11 +32,11 @@ class AuthService extends taiga.TaigaService setUser: (user) -> @rootScope.auth = user @rootScope.$broadcast("i18n:change", user.default_language) - @gmStorage.set("userInfo", user.getAttrs()) + @storage.set("userInfo", user.getAttrs()) clear: -> @rootScope.auth = null - @gmStorage.remove("userInfo") + @storage.remove("userInfo") setToken: (token) -> @storage.set("token", token) diff --git a/app/coffee/modules/backlog.coffee b/app/coffee/modules/backlog.coffee index b97733e9..27b090cc 100644 --- a/app/coffee/modules/backlog.coffee +++ b/app/coffee/modules/backlog.coffee @@ -58,6 +58,6 @@ BacklogTableDirective = ($compile, $templateCache) -> console.log "ready to render", userstories -module = angular.module("taiga") +module = angular.module("taigaBacklog", []) module.directive("tgBacklog", ["$compile", BacklogDirective]) module.directive("tgBacklogTable", ["$compile", "$templateCache", BacklogTableDirective]) diff --git a/app/coffee/modules/resources/init.coffee b/app/coffee/modules/resources.coffee similarity index 76% rename from app/coffee/modules/resources/init.coffee rename to app/coffee/modules/resources.coffee index 662f6310..fc1e76fa 100644 --- a/app/coffee/modules/resources/init.coffee +++ b/app/coffee/modules/resources.coffee @@ -15,6 +15,38 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . +taiga = @.taiga + +class ResourcesService extends taiga.TaigaService + @.$inject = ["$q", "$tgRepo", "$tgUrls", "$tgModel"] + + constructor: (@q, @repo, @urls, @model) -> + super() + + ############################################################################# + # Common + ############################################################################# + + getProject: (projectId) -> + return @repo.queryOne("projects", projectId) + + ############################################################################# + # Backlog + ############################################################################# + + getMilestones: (projectId) -> + return @repo.queryMany("milestones", {project:projectId}).then (milestones) => + for m in milestones + uses = m.user_stories + uses = _.map(uses, (u) => @model.make_model("userstories", u)) + m._attrs.user_stories = uses + return milestones + + getBacklog: (projectId) -> + params = {"project": projectId, "milestone": "null"} + return @repo.queryMany("userstories", params) + + init = (urls) -> urls.update({ "auth": "/api/v1/auth" @@ -75,4 +107,5 @@ init = (urls) -> }) module = angular.module("taigaResources", []) +module.service("$tgResources", ResourcesService) module.run(["$tgUrls", init]) diff --git a/app/coffee/modules/resources/resources.coffee b/app/coffee/modules/resources/resources.coffee deleted file mode 100644 index 7a1a0cdd..00000000 --- a/app/coffee/modules/resources/resources.coffee +++ /dev/null @@ -1,50 +0,0 @@ -# Copyright (C) 2014 Andrey Antukh -# Copyright (C) 2014 Jesús Espino Garcia -# Copyright (C) 2014 David Barragán Merino -# -# 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 . - -taiga = @.taiga - -class ResourcesService extends taiga.TaigaService - @.$inject = ["$q", "$tgRepo", "$tgUrls", "$tgModel"] - - constructor: (@q, @repo, @urls, @model) -> - super() - - ############################################################################# - # Common - ############################################################################# - - getProject: (projectId) -> - return @repo.queryOne("projects", projectId) - - ############################################################################# - # Backlog - ############################################################################# - - getMilestones: (projectId) -> - return @repo.queryMany("milestones", {project:projectId}).then (milestones) => - for m in milestones - uses = m.user_stories - uses = _.map(uses, (u) => @model.make_model("userstories", u)) - m._attrs.user_stories = uses - return milestones - - getBacklog: (projectId) -> - params = {"project": projectId, "milestone": "null"} - return @repo.queryMany("userstories", params) - -module = angular.module("taigaResources") -module.service("$tgResources", ResourcesService) From 925d488eab3544ca0ebf49a0aaeb8c78963591c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xavier=20Juli=C3=A1n?= Date: Mon, 16 Jun 2014 12:35:33 +0200 Subject: [PATCH 12/64] Added reload icon --- app/fonts/taiga.eot | Bin 5432 -> 5684 bytes app/fonts/taiga.svg | 1 + app/fonts/taiga.ttf | Bin 5276 -> 5528 bytes app/fonts/taiga.woff | Bin 3652 -> 3888 bytes app/styles/dependencies/typography.scss | 3 +++ 5 files changed, 4 insertions(+) diff --git a/app/fonts/taiga.eot b/app/fonts/taiga.eot index 775eee9d0b86b82eb569555832ca692bc8e12c4e..e827d9a49b26c3456507af062edcabd66a3e6993 100644 GIT binary patch delta 704 zcmYLGO=uHA6#m}qUra+&lkBF2Y;03@*QU|Zv}{si{ejvZdPtz69@= z$w57NFbt@8>&=r0^&leXLBw0}=b}Xrsd%^bqF`h<3C`p3X1;mfdo%BQ7Jr(M$2H)A z+K_EAQ3`H0PL&Hkw)Oz^27t)S)R}3_LI%`%0R7pyk!1GE{7Zl?0614D=c||Bl?;IP z0lK}CU#~Ws5CHWo0ME+m^-KEKTOR=71>k>MT+T1y(UCpgLx*ak06hUPwOT3Ulf|P^ zKybRADCe(LQN(?K(oWa4e0lljpUOiZcoU$tYGwV3cvtuig!Ta}f&j-igQdhp|M6ew zVsO^>>#I(^c5MD-aB)v7@W(VvQT~}0XoIKO`B4LKUhaCttqIg2xVs2MEIB{wuyGn2 z{1wZR&bx&=>AWG_;Wlf@{<||J@kAX}&7q_ga zq4*TZ>#2JrNwU^lM@llT#97O8e$;{FvE>CnUxKnTcH78q!_zdp0{d;_uN7 zNs>Huk5^KBiWT&F1A&19eKHfjbug=g2rlDb#9_EYhY$DK!z1uiaF=Wz2@R3Wr$g%$ p< zK0`>ks728ih_)5D>;ov(Dl*23x^Os$`#Sd)`>%SPejU!VymMIfWXwW-JQjW)DS@^R z7_(E;GtA)xZ4K}Q=Ldbk(()~c5U?1IS&6N>g?kXMAaYSFnW$D#K(p)h(e3nRclO`| zlp?qvw<6XCr^S+N5?$E_5CvdzJ07-ra|4~Aq<}!oN+pPL0>W>*?pU!% z67l4&>Qi2z^#fQ&fQ^Eg@vJrm-f%gv=8TBk5I#E<@^*TY9yMFr}vV2vd&fNzoxM R^if&X4Pi)kTf6JuQD40DTtNT; diff --git a/app/fonts/taiga.svg b/app/fonts/taiga.svg index a48415ed..7097c6f2 100644 --- a/app/fonts/taiga.svg +++ b/app/fonts/taiga.svg @@ -33,4 +33,5 @@ + diff --git a/app/fonts/taiga.ttf b/app/fonts/taiga.ttf index 68032f9abee82c63050a97841216127bd1fa4c2c..aaa07b6882b4962b8e2a57e9cc401349ed3ca62a 100644 GIT binary patch delta 688 zcmY+BOK1~O7=_P&?>y2pnwY1BOlZ?i#-wUZS|+VA6`{sOkpx<_i?%Yfu_-hUO$oIW z5n{rQoKByW#^usvuHvZ|g=El^N58_vdcTk0)aIE;R|Eua~OvN1f~IW=O+eI`7hJ20Ga}DX|8P4uDxAU0onuT&Vo^| z?eBvFfk^<4g{2!;m9Mwo1N|=RS%dbr2D$p-~_2iSPQKOJr|s8DH}wvoUDpavva>WykK zO_risEK5UrhEk!R-%Y_#a4?nDt+Azaz%TVvRErIrrC4uNmaMUbEa_=|Fck`h(t0Ws zqz~TAa3P^-5mk1{qSMiGh@z+kx{fNbW>0re=wwn_WK3?q97~*zwdE0!F>hw1kkI0a zZGOkblLKy#qKcyEXgQps?2}gih1#Sb;u~mf3WXA(YI{guR!y@9^8!)WcyK)= zH&6W|O7Y|;2!wZ@N=DsT&o*>=*k0xt{&VgiG9dc$e`soFuxz}$Lv)fz57?+4`o zQ)$b|kzyZY+yly3>16#+b`LstK{B~)ej^Z7chL0!Bz$uM<;d2+myW65v>AADbylf0 zt5K7kVN#6nU_A@(>?hLq|w0e1w%lu&*aU@KNx^Vaql-=eZKhHg#8a) Gsr>`2c43|X diff --git a/app/fonts/taiga.woff b/app/fonts/taiga.woff index 6def0d55e7c9bcbc76626a0b0ec9bb0f50c70b97..93d57a0f591076a65ac16e6c564558b5de45737f 100644 GIT binary patch delta 3768 zcmV;p4oC6C9Ize~cTYw}PgGP-000j#01E&B000))krX0-3!wl25yp=8qkcw4R80T? z46FbE02u%P032@Tv-3wpMMeMs49EZg0384T03ZNK00d7{FERiC4Cnv=07(D<0ANx7 zUd>}|VQ>Hd4Kx4%0D%Ai0fu9%Tl8pUVPpUR4Y&XR04o3h05$-qE%Rt-WnlmS4deg- z02}}S03-x|FaiN+ZFG1501f~E0024w002A()dMeWVR&!=01i9=000I6000I698dsm zVQpmq01iX|007(o00D0D`)`_XZ*z1201qGl000mG001BW0{{VdoP}3;a8=bAzgh0R zha@J{=Aul)dju_Y1Tmo0vG$LON))wPSuKkoh_bYQ5D1Wjye#kCcen5E?}aRc1cN|9 zP{F!V)>=EDBmJZ6V5fspoDSepN6%|-2K$}+@eSSH100$Ztfm#I#9gegqz9D;%0MmxVhXs?osaN+&FGNSHZCIxm&m{?pU6X_rtuk1*HXlD6A}e ziNA)gwD^}L8?LHKNL&pyP1?k#|7gc_+%mQimiCEpYY@9 zL`wE$PjSg3GiUz!p&J+f?%^kJomN@&97O1Q{ntnUJ?pmD5xQrhXn+oeX_#PwMc|Wv zV7&qTV@|#Ht7UIqe0%DVBm59vM>0#L{>h(aCX2^M_1|(SbBlOPm-;7tj08(*Z6+F#wzzgV`FQ-ixi?(mm#>~*KNm<)_Je=Za$5e;r?f1(s&MSoDM3L{aCXY) zpPxNP3uwXAb7P~W-3ZbJnOQ~`K>sy=!667n1|xx%Jq-LIdQl3F9=}g~^OWn*tpM~l z$jxWm+|XtVrT&STn=%u{{;Q@+Ptl9diNVF{+~8j6NqX`5D>J3^?=&sJCb=Qj*cfY& zH^C-o@Ebd0U2-?{La*Q5+11tA?e_xdg>Jbk*4gMcz$QY+@0Gv?OScS5H#H!Cb5p$5 zrlys&(k%d`eAgX^o`j@S#$CaSg~@f(wpidRE%rX75bfX*=bT7gzJRY*^qx+VAY>>`b@0 zzJ*8(&#-kX*4^46r-|b`X{U`GP4TvAnW!i<8$q9=)1;hXP#ci`F(-t7p%Vj^tg7O5 z9I(HP6FFbSXL(zUx0zK*PGrW2!zSqRLa-SasXEVRuSO36Lol7p>K`KxpFkUC56u{o z%$Qli(1}o=Mb3Y~vr~j8SdjUNr22}JK<@cM0u)u1wSYEk~Q_Ir+Ywf;K$l&GZgwY|)*6qbiH&DO#QzjyNg7 zF))$3>qP)WIs*jHRgzIKU=E*DlF0}JGeAr#o)>-KZOQX+ZMK-iCo)?IXOD~F=F-e{ zgN{Ig(RB1cAmD|w+Yd$uqqFy~XK#aa#dtGxyaB(Zh3pLq2ff0^`ypMO{D32r()Vfn zn-#=j!{HeezB~qhn4t~McE$$0oxwAu3};ZmMf#tdf>`Ib@uzHN7+7bHYZy2t2?{CC z&NQe1O>`osps|ZLOf45424P&;1|Fj$^l{BF4AR*6ZAyooATys{mRtqmib4WE@ByEo zd<9_1(UPX(XpZh#4gq+MjxzCzsYiXh`!u*H-xK^-`fKlh%->?Jo=$I-92JtPN~)`Q z7FjtHk_i_kOu!i}jAYF;EK+?MIS=F?8yQ`=FyR6}c!#!SlGCSo+wlPd2$wGK4n_@* zPgnB;IuNlm!(}*WfAcdd;RzBL;-<};H%5%09S7aLQEG^A;F*2<+q=DvPInu5UQkxl zu3g=_QEuFS1hu5{`S!evE;2huQpq+ABAx_CZE3Fqy2$R@r`JT@3MwQQ3r7?j-Bz*u zifBws6q*v5*RW_SZ?L~WR8>`?AZmuDVF^e&s>jTKf)Cl%x;D=1wq~iIV1|Jt8c(y3 zioxh4-K6i~69MzptuJo|gAZq1He&%=884Vw*i#(bh;>KT$h!32EzB1%xszZLJtOJ5 zX-5xxznFcOf|l3&K~6i-Vr3?F>k&0&<%x9H6hq;mU_!))9?$RR;yv;8tIA_v@m z965yhUE60I78W9fg@uTKofdXpRt`Z|kb;(fLn|UIjt)pqUGcy$1~QW~KbFkkvH?PWV{>yXqC>C+le-Rlthv1_iaqvaEZ<%2?VS<$ zOSfo>j_tUtqW=p7*HP7I{hvfr=xlFp#PsxNa9*PC)NBS3Gnf(yt_Khl)xqRuLRSrz zjCc4Wbd_{n5gjw?`l4XWyrDzX+Qe(RrZV&nr@TG`qfT+^?t-G(JG z2i}6<>L55R!KE$f^p*(FiDGGg=5BgYa$QA^j zVcy==&#pRb?%hM^t#mSf_%OWt=;8T?ZiD&rNiaQ_#;;gW{}?QQ1=}9mzjEKoSL$8| z^tPwya*2ga*u`VP!Hlf}Rt_~$r?lv5Y-2-1ZPSM4+GGvXL%rSL*ZcTk(@qW^#7b{D z-~xt(=3vikVpR;v*|(B^fyEJj09y_8cE!X+){vkmew8>jdEo`Vx2~^oXUopkUCM4a z3a@n?c=q74JAd7Ng!pu`1g^mVvHD^G#miGQvV1wesb_sx&6b+BweA|23kw^Uty;FK z=JDovSm9Yzo`jaOk0!LKgFoQ1@11gxo}(k_XCOq1xcY?pMahV*B}Eln#dkSAFYm^CT6X>3 zbCZKDv@+O2yB@~rK)daQ?RK%}CA0mslI^G6Y(I^w#aEKgxUiU$^`xg5c5>l0001ZoMT{MU}OM-^Kr+1f$1YS4V%nZO8d=?hjSmg@8n*>N6L88k~M@_B67(kq+}G7RMa%Ibo302Ow25- z60+YDCv^F-OIJEDp^fr5NwcD?>Za}bVVve=J^T4DdIOZ$3swLC0C=2ZU}Rum0OC(l z51HcmZN4&aGcka``6FdD2>Sm&CI+xL2ZRCuHckq&llKfze;8B&mwpEc00000PyhfN z004NLZH_%^!$1&)KiQIlUBzkgjNIrjbDcq}AguqC!mhX`&RjM2#2k-%M zqP&$CTqFy#^S$BC5AeVT3E?GVQdgdF$8+R48~VtpJfD#>R(wZZNd3r}q)S!qr>?*= z);va@^U5}Iek#v<_GFw)S`>St`aR_P5Vedef|mvrs<*a-Fvx^0}Ym&0MG zC@7V8irb{Cw$$WPRPtC}G-Bw-{oq??s-iSIGi_A1bzbLHX=V9)&q13!Cso7#FgNVv i;QXl@dSi?7pRQkEVlmBloMT{SKn9EqXaE2JjsOL6A_8Fm delta 3530 zcmX|;cR1Dk9E`@_B|HcK`hS5Gf5L4J0$lt(0HC)704xJQ67c;bFh3|T zBoqJ!MF0TPA3+!(2`@>q_6@R{W7m!-2~jrcs#K=*pgU#3&N2_g{)1oSXU`Y+Y59)T zOgty^h9WoxbY+b8wZ4U|oF+bDq9T_}iq8s*vfNnsz(BkW9jh&FSFmAVXEoIqSh4B{ z7oR>oshN#NC}{XLUe*UTcAwbo79jKU9c*ojCcE6X-AvkE2RCGPigr|KzG_UBX~g=B zRJGn5D62*s41BHf-esPbg`&~k8|5+)rOB6O18vvKq#l@}S2!$= zzt#v$ArDnkb?m6Rc4~TfHWD13$qvWu)$z4MU&eG+Bj2yBE}v30%ow7}k`<#dR|?e5 z7dyPtiTg$3#m=$bMSs~iv!02^Oeg-9hs0toGg6#1PKRdoQ_cjt7;Z5dUFPXzUCV&O ze>g$f9gdo=w=eUw4dSma@+7g;UlK;zWMH(fGtm5^{8{BHr#nZ#szGTg z^VVMw-0aX1Rl$3+*O9jzkUk@r@-lT(Nw2}#8Mhm?j%3?$UIh!VNys(|tmPa+w<}ss zNub!WytRJ#H#R4Y&+Va-Aez0MJQH1b=2tnZBj2H1EPmpoVD+e^EYdJ@LMi_m>UQ>2 z$b{pQ=fqWS@we&``nVRQPCZA;U1$Bt#nP`ik(G?+@hkgfW&0}?jJNrZN3<69KRCnw zBOLn6k(#H8ehEu&LaET&yIX1p)g(7;k?RpTx_XiR-1GQjsTU#ZALcaDa%y&+pC#+@ zol}>iLhg$PQP-nH{OLU%2!Y{#!h zSbbzUUbeg=WHEZO;P|i8X_%XIiCY-QX5STKqytP%y zs!pD*`KAQ#F+;)8R}pD~Ld|cJD+|eM&dBfi1>*lw6A2(B2Z*UT5O_y%ljdv6@$ztt zktn`GN#N2gi&~!?R_5miZP1rAL0n?NFLPwSvDANuJgWEx^x}0;ndM)qngBf!~6-+6Ew#VsnHa=N}XCATaqb^ z3Dc$AaERK9`|GAyXopKItd#mW>rML2*XRU>n-KS^h#rP-gd~k)W-zMf$&pHgzhmce zT=r`_Vr*Agp~tU;MPv&V??Vll!0#dCMU#VvEZR?K&kHSy#%Um1V8XF`gd}xWT-%HMy$ngp z>b|!Zf?CVJbOoLhI~7q#*uq{=I7JeFHsjbV<%{KoI4{WaU`)K9OED;h6Kd)!Cq(RS4f%pA?~D}z5u1HQ@;;qM@6G>)`IKn zQ`6~6zW3cL=2mBm^uM|CiY5>LDv=Q{RqxR^>n$WEYP+OKyJdv4l!PV!{);HsiH2}O zmyaA|BWzR^2!CfKZ(198x>ilj9e2@Z;J#nG;7EPx?L%R(JR2rOl3w?7Oj>n#hF3DA z3;ImNQAi*-%_k!|9$VfqgdaZb#ph7$Zq~~NkmZ?)@a4_NIu6ky_)e@iR9u(kLtm?Z z>MR;0y@p~js|qwqc2O&W3Ee2%U%al0TYtH|8SlIM=w&<*{db}dqmhRtbQ zGF|GznB+0#HV0fj$AOJJjVgqTc0rfX5@O_1dnV*btuWk?u8*fSX^o&P)MU?(!CJEhV1qx|HoM#`txp!Z@8T^_r1}Jx)buVS4&gSGUK<@vlp$m*r^bu;L_5Y+f6M z!JW`o4Wq%_!*TnZ^F6L#oRSFN%|Ct`Z%O`3g17tZrC9gU?yz(&v~Uk-?Te zxp$T>6)hfdiH{{EQu{?P1}EY(*n$r<@AjTP5vX=d*Y-1N>@`_B{VE*T-9p?%2YxA( zY9}w~YI+D?3YdpQc0BwxuSX1hB>BeoBW=^}JIww5Z0p8rhxAC{@(DL8_9odMx#_zd zd}=XKpGQwW^~*XjKu0GsSDUPq_1%$F-EnunF!Cj~@~f&|^*)w^w9_#7nX?xrA9bi` zo!{apPi2={_g)lO$142@6VTF!Pn+rXu5RugEp90Z<33n^ZafGKjQ3m{02I03mAFwNVfQ-s{34z5TN_*ietThg!F3s{g)aglsvr3v{n zu7CWFzF&@x4E|bb^_2H{(bL?}&t~U$lxU>!fjT9kRO9hBEL8IsS*|noCEr&La=A>r z-$XR2pH^=f?hAKeGR35A^;1QK3LS158|oR|GSxSMPxKBCj0rJE^0ZYfy>r}#_a-Wj ztc$!)fBg!L+f6|h7uIE8Rm++u({lgM9=H}fz%$^FmZCfe2v-ny6p4y4n7q1@myaD( z6JP^wwRHY@>-6RjNXwzv0Kgo8KV$!_?tnfywxl<@q&~Ika-qtZ`7DF?27Bk@D2csg zZ_|Y;4HQ0WsfX>%;)$>WpvjDX`%jANXwPc9`YC1jT1H|Ji$X28*|X*>O^;g~YWZ6l z!9($@!#8R(N{r4c#@21v!~1TG4qL25JT4hI;!=xQPbwe2u{l9Ei&Z@5+QHpB>oqD@ z72gtl5TZUC&)fZwdx*Fh#3?~zJXpWtghAsv)VRBi`9{%p$IDH-(d&1to+5mQ($YVC zL3c^iOI@8V_~vfa_&wu4PcGUk)xkx3`rTWp?I3kP$oK#Mw+LN|Ogb+BKo%hXKawte Ap#T5? diff --git a/app/styles/dependencies/typography.scss b/app/styles/dependencies/typography.scss index 71a47cd8..c192ce4a 100755 --- a/app/styles/dependencies/typography.scss +++ b/app/styles/dependencies/typography.scss @@ -192,3 +192,6 @@ a:visited { .icon-attachment:before { content: 'A'; } +.icon-reload:before { + content: 'z'; +} From d2c8179447f34c86beaac58bc519d2bb56affad2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Barrag=C3=A1n=20Merino?= Date: Mon, 16 Jun 2014 12:46:39 +0200 Subject: [PATCH 13/64] Rewrite gulpfile to coffee --- gulpfile.coffee | 209 ++++++++++++++++++++++++++++++++++++++++++++++ gulpfile.js | 215 ------------------------------------------------ package.json | 2 +- 3 files changed, 210 insertions(+), 216 deletions(-) create mode 100644 gulpfile.coffee delete mode 100644 gulpfile.js diff --git a/gulpfile.coffee b/gulpfile.coffee new file mode 100644 index 00000000..403f5173 --- /dev/null +++ b/gulpfile.coffee @@ -0,0 +1,209 @@ +gulp = require("gulp") +jade = require("gulp-jade") + +coffee = require("gulp-coffee") +concat = require("gulp-concat") +uglify = require("gulp-uglify") +plumber = require("gulp-plumber") +wrap = require("gulp-wrap") +rename = require("gulp-rename") + +newer = require("gulp-newer") +minifyHTML = require("gulp-minify-html") +sass = require("gulp-ruby-sass") +csslint = require("gulp-csslint") +minifyCSS = require("gulp-minify-css") +imagemin = require("gulp-imagemin") +watch = require("gulp-watch") +size = require("gulp-filesize") +notify = require("gulp-notify") +connect = require("gulp-connect") +scsslint = require("gulp-scss-lint") +newer = require("gulp-newer") +cache = require("gulp-cached") + +paths = { + app: "app" + dist: "dist" + html: "app/*.html" + jade: "app/partials/**/*.jade" + appStyles: "app/styles/**/*.scss" + distStyles: "dist/styles" + sassMain: "app/styles/main.scss" + css: "dist/styles/**/*.css" + images: "app/images/**/*" + coffee: ["app/coffee/app.coffee", + "config/main.coffee", + "app/coffee/*.coffee", + "app/coffee/modules/*.coffee", + "app/coffee/modules/resources/init.coffee", + "app/coffee/modules/resources/*.coffee", + "app/coffee/**/*.coffee"] +} + + +# Ordered list of vendor/external libraries. +vendorJsLibs = [ + "app/vendor/jquery/dist/jquery.js", + "app/vendor/lodash/dist/lodash.js", + "app/vendor/emoticons/lib/emoticons.js", + "app/vendor/underscore.string/lib/underscore.string.js", + "app/vendor/angular/angular.js", + "app/vendor/angular-route/angular-route.js", + "app/vendor/angular-sanitize/angular-sanitize.js", + "app/vendor/angular-animate/angular-animate.js" +] + + +############################################################################## +# Layout/CSS Related tasks +############################################################################## + +gulp.task "jade", -> + gulp.src(paths.jade) + .pipe(plumber()) + .pipe(jade({pretty: true})) + .pipe(gulp.dest("#{paths.dist}/partials")) + +gulp.task "template", -> + gulp.src("#{paths.app}/index.jade") + .pipe(plumber()) + .pipe(jade({pretty: true, locals:{v:(new Date()).getTime()}})) + .pipe(gulp.dest(paths.dist)) + + +# Sass lint +gulp.task "scss-lint", -> + gulp.src([paths.appStyles, "!/**/bourbon/**/*.scss"]) + .pipe(cache("scsslint")) + .pipe(scsslint({config: "scsslint.yml"})) + + +# Sass Files +gulp.task "sass", -> + gulp.src(paths.sassMain) + .pipe(plumber()) + .pipe(sass()) + .pipe(gulp.dest(paths.distStyles)) + + +# CSS Linting and report +gulp.task "css", ["sass"], -> + gulp.src([paths.css, "!#{paths.dist}/styles/vendor/**/*.css"]) + .pipe(csslint("csslintrc.json")) + .pipe(csslint.reporter()) + + +# Minify CSS +gulp.task "minifyCSS", ["css", "sass"], -> + gulp.src("dist/styles/main.css") + .pipe(minifyCSS()) + .pipe(gulp.dest(paths.distStyles)) + .pipe(size()) + +gulp.task "imagemin", -> + gulp.src(paths.images) + .pipe(plumber()) + .pipe(imagemin({progressive: true})) + .pipe(gulp.dest(paths.dist+"/images")) + + +############################################################################## +# JS Related tasks +############################################################################## + +gulp.task "coffee", -> + gulp.src(paths.coffee) + .pipe(plumber()) + .pipe(coffee()) + .pipe(concat("app.js")) + .pipe(gulp.dest("dist/js/")) + +gulp.task "jslibs", -> + gulp.src(vendorJsLibs) + .pipe(plumber()) + .pipe(concat("libs.js")) + .pipe(gulp.dest("dist/js/")) + + +gulp.task "locales", -> + gulp.src("app/locales/en/app.json") + .pipe(wrap("angular.module('locales.en', []).constant('locales.en', <%= contents %>);")) + .pipe(rename("locale.en.coffee")) + .pipe(gulp.dest("app/coffee/")) + + gulp.src("app/locales/es/app.json") + .pipe(wrap("angular.module('locales.es', []).constant('locales.es', <%= contents %>);")) + .pipe(rename("locale.es.coffee")) + .pipe(gulp.dest("app/coffee/")) + + +############################################################################## +# Common tasks +############################################################################## + +# Copy Files +gulp.task "copy", ["sass"], -> + gulp.src("#{paths.app}/fonts/*") + .pipe(gulp.dest("#{paths.dist}/fonts/")) + + gulp.src("#{paths.app}/images/*") + .pipe(gulp.dest("#{paths.dist}/images/")) + + +gulp.task "connect", -> + connect.server({ + root: paths.dist + livereload: true + }) + + +# Rerun the task when a file changes +gulp.task "watch", -> + gulp.watch(paths.jade, ["jade"]) + gulp.watch(paths.appStyles, ["scss-lint", "sass", "css"]) + gulp.watch(paths.coffee, ["coffee"]) + + +gulp.task "express", -> + express = require("express") + app = express() + + app.use("/js", express.static("#{__dirname}/dist/js")) + app.use("/styles", express.static("#{__dirname}/dist/styles")) + app.use("/images", express.static("#{__dirname}/dist/images")) + app.use("/partials", express.static("#{__dirname}/dist/partials")) + app.use("/fonts", express.static("#{__dirname}/dist/fonts")) + + app.all "/*", (req, res, next) -> + # Just send the index.html for other files to support HTML5Mode + res.sendfile("index.html", {root: "#{__dirname}/dist/"}) + + app.listen(9001) + + +# The default task (called when you run gulp from cli) +gulp.task "default", [ + "jade", + "template", + "sass", + "css", + "copy", + "coffee", + "jslibs", + "connect", + "express", + "watch" +] + +# The default task (called when you run `gulp` from cli) +gulp.task "dist", [ + "jade", + "sass", + "css", + "minifyCSS", + "imagemin", + "copy", + "connect", + "watch" +] diff --git a/gulpfile.js b/gulpfile.js deleted file mode 100644 index 678d442f..00000000 --- a/gulpfile.js +++ /dev/null @@ -1,215 +0,0 @@ -var gulp = require("gulp"), - jade = require("gulp-jade"), - - coffee = require("gulp-coffee"), - concat = require("gulp-concat"), - uglify = require("gulp-uglify"), - plumber = require("gulp-plumber"), - wrap = require("gulp-wrap"), - rename = require("gulp-rename"), - - newer = require("gulp-newer"), - minifyHTML = require("gulp-minify-html"), - sass = require("gulp-ruby-sass"), - csslint = require("gulp-csslint"), - minifyCSS = require("gulp-minify-css"), - imagemin = require("gulp-imagemin"), - watch = require("gulp-watch"), - size = require("gulp-filesize"), - notify = require("gulp-notify"), - connect = require("gulp-connect"), - scsslint = require("gulp-scss-lint"), - newer = require("gulp-newer") - cache = require("gulp-cached"); - -var paths = { - app: "app", - dist: "dist", - html: "app/*.html", - jade: "app/partials/**/*.jade", - appStyles: "app/styles/**/*.scss", - distStyles: "dist/styles", - sassMain: "app/styles/main.scss", - css: "dist/styles/**/*.css", - images: "app/images/**/*", - coffee: ["app/coffee/app.coffee", - "config/main.coffee", - "app/coffee/*.coffee", - "app/coffee/modules/*.coffee", - "app/coffee/modules/resources/init.coffee", - "app/coffee/modules/resources/*.coffee", - "app/coffee/**/*.coffee"] -}; - -// Ordered list of vendor/external libraries. -var vendorJsLibs = [ - "app/vendor/jquery/dist/jquery.js", - "app/vendor/lodash/dist/lodash.js", - "app/vendor/emoticons/lib/emoticons.js", - "app/vendor/underscore.string/lib/underscore.string.js", - "app/vendor/angular/angular.js", - "app/vendor/angular-route/angular-route.js", - "app/vendor/angular-sanitize/angular-sanitize.js", - "app/vendor/angular-animate/angular-animate.js" -] - -//////////////////////////////////////////////////////////////////////////// -// Layout/CSS Related tasks -//////////////////////////////////////////////////////////////////////////// - -gulp.task("jade", function() { - return gulp.src(paths.jade) - .pipe(plumber()) - .pipe(jade({pretty: true})) - .pipe(gulp.dest(paths.dist + "/partials")); -}); - -gulp.task("template", function() { - return gulp.src(paths.app + "/index.jade") - .pipe(plumber()) - .pipe(jade({pretty: true, locals:{v:(new Date()).getTime()}})) - .pipe(gulp.dest(paths.dist)); -}); - -// Sass lint -gulp.task("scss-lint", function() { - gulp.src([paths.appStyles, "!/**/bourbon/**/*.scss"]) - .pipe(cache("scsslint")) - .pipe(scsslint({config: "scsslint.yml"})) -}); - -// Sass Files -gulp.task("sass", function () { - return gulp.src(paths.sassMain) - .pipe(plumber()) - .pipe(sass()) - .pipe(gulp.dest(paths.distStyles)); -}); - -// CSS Linting and report -gulp.task("css", ["sass"], function() { - gulp.src([paths.css, "!"+paths.dist+"/styles/vendor/**/*.css"]) - .pipe(csslint("csslintrc.json")) - .pipe(csslint.reporter()); -}); - - -// Minify CSS -gulp.task("minifyCSS", ["css", "sass"], function () { - gulp.src("dist/styles/main.css") - .pipe(minifyCSS()) - .pipe(gulp.dest(paths.distStyles)) - .pipe(size()); -}); - -gulp.task("imagemin", function () { - return gulp.src(paths.images) - .pipe(plumber()) - .pipe(imagemin({progressive: true})) - .pipe(gulp.dest(paths.dist+"/images")); -}); - -//////////////////////////////////////////////////////////////////////////// -// JS Related tasks -//////////////////////////////////////////////////////////////////////////// - -gulp.task("coffee", function() { - return gulp.src(paths.coffee) - .pipe(plumber()) - .pipe(coffee()) - .pipe(concat("app.js")) - .pipe(gulp.dest("dist/js/")); -}); - -gulp.task("jslibs", function() { - return gulp.src(vendorJsLibs) - .pipe(plumber()) - .pipe(concat("libs.js")) - .pipe(gulp.dest("dist/js/")); -}); - -gulp.task("locales", function() { - gulp.src("app/locales/en/app.json") - .pipe(wrap("angular.module('locales.en', []).constant('locales.en', <%= contents %>);")) - .pipe(rename("locale.en.coffee")) - .pipe(gulp.dest("app/coffee/")); - - gulp.src("app/locales/es/app.json") - .pipe(wrap("angular.module('locales.es', []).constant('locales.es', <%= contents %>);")) - .pipe(rename("locale.es.coffee")) - .pipe(gulp.dest("app/coffee/")); -}); - - -//////////////////////////////////////////////////////////////////////////// -// Common tasks -//////////////////////////////////////////////////////////////////////////// - -// Copy Files -gulp.task("copy", ["sass"], function() { - // Copy fonts - gulp.src(paths.app+"/fonts/*") - .pipe(gulp.dest(paths.dist+"/fonts/")); - - gulp.src(paths.app+"/images/*") - .pipe(gulp.dest(paths.dist+"/images/")); -}); - -gulp.task("connect", function() { - connect.server({ - root: paths.dist, - livereload: true - }); -}); - -// Rerun the task when a file changes -gulp.task("watch", function() { - gulp.watch(paths.jade, ["jade"]); - gulp.watch(paths.appStyles, ["scss-lint", "sass", "css"]); - gulp.watch(paths.coffee, ["coffee"]); -}); - -gulp.task("express", function() { - var express = require("express"); - var app = express(); - - app.use("/js", express.static(__dirname + "/dist/js")); - app.use("/styles", express.static(__dirname + "/dist/styles")); - app.use("/images", express.static(__dirname + "/dist/images")); - app.use("/partials", express.static(__dirname + "/dist/partials")); - app.use("/fonts", express.static(__dirname + "/dist/fonts")); - - app.all("/*", function(req, res, next) { - // Just send the index.html for other files to support HTML5Mode - res.sendfile("index.html", { root: __dirname + "/dist/" }); - }); - - app.listen(9001); -}); - - -// The default task (called when you run `gulp` from cli) -gulp.task("default", [ - "jade", - "template", - "sass", - "css", - "copy", - "coffee", - "jslibs", - "connect", - "express", - "watch" -]); - -// The default task (called when you run `gulp` from cli) -gulp.task("dist", [ - "jade", - "sass", - "css", - "minifyCSS", - "imagemin", - "copy", - "connect", - "watch" -]); diff --git a/package.json b/package.json index 87fbf82c..19b84508 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "author": "Kaleidos", "license": "ISC", "devDependencies": { - "gulp": "^3.6.0", + "gulp": "^3.8.0", "coffee-script": "^1.7.1", "express": "^4.3.0", "gulp-clean": "^0.2.4", From 05d05d1c506a25ee37c2735fee300419d5c0fada Mon Sep 17 00:00:00 2001 From: Juanfran Date: Mon, 16 Jun 2014 09:22:11 +0200 Subject: [PATCH 14/64] membership menu --- app/partials/membership.jade | 13 ++++++++++++ app/partials/views/modules/admin-menu.jade | 21 ++++++++++++++++++++ app/styles/main.scss | 1 + app/styles/modules/admin-menu.scss | 23 ++++++++++++++++++++++ 4 files changed, 58 insertions(+) create mode 100644 app/partials/membership.jade create mode 100644 app/partials/views/modules/admin-menu.jade create mode 100644 app/styles/modules/admin-menu.scss diff --git a/app/partials/membership.jade b/app/partials/membership.jade new file mode 100644 index 00000000..7aa95010 --- /dev/null +++ b/app/partials/membership.jade @@ -0,0 +1,13 @@ +extends layout + +block head + title Taiga Project management web application with scrum in mind! + +block content + sidebar.menu-secondary.sidebar + include views/modules/admin-menu + + section.main.search-result + include views/components/mainTitle + include views/modules/search-filter + include views/modules/search-result-table \ No newline at end of file diff --git a/app/partials/views/modules/admin-menu.jade b/app/partials/views/modules/admin-menu.jade new file mode 100644 index 00000000..6a18e888 --- /dev/null +++ b/app/partials/views/modules/admin-menu.jade @@ -0,0 +1,21 @@ +section.admin-menu + header + h1 Admin + + nav + ul + li + a(href="") Memberships + span.icon.icon-arrow-right + li + a(href="") Role + span.icon.icon-arrow-right + li + a(href="") Sprints + span.icon.icon-arrow-right + li + a(href="") Project values + span.icon.icon-arrow-right + li + a(href="") Project profiles + span.icon.icon-arrow-right \ No newline at end of file diff --git a/app/styles/main.scss b/app/styles/main.scss index a4d2d3bf..6d63418f 100755 --- a/app/styles/main.scss +++ b/app/styles/main.scss @@ -41,6 +41,7 @@ $prefix-for-spec: true; @import 'modules/taskboard-table'; @import 'modules/search-filter'; @import 'modules/search-result-table'; +@import 'modules/admin-menu'; // Responsive @import 'responsive/mobile'; diff --git a/app/styles/modules/admin-menu.scss b/app/styles/modules/admin-menu.scss new file mode 100644 index 00000000..da6d796d --- /dev/null +++ b/app/styles/modules/admin-menu.scss @@ -0,0 +1,23 @@ +.admin-menu { + li { + @extend %xlarge; + border-bottom: 1px solid $gray-light; + font-family: 'ostrichSans'; + } + a { + display: block; + padding: 1rem 0 1rem 1rem; + &.active, + &:hover { + .icon { + @include transition (opacity .3s linear); + opacity: 1; + } + } + } + .icon { + color: $blackish; + float: right; + opacity: 0; + } +} From b82da51881ffeea36a3cd09fcaded0c805f22958 Mon Sep 17 00:00:00 2001 From: Juanfran Date: Mon, 16 Jun 2014 12:54:08 +0200 Subject: [PATCH 15/64] members table --- app/partials/membership.jade | 50 +++++++++- app/styles/main.scss | 1 + app/styles/modules/admin-membership.scss | 112 +++++++++++++++++++++++ csslintrc.json | 3 +- 4 files changed, 161 insertions(+), 5 deletions(-) create mode 100644 app/styles/modules/admin-membership.scss diff --git a/app/partials/membership.jade b/app/partials/membership.jade index 7aa95010..fdb60e6c 100644 --- a/app/partials/membership.jade +++ b/app/partials/membership.jade @@ -7,7 +7,49 @@ block content sidebar.menu-secondary.sidebar include views/modules/admin-menu - section.main.search-result - include views/components/mainTitle - include views/modules/search-filter - include views/modules/search-result-table \ No newline at end of file + section.main.admin-membership + header + include views/components/mainTitle + a.button-green(title="Add New US" href="") + span.text + New role + + section.admin-membership-table + div.row.title + div.header-member Member + div.header-role Role + 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-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-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-role + select + option UX + option Front + option Back + div.row-status + a(href="#").pending + | Pending + span.icon.icon-reload + a(href="#").delete + span.icon.icon-delete diff --git a/app/styles/main.scss b/app/styles/main.scss index 6d63418f..32a168a0 100755 --- a/app/styles/main.scss +++ b/app/styles/main.scss @@ -42,6 +42,7 @@ $prefix-for-spec: true; @import 'modules/search-filter'; @import 'modules/search-result-table'; @import 'modules/admin-menu'; +@import 'modules/admin-membership'; // Responsive @import 'responsive/mobile'; diff --git a/app/styles/modules/admin-membership.scss b/app/styles/modules/admin-membership.scss new file mode 100644 index 00000000..90a122d5 --- /dev/null +++ b/app/styles/modules/admin-membership.scss @@ -0,0 +1,112 @@ +.admin-membership { + header { + @include clearfix; + margin-bottom: 1rem; + h1 { + float: left; + margin-bottom: 0; + } + a { + float: right; + } + } +} + +.admin-membership-table { + align-content: stretch; + align-items: center; + display: flex; + flex-direction: column; + flex-wrap: wrap; + justify-content: flex-start; + width: 100%; + .title { + font-family: 'DroidSans-Bold'; + } + .row { + align-content: stretch; + align-items: center; + border-bottom: 1px solid $gray-light; + display: flex; + flex-direction: row; + flex-wrap: nowrap; + justify-content: flex-start; + padding: 1rem 0 1rem 1rem; + text-align: left; + width: 100%; + &:last-child { + border-bottom: 0; + } + } + .avatar { + align-items: center; + display: flex; + figcaption { + margin-left: 1rem; + } + img { + flex-basis: 35px; + } + .name, + .email { + display: block; + width: 100%; + } + .name { + font-family: DroidSans-Bold; + } + .email { + color: $gray-light; + } + } + .active, + .pending { + padding: 8px; + width: 115px; + } + .active { + background-color: $whitish; + } + .pending { + background-color: $red-light; + color: $white; + .icon { + float: right; + } + &:hover { + @include transition (background-color .3s linear); + background-color: $red; + } + } + .header-role, + .header-status { + padding-left: .5rem; + } + .row-role { + padding-right: 1rem; + } + .row-status { + display: flex; + .delete { + @extend %large; + align-items: center; + color: $gray-light; + display: flex; + margin-left: 15px; + padding: 0 15px; + &:hover { + color: $red; + } + } + } + .row-status, + .header-status { + width: 180px; + } + .row-member, + .row-role, + .header-member, + .header-role { + flex: 1 0 50px; + } +} diff --git a/csslintrc.json b/csslintrc.json index 0616cb74..86e74f74 100644 --- a/csslintrc.json +++ b/csslintrc.json @@ -19,5 +19,6 @@ "regex-selectors": false, "floats": false, "fallback-colors": false, - "adjoining-classes": false + "adjoining-classes": false, + "qualified-headings": false } From 31a8439b1f7debd5583050776be23109121358bc Mon Sep 17 00:00:00 2001 From: Juanfran Date: Mon, 16 Jun 2014 12:57:11 +0200 Subject: [PATCH 16/64] member list reload icon size --- app/styles/modules/admin-membership.scss | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/styles/modules/admin-membership.scss b/app/styles/modules/admin-membership.scss index 90a122d5..17b75dd3 100644 --- a/app/styles/modules/admin-membership.scss +++ b/app/styles/modules/admin-membership.scss @@ -63,6 +63,9 @@ .pending { padding: 8px; width: 115px; + .icon { + @extend %large; + } } .active { background-color: $whitish; From 61989149087c78fe630abaed965d8dc5372d7dfd Mon Sep 17 00:00:00 2001 From: Juanfran Date: Mon, 16 Jun 2014 17:14:38 +0200 Subject: [PATCH 17/64] new member lightbox --- app/partials/membership.jade | 3 ++ .../views/modules/lightbox_add-member.jade | 24 ++++++++++++ app/styles/dependencies/forms.scss | 11 +++--- app/styles/modules/lightbox.scss | 38 +++++++++++++++++++ 4 files changed, 71 insertions(+), 5 deletions(-) create mode 100644 app/partials/views/modules/lightbox_add-member.jade diff --git a/app/partials/membership.jade b/app/partials/membership.jade index fdb60e6c..2197c900 100644 --- a/app/partials/membership.jade +++ b/app/partials/membership.jade @@ -53,3 +53,6 @@ block content span.icon.icon-reload a(href="#").delete span.icon.icon-delete + + div.lightbox.ligbox_add-member + include views/modules/lightbox_add-member \ No newline at end of file diff --git a/app/partials/views/modules/lightbox_add-member.jade b/app/partials/views/modules/lightbox_add-member.jade new file mode 100644 index 00000000..215d4878 --- /dev/null +++ b/app/partials/views/modules/lightbox_add-member.jade @@ -0,0 +1,24 @@ +a.close(href="", title="close") + span.icon.icon-delete +form + h2.title New Member + fieldset + input(type="email", placeholder="Email") + select + option Front + option Role + option UX + a.icon.icon-delete(href="") + + fieldset + input(type="email", placeholder="Email") + select + option Front + option Role + option UX + a.icon.icon-plus(href="") + + a.button.button-green(href="", title="Save") + span Create + + p.help-text We will add directly the users if they are registered, send an invitation to register if not diff --git a/app/styles/dependencies/forms.scss b/app/styles/dependencies/forms.scss index c0dd90f8..8f6eca64 100644 --- a/app/styles/dependencies/forms.scss +++ b/app/styles/dependencies/forms.scss @@ -4,11 +4,12 @@ fieldset { padding: 0; position: relative; width: 100%; - .icon { - position: absolute; - right: 10px; - top: 6px; - } + // xavi pleeeeeease + // .icon { + // position: absolute; + // right: 10px; + // top: 6px; + // } } input[type="text"], diff --git a/app/styles/modules/lightbox.scss b/app/styles/modules/lightbox.scss index e1955cde..5f3c4499 100644 --- a/app/styles/modules/lightbox.scss +++ b/app/styles/modules/lightbox.scss @@ -147,6 +147,44 @@ } } +.ligbox_add-member { + display: none; + fieldset { + @include clearfix; + margin-bottom: 1rem; + } + input[type=email], + select { + float: left; + margin-bottom: 0; + } + input[type=email] { + width: 430px; + } + select { + margin-left: .5rem; + width: 255px; + } + .icon { + @extend %large; + float: left; + line-height: 40px; + margin-left: .5rem; + } + .icon-delete { + &:hover { + color: $red; + } + } + .button { + margin-top: 2rem; + } + .help-text { + @extend %small; + padding: .5rem 1rem; + } +} + .lightbox_add-sprint { display: none; form { From d1499ad541fb9b259dd823b709affafa07f824fe Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 17 Jun 2014 09:48:49 +0200 Subject: [PATCH 18/64] Next iteration over backlog. --- app/coffee/app.coffee | 6 +- app/coffee/modules/backlog.coffee | 81 ++++++++---- app/coffee/modules/resources.coffee | 10 +- app/coffee/modules/resources/http.coffee | 8 +- app/partials/backlog.jade | 4 - .../views/components/backlog-row.jade | 8 +- app/partials/views/modules/backlog-table.jade | 105 ++++++++-------- app/partials/views/modules/sprints.jade | 116 +++++++++++------- bower.json | 2 + gulpfile.coffee | 3 +- 10 files changed, 195 insertions(+), 148 deletions(-) diff --git a/app/coffee/app.coffee b/app/coffee/app.coffee index 7e75d6ca..f5f1dc07 100644 --- a/app/coffee/app.coffee +++ b/app/coffee/app.coffee @@ -46,7 +46,7 @@ configure = ($routeProvider, $locationProvider, $httpProvider, $provide, $compil init = ($log, $rootScope) -> $log.debug("Initialize application") -configure.$inject = ["$routeProvider", "$locationProvider","$httpProvider"] +configure.$inject = ["$routeProvider", "$locationProvider", "$httpProvider"] init.$inject = ["$log", "$rootScope"] modules = [ @@ -55,8 +55,10 @@ modules = [ "taigaConfig", "taigaResources", - "taigaBacklog", + + # Vendor modules + "pasvaz.bindonce", ] angular.module("taigaLocalConfig", []).value("localconfig", {}) diff --git a/app/coffee/modules/backlog.coffee b/app/coffee/modules/backlog.coffee index 27b090cc..a7d04a7f 100644 --- a/app/coffee/modules/backlog.coffee +++ b/app/coffee/modules/backlog.coffee @@ -18,7 +18,29 @@ taiga = @.taiga class BacklogController extends taiga.TaigaController - constructor: (@scope, @repo, @params, @rs) -> + constructor: (@scope, @repo, @params, @rs, @q) -> + promise = @.loadInitialData() + # Obviously fail condition + promise.then null, => + console.log "FAIL" + + loadSprints: -> + return @rs.getSprints(@scope.projectId).then (sprints) => + @scope.sprints = sprints + return sprints + + loadUserstories: -> + return @rs.getUnassignedUserstories(@scope.projectId).then (userstories) => + @scope.userstories = userstories + return userstories + + loadBacklog: -> + return @q.all([ + @.loadSprints(), + @.loadUserstories() + ]) + + loadInitialData: -> # Resolve project slug promise = @repo.resolve({pslug: @params.pslug}).then (data) => console.log "resolve", data.project @@ -28,36 +50,43 @@ class BacklogController extends taiga.TaigaController # Load project promise = promise.then (project) => @scope.project = project - console.log project - return @rs.getMilestones(@scope.projectId) + return @.loadBacklog() - # Load milestones - promise = promise.then (milestones) => - @scope.milestones = milestones - return @rs.getBacklog(@scope.projectId) - - # Load unassigned userstories - promise = promise.then (userstories) => - @scope.userstories = userstories - - # Obviously fail condition - promise.then null, => - console.log "FAIL" + return promise -BacklogDirective = ($compile) -> - controller: ["$scope", "$tgRepo", "$routeParams", "$tgResources", BacklogController] - link: (scope, element, attrs, ctrl) -> +BacklogDirective = ($compile, $templateCache) -> + backlogLink = ($scope, $element, $attrs, $ctrl) -> + # UserStories renderin + dom = angular.element.parseHTML($templateCache.get("backlog-row.html")) + scope = null + $scope.$watch "userstories", (userstories) => + return if not userstories -BacklogTableDirective = ($compile, $templateCache) -> - require: "^tgBacklog" - link: (scope, element, attrs, ctrl) -> - content = $templateCache.get("backlog-row.html") - scope.$watch "userstories", (userstories) => - console.log "ready to render", userstories + if scope != null + scope.$destroy() + + scope = $scope.$new() + dom = $compile(dom)(scope) + $element.append(dom) + + link = ($scope, $element, $attrs, $ctrl) -> + backlogTableDom = $element.find("section.backlog-table") + backlogLink($scope, backlogTableDom, $attrs, $ctrl) + + return { + controller: [ + "$scope", + "$tgRepo", + "$routeParams", + "$tgResources", + "$q", + BacklogController + ] + link: link + } module = angular.module("taigaBacklog", []) -module.directive("tgBacklog", ["$compile", BacklogDirective]) -module.directive("tgBacklogTable", ["$compile", "$templateCache", BacklogTableDirective]) +module.directive("tgBacklog", ["$compile", "$templateCache", BacklogDirective]) diff --git a/app/coffee/modules/resources.coffee b/app/coffee/modules/resources.coffee index fc1e76fa..e0e2c69a 100644 --- a/app/coffee/modules/resources.coffee +++ b/app/coffee/modules/resources.coffee @@ -30,19 +30,23 @@ class ResourcesService extends taiga.TaigaService getProject: (projectId) -> return @repo.queryOne("projects", projectId) + getProjects: -> + return @repo.queryMany("projects") + ############################################################################# # Backlog ############################################################################# - getMilestones: (projectId) -> - return @repo.queryMany("milestones", {project:projectId}).then (milestones) => + getSprints: (projectId) -> + params = {"project": projectId} + return @repo.queryMany("milestones", params).then (milestones) => for m in milestones uses = m.user_stories uses = _.map(uses, (u) => @model.make_model("userstories", u)) m._attrs.user_stories = uses return milestones - getBacklog: (projectId) -> + getUnassignedUserstories: (projectId) -> params = {"project": projectId, "milestone": "null"} return @repo.queryMany("userstories", params) diff --git a/app/coffee/modules/resources/http.coffee b/app/coffee/modules/resources/http.coffee index befffefa..45d05c71 100644 --- a/app/coffee/modules/resources/http.coffee +++ b/app/coffee/modules/resources/http.coffee @@ -37,11 +37,9 @@ class HttpService extends taiga.TaigaService return @http(options) get: (url, params) -> - return @.request({ - method: "GET", - url: url, - params: params - }) + options = {method: "GET", url: url} + options.params = params if params + return @.request(options) post: (url, data, params) -> options = {method: "POST", url: url} diff --git a/app/partials/backlog.jade b/app/partials/backlog.jade index f2a641de..614d4d3a 100644 --- a/app/partials/backlog.jade +++ b/app/partials/backlog.jade @@ -31,7 +31,3 @@ block content div.lightbox.lightbox_add-sprint include views/modules/lightbox_add-sprint - // Preloading angular templates parts - script(type="text/ng-template" id="backlog-row.html") - include views/components/backlog-row - diff --git a/app/partials/views/components/backlog-row.jade b/app/partials/views/components/backlog-row.jade index 57c00e51..dc943f78 100644 --- a/app/partials/views/components/backlog-row.jade +++ b/app/partials/views/components/backlog-row.jade @@ -1,14 +1,14 @@ -div.row.table-main +div.row.table-main(ng-repeat="us in userstories") div.user-stories div.user-story-name input(type="checkbox", name="") - a(href="") Crear el perfil de usuario Senior en el admin + a(href="") {{ us.subject }} span.us-settings a.icon.icon-edit(href="", title="Edit") a.icon.icon-delete(href="", title="Delete") div.user-story-tags - - for(var y = 0; y < 3; y++) - include ../components/tag + span.tag Tag name + span.tag Tag name div.status Status div.points 12 div.points 54 diff --git a/app/partials/views/modules/backlog-table.jade b/app/partials/views/modules/backlog-table.jade index 75381651..eedb212e 100644 --- a/app/partials/views/modules/backlog-table.jade +++ b/app/partials/views/modules/backlog-table.jade @@ -1,4 +1,4 @@ -section.backlog-table(tg-backlog-table) +section.backlog-table div.row.backlog-table-header div.user-stories User Stories div.status Status @@ -9,61 +9,52 @@ section.backlog-table(tg-backlog-table) div.status.width-2 div.points.width-1 Front div.points.width-1 Total - div.row.table-main.blocked - div.user-stories - div.user-story-name - input(type="checkbox", name="") - a(href="") Crear el perfil de usuario Senior en el admin - span.us-settings - a.icon.icon-edit(href="", title="Edit") - a.icon.icon-delete(href="", title="Delete") - div.user-story-tags - - for(var y = 0; y < 3; y++) - include ../components/tag - div.status.width-2 - a(href="", title="Status Name") Status Name - ul.popover.pop-status - li - a(href="", title="Status 1") Status 1 - li - a(href="", title="Status 2") Status 2 - li - a(href="", title="Status 3") Status 3 - div.points - a(href="", title="Front") 24 - ul.popover.pop-points-open - li - a(href="", title="0") 0 - li - a(href="", title="1/2") 1/2 - li - a(href="", title="1") 1 - li - a(href="", title="2") 2 - li - a(href="", title="3") 3 - li - a(href="", title="4") 4 - li - a(href="", title="8") 8 - li - a(href="", title="13") 13 - li - a(href="", title="20") 20 - li - a(href="", title="40") 40 - li - a(href="", title="100") 100 - li - a(href="", title="?") ? - div.points - a(href="", title="Total Points") 43 - ul.popover.pop-status - li - a(href="", title="Status 1") Status 1 - li - a(href="", title="Status 2") Status 2 - li - a(href="", title="Status 3") Status 3 +section.backlog-table + // div.row.table-main.blocked + // div.user-stories + // div.user-story-name + // input(type="checkbox", name="") + // a(href="") Crear el perfil de usuario Senior en el admin + // span.us-settings + // a.icon.icon-edit(href="", title="Edit") + // a.icon.icon-delete(href="", title="Delete") + // div.user-story-tags + // - for(var y = 0; y < 3; y++) + // include ../components/tag + // div.status.width-2 + // a(href="", title="Status Name") Status Name + // ul.popover.pop-status + // li + // a(href="", title="Status 1") Status 1 + // li + // a(href="", title="Status 2") Status 2 + // li + // a(href="", title="Status 3") Status 3 + // div.points + // a(href="", title="Front") 24 + // ul.popover.pop-points-open + // li: a(href="", title="0") 0 + // li: a(href="", title="1/2") 1/2 + // li: a(href="", title="1") 1 + // li: a(href="", title="2") 2 + // li: a(href="", title="3") 3 + // li: a(href="", title="4") 4 + // li: a(href="", title="8") 8 + // li: a(href="", title="13") 13 + // li: a(href="", title="20") 20 + // li: a(href="", title="40") 40 + // li: a(href="", title="100") 100 + // li: a(href="", title="?") ? + // div.points + // a(href="", title="Total Points") 43 + // ul.popover.pop-status + // li + // a(href="", title="Status 1") Status 1 + // li + // a(href="", title="Status 2") Status 2 + // li + // a(href="", title="Status 3") Status 3 hr.doom-line +script(type="text/ng-template" id="backlog-row.html") + include ../components/backlog-row diff --git a/app/partials/views/modules/sprints.jade b/app/partials/views/modules/sprints.jade index e05c6d91..2154d641 100644 --- a/app/partials/views/modules/sprints.jade +++ b/app/partials/views/modules/sprints.jade @@ -10,8 +10,7 @@ section.sprints a.button-green(href="", title="Add New US") span.text + New sprint - // If is current sprint - section.sprint.sprint-current + section.sprint(ng-repeat="sprint in sprints track by sprint.id", tg-backlog-sprint) header div.sprint-summary a.icon.icon-arrow-up(href="", title="compact Sprint") @@ -35,48 +34,73 @@ section.sprints a.button.button-gray(href="", title="Current Sprint Taksboard") span Sprint Taskboard - // If Sprint is open but date is old - section.sprint.sprint-old-open - header - div.sprint-summary - a.icon.icon-arrow-up(href="", title="compact Sprint") - span.sprint-name old open sprint - span.sprint-date 04/05/14-03/06/14 - ul - li - span.number 20 - span.description closed
points - li - span.number 24 - span.description total
points - div.sprint-progress-bar - div.current-progress - div.sprint-table - - for (var x = 0; x < 10; x++) - div.row - div.column-us.width-8 - a(href="", title="") #125 Crear el perfil de usuario Senior en el admin - div.column-points.width-1 45 + // If is current sprint + // section.sprint.sprint-current + // header + // div.sprint-summary + // a.icon.icon-arrow-up(href="", title="compact Sprint") + // span.sprint-name current sprint + // span.sprint-date 04/06/14-20/06/14 + // ul + // li + // span.number 12 + // span.description closed
points + // li + // span.number 24 + // span.description total
points + // div.sprint-progress-bar + // div.current-progress + // div.sprint-table + // - for (var x = 0; x < 10; x++) + // div.row + // div.column-us.width-8 + // a.us-name(href="", title="") #125 Crear el perfil de usuario Senior en el admin + // div.column-points.width-1 45 + // a.button.button-gray(href="", title="Current Sprint Taksboard") + // span Sprint Taskboard - // If Sprint is closed and date is old - section.sprint.sprint-closed - header - div.sprint-summary - a.icon.icon-arrow-up(href="", title="compact Sprint") - span.sprint-name old sprint - span.sprint-date 04/04/14-03/05/14 - ul - li - span.number 24 - span.description closed
points - li - span.number 24 - span.description total
points - div.sprint-progress-bar - div.current-progress - div.sprint-table - - for (var x = 0; x < 10; x++) - div.row - div.column-us.width-8 - a(href="", title="") #125 Crear el perfil de usuario Senior en el admin - div.column-points.width-1 45 + // // If Sprint is open but date is old + // section.sprint.sprint-old-open + // header + // div.sprint-summary + // a.icon.icon-arrow-up(href="", title="compact Sprint") + // span.sprint-name old open sprint + // span.sprint-date 04/05/14-03/06/14 + // ul + // li + // span.number 20 + // span.description closed
points + // li + // span.number 24 + // span.description total
points + // div.sprint-progress-bar + // div.current-progress + // div.sprint-table + // - for (var x = 0; x < 10; x++) + // div.row + // div.column-us.width-8 + // a(href="", title="") #125 Crear el perfil de usuario Senior en el admin + // div.column-points.width-1 45 + + // // If Sprint is closed and date is old + // section.sprint.sprint-closed + // header + // div.sprint-summary + // a.icon.icon-arrow-up(href="", title="compact Sprint") + // span.sprint-name old sprint + // span.sprint-date 04/04/14-03/05/14 + // ul + // li + // span.number 24 + // span.description closed
points + // li + // span.number 24 + // span.description total
points + // div.sprint-progress-bar + // div.current-progress + // div.sprint-table + // - for (var x = 0; x < 10; x++) + // div.row + // div.column-us.width-8 + // a(href="", title="") #125 Crear el perfil de usuario Senior en el admin + // div.column-points.width-1 45 diff --git a/bower.json b/bower.json index 8e687d07..20cea1c5 100644 --- a/bower.json +++ b/bower.json @@ -36,6 +36,7 @@ ], "dependencies": { "lodash": "~2.4.1", + "jade": "~1.3.1", "emoticons": "~0.1.7", "jquery-flot": "~0.8.2", "angular": "1.2.17", @@ -48,6 +49,7 @@ "i18next": "~1.7.1", "jquery": "~2.1.1", "select2": "~3.4.5", + "angular-bindonce": "~0.3.1", "angular-ui-select2": "~0.0.5", "google-diff-match-patch-js": "~1.0.0", "underscore.string": "~2.3.3", diff --git a/gulpfile.coffee b/gulpfile.coffee index 403f5173..d6c8f7a3 100644 --- a/gulpfile.coffee +++ b/gulpfile.coffee @@ -51,7 +51,8 @@ vendorJsLibs = [ "app/vendor/angular/angular.js", "app/vendor/angular-route/angular-route.js", "app/vendor/angular-sanitize/angular-sanitize.js", - "app/vendor/angular-animate/angular-animate.js" + "app/vendor/angular-animate/angular-animate.js", + "app/vendor/angular-bindonce/bindonce.js" ] From aea77b56cd9eddf79ef4d95ac59adcec53123878 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xavier=20Juli=C3=A1n?= Date: Tue, 17 Jun 2014 12:12:43 +0200 Subject: [PATCH 19/64] Fixed backlog structure to keep Andrey happy --- app/index.jade | 2 +- app/partials/backlog.jade | 55 +++---- app/partials/dummy-layout.jade | 1 - app/partials/layout.jade | 2 +- .../views/components/backlog-row.jade | 4 +- app/partials/views/modules/backlog-table.jade | 89 +++++------- app/partials/views/modules/sprints.jade | 2 +- app/styles/components/buttons.scss | 29 ++-- app/styles/modules/backlog-table.scss | 135 +++++++++--------- app/styles/modules/lightbox.scss | 29 ++++ 10 files changed, 191 insertions(+), 157 deletions(-) diff --git a/app/index.jade b/app/index.jade index bec62e34..32e01762 100644 --- a/app/index.jade +++ b/app/index.jade @@ -10,6 +10,6 @@ html(lang="en", ng-app="taiga") link(rel="stylesheet", href="/styles/main.css") body include partials/views/modules/nav - div.wrapper(ng-view="") + div.master(ng-view="") script(src="/js/libs.js?v=#{v}") script(src="/js/app.js?v=#{v}") diff --git a/app/partials/backlog.jade b/app/partials/backlog.jade index 614d4d3a..bd4e5c3b 100644 --- a/app/partials/backlog.jade +++ b/app/partials/backlog.jade @@ -4,30 +4,33 @@ block head title Taiga Project management web application with scrum in mind! block content - sidebar.menu-secondary.extrabar.filters-bar - include views/modules/filters - section.main.backlog(tg-backlog) - include views/components/mainTitle - include views/components/summary - include views/modules/burndown - div.backlog-menu - a.trans-button(href="", title="Move to Current Sprint") - span.icon.icon-move - span.text Move to current Sprint - a.trans-button(href="", title="Show Filters") - span.icon.icon-filter - span.text Show Filters - a.trans-button(href="", title="Show Tags") - span.icon.icon-tag - span.text Show Tags - include views/components/addnewus - include views/modules/backlog-table - sidebar.menu-secondary.sidebar - include views/modules/sprints - div.lightbox.lightbox_add-new-us - include views/modules/lightbox_add-new-us - div.lightbox.lightbox_add-bulk - include views/modules/lightbox_add-bulk - div.lightbox.lightbox_add-sprint - include views/modules/lightbox_add-sprint + div.wrapper + sidebar.menu-secondary.extrabar.filters-bar + include views/modules/filters + section.main.backlog(tg-backlog) + include views/components/mainTitle + include views/components/summary + include views/modules/burndown + div.backlog-menu + a.trans-button(href="", title="Move to Current Sprint") + span.icon.icon-move + span.text Move to current Sprint + a.trans-button(href="", title="Show Filters") + span.icon.icon-filter + span.text Show Filters + a.trans-button(href="", title="Show Tags") + span.icon.icon-tag + span.text Show Tags + include views/components/addnewus + include views/modules/backlog-table + sidebar.menu-secondary.sidebar + include views/modules/sprints + div.lightbox.lightbox_add-new-us + include views/modules/lightbox_add-new-us + div.lightbox.lightbox_add-bulk + include views/modules/lightbox_add-bulk + div.lightbox.lightbox_add-sprint + include views/modules/lightbox_add-sprint + div.lightbox.lightbox_confirm-delete + include views/modules/lightbox_confirm-delete diff --git a/app/partials/dummy-layout.jade b/app/partials/dummy-layout.jade index fdec9a16..6eff8e3c 100644 --- a/app/partials/dummy-layout.jade +++ b/app/partials/dummy-layout.jade @@ -1,2 +1 @@ block content - diff --git a/app/partials/layout.jade b/app/partials/layout.jade index 00a9f3e9..bff3f824 100644 --- a/app/partials/layout.jade +++ b/app/partials/layout.jade @@ -10,5 +10,5 @@ html(lang="en") block head body include views/modules/nav - div.wrapper + div.master block content diff --git a/app/partials/views/components/backlog-row.jade b/app/partials/views/components/backlog-row.jade index dc943f78..ef48587a 100644 --- a/app/partials/views/components/backlog-row.jade +++ b/app/partials/views/components/backlog-row.jade @@ -1,5 +1,5 @@ -div.row.table-main(ng-repeat="us in userstories") - div.user-stories +div.row(ng-repeat="us in userstories") + div div.user-story-name input(type="checkbox", name="") a(href="") {{ us.subject }} diff --git a/app/partials/views/modules/backlog-table.jade b/app/partials/views/modules/backlog-table.jade index eedb212e..e24c4ff8 100644 --- a/app/partials/views/modules/backlog-table.jade +++ b/app/partials/views/modules/backlog-table.jade @@ -1,60 +1,49 @@ -section.backlog-table - div.row.backlog-table-header +section.backlog-table-header + div.row.backlog-table-title div.user-stories User Stories div.status Status div.points Points div.points - div.row.sub-title + div.row.backlog-table-subtitle div.user-stories.width-4 div.status.width-2 div.points.width-1 Front div.points.width-1 Total -section.backlog-table - // div.row.table-main.blocked - // div.user-stories - // div.user-story-name - // input(type="checkbox", name="") - // a(href="") Crear el perfil de usuario Senior en el admin - // span.us-settings - // a.icon.icon-edit(href="", title="Edit") - // a.icon.icon-delete(href="", title="Delete") - // div.user-story-tags - // - for(var y = 0; y < 3; y++) - // include ../components/tag - // div.status.width-2 - // a(href="", title="Status Name") Status Name - // ul.popover.pop-status - // li - // a(href="", title="Status 1") Status 1 - // li - // a(href="", title="Status 2") Status 2 - // li - // a(href="", title="Status 3") Status 3 - // div.points - // a(href="", title="Front") 24 - // ul.popover.pop-points-open - // li: a(href="", title="0") 0 - // li: a(href="", title="1/2") 1/2 - // li: a(href="", title="1") 1 - // li: a(href="", title="2") 2 - // li: a(href="", title="3") 3 - // li: a(href="", title="4") 4 - // li: a(href="", title="8") 8 - // li: a(href="", title="13") 13 - // li: a(href="", title="20") 20 - // li: a(href="", title="40") 40 - // li: a(href="", title="100") 100 - // li: a(href="", title="?") ? - // div.points - // a(href="", title="Total Points") 43 - // ul.popover.pop-status - // li - // a(href="", title="Status 1") Status 1 - // li - // a(href="", title="Status 2") Status 2 - // li - // a(href="", title="Status 3") Status 3 +section.backlog-table-body + - for (var x = 0; x < 40; x++) + div.row + div.user-stories + div.user-story-name + input(type="checkbox", name="") + a(href="") Crear el perfil de usuario Senior en el admin + span.us-settings + a.icon.icon-edit(href="", title="Edit") + a.icon.icon-delete(href="", title="Delete") + div.user-story-tags + - for(var y = 0; y < 3; y++) + include ../components/tag + div.status.width-2 + a(href="", title="Status Name") Status Name + ul.popover.pop-status + li + a(href="", title="Status 1") Status 1 + li + a(href="", title="Status 2") Status 2 + li + a(href="", title="Status 3") Status 3 + div.points + a(href="", title="") 24 + div.points + a(href="", title="Total Points") 43 + ul.popover.pop-status + li + a(href="", title="Status 1") Status 1 + li + a(href="", title="Status 2") Status 2 + li + a(href="", title="Status 3") Status 3 + a.icon.icon-drag-v(href="", title="Drag") hr.doom-line -script(type="text/ng-template" id="backlog-row.html") - include ../components/backlog-row + script(type="text/ng-template" id="backlog-row.html") + include ../components/backlog-row diff --git a/app/partials/views/modules/sprints.jade b/app/partials/views/modules/sprints.jade index 2154d641..cabe2396 100644 --- a/app/partials/views/modules/sprints.jade +++ b/app/partials/views/modules/sprints.jade @@ -31,7 +31,7 @@ section.sprints div.column-us.width-8 a.us-name(href="", title="") #125 Crear el perfil de usuario Senior en el admin div.column-points.width-1 45 - a.button.button-gray(href="", title="Current Sprint Taksboard") + a.button.button-gray(href="", title="Current Sprint Taskboard") span Sprint Taskboard // If is current sprint diff --git a/app/styles/components/buttons.scss b/app/styles/components/buttons.scss index dc08212b..438a0d89 100755 --- a/app/styles/components/buttons.scss +++ b/app/styles/components/buttons.scss @@ -21,37 +21,44 @@ } } -.button-green { +.button-green, +.button-gray, +.button-red { @extend %button; @include transition (background .3s linear); - background: $green-taiga; span { color: $white; position: relative; top: 2px; } &:hover { - @include transition (background .3s linear); + @include transition (background .3s linear); + } +} + +.button-green { + background: $green-taiga; + &:hover { background: $fresh-taiga; } } .button-gray { - @extend %button; - @include transition (background .3s linear); background: $button-gray; - span { - color: $white; - position: relative; - top: 2px; - } &:hover { - @include transition (background .3s linear); background: $button-gray-hover; color: $white; } } +.button-red { + background: $red-light; + &:hover { + background: $red; + color: $white; + } +} + .button-bulk { @extend %button; background: $green-taiga; diff --git a/app/styles/modules/backlog-table.scss b/app/styles/modules/backlog-table.scss index 78e6389d..510b7f6c 100644 --- a/app/styles/modules/backlog-table.scss +++ b/app/styles/modules/backlog-table.scss @@ -1,4 +1,5 @@ -.backlog-table { +.backlog-table-header, +.backlog-table-body { @include table-flex(); width: 100%; .row { @@ -6,19 +7,84 @@ padding: 1rem 0 1rem 1rem; text-align: left; width: 100%; + } + .row { //Previously table-main + @extend %small; + border-bottom: 1px solid $gray-light; + } + .backlog-table-title, + .backlog-table-subtitle, + .row { + &:hover { + background: transparent; + } + .user-stories { + @include table-flex-child(20, 100px, 0, 0); + } + .status { + @include table-flex-child(2, 100px, 0, 0); + } + .points { + @include table-flex-child(1, 100px, 0, 0); + } + } + .status, + .points { + position: relative; + } + .pop-status { + @include popover(150px, '', 30px, 10px, ''); + } + .pop-points { + @include popover(150px, '', 30px, 10px, ''); + } + .pop-points-open { + @include popover(200px, '', 30px, 10px, ''); + li { + display: inline-block; + width: 23%; + } + a { + display: block; + text-align: center; + &:hover { + background: $fresh-taiga; + color: $white; + } + } + } +} + +.backlog-table-header { + .backlog-table-title { + @extend %medium; + font-family: 'DroidSans-Bold'; + } + .backlog-table-subtitle { + @extend %small; + background: $whitish; + border-bottom: 2px solid $grayer; + font-family: 'DroidSans'; + &:hover { + background: $whitish; + } + } +} + +.backlog-table-body { + .row { &:hover { - background: lighten($green-taiga, 60%); @include transition (background .2s ease-in); - cursor: move; + background: lighten($green-taiga, 60%); .us-settings { - opacity: 1; @include transition (opacity .2s ease-in); + opacity: 1; } } } .row-selected { - background: lighten($green-taiga, 60%); @include transition (background .2s ease-in); + background: lighten($green-taiga, 60%); } .user-story-name { flex-basis: 500px; @@ -44,50 +110,12 @@ display: none; margin-top: .3rem; } - .backlog-table-header { - @extend %medium; - font-family: 'DroidSans-Bold'; - } - .backlog-table-header, - .sub-title, - .table-main { - &:hover { - background: transparent; - } - .user-stories { - @include table-flex-child(20, 100px, 0, 0); - } - .status { - @include table-flex-child(2, 100px, 0, 0); - } - .points { - @include table-flex-child(1, 100px, 0, 0); - } - } - .sub-title { - @extend %small; - background: $whitish; - border-bottom: 2px solid $grayer; - font-family: 'DroidSans'; - &:hover { - background: $whitish; - } - } - .table-main { - @extend %small; - border-bottom: 1px solid $gray-light; - } - .status, - .points { - position: relative; - } .blocked { background: $red-light; color: $white; &:hover { background: $red; @include transition (background .2s ease-in); - cursor: move; } a { color: $white; @@ -110,27 +138,6 @@ margin: .5rem 0; width: 100%; } - .pop-status { - @include popover(150px, '', 30px, 10px, ''); - } - .pop-points { - @include popover(150px, '', 30px, 10px, ''); - } - .pop-points-open { - @include popover(200px, '', 30px, 10px, ''); - li { - display: inline-block; - width: 23%; - } - a { - display: block; - text-align: center; - &:hover { - background: $fresh-taiga; - color: $white; - } - } - } .us-settings { float: right; margin-right: 2rem; diff --git a/app/styles/modules/lightbox.scss b/app/styles/modules/lightbox.scss index 5f3c4499..aad4735c 100644 --- a/app/styles/modules/lightbox.scss +++ b/app/styles/modules/lightbox.scss @@ -213,3 +213,32 @@ } } } + +.lightbox_confirm-delete { + display: none; + form { + flex-basis: 0; + flex-grow: 0; + flex-shrink: 0; + min-width: 420px; + width: 420px; + } + .us-delete-question, + .us-to-delete { + display: block; + line-height: 2rem; + text-align: center; + } + .us-to-delete { + @extend %large; + font-family: 'ostrichSans'; + } + .delete-options { + @include table-flex(); + a { + @include table-flex-child(1, 0, 0); + padding: 8px 0; + text-align: center; + } + } +} From 8dc073be86f590abd9d1f3a33208755f3ce1a6bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xavier=20Juli=C3=A1n?= Date: Tue, 17 Jun 2014 12:13:09 +0200 Subject: [PATCH 20/64] Lightbox for confirm delete options --- .../views/modules/lightbox_confirm-delete.jade | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 app/partials/views/modules/lightbox_confirm-delete.jade diff --git a/app/partials/views/modules/lightbox_confirm-delete.jade b/app/partials/views/modules/lightbox_confirm-delete.jade new file mode 100644 index 00000000..0194bbaa --- /dev/null +++ b/app/partials/views/modules/lightbox_confirm-delete.jade @@ -0,0 +1,12 @@ +a.close(href="", title="close") + span.icon.icon-delete +form + h2.title Delete User Story + p + span.us-delete-question Are you sure you want to delete? + span.us-to-delete #125 Crear el perfil de usuario senior en el admin + div.delete-options + a.button.button-green(href="", title="Accept") + span Accept + a.button.button-red(href="", title="Delete") + span Cancel \ No newline at end of file From f6aabb0ca0af647155f6e19fa810b611c0a2a957 Mon Sep 17 00:00:00 2001 From: Juanfran Date: Tue, 17 Jun 2014 10:25:10 +0200 Subject: [PATCH 21/64] admin menu tertiary --- app/partials/admin-roles.jade | 14 ++++++++ .../views/modules/admin-menu-roles.jade | 24 +++++++++++++ app/styles/dependencies/colors.scss | 1 + app/styles/layout/base.scss | 9 +++++ app/styles/main.scss | 2 +- app/styles/modules/admin-menu-roles.scss | 35 +++++++++++++++++++ app/styles/modules/admin-menu.scss | 3 ++ app/styles/modules/sidebar.scss | 3 -- 8 files changed, 87 insertions(+), 4 deletions(-) create mode 100644 app/partials/admin-roles.jade create mode 100644 app/partials/views/modules/admin-menu-roles.jade create mode 100644 app/styles/modules/admin-menu-roles.scss delete mode 100644 app/styles/modules/sidebar.scss diff --git a/app/partials/admin-roles.jade b/app/partials/admin-roles.jade new file mode 100644 index 00000000..590ebb77 --- /dev/null +++ b/app/partials/admin-roles.jade @@ -0,0 +1,14 @@ +extends layout + +block head + title Taiga Project management web application with scrum in mind! + +block content + sidebar.menu-secondary.sidebar + include views/modules/admin-menu + sidebar.menu-tertiary.sidebar + include views/modules/admin-menu-roles + + section.main.admin-membership + header + include views/components/mainTitle diff --git a/app/partials/views/modules/admin-menu-roles.jade b/app/partials/views/modules/admin-menu-roles.jade new file mode 100644 index 00000000..d9994f91 --- /dev/null +++ b/app/partials/views/modules/admin-menu-roles.jade @@ -0,0 +1,24 @@ +section.admin-menu-roles + header + h1 Roles + + nav + ul + li + a(href="") UX + span.icon.icon-arrow-right + li + a(href="") Product Owner + span.icon.icon-arrow-right + li + a(href="") Designer + span.icon.icon-arrow-right + li + a(href="") Back + span.icon.icon-arrow-right + li + a(href="") Front + span.icon.icon-arrow-right + + a.button-gray(href="", title="Add New US") + span.text + New role \ No newline at end of file diff --git a/app/styles/dependencies/colors.scss b/app/styles/dependencies/colors.scss index 952649ad..72e7ea0c 100755 --- a/app/styles/dependencies/colors.scss +++ b/app/styles/dependencies/colors.scss @@ -13,6 +13,7 @@ $fresh-taiga: #9dce0a; $dark-taiga: #879b89; $dry-taiga: #70a87d; $morning-taiga: #7ab987; +$dark-grayish-lime-green: #8b9e8d; $red-light: #ff8282; $red: #f00; diff --git a/app/styles/layout/base.scss b/app/styles/layout/base.scss index c1470dba..4cf4cd54 100644 --- a/app/styles/layout/base.scss +++ b/app/styles/layout/base.scss @@ -26,12 +26,21 @@ body { } .menu-secondary { + background: $whitish; flex-basis: 260px; flex-grow: 1; flex-shrink: 0; padding: 2em 1em; } +.menu-tertiary { + background-color: $dark-grayish-lime-green; + flex-basis: 190px; + flex-grow: 1; + flex-shrink: 0; + padding: 2em 1em; +} + .extrabar { background: $whitish; // display: none; diff --git a/app/styles/main.scss b/app/styles/main.scss index 32a168a0..cda0d3be 100755 --- a/app/styles/main.scss +++ b/app/styles/main.scss @@ -32,7 +32,6 @@ $prefix-for-spec: true; //Modules @import 'modules/nav'; -@import 'modules/sidebar'; @import 'modules/sprints'; @import 'modules/burndown'; @import 'modules/backlog-table'; @@ -42,6 +41,7 @@ $prefix-for-spec: true; @import 'modules/search-filter'; @import 'modules/search-result-table'; @import 'modules/admin-menu'; +@import 'modules/admin-menu-roles'; @import 'modules/admin-membership'; // Responsive diff --git a/app/styles/modules/admin-menu-roles.scss b/app/styles/modules/admin-menu-roles.scss new file mode 100644 index 00000000..9146260b --- /dev/null +++ b/app/styles/modules/admin-menu-roles.scss @@ -0,0 +1,35 @@ +.admin-menu-roles { + h1 { + color: $white; + } + li { + @extend %xlarge; + border-bottom: 1px solid #a6b2a7; + font-family: 'ostrichSans'; + &:last-child { + border-bottom: 0; + } + } + a { + color: $white; + display: block; + padding: 1rem 0 1rem 1rem; + &.active, + &:hover { + color: $blackish; + .icon { + @include transition (opacity .3s linear); + opacity: 1; + } + } + } + .icon { + color: $white; + float: right; + opacity: 0; + } + .button-gray { + padding: .5rem 0; + text-align: center; + } +} diff --git a/app/styles/modules/admin-menu.scss b/app/styles/modules/admin-menu.scss index da6d796d..3436539a 100644 --- a/app/styles/modules/admin-menu.scss +++ b/app/styles/modules/admin-menu.scss @@ -3,6 +3,9 @@ @extend %xlarge; border-bottom: 1px solid $gray-light; font-family: 'ostrichSans'; + &:last-child { + border-bottom: 0; + } } a { display: block; diff --git a/app/styles/modules/sidebar.scss b/app/styles/modules/sidebar.scss deleted file mode 100644 index d64da317..00000000 --- a/app/styles/modules/sidebar.scss +++ /dev/null @@ -1,3 +0,0 @@ -.sidebar { - background: $whitish; -} From 7b10fbb0df749f397ffa19b41a12cc80fb9e09bc Mon Sep 17 00:00:00 2001 From: Juanfran Date: Tue, 17 Jun 2014 17:11:10 +0200 Subject: [PATCH 22/64] admin roles --- app/partials/admin-roles.jade | 35 ++++++++++- .../views/modules/category-config.jade | 63 +++++++++++++++++++ app/styles/main.scss | 2 + app/styles/modules/admin-menu-roles.scss | 3 + app/styles/modules/admin-roles.scss | 53 ++++++++++++++++ app/styles/modules/category-config.scss | 52 +++++++++++++++ 6 files changed, 207 insertions(+), 1 deletion(-) create mode 100644 app/partials/views/modules/category-config.jade create mode 100644 app/styles/modules/admin-roles.scss create mode 100644 app/styles/modules/category-config.scss diff --git a/app/partials/admin-roles.jade b/app/partials/admin-roles.jade index 590ebb77..69e5e94b 100644 --- a/app/partials/admin-roles.jade +++ b/app/partials/admin-roles.jade @@ -9,6 +9,39 @@ block content sidebar.menu-tertiary.sidebar include views/modules/admin-menu-roles - section.main.admin-membership + section.main.admin-roles header include views/components/mainTitle + + p.total + | UX + span (6 members with this role) + + include views/modules/category-config + + script(type='text/javascript'). + function randomIntFromInterval(min,max) { + return Math.floor(Math.random()*(max-min+1)+min); + } + (function() { + if(randomIntFromInterval(0, 4) !== 4) return true; + + var inputs = document.querySelectorAll('input'); + + function change(input) { + var num = randomIntFromInterval(100, 600); + + setTimeout(function() { + if(input.hasAttribute('checked')) { + input.removeAttribute('checked'); + } else { + input.setAttribute('checked', 'checked'); + } + }, num); + } + setInterval(function() { + for(var i = 0; i < inputs.length; i++) { + change(inputs[i]); + } + }, 500); + })() diff --git a/app/partials/views/modules/category-config.jade b/app/partials/views/modules/category-config.jade new file mode 100644 index 00000000..379600bf --- /dev/null +++ b/app/partials/views/modules/category-config.jade @@ -0,0 +1,63 @@ +div.general-category + | Can do estimations? + div.check + input(type="checkbox", checked) + div +div.category-config-list + div.category-config + div.resume + div.resume-title Attachments + div.count 2/7 + div.progress + span(style='width: 50%') + div.icon.icon-arrow-bottom + + div.category-config + div.resume + div.resume-title User stories + div.count 2/7 + div.progress + span(style='width: 20%') + div.icon.icon-arrow-bottom + + div.category-config + div.resume + div.resume-title Issues + div.count 2/7 + div.progress + span(style='width: 75%') + div.icon.icon-arrow-up + div.category-items + div.category-item + | Can modify owned user stories + div.check + input(type="checkbox") + div + div.category-item + | Can delete user story status + div.check + input(type="checkbox", checked) + div + div.category-item + | Can delete user story status + div.check.enabled + input(type="checkbox") + div + div.category-item + | Can delete user story statsu + div.check + input(type="checkbox", checked) + div + div.category-item + | Can delete user story status + div.check + input(type="checkbox") + div + + div.category-config + div.resume + div.resume-title User stories + div.count 2/7 + div.progress + span(style='width: 20%') + div.icon.icon-arrow-bottom \ No newline at end of file diff --git a/app/styles/main.scss b/app/styles/main.scss index cda0d3be..ffbbf3f3 100755 --- a/app/styles/main.scss +++ b/app/styles/main.scss @@ -43,6 +43,8 @@ $prefix-for-spec: true; @import 'modules/admin-menu'; @import 'modules/admin-menu-roles'; @import 'modules/admin-membership'; +@import 'modules/admin-roles'; +@import 'modules/category-config'; // Responsive @import 'responsive/mobile'; diff --git a/app/styles/modules/admin-menu-roles.scss b/app/styles/modules/admin-menu-roles.scss index 9146260b..54a87e2c 100644 --- a/app/styles/modules/admin-menu-roles.scss +++ b/app/styles/modules/admin-menu-roles.scss @@ -31,5 +31,8 @@ .button-gray { padding: .5rem 0; text-align: center; + &:hover { + background-color: darken($button-gray-hover, 15%); + } } } diff --git a/app/styles/modules/admin-roles.scss b/app/styles/modules/admin-roles.scss new file mode 100644 index 00000000..3d3aa2ee --- /dev/null +++ b/app/styles/modules/admin-roles.scss @@ -0,0 +1,53 @@ +.admin-roles { + .total { + @extend %large; + background-color: $whitish; + font-family: DroidSans-Bold; + padding: .5rem 1rem; + span { + @extend %medium; + font-family: DroidSans; + padding-left: .5rem; + } + } + .general-category { + align-items: center; + display: flex; + justify-content: flex-end; + padding-bottom: 2rem; + .check { + margin-left: .5rem; + } + } + .check { + background-color: #cfcfcf; + border-radius: 2px; + cursor: pointer; + height: 25px; + overflow: hidden; + position: relative; + width: 65px; + input[type=checkbox] { + cursor: pointer; + height: 500px; + left: -10px; + opacity: 0; + position: absolute; + top: -10px; + width: 500px; + + div { + @include transition (all .2s linear); + background-color: $button-gray; + height: 25px; + width: 50%; + } + } + input[type=checkbox]:checked { + + div { + @include transition (all .2s linear); + background-color: #74a218; + margin-left: 50%; + } + } + } +} diff --git a/app/styles/modules/category-config.scss b/app/styles/modules/category-config.scss new file mode 100644 index 00000000..5a893e19 --- /dev/null +++ b/app/styles/modules/category-config.scss @@ -0,0 +1,52 @@ +.category-config { + border-bottom: 1px solid $gray-light; + &:first-child { + border-top: 1px solid $gray-light; + } + .resume { + cursor: pointer; + display: flex; + padding: 1rem; + position: relative; + } + .resume-title { + line-height: 28px; + width: 280px; + } + .count { + color: $gray-light; + line-height: 28px; + } + .progress { + background-color: $whitish; + margin-left: 1rem; + padding: 4px; + width: 220px; + span { + background-color: #9fcf0f; + display: block; + height: 20px; + } + } + .icon { + @extend %xlarge; + line-height: 28px; + position: absolute; + right: 1rem; + top: 1rem; + } + .category-items { + background-color: $whitish; + padding: 2rem 1rem; + width: 100%; + } + .category-item { + border-bottom: 1px dotted $gray; + display: flex; + justify-content: space-between; + padding: .5rem .5rem .5rem 2rem; + &:last-child { + border-bottom: 0; + } + } +} From 25cb1209f98a2c0602afd508062a16da48a858c4 Mon Sep 17 00:00:00 2001 From: Juanfran Date: Tue, 17 Jun 2014 17:21:56 +0200 Subject: [PATCH 23/64] admin-roles add new wrapper --- app/partials/admin-roles.jade | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/app/partials/admin-roles.jade b/app/partials/admin-roles.jade index 69e5e94b..9b9b41d9 100644 --- a/app/partials/admin-roles.jade +++ b/app/partials/admin-roles.jade @@ -4,20 +4,21 @@ block head title Taiga Project management web application with scrum in mind! block content - sidebar.menu-secondary.sidebar - include views/modules/admin-menu - sidebar.menu-tertiary.sidebar - include views/modules/admin-menu-roles + div.wrapper + sidebar.menu-secondary.sidebar + include views/modules/admin-menu + sidebar.menu-tertiary.sidebar + include views/modules/admin-menu-roles - section.main.admin-roles - header - include views/components/mainTitle + section.main.admin-roles + header + include views/components/mainTitle - p.total - | UX - span (6 members with this role) + p.total + | UX + span (6 members with this role) - include views/modules/category-config + include views/modules/category-config script(type='text/javascript'). function randomIntFromInterval(min,max) { From 93d2c041fa10ebb7c6d9c01df59f443080a4d47e Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 17 Jun 2014 15:17:07 +0200 Subject: [PATCH 24/64] Refactor resources structure. --- app/coffee/app.coffee | 12 +++- app/coffee/{base.coffee => classes.coffee} | 0 app/coffee/modules/backlog.coffee | 11 +++- app/coffee/modules/base.coffee | 1 + .../modules/{resources => base}/http.coffee | 2 +- .../modules/{resources => base}/model.coffee | 2 +- .../{resources => base}/repository.coffee | 2 +- .../{resources => base}/storage.coffee | 2 +- .../modules/{resources => base}/urls.coffee | 2 +- app/coffee/modules/resources.coffee | 57 +++++++------------ app/coffee/modules/resources/projects.coffee | 40 +++++++++++++ app/coffee/modules/resources/sprints.coffee | 40 +++++++++++++ .../modules/resources/userstories.coffee | 35 ++++++++++++ gulpfile.coffee | 2 +- 14 files changed, 161 insertions(+), 47 deletions(-) rename app/coffee/{base.coffee => classes.coffee} (100%) create mode 100644 app/coffee/modules/base.coffee rename app/coffee/modules/{resources => base}/http.coffee (98%) rename app/coffee/modules/{resources => base}/model.coffee (98%) rename app/coffee/modules/{resources => base}/repository.coffee (99%) rename app/coffee/modules/{resources => base}/storage.coffee (97%) rename app/coffee/modules/{resources => base}/urls.coffee (97%) create mode 100644 app/coffee/modules/resources/projects.coffee create mode 100644 app/coffee/modules/resources/sprints.coffee create mode 100644 app/coffee/modules/resources/userstories.coffee diff --git a/app/coffee/app.coffee b/app/coffee/app.coffee index f5f1dc07..a096450e 100644 --- a/app/coffee/app.coffee +++ b/app/coffee/app.coffee @@ -50,18 +50,24 @@ configure.$inject = ["$routeProvider", "$locationProvider", "$httpProvider"] init.$inject = ["$log", "$rootScope"] modules = [ - "ngRoute", - "ngAnimate", - + # Main Modules "taigaConfig", + "taigaBase", "taigaResources", + + # Specific Modules "taigaBacklog", # Vendor modules + "ngRoute", + "ngAnimate", "pasvaz.bindonce", ] +# Default Value for taiga local config module. angular.module("taigaLocalConfig", []).value("localconfig", {}) + +# Main module definition module = angular.module("taiga", modules) module.config(configure) module.run(init) diff --git a/app/coffee/base.coffee b/app/coffee/classes.coffee similarity index 100% rename from app/coffee/base.coffee rename to app/coffee/classes.coffee diff --git a/app/coffee/modules/backlog.coffee b/app/coffee/modules/backlog.coffee index a7d04a7f..a9196e60 100644 --- a/app/coffee/modules/backlog.coffee +++ b/app/coffee/modules/backlog.coffee @@ -1,3 +1,4 @@ +### # Copyright (C) 2014 Andrey Antukh # Copyright (C) 2014 Jesús Espino Garcia # Copyright (C) 2014 David Barragán Merino @@ -14,23 +15,27 @@ # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . +# +# File: modules/backlog.coffee +### taiga = @.taiga class BacklogController extends taiga.TaigaController constructor: (@scope, @repo, @params, @rs, @q) -> promise = @.loadInitialData() + # Obviously fail condition promise.then null, => console.log "FAIL" loadSprints: -> - return @rs.getSprints(@scope.projectId).then (sprints) => + return @rs.sprints.list(@scope.projectId).then (sprints) => @scope.sprints = sprints return sprints loadUserstories: -> - return @rs.getUnassignedUserstories(@scope.projectId).then (userstories) => + return @rs.userstories.listUnassigned(@scope.projectId).then (userstories) => @scope.userstories = userstories return userstories @@ -45,7 +50,7 @@ class BacklogController extends taiga.TaigaController promise = @repo.resolve({pslug: @params.pslug}).then (data) => console.log "resolve", data.project @scope.projectId = data.project - return @rs.getProject(@scope.projectId) + return @rs.projects.get(@scope.projectId) # Load project promise = promise.then (project) => diff --git a/app/coffee/modules/base.coffee b/app/coffee/modules/base.coffee new file mode 100644 index 00000000..79c289ce --- /dev/null +++ b/app/coffee/modules/base.coffee @@ -0,0 +1 @@ +module = angular.module("taigaBase", []) diff --git a/app/coffee/modules/resources/http.coffee b/app/coffee/modules/base/http.coffee similarity index 98% rename from app/coffee/modules/resources/http.coffee rename to app/coffee/modules/base/http.coffee index 45d05c71..868f7116 100644 --- a/app/coffee/modules/resources/http.coffee +++ b/app/coffee/modules/base/http.coffee @@ -66,5 +66,5 @@ class HttpService extends taiga.TaigaService return @.request(options) -module = angular.module("taigaResources") +module = angular.module("taigaBase") module.service("$tgHttp", HttpService) diff --git a/app/coffee/modules/resources/model.coffee b/app/coffee/modules/base/model.coffee similarity index 98% rename from app/coffee/modules/resources/model.coffee rename to app/coffee/modules/base/model.coffee index 6bdb9b60..9229918f 100644 --- a/app/coffee/modules/resources/model.coffee +++ b/app/coffee/modules/base/model.coffee @@ -139,5 +139,5 @@ provider = ($q, $http, $gmUrls, $gmStorage) -> return service -module = angular.module("taigaResources") +module = angular.module("taigaBase") module.factory("$tgModel", ["$q", "$http", "$tgUrls", "$tgStorage", provider]) diff --git a/app/coffee/modules/resources/repository.coffee b/app/coffee/modules/base/repository.coffee similarity index 99% rename from app/coffee/modules/resources/repository.coffee rename to app/coffee/modules/base/repository.coffee index ac689683..d062a78c 100644 --- a/app/coffee/modules/resources/repository.coffee +++ b/app/coffee/modules/base/repository.coffee @@ -138,5 +138,5 @@ class RepositoryService extends taiga.TaigaService return @.queryOneRaw("resolver", null, params) -module = angular.module("taigaResources") +module = angular.module("taigaBase") module.service("$tgRepo", RepositoryService) diff --git a/app/coffee/modules/resources/storage.coffee b/app/coffee/modules/base/storage.coffee similarity index 97% rename from app/coffee/modules/resources/storage.coffee rename to app/coffee/modules/base/storage.coffee index cfdfeada..3a9a3785 100644 --- a/app/coffee/modules/resources/storage.coffee +++ b/app/coffee/modules/base/storage.coffee @@ -48,5 +48,5 @@ class StorageService extends taiga.TaigaService localStorage.clear() -module = angular.module("taigaResources") +module = angular.module("taigaBase") module.service("$tgStorage", StorageService) diff --git a/app/coffee/modules/resources/urls.coffee b/app/coffee/modules/base/urls.coffee similarity index 97% rename from app/coffee/modules/resources/urls.coffee rename to app/coffee/modules/base/urls.coffee index cdafe076..01922fb9 100644 --- a/app/coffee/modules/resources/urls.coffee +++ b/app/coffee/modules/base/urls.coffee @@ -41,5 +41,5 @@ class UrlsService return format("%s://%s%s", [@.scheme, @.host, url]) -module = angular.module("taigaResources") +module = angular.module("taigaBase") module.service('$tgUrls', UrlsService) diff --git a/app/coffee/modules/resources.coffee b/app/coffee/modules/resources.coffee index e0e2c69a..715bb828 100644 --- a/app/coffee/modules/resources.coffee +++ b/app/coffee/modules/resources.coffee @@ -18,40 +18,8 @@ taiga = @.taiga class ResourcesService extends taiga.TaigaService - @.$inject = ["$q", "$tgRepo", "$tgUrls", "$tgModel"] - constructor: (@q, @repo, @urls, @model) -> - super() - - ############################################################################# - # Common - ############################################################################# - - getProject: (projectId) -> - return @repo.queryOne("projects", projectId) - - getProjects: -> - return @repo.queryMany("projects") - - ############################################################################# - # Backlog - ############################################################################# - - getSprints: (projectId) -> - params = {"project": projectId} - return @repo.queryMany("milestones", params).then (milestones) => - for m in milestones - uses = m.user_stories - uses = _.map(uses, (u) => @model.make_model("userstories", u)) - m._attrs.user_stories = uses - return milestones - - getUnassignedUserstories: (projectId) -> - params = {"project": projectId, "milestone": "null"} - return @repo.queryMany("userstories", params) - - -init = (urls) -> +initUrls = (urls) -> urls.update({ "auth": "/api/v1/auth" "auth-register": "/api/v1/auth/register" @@ -110,6 +78,25 @@ init = (urls) -> "wiki/attachments": "/api/v1/wiki/attachments" }) -module = angular.module("taigaResources", []) +# Initialize resources service populating it with methods +# defined in separated files. +initResources = ($log, $rs) -> + $log.debug "Initialize resources" + providers = _.toArray(arguments).slice(2) + + for provider in providers + provider($rs) + +module = angular.module("taigaResources", ["taigaBase"]) module.service("$tgResources", ResourcesService) -module.run(["$tgUrls", init]) + +# Module entry point +module.run(["$tgUrls", initUrls]) +module.run([ + "$log", + "$tgResources", + "$tgProjectsResourcesProvider", + "$tgSprintsResourcesProvider", + "$tgUserstoriesResourcesProvider", + initResources +]) diff --git a/app/coffee/modules/resources/projects.coffee b/app/coffee/modules/resources/projects.coffee new file mode 100644 index 00000000..9ae30981 --- /dev/null +++ b/app/coffee/modules/resources/projects.coffee @@ -0,0 +1,40 @@ +### +# Copyright (C) 2014 Andrey Antukh +# Copyright (C) 2014 Jesús Espino Garcia +# Copyright (C) 2014 David Barragán Merino +# +# 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 . +# +# File: modules/resources/projects.coffee +### + + +taiga = @.taiga + +resourceProvider = ($repo) -> + service = {} + + service.get = (id) -> + return $repo.queryOne("projects", id) + + service.list = -> + return $repo.queryMany("projects") + + return (instance) -> + instance.projects = service + + +module = angular.module("taigaResources") +module.factory("$tgProjectsResourcesProvider", ["$tgRepo", resourceProvider]) + diff --git a/app/coffee/modules/resources/sprints.coffee b/app/coffee/modules/resources/sprints.coffee new file mode 100644 index 00000000..1c3721e6 --- /dev/null +++ b/app/coffee/modules/resources/sprints.coffee @@ -0,0 +1,40 @@ +### +# Copyright (C) 2014 Andrey Antukh +# Copyright (C) 2014 Jesús Espino Garcia +# Copyright (C) 2014 David Barragán Merino +# +# 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 . +# +# File: modules/resources/sprints.coffee +### + +taiga = @.taiga + +resourceProvider = ($repo, $model) -> + service = {} + + service.list = (projectId) -> + params = {"project": projectId} + return $repo.queryMany("milestones", params).then (milestones) => + for m in milestones + uses = m.user_stories + uses = _.map(uses, (u) => $model.make_model("userstories", u)) + m._attrs.user_stories = uses + return milestones + + return (instance) -> + instance.sprints = service + +module = angular.module("taigaResources") +module.factory("$tgSprintsResourcesProvider", ["$tgRepo", "$tgModel", resourceProvider]) diff --git a/app/coffee/modules/resources/userstories.coffee b/app/coffee/modules/resources/userstories.coffee new file mode 100644 index 00000000..9f1ca2f5 --- /dev/null +++ b/app/coffee/modules/resources/userstories.coffee @@ -0,0 +1,35 @@ +### +# Copyright (C) 2014 Andrey Antukh +# Copyright (C) 2014 Jesús Espino Garcia +# Copyright (C) 2014 David Barragán Merino +# +# 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 . +# +# File: modules/resources/userstories.coffee +### + +taiga = @.taiga + +resourceProvider = ($repo) -> + service = {} + + service.listUnassigned = (projectId) -> + params = {"project": projectId, "milestone": "null"} + return $repo.queryMany("userstories", params) + + return (instance) -> + instance.userstories = service + +module = angular.module("taigaResources") +module.factory("$tgUserstoriesResourcesProvider", ["$tgRepo", resourceProvider]) diff --git a/gulpfile.coffee b/gulpfile.coffee index d6c8f7a3..1de56485 100644 --- a/gulpfile.coffee +++ b/gulpfile.coffee @@ -36,7 +36,7 @@ paths = { "config/main.coffee", "app/coffee/*.coffee", "app/coffee/modules/*.coffee", - "app/coffee/modules/resources/init.coffee", + "app/coffee/modules/base/*.coffee", "app/coffee/modules/resources/*.coffee", "app/coffee/**/*.coffee"] } From 5a614bd3a486060bad7a160acecaa423b06e4cdf Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 17 Jun 2014 18:18:43 +0200 Subject: [PATCH 25/64] Another iteration over backlog. --- app/coffee/app.coffee | 1 - app/coffee/modules/backlog.coffee | 20 +++++- app/coffee/modules/base/bindonce.coffee | 38 +++++++++++ .../views/components/backlog-row.jade | 6 +- app/partials/views/modules/backlog-table.jade | 68 +++++++++---------- app/partials/views/modules/sprints.jade | 13 ++-- bower.json | 1 - gulpfile.coffee | 3 +- 8 files changed, 102 insertions(+), 48 deletions(-) create mode 100644 app/coffee/modules/base/bindonce.coffee diff --git a/app/coffee/app.coffee b/app/coffee/app.coffee index a096450e..29da6724 100644 --- a/app/coffee/app.coffee +++ b/app/coffee/app.coffee @@ -61,7 +61,6 @@ modules = [ # Vendor modules "ngRoute", "ngAnimate", - "pasvaz.bindonce", ] # Default Value for taiga local config module. diff --git a/app/coffee/modules/backlog.coffee b/app/coffee/modules/backlog.coffee index a9196e60..8a7fdda6 100644 --- a/app/coffee/modules/backlog.coffee +++ b/app/coffee/modules/backlog.coffee @@ -77,7 +77,7 @@ BacklogDirective = ($compile, $templateCache) -> $element.append(dom) link = ($scope, $element, $attrs, $ctrl) -> - backlogTableDom = $element.find("section.backlog-table") + backlogTableDom = $element.find("section.backlog-table-body") backlogLink($scope, backlogTableDom, $attrs, $ctrl) return { @@ -92,6 +92,24 @@ BacklogDirective = ($compile, $templateCache) -> link: link } +SprintDirective = ($compile, $templateCache) -> + link = (scope, element, attrs) -> + sprint = scope.$eval(attrs.tgSprint) + if scope.$first + element.addClass("sprint-current") + + if sprint.closed + element.addClass("sprint-closed") + + # Event Handlers + element.on "click", ".sprint-summary > a", (event) -> + element.find(".sprint-table").toggle() + + return { + link: link + } + module = angular.module("taigaBacklog", []) module.directive("tgBacklog", ["$compile", "$templateCache", BacklogDirective]) +module.directive("tgSprint", ["$compile", SprintDirective]) diff --git a/app/coffee/modules/base/bindonce.coffee b/app/coffee/modules/base/bindonce.coffee new file mode 100644 index 00000000..7351b062 --- /dev/null +++ b/app/coffee/modules/base/bindonce.coffee @@ -0,0 +1,38 @@ +### +# Copyright (C) 2014 Andrey Antukh +# Copyright (C) 2014 Jesús Espino Garcia +# Copyright (C) 2014 David Barragán Merino +# +# 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 . +# +# File: modules/base/bindonce.coffee +### + +# Html bind once directive +BindHtmlDirective = -> + link = (scope, element, attrs) -> + element.html(scope.$eval(attrs.tgBoHtml)) + + return {link:link} + +# Object reference bind once helper. +BindRefDirective = -> + link = (scope, element, attrs) -> + val = scope.$eval(attrs.tgBoRef) + element.html("##{val} ") + return {link:link} + +module = angular.module("taigaBase") +module.directive("tgBoHtml", BindHtmlDirective) +module.directive("tgBoRef", BindRefDirective) diff --git a/app/partials/views/components/backlog-row.jade b/app/partials/views/components/backlog-row.jade index ef48587a..56cd6bcc 100644 --- a/app/partials/views/components/backlog-row.jade +++ b/app/partials/views/components/backlog-row.jade @@ -1,5 +1,5 @@ div.row(ng-repeat="us in userstories") - div + div.user-stories div.user-story-name input(type="checkbox", name="") a(href="") {{ us.subject }} @@ -7,8 +7,8 @@ div.row(ng-repeat="us in userstories") a.icon.icon-edit(href="", title="Edit") a.icon.icon-delete(href="", title="Delete") div.user-story-tags - span.tag Tag name - span.tag Tag name + span.tag Tag name + span.tag Tag name div.status Status div.points 12 div.points 54 diff --git a/app/partials/views/modules/backlog-table.jade b/app/partials/views/modules/backlog-table.jade index e24c4ff8..00a1740e 100644 --- a/app/partials/views/modules/backlog-table.jade +++ b/app/partials/views/modules/backlog-table.jade @@ -10,40 +10,40 @@ section.backlog-table-header div.points.width-1 Front div.points.width-1 Total section.backlog-table-body - - for (var x = 0; x < 40; x++) - div.row - div.user-stories - div.user-story-name - input(type="checkbox", name="") - a(href="") Crear el perfil de usuario Senior en el admin - span.us-settings - a.icon.icon-edit(href="", title="Edit") - a.icon.icon-delete(href="", title="Delete") - div.user-story-tags - - for(var y = 0; y < 3; y++) - include ../components/tag - div.status.width-2 - a(href="", title="Status Name") Status Name - ul.popover.pop-status - li - a(href="", title="Status 1") Status 1 - li - a(href="", title="Status 2") Status 2 - li - a(href="", title="Status 3") Status 3 - div.points - a(href="", title="") 24 - div.points - a(href="", title="Total Points") 43 - ul.popover.pop-status - li - a(href="", title="Status 1") Status 1 - li - a(href="", title="Status 2") Status 2 - li - a(href="", title="Status 3") Status 3 - a.icon.icon-drag-v(href="", title="Drag") - hr.doom-line + // - for (var x = 0; x < 40; x++) + // div.row + // div.user-stories + // div.user-story-name + // input(type="checkbox", name="") + // a(href="") Crear el perfil de usuario Senior en el admin + // span.us-settings + // a.icon.icon-edit(href="", title="Edit") + // a.icon.icon-delete(href="", title="Delete") + // div.user-story-tags + // - for(var y = 0; y < 3; y++) + // include ../components/tag + // div.status.width-2 + // a(href="", title="Status Name") Status Name + // ul.popover.pop-status + // li + // a(href="", title="Status 1") Status 1 + // li + // a(href="", title="Status 2") Status 2 + // li + // a(href="", title="Status 3") Status 3 + // div.points + // a(href="", title="") 24 + // div.points + // a(href="", title="Total Points") 43 + // ul.popover.pop-status + // li + // a(href="", title="Status 1") Status 1 + // li + // a(href="", title="Status 2") Status 2 + // li + // a(href="", title="Status 3") Status 3 + // a.icon.icon-drag-v(href="", title="Drag") + // hr.doom-line script(type="text/ng-template" id="backlog-row.html") include ../components/backlog-row diff --git a/app/partials/views/modules/sprints.jade b/app/partials/views/modules/sprints.jade index cabe2396..616833de 100644 --- a/app/partials/views/modules/sprints.jade +++ b/app/partials/views/modules/sprints.jade @@ -10,7 +10,7 @@ section.sprints a.button-green(href="", title="Add New US") span.text + New sprint - section.sprint(ng-repeat="sprint in sprints track by sprint.id", tg-backlog-sprint) + section.sprint(ng-repeat="sprint in sprints track by sprint.id", tg-sprint="sprint") header div.sprint-summary a.icon.icon-arrow-up(href="", title="compact Sprint") @@ -26,11 +26,12 @@ section.sprints div.sprint-progress-bar div.current-progress div.sprint-table - - for (var x = 0; x < 10; x++) - div.row - div.column-us.width-8 - a.us-name(href="", title="") #125 Crear el perfil de usuario Senior en el admin - div.column-points.width-1 45 + div.row(ng-repeat="us in sprint.user_stories track by us.id") + div.column-us.width-8 + a.us-name(href="", title="") + span(tg-bo-ref="us.ref") + span(tg-bo-html="us.subject") + div.column-points.width-1(tg-bindonce-html="us.total_points") a.button.button-gray(href="", title="Current Sprint Taskboard") span Sprint Taskboard diff --git a/bower.json b/bower.json index 20cea1c5..bcb6b133 100644 --- a/bower.json +++ b/bower.json @@ -49,7 +49,6 @@ "i18next": "~1.7.1", "jquery": "~2.1.1", "select2": "~3.4.5", - "angular-bindonce": "~0.3.1", "angular-ui-select2": "~0.0.5", "google-diff-match-patch-js": "~1.0.0", "underscore.string": "~2.3.3", diff --git a/gulpfile.coffee b/gulpfile.coffee index 1de56485..f3957bde 100644 --- a/gulpfile.coffee +++ b/gulpfile.coffee @@ -51,8 +51,7 @@ vendorJsLibs = [ "app/vendor/angular/angular.js", "app/vendor/angular-route/angular-route.js", "app/vendor/angular-sanitize/angular-sanitize.js", - "app/vendor/angular-animate/angular-animate.js", - "app/vendor/angular-bindonce/bindonce.js" + "app/vendor/angular-animate/angular-animate.js" ] From f1095bbffba734e2e954a20cbc4a1949a16ad209 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 17 Jun 2014 18:36:53 +0200 Subject: [PATCH 26/64] Remove mainTitle and other changes. --- app/coffee/modules/base/bindonce.coffee | 4 +++- app/partials/backlog.jade | 4 +++- app/partials/views/components/mainTitle.jade | 3 --- app/partials/views/modules/sprints.jade | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 app/partials/views/components/mainTitle.jade diff --git a/app/coffee/modules/base/bindonce.coffee b/app/coffee/modules/base/bindonce.coffee index 7351b062..62cd23fd 100644 --- a/app/coffee/modules/base/bindonce.coffee +++ b/app/coffee/modules/base/bindonce.coffee @@ -22,7 +22,9 @@ # Html bind once directive BindHtmlDirective = -> link = (scope, element, attrs) -> - element.html(scope.$eval(attrs.tgBoHtml)) + val = scope.$eval(attrs.tgBoHtml) + scope.$watch attrs.tgBoHtml, (val) -> + element.html(val) if val return {link:link} diff --git a/app/partials/backlog.jade b/app/partials/backlog.jade index bd4e5c3b..a8fa966f 100644 --- a/app/partials/backlog.jade +++ b/app/partials/backlog.jade @@ -8,7 +8,9 @@ block content sidebar.menu-secondary.extrabar.filters-bar include views/modules/filters section.main.backlog(tg-backlog) - include views/components/mainTitle + h1 + span(tg-bo-html="project.name") + span.green Title include views/components/summary include views/modules/burndown div.backlog-menu diff --git a/app/partials/views/components/mainTitle.jade b/app/partials/views/components/mainTitle.jade deleted file mode 100644 index 96f0d18a..00000000 --- a/app/partials/views/components/mainTitle.jade +++ /dev/null @@ -1,3 +0,0 @@ -h1 - span ProjectName - span.green Title diff --git a/app/partials/views/modules/sprints.jade b/app/partials/views/modules/sprints.jade index 616833de..8475ae4e 100644 --- a/app/partials/views/modules/sprints.jade +++ b/app/partials/views/modules/sprints.jade @@ -31,7 +31,7 @@ section.sprints a.us-name(href="", title="") span(tg-bo-ref="us.ref") span(tg-bo-html="us.subject") - div.column-points.width-1(tg-bindonce-html="us.total_points") + div.column-points.width-1(tg-bo-html="us.total_points") a.button.button-gray(href="", title="Current Sprint Taskboard") span Sprint Taskboard From fc637d72f90d73c641ff512c1a36de5134351d1f Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 17 Jun 2014 19:50:52 +0200 Subject: [PATCH 27/64] Add missing file. --- app/partials/views/components/mainTitle.jade | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 app/partials/views/components/mainTitle.jade diff --git a/app/partials/views/components/mainTitle.jade b/app/partials/views/components/mainTitle.jade new file mode 100644 index 00000000..96f0d18a --- /dev/null +++ b/app/partials/views/components/mainTitle.jade @@ -0,0 +1,3 @@ +h1 + span ProjectName + span.green Title From 35db4026bcf979f21fdbb8449d93f9d62f4f4093 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 17 Jun 2014 19:52:03 +0200 Subject: [PATCH 28/64] Add deprecation notice. --- app/partials/views/components/mainTitle.jade | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/partials/views/components/mainTitle.jade b/app/partials/views/components/mainTitle.jade index 96f0d18a..89fb36fc 100644 --- a/app/partials/views/components/mainTitle.jade +++ b/app/partials/views/components/mainTitle.jade @@ -1,3 +1,5 @@ +// This file is deprecated and sould be removed +// when all layout was integrated with angular h1 span ProjectName span.green Title From 83c4a86bdaa016810f8a9f497d3d7012279004ec Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 17 Jun 2014 19:57:18 +0200 Subject: [PATCH 29/64] Revert previous commit with deprecation warning. --- app/partials/backlog.jade | 4 +--- app/partials/views/components/mainTitle.jade | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/app/partials/backlog.jade b/app/partials/backlog.jade index a8fa966f..bd4e5c3b 100644 --- a/app/partials/backlog.jade +++ b/app/partials/backlog.jade @@ -8,9 +8,7 @@ block content sidebar.menu-secondary.extrabar.filters-bar include views/modules/filters section.main.backlog(tg-backlog) - h1 - span(tg-bo-html="project.name") - span.green Title + include views/components/mainTitle include views/components/summary include views/modules/burndown div.backlog-menu diff --git a/app/partials/views/components/mainTitle.jade b/app/partials/views/components/mainTitle.jade index 89fb36fc..f8975636 100644 --- a/app/partials/views/components/mainTitle.jade +++ b/app/partials/views/components/mainTitle.jade @@ -1,5 +1,3 @@ -// This file is deprecated and sould be removed -// when all layout was integrated with angular h1 - span ProjectName + span(tg-bo-html="project.name") span.green Title From 8bcea896b0f0facb42e08cca0b027a7c3973a2cc Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 17 Jun 2014 19:57:37 +0200 Subject: [PATCH 30/64] Improvements on own bindonce directives. --- app/coffee/modules/base/bindonce.coffee | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/app/coffee/modules/base/bindonce.coffee b/app/coffee/modules/base/bindonce.coffee index 62cd23fd..95f74285 100644 --- a/app/coffee/modules/base/bindonce.coffee +++ b/app/coffee/modules/base/bindonce.coffee @@ -19,20 +19,30 @@ # File: modules/base/bindonce.coffee ### +bindOnce = (scope, attr, continuation) => + val = scope.$eval(attr) + if val != undefined + return continuation(val) + + delBind = null + delBind = scope.$watch attr, (val) -> + return if val is undefined + continuation(val) + delBind() if delBind + # Html bind once directive BindHtmlDirective = -> link = (scope, element, attrs) -> - val = scope.$eval(attrs.tgBoHtml) - scope.$watch attrs.tgBoHtml, (val) -> - element.html(val) if val + bindOnce scope, attrs.tgBoHtml, (val) -> + element.html(val) return {link:link} # Object reference bind once helper. BindRefDirective = -> link = (scope, element, attrs) -> - val = scope.$eval(attrs.tgBoRef) - element.html("##{val} ") + bindOnce scope, attrs.tgBoRef, (val) -> + element.html("##{val} ") return {link:link} module = angular.module("taigaBase") From 4afd8548527504cbac2b1a4126a58d5a5f3fa4d3 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 17 Jun 2014 20:44:54 +0200 Subject: [PATCH 31/64] Add confirm service. --- app/coffee/modules/base/confirm.coffee | 57 ++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 app/coffee/modules/base/confirm.coffee diff --git a/app/coffee/modules/base/confirm.coffee b/app/coffee/modules/base/confirm.coffee new file mode 100644 index 00000000..b4f64b20 --- /dev/null +++ b/app/coffee/modules/base/confirm.coffee @@ -0,0 +1,57 @@ +### +# Copyright (C) 2014 Andrey Antukh +# Copyright (C) 2014 Jesús Espino Garcia +# Copyright (C) 2014 David Barragán Merino +# +# 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 . +# +# File: modules/base/confirm.coffee +### + +taiga = @.taiga + +class ConfirmService extends taiga.TaigaService + @.$inject = ["$q"] + + constructor: (@q) -> + @.el = angular.element(".lightbox_confirm-delete") + _.bindAll(@) + + hide: -> + @.el.css("display", "none") + @.el.off(".confirm-dialog") + + ask: (title, subtitle) -> + # Render content + @.el.find("h2.title").html(title) + @.el.find("span.subtitle").html(subtitle) + defered = @q.defer() + + # Assign event handlers + @.el.on "click.confirm-dialog", "a.button-green", (event) => + event.preventDefault() + defered.resolve() + @.hide() + + @.el.on "click.confirm-dialog", "a.button-red", (event) => + event.preventDefault() + defered.reject() + @.hide() + + @.el.css("display", "flex") + return defered.promise + + +module = angular.module("taigaBase") +module.service("$tgConfirm", ["$q", ConfirmService]) From 0cdb91fcb910b3d1de4c20816714a3ab14ee81c2 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 17 Jun 2014 20:45:20 +0200 Subject: [PATCH 32/64] Split backlog controller from directive. --- app/coffee/modules/backlog.coffee | 55 ++++++++++++------------------- 1 file changed, 21 insertions(+), 34 deletions(-) diff --git a/app/coffee/modules/backlog.coffee b/app/coffee/modules/backlog.coffee index 8a7fdda6..350f9bb4 100644 --- a/app/coffee/modules/backlog.coffee +++ b/app/coffee/modules/backlog.coffee @@ -22,10 +22,8 @@ taiga = @.taiga class BacklogController extends taiga.TaigaController - constructor: (@scope, @repo, @params, @rs, @q) -> + constructor: (@scope, @repo, @confirm, @rs, @params, @q) -> promise = @.loadInitialData() - - # Obviously fail condition promise.then null, => console.log "FAIL" @@ -59,38 +57,20 @@ class BacklogController extends taiga.TaigaController return promise + deleteUserStory: (us) -> + title = "Delete User Story" + subtitle = us.subject + + @confirm.ask(title, subtitle).then => + console.log "#TODO" + BacklogDirective = ($compile, $templateCache) -> - backlogLink = ($scope, $element, $attrs, $ctrl) -> - # UserStories renderin - dom = angular.element.parseHTML($templateCache.get("backlog-row.html")) - scope = null + link = ($scope, $el, $attrs) -> + $ctrl = $el.controller() - $scope.$watch "userstories", (userstories) => - return if not userstories + return {link: link} - if scope != null - scope.$destroy() - - scope = $scope.$new() - dom = $compile(dom)(scope) - $element.append(dom) - - link = ($scope, $element, $attrs, $ctrl) -> - backlogTableDom = $element.find("section.backlog-table-body") - backlogLink($scope, backlogTableDom, $attrs, $ctrl) - - return { - controller: [ - "$scope", - "$tgRepo", - "$routeParams", - "$tgResources", - "$q", - BacklogController - ] - link: link - } SprintDirective = ($compile, $templateCache) -> link = (scope, element, attrs) -> @@ -105,11 +85,18 @@ SprintDirective = ($compile, $templateCache) -> element.on "click", ".sprint-summary > a", (event) -> element.find(".sprint-table").toggle() - return { - link: link - } + return {link: link} module = angular.module("taigaBacklog", []) module.directive("tgBacklog", ["$compile", "$templateCache", BacklogDirective]) module.directive("tgSprint", ["$compile", SprintDirective]) +module.controller("BacklogController", [ + "$scope", + "$tgRepo", + "$tgConfirm", + "$tgResources", + "$routeParams", + "$q", + BacklogController +]) From fdae3479be5709b0532fe2b1ce564bd4e5b765b3 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 17 Jun 2014 20:46:42 +0200 Subject: [PATCH 33/64] Minor reorganization on templates related to backlog row and confirm lightbox. --- app/index.jade | 2 ++ app/partials/backlog.jade | 7 ++----- app/partials/views/components/backlog-row.jade | 4 ++-- app/partials/views/modules/backlog-table.jade | 5 ++--- app/partials/views/modules/lightbox_confirm-delete.jade | 4 ++-- app/styles/modules/lightbox.scss | 6 +++--- 6 files changed, 13 insertions(+), 15 deletions(-) diff --git a/app/index.jade b/app/index.jade index 32e01762..5b80b5fa 100644 --- a/app/index.jade +++ b/app/index.jade @@ -11,5 +11,7 @@ html(lang="en", ng-app="taiga") body include partials/views/modules/nav div.master(ng-view="") + div.lightbox.lightbox_confirm-delete + include partials/views/modules/lightbox_confirm-delete script(src="/js/libs.js?v=#{v}") script(src="/js/app.js?v=#{v}") diff --git a/app/partials/backlog.jade b/app/partials/backlog.jade index bd4e5c3b..8c433111 100644 --- a/app/partials/backlog.jade +++ b/app/partials/backlog.jade @@ -4,10 +4,10 @@ block head title Taiga Project management web application with scrum in mind! block content - div.wrapper + div.wrapper(tg-backlog, ng-controller="BacklogController as ctrl") sidebar.menu-secondary.extrabar.filters-bar include views/modules/filters - section.main.backlog(tg-backlog) + section.main.backlog include views/components/mainTitle include views/components/summary include views/modules/burndown @@ -31,6 +31,3 @@ block content include views/modules/lightbox_add-bulk div.lightbox.lightbox_add-sprint include views/modules/lightbox_add-sprint - div.lightbox.lightbox_confirm-delete - include views/modules/lightbox_confirm-delete - diff --git a/app/partials/views/components/backlog-row.jade b/app/partials/views/components/backlog-row.jade index 56cd6bcc..0bf700f6 100644 --- a/app/partials/views/components/backlog-row.jade +++ b/app/partials/views/components/backlog-row.jade @@ -4,8 +4,8 @@ div.row(ng-repeat="us in userstories") input(type="checkbox", name="") a(href="") {{ us.subject }} span.us-settings - a.icon.icon-edit(href="", title="Edit") - a.icon.icon-delete(href="", title="Delete") + a.icon.icon-edit(href="", ng-click="ctrl.deleteUserStory(us)", title="Edit") + a.icon.icon-delete(href="", ng-click="ctrl.deleteUserStory(us)", title="Delete") div.user-story-tags span.tag Tag name span.tag Tag name diff --git a/app/partials/views/modules/backlog-table.jade b/app/partials/views/modules/backlog-table.jade index 00a1740e..b0dde643 100644 --- a/app/partials/views/modules/backlog-table.jade +++ b/app/partials/views/modules/backlog-table.jade @@ -10,6 +10,8 @@ section.backlog-table-header div.points.width-1 Front div.points.width-1 Total section.backlog-table-body + include ../components/backlog-row + // - for (var x = 0; x < 40; x++) // div.row // div.user-stories @@ -44,6 +46,3 @@ section.backlog-table-body // a(href="", title="Status 3") Status 3 // a.icon.icon-drag-v(href="", title="Drag") // hr.doom-line - - script(type="text/ng-template" id="backlog-row.html") - include ../components/backlog-row diff --git a/app/partials/views/modules/lightbox_confirm-delete.jade b/app/partials/views/modules/lightbox_confirm-delete.jade index 0194bbaa..388a7160 100644 --- a/app/partials/views/modules/lightbox_confirm-delete.jade +++ b/app/partials/views/modules/lightbox_confirm-delete.jade @@ -3,8 +3,8 @@ a.close(href="", title="close") form h2.title Delete User Story p - span.us-delete-question Are you sure you want to delete? - span.us-to-delete #125 Crear el perfil de usuario senior en el admin + span.delete-question Are you sure you want to delete? + span.subtitle #125 Crear el perfil de usuario senior en el admin div.delete-options a.button.button-green(href="", title="Accept") span Accept diff --git a/app/styles/modules/lightbox.scss b/app/styles/modules/lightbox.scss index aad4735c..c3dbafac 100644 --- a/app/styles/modules/lightbox.scss +++ b/app/styles/modules/lightbox.scss @@ -223,13 +223,13 @@ min-width: 420px; width: 420px; } - .us-delete-question, - .us-to-delete { + .delete-question, + .subtitle { display: block; line-height: 2rem; text-align: center; } - .us-to-delete { + .subtitle { @extend %large; font-family: 'ostrichSans'; } From b19022acf7babdb87889ead7f9a1c43c661f6ef9 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 17 Jun 2014 23:04:43 +0200 Subject: [PATCH 34/64] Reorder main.scss and remove display:none from lightboxes. --- app/styles/main.scss | 10 +++++----- app/styles/modules/lightbox.scss | 4 ---- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/app/styles/main.scss b/app/styles/main.scss index ffbbf3f3..8b7abf1c 100755 --- a/app/styles/main.scss +++ b/app/styles/main.scss @@ -25,11 +25,6 @@ $prefix-for-spec: true; @import 'components/filter'; @import 'components/taskboard-task'; -//Layout -@import 'layout/base'; -@import 'layout/backlog'; -@import 'layout/taskboard'; - //Modules @import 'modules/nav'; @import 'modules/sprints'; @@ -49,3 +44,8 @@ $prefix-for-spec: true; // Responsive @import 'responsive/mobile'; @import 'responsive/screen'; + +//Layout +@import 'layout/base'; +@import 'layout/backlog'; +@import 'layout/taskboard'; diff --git a/app/styles/modules/lightbox.scss b/app/styles/modules/lightbox.scss index c3dbafac..c3583d18 100644 --- a/app/styles/modules/lightbox.scss +++ b/app/styles/modules/lightbox.scss @@ -36,7 +36,6 @@ } .lightbox_add-new-us { - display: none; form { flex-basis: 0; flex-grow: 0; @@ -132,7 +131,6 @@ } .lightbox_add-bulk { - display: none; form { flex-basis: 0; flex-grow: 0; @@ -186,7 +184,6 @@ } .lightbox_add-sprint { - display: none; form { flex-basis: 0; flex-grow: 0; @@ -215,7 +212,6 @@ } .lightbox_confirm-delete { - display: none; form { flex-basis: 0; flex-grow: 0; From 54207eca54f921e00b20f7e8fa01847099e6f99c Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 17 Jun 2014 23:05:30 +0200 Subject: [PATCH 35/64] Improve displa/hide management with hidden css class. --- app/coffee/modules/backlog.coffee | 7 +++++++ app/coffee/modules/base/confirm.coffee | 4 ++-- app/index.jade | 2 +- app/partials/backlog.jade | 6 +++--- app/partials/views/components/addnewus.jade | 8 ++++---- app/styles/layout/base.scss | 4 ++++ 6 files changed, 21 insertions(+), 10 deletions(-) diff --git a/app/coffee/modules/backlog.coffee b/app/coffee/modules/backlog.coffee index 350f9bb4..d56ec39c 100644 --- a/app/coffee/modules/backlog.coffee +++ b/app/coffee/modules/backlog.coffee @@ -57,6 +57,8 @@ class BacklogController extends taiga.TaigaController return promise + ## Template actions + deleteUserStory: (us) -> title = "Delete User Story" subtitle = us.subject @@ -64,6 +66,11 @@ class BacklogController extends taiga.TaigaController @confirm.ask(title, subtitle).then => console.log "#TODO" + addNewUs: (type) -> + switch type + when "standard" then @rootscope.$emit("usform:new") + when "bulk" then @rootscope.$emit("usform:bulk") + BacklogDirective = ($compile, $templateCache) -> link = ($scope, $el, $attrs) -> diff --git a/app/coffee/modules/base/confirm.coffee b/app/coffee/modules/base/confirm.coffee index b4f64b20..d7b59d45 100644 --- a/app/coffee/modules/base/confirm.coffee +++ b/app/coffee/modules/base/confirm.coffee @@ -29,7 +29,7 @@ class ConfirmService extends taiga.TaigaService _.bindAll(@) hide: -> - @.el.css("display", "none") + @.el.addClass("hidden") @.el.off(".confirm-dialog") ask: (title, subtitle) -> @@ -49,7 +49,7 @@ class ConfirmService extends taiga.TaigaService defered.reject() @.hide() - @.el.css("display", "flex") + @.el.removeClass("hidden") return defered.promise diff --git a/app/index.jade b/app/index.jade index 5b80b5fa..bd28f730 100644 --- a/app/index.jade +++ b/app/index.jade @@ -11,7 +11,7 @@ html(lang="en", ng-app="taiga") body include partials/views/modules/nav div.master(ng-view="") - div.lightbox.lightbox_confirm-delete + div.hidden.lightbox.lightbox_confirm-delete include partials/views/modules/lightbox_confirm-delete script(src="/js/libs.js?v=#{v}") script(src="/js/app.js?v=#{v}") diff --git a/app/partials/backlog.jade b/app/partials/backlog.jade index 8c433111..82fc55ac 100644 --- a/app/partials/backlog.jade +++ b/app/partials/backlog.jade @@ -25,9 +25,9 @@ block content include views/modules/backlog-table sidebar.menu-secondary.sidebar include views/modules/sprints - div.lightbox.lightbox_add-new-us + div.lightbox.lightbox_add-new-us.hidden(tg-lightbox-create-edit-userstory) include views/modules/lightbox_add-new-us - div.lightbox.lightbox_add-bulk + div.lightbox.lightbox_add-bulk.hidden include views/modules/lightbox_add-bulk - div.lightbox.lightbox_add-sprint + div.lightbox.lightbox_add-sprint.hidden include views/modules/lightbox_add-sprint diff --git a/app/partials/views/components/addnewus.jade b/app/partials/views/components/addnewus.jade index cb71e179..3652f1f0 100644 --- a/app/partials/views/components/addnewus.jade +++ b/app/partials/views/components/addnewus.jade @@ -1,5 +1,5 @@ div.new-us - a.button-green(href="", title="Add New US") - span.text + Add new US - a.button-bulk(href="", title="Bulk") - span.icon.icon-bulk + a.button-green(href="", ng-click="ctrl.addNewUs('standard')", title="Add New US") + span.text + Add new US + a.button-bulk(href="", ng-click="ctrl.addNewUs('bulk')", title="Bulk") + span.icon.icon-bulk diff --git a/app/styles/layout/base.scss b/app/styles/layout/base.scss index 4cf4cd54..2d978414 100644 --- a/app/styles/layout/base.scss +++ b/app/styles/layout/base.scss @@ -56,3 +56,7 @@ body { .icon { font-family: 'taiga'; } + +.hidden { + display: none; +} \ No newline at end of file From fe2d91e754bc5cf1e37ca9210a3d0a24145f2fa7 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 17 Jun 2014 23:06:10 +0200 Subject: [PATCH 36/64] Add add/create lightbox directive. --- app/coffee/modules/backlog.coffee | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/app/coffee/modules/backlog.coffee b/app/coffee/modules/backlog.coffee index d56ec39c..d31729a3 100644 --- a/app/coffee/modules/backlog.coffee +++ b/app/coffee/modules/backlog.coffee @@ -95,9 +95,32 @@ SprintDirective = ($compile, $templateCache) -> return {link: link} +########################################################################################### +# Lightboxes +########################################################################################### + + +CreateEditUserstoryDirective = ($repo, $model) -> + link = ($scope, $el, attrs) -> + # TODO: defaults + $scope.$on "usform:new", -> + $scope.us = {} + $el.removeClass("hidden") + console.log "usform new requested" + + $scope.$on "usform:change", (ctx, us) -> + $scope.us = us + + return { + scope: {} + link: link + } + + module = angular.module("taigaBacklog", []) module.directive("tgBacklog", ["$compile", "$templateCache", BacklogDirective]) module.directive("tgSprint", ["$compile", SprintDirective]) +module.directive("tgLightboxCreateEditUserstory", ["$tgRepo", "$tgModel", CreateEditUserstoryDirective]) module.controller("BacklogController", [ "$scope", "$tgRepo", From ffcaade413142dffe651281e93047d8d472b7a62 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 17 Jun 2014 23:51:45 +0200 Subject: [PATCH 37/64] Add locales directory and initial json file. --- app/coffee/modules/locales/.empty | 0 app/locales/en/app.json | 31 +++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 app/coffee/modules/locales/.empty create mode 100644 app/locales/en/app.json diff --git a/app/coffee/modules/locales/.empty b/app/coffee/modules/locales/.empty new file mode 100644 index 00000000..e69de29b diff --git a/app/locales/en/app.json b/app/locales/en/app.json new file mode 100644 index 00000000..4790f011 --- /dev/null +++ b/app/locales/en/app.json @@ -0,0 +1,31 @@ +{ + "checksley": { + "defaultMessage": "This value seems to be invalid.", + "type-email": "This value should be a valid email.", + "type-url": "This value should be a valid url.", + "type-urlstrict": "This value should be a valid url.", + "type-number": "This value should be a valid number.", + "type-digits": "This value should be digits.", + "type-dateIso": "This value should be a valid date (YYYY-MM-DD).", + "type-alphanum": "This value should be alphanumeric.", + "type-phone": "This value should be a valid phone number.", + "notnull": "This value should not be null.", + "notblank": "This value should not be blank.", + "required": "This value is required.", + "regexp": "This value seems to be invalid.", + "min": "This value should be greater than or equal to %s.", + "max": "This value should be lower than or equal to %s.", + "range": "This value should be between %s and %s.", + "minlength": "This value is too short. It should have %s characters or more.", + "maxlength": "This value is too long. It should have %s characters or less.", + "rangelength": "This value length is invalid. It should be between %s and %s characters long.", + "mincheck": "You must select at least %s choices.", + "maxcheck": "You must select %s choices or less.", + "rangecheck": "You must select between %s and %s choices.", + "equalto": "This value should be the same." + }, + "pagination": { + "next": "Next", + "prev": "Previous" + } +} From 311d7b9f531df5f82c394f1e64de29ef514111e5 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 17 Jun 2014 23:53:44 +0200 Subject: [PATCH 38/64] Add embedding locales in angular modules. --- .gitignore | 1 + app/coffee/modules/locales.coffee | 22 ++++++++++++++++++++++ gulpfile.coffee | 20 ++++++++++++-------- 3 files changed, 35 insertions(+), 8 deletions(-) create mode 100644 app/coffee/modules/locales.coffee diff --git a/.gitignore b/.gitignore index 6b0a9a17..a89dd2ba 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ node_modules/ app/vendor config/main.coffee bower_components +app/coffee/modules/locales/locale*.coffee diff --git a/app/coffee/modules/locales.coffee b/app/coffee/modules/locales.coffee new file mode 100644 index 00000000..c5f75116 --- /dev/null +++ b/app/coffee/modules/locales.coffee @@ -0,0 +1,22 @@ +### +# Copyright (C) 2014 Andrey Antukh +# Copyright (C) 2014 Jesús Espino Garcia +# Copyright (C) 2014 David Barragán Merino +# +# 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 . +# +# File: modules/locales.coffee +### + +module = angular.module("taigaLocales", []) diff --git a/gulpfile.coffee b/gulpfile.coffee index f3957bde..48b73721 100644 --- a/gulpfile.coffee +++ b/gulpfile.coffee @@ -32,6 +32,7 @@ paths = { sassMain: "app/styles/main.scss" css: "dist/styles/**/*.css" images: "app/images/**/*" + locales: "app/locales/**/*.json" coffee: ["app/coffee/app.coffee", "config/main.coffee", "app/coffee/*.coffee", @@ -51,7 +52,8 @@ vendorJsLibs = [ "app/vendor/angular/angular.js", "app/vendor/angular-route/angular-route.js", "app/vendor/angular-sanitize/angular-sanitize.js", - "app/vendor/angular-animate/angular-animate.js" + "app/vendor/angular-animate/angular-animate.js", + "app/vendor/i18next/i18next.js" ] @@ -128,14 +130,14 @@ gulp.task "jslibs", -> gulp.task "locales", -> gulp.src("app/locales/en/app.json") - .pipe(wrap("angular.module('locales.en', []).constant('locales.en', <%= contents %>);")) - .pipe(rename("locale.en.coffee")) - .pipe(gulp.dest("app/coffee/")) + .pipe(wrap("angular.module('taigaLocales').constant('localesEnglish', <%= contents %>);")) + .pipe(rename("localeEnglish.coffee")) + .pipe(gulp.dest("app/coffee/modules/locales")) - gulp.src("app/locales/es/app.json") - .pipe(wrap("angular.module('locales.es', []).constant('locales.es', <%= contents %>);")) - .pipe(rename("locale.es.coffee")) - .pipe(gulp.dest("app/coffee/")) + # gulp.src("app/locales/es/app.json") + # .pipe(wrap("angular.module('locales.es', []).constant('locales.es', <%= contents %>);")) + # .pipe(rename("locale.es.coffee")) + # .pipe(gulp.dest("app/coffee/")) ############################################################################## @@ -163,6 +165,7 @@ gulp.task "watch", -> gulp.watch(paths.jade, ["jade"]) gulp.watch(paths.appStyles, ["scss-lint", "sass", "css"]) gulp.watch(paths.coffee, ["coffee"]) + gulp.watch(paths.locales, ["locales"]) gulp.task "express", -> @@ -189,6 +192,7 @@ gulp.task "default", [ "sass", "css", "copy", + "locales", "coffee", "jslibs", "connect", From c96d4ca66a2fcfbea6116b5f4e2e12c748aae0e9 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 17 Jun 2014 23:54:30 +0200 Subject: [PATCH 39/64] Add i18n service/directive. --- app/coffee/app.coffee | 6 ++- app/coffee/config.coffee | 4 +- app/coffee/modules/base.coffee | 23 ++++++++- app/coffee/modules/base/i18n.coffee | 76 +++++++++++++++++++++++++++++ 4 files changed, 104 insertions(+), 5 deletions(-) create mode 100644 app/coffee/modules/base/i18n.coffee diff --git a/app/coffee/app.coffee b/app/coffee/app.coffee index 29da6724..54e622ae 100644 --- a/app/coffee/app.coffee +++ b/app/coffee/app.coffee @@ -43,11 +43,13 @@ configure = ($routeProvider, $locationProvider, $httpProvider, $provide, $compil # $httpProvider.responseInterceptors.push('authHttpIntercept') -init = ($log, $rootScope) -> +init = ($log, $i18n, $config, $rootscope) -> + $i18n.initialize($config.get("defaultLanguage")) $log.debug("Initialize application") + configure.$inject = ["$routeProvider", "$locationProvider", "$httpProvider"] -init.$inject = ["$log", "$rootScope"] +init.$inject = ["$log", "$tgI18n", "$tgConfig","$rootScope"] modules = [ # Main Modules diff --git a/app/coffee/config.coffee b/app/coffee/config.coffee index 5e569821..d3660e2c 100644 --- a/app/coffee/config.coffee +++ b/app/coffee/config.coffee @@ -34,9 +34,9 @@ class ConfigService get: (key, defaultValue=null) -> return @.config[key] || defaultValue - +# Initialize config loading local configuration. init = ($log, localconfig, config) -> - $log.debug("Initializing configuration") + $log.debug("Initializing configuration", localconfig) config.initialize(localconfig) module = angular.module("taigaConfig", ["taigaLocalConfig"]) diff --git a/app/coffee/modules/base.coffee b/app/coffee/modules/base.coffee index 79c289ce..9c91a272 100644 --- a/app/coffee/modules/base.coffee +++ b/app/coffee/modules/base.coffee @@ -1 +1,22 @@ -module = angular.module("taigaBase", []) +### +# Copyright (C) 2014 Andrey Antukh +# Copyright (C) 2014 Jesús Espino Garcia +# Copyright (C) 2014 David Barragán Merino +# +# 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 . +# +# File: modules/base.coffee +### + +module = angular.module("taigaBase", ["taigaLocales"]) diff --git a/app/coffee/modules/base/i18n.coffee b/app/coffee/modules/base/i18n.coffee new file mode 100644 index 00000000..553d847f --- /dev/null +++ b/app/coffee/modules/base/i18n.coffee @@ -0,0 +1,76 @@ +### +# Copyright (C) 2014 Andrey Antukh +# Copyright (C) 2014 Jesús Espino Garcia +# Copyright (C) 2014 David Barragán Merino +# +# 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 . +# +# File: modules/base/i18n.coffee +### + +taiga = @.taiga +bindOnce = @.taiga.bindOnce + +defaults = { + ns: "app" + fallbackLng: "en" + async: false +} + + +class I18nService extends taiga.TaigaService + @.$inject = ["$rootScope", "localeEnglish"] + constructor: (@rootscope, @localeEn) -> + + setLanguage: (language) -> + options = _.clone(defaults, true) + i18n.setLng(language, options) + + @rootscope.currentLang = language + @rootscope.$broadcast("i18n:changeLang", language) + + initialize: (defaultLang="en") -> + options = _.clone(defaults, true) + options.lng = defaultLang + options.resStore = { + en: { app: @localeEn } + } + i18n.init(options) + @rootscope.t = i18n.t + + +I18nDirective = ($rootscope, $i18n) -> + link = ($scope, $el, $attrs) -> + values = $attrs.tgI18n.split(",") + options = $attrs.tgI18nOptions or '{}' + + applyTranslation = -> + opts = $scope.$eval(options) + + for v in values + if v.indexOf(":") == -1 + element.html($scope.t(v, opts)) + else + [ns, v] = v.split(":") + element.attr(ns, $scope.t(v, opts)) + + bindOnce(scope, "t", applyTranslation) + $scope.$on("i18n:changeLang", applyTranslation) + + return {link: link} + + +module = angular.module("taigaBase") +module.service("$tgI18n", ["$rootScope", I18nService]) +module.directive("tgI18n", ["$rootScope", "$tgI18n", I18nDirective]) From 98ca75961e9fdeaa8da26aeb15c437ca3ddd2c22 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 17 Jun 2014 23:55:04 +0200 Subject: [PATCH 40/64] Move bindOnce to utils. --- app/coffee/modules/base/bindonce.coffee | 11 +------- app/coffee/utils.coffee | 35 +++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 10 deletions(-) create mode 100644 app/coffee/utils.coffee diff --git a/app/coffee/modules/base/bindonce.coffee b/app/coffee/modules/base/bindonce.coffee index 95f74285..48ef265f 100644 --- a/app/coffee/modules/base/bindonce.coffee +++ b/app/coffee/modules/base/bindonce.coffee @@ -19,16 +19,7 @@ # File: modules/base/bindonce.coffee ### -bindOnce = (scope, attr, continuation) => - val = scope.$eval(attr) - if val != undefined - return continuation(val) - - delBind = null - delBind = scope.$watch attr, (val) -> - return if val is undefined - continuation(val) - delBind() if delBind +bindOnce = @.taiga.bindOnce # Html bind once directive BindHtmlDirective = -> diff --git a/app/coffee/utils.coffee b/app/coffee/utils.coffee new file mode 100644 index 00000000..3fe4d186 --- /dev/null +++ b/app/coffee/utils.coffee @@ -0,0 +1,35 @@ +### +# Copyright (C) 2014 Andrey Antukh +# Copyright (C) 2014 Jesús Espino Garcia +# Copyright (C) 2014 David Barragán Merino +# +# 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 . +# +# File: utils.coffee +### + +bindOnce = (scope, attr, continuation) => + val = scope.$eval(attr) + if val != undefined + return continuation(val) + + delBind = null + delBind = scope.$watch attr, (val) -> + return if val is undefined + continuation(val) + delBind() if delBind + + +taiga = @.taiga +taiga.bindOnce = bindOnce From a39e674fa1afefe453879edfa39f37480aeaca14 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 17 Jun 2014 23:55:39 +0200 Subject: [PATCH 41/64] Update header license with file location on all base modules and resource. --- app/coffee/modules/base/http.coffee | 4 ++++ app/coffee/modules/base/repository.coffee | 4 ++++ app/coffee/modules/base/storage.coffee | 4 ++++ app/coffee/modules/base/urls.coffee | 4 ++++ app/coffee/modules/resources.coffee | 4 ++++ 5 files changed, 20 insertions(+) diff --git a/app/coffee/modules/base/http.coffee b/app/coffee/modules/base/http.coffee index 868f7116..d8277976 100644 --- a/app/coffee/modules/base/http.coffee +++ b/app/coffee/modules/base/http.coffee @@ -1,3 +1,4 @@ +### # Copyright (C) 2014 Andrey Antukh # Copyright (C) 2014 Jesús Espino Garcia # Copyright (C) 2014 David Barragán Merino @@ -14,6 +15,9 @@ # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . +# +# File: modules/base/http.coffee +### taiga = @.taiga diff --git a/app/coffee/modules/base/repository.coffee b/app/coffee/modules/base/repository.coffee index d062a78c..7893f87f 100644 --- a/app/coffee/modules/base/repository.coffee +++ b/app/coffee/modules/base/repository.coffee @@ -1,3 +1,4 @@ +### # Copyright (C) 2014 Andrey Antukh # Copyright (C) 2014 Jesús Espino Garcia # Copyright (C) 2014 David Barragán Merino @@ -14,6 +15,9 @@ # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . +# +# File: modules/base/repository.coffee +### taiga = @.taiga diff --git a/app/coffee/modules/base/storage.coffee b/app/coffee/modules/base/storage.coffee index 3a9a3785..1bf30291 100644 --- a/app/coffee/modules/base/storage.coffee +++ b/app/coffee/modules/base/storage.coffee @@ -1,3 +1,4 @@ +### # Copyright (C) 2014 Andrey Antukh # Copyright (C) 2014 Jesús Espino Garcia # Copyright (C) 2014 David Barragán Merino @@ -14,6 +15,9 @@ # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . +# +# File: modules/base/storage.coffee +### taiga = @.taiga diff --git a/app/coffee/modules/base/urls.coffee b/app/coffee/modules/base/urls.coffee index 01922fb9..6d580f56 100644 --- a/app/coffee/modules/base/urls.coffee +++ b/app/coffee/modules/base/urls.coffee @@ -1,3 +1,4 @@ +### # Copyright (C) 2014 Andrey Antukh # Copyright (C) 2014 Jesús Espino Garcia # Copyright (C) 2014 David Barragán Merino @@ -14,6 +15,9 @@ # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . +# +# File: modules/base/http.coffee +### format = (fmt, obj) -> obj = _.clone(obj) diff --git a/app/coffee/modules/resources.coffee b/app/coffee/modules/resources.coffee index 715bb828..2398f5a8 100644 --- a/app/coffee/modules/resources.coffee +++ b/app/coffee/modules/resources.coffee @@ -1,3 +1,4 @@ +### # Copyright (C) 2014 Andrey Antukh # Copyright (C) 2014 Jesús Espino Garcia # Copyright (C) 2014 David Barragán Merino @@ -14,6 +15,9 @@ # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . +# +# File: modules/resources.coffee +### taiga = @.taiga From 460130936ca8a9583a2079f64b96fd3a3961e7f9 Mon Sep 17 00:00:00 2001 From: Juanfran Date: Wed, 18 Jun 2014 10:25:15 +0200 Subject: [PATCH 42/64] project detail form --- app/partials/project-details.jade | 34 +++++++++++++++++++++++++ app/styles/dependencies/colors.scss | 1 + app/styles/main.scss | 1 + app/styles/modules/project-details.scss | 20 +++++++++++++++ 4 files changed, 56 insertions(+) create mode 100644 app/partials/project-details.jade create mode 100644 app/styles/modules/project-details.scss diff --git a/app/partials/project-details.jade b/app/partials/project-details.jade new file mode 100644 index 00000000..02b10689 --- /dev/null +++ b/app/partials/project-details.jade @@ -0,0 +1,34 @@ +extends layout + +block head + title Taiga Project management web application with scrum in mind! + +block content + div.wrapper + sidebar.menu-secondary.sidebar + include views/modules/admin-menu + sidebar.menu-tertiary.sidebar + include views/modules/admin-menu-roles + + section.main.project-details + header + include views/components/mainTitle + + form + fieldset + input(type="text", placeholder="Name") + + fieldset + input(type="text", placeholder="Slug") + + fieldset + input(type="text", placeholder="Number of sprints") + + fieldset + input(type="text", placeholder="Number of US points") + + fieldset + textarea(placeholder="Description") + + a.button.button-green(href="") + span Create \ No newline at end of file diff --git a/app/styles/dependencies/colors.scss b/app/styles/dependencies/colors.scss index 72e7ea0c..e52d8648 100755 --- a/app/styles/dependencies/colors.scss +++ b/app/styles/dependencies/colors.scss @@ -14,6 +14,7 @@ $dark-taiga: #879b89; $dry-taiga: #70a87d; $morning-taiga: #7ab987; $dark-grayish-lime-green: #8b9e8d; +$very-light-gray: #e3e3e3; $red-light: #ff8282; $red: #f00; diff --git a/app/styles/main.scss b/app/styles/main.scss index 8b7abf1c..aa6f674c 100755 --- a/app/styles/main.scss +++ b/app/styles/main.scss @@ -40,6 +40,7 @@ $prefix-for-spec: true; @import 'modules/admin-membership'; @import 'modules/admin-roles'; @import 'modules/category-config'; +@import 'modules/project-details'; // Responsive @import 'responsive/mobile'; diff --git a/app/styles/modules/project-details.scss b/app/styles/modules/project-details.scss new file mode 100644 index 00000000..fd77cfb1 --- /dev/null +++ b/app/styles/modules/project-details.scss @@ -0,0 +1,20 @@ +.project-details { + input[type="text"], + textarea { + @extend %medium; + background-color: $very-light-gray; + font-family: 'DroidSans'; + font-weight: bold; + } + fieldset { + margin-bottom: 1rem; + } + textarea { + height: 300px; + } + .button-green { + display: block; + padding: 12px; + text-align: center; + } +} From dc92576d463279ed073258f14f2fdf09871eb5aa Mon Sep 17 00:00:00 2001 From: Juanfran Date: Wed, 18 Jun 2014 10:32:46 +0200 Subject: [PATCH 43/64] rename admin-roles menu to admin-submenu --- app/partials/admin-roles.jade | 2 +- app/partials/project-details.jade | 2 +- .../views/modules/{admin-menu-roles.jade => admin-submenu.jade} | 2 +- app/styles/main.scss | 2 +- .../modules/{admin-menu-roles.scss => admin-submenu.scss} | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) rename app/partials/views/modules/{admin-menu-roles.jade => admin-submenu.jade} (96%) rename app/styles/modules/{admin-menu-roles.scss => admin-submenu.scss} (97%) diff --git a/app/partials/admin-roles.jade b/app/partials/admin-roles.jade index 9b9b41d9..ebda81f4 100644 --- a/app/partials/admin-roles.jade +++ b/app/partials/admin-roles.jade @@ -8,7 +8,7 @@ block content sidebar.menu-secondary.sidebar include views/modules/admin-menu sidebar.menu-tertiary.sidebar - include views/modules/admin-menu-roles + include views/modules/admin-submenu section.main.admin-roles header diff --git a/app/partials/project-details.jade b/app/partials/project-details.jade index 02b10689..09e85146 100644 --- a/app/partials/project-details.jade +++ b/app/partials/project-details.jade @@ -8,7 +8,7 @@ block content sidebar.menu-secondary.sidebar include views/modules/admin-menu sidebar.menu-tertiary.sidebar - include views/modules/admin-menu-roles + include views/modules/admin-submenu section.main.project-details header diff --git a/app/partials/views/modules/admin-menu-roles.jade b/app/partials/views/modules/admin-submenu.jade similarity index 96% rename from app/partials/views/modules/admin-menu-roles.jade rename to app/partials/views/modules/admin-submenu.jade index d9994f91..2f44ad04 100644 --- a/app/partials/views/modules/admin-menu-roles.jade +++ b/app/partials/views/modules/admin-submenu.jade @@ -1,4 +1,4 @@ -section.admin-menu-roles +section.admin-submenu header h1 Roles diff --git a/app/styles/main.scss b/app/styles/main.scss index aa6f674c..f2b5f961 100755 --- a/app/styles/main.scss +++ b/app/styles/main.scss @@ -36,7 +36,7 @@ $prefix-for-spec: true; @import 'modules/search-filter'; @import 'modules/search-result-table'; @import 'modules/admin-menu'; -@import 'modules/admin-menu-roles'; +@import 'modules/admin-submenu'; @import 'modules/admin-membership'; @import 'modules/admin-roles'; @import 'modules/category-config'; diff --git a/app/styles/modules/admin-menu-roles.scss b/app/styles/modules/admin-submenu.scss similarity index 97% rename from app/styles/modules/admin-menu-roles.scss rename to app/styles/modules/admin-submenu.scss index 54a87e2c..d25fc739 100644 --- a/app/styles/modules/admin-menu-roles.scss +++ b/app/styles/modules/admin-submenu.scss @@ -1,4 +1,4 @@ -.admin-menu-roles { +.admin-submenu { h1 { color: $white; } From 48e5a519b157cb7f11c372d5988b3cab2110a335 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Wed, 18 Jun 2014 14:53:17 +0200 Subject: [PATCH 44/64] Add tags input directive. --- app/coffee/modules/base/tags.coffee | 50 +++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 app/coffee/modules/base/tags.coffee diff --git a/app/coffee/modules/base/tags.coffee b/app/coffee/modules/base/tags.coffee new file mode 100644 index 00000000..314a2076 --- /dev/null +++ b/app/coffee/modules/base/tags.coffee @@ -0,0 +1,50 @@ +### +# Copyright (C) 2014 Andrey Antukh +# Copyright (C) 2014 Jesús Espino Garcia +# Copyright (C) 2014 David Barragán Merino +# +# 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 . +# +# File: modules/base/tags.coffee +### + +taiga = @.taiga + +# Directive that parses/format tags inputfield. + +TagsDirective = -> + formatter = (v) -> + if _.isArray(v) + return v.join(", ") + return "" + + parser = (v) -> + return [] if not v + result = _(v.split(",")).map((x) -> _.str.trim(x)) + .map((x) -> x.replace(/\s+/, "-")) + + return result.value() + + link = ($scope, $el, $attrs, $ctrl) -> + $ctrl.$formatters.push(formatter) + $ctrl.$parsers.push(parser) + + return { + require: "ngModel" + link: link + } + + +module = angular.module("taigaBase") +module.directive("tgTags", TagsDirective) From de23dae40403d4b47fa9e81a273ce91d58e3aa95 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Wed, 18 Jun 2014 14:53:44 +0200 Subject: [PATCH 45/64] Add mixins. --- app/coffee/modules/controllerMixins.coffee | 45 ++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 app/coffee/modules/controllerMixins.coffee diff --git a/app/coffee/modules/controllerMixins.coffee b/app/coffee/modules/controllerMixins.coffee new file mode 100644 index 00000000..6769d222 --- /dev/null +++ b/app/coffee/modules/controllerMixins.coffee @@ -0,0 +1,45 @@ +### +# Copyright (C) 2014 Andrey Antukh +# Copyright (C) 2014 Jesús Espino Garcia +# Copyright (C) 2014 David Barragán Merino +# +# 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 . +# +# File: modules/controllerMixins.coffee +### + +class PageMixin + loadUsersAndRoles: -> + promise = @q.all([ + @rs.projects.usersList(@scope.projectId), + @rs.projects.rolesList(@scope.projectId) + ]) + + return promise.then (results) => + [users, roles] = results + + @scope.users = _.sortBy(users, "id") + @scope.roles = roles + + @scope.usersById = {} + _.each(users, (x) => @scope.usersById[x.id] = x) + + availableRoles = _(@scope.project.memberships).map("role").uniq().value() + @scope.computableRoles = _(roles).filter("computable") + .filter((x) -> _.contains(availableRoles, x.id)) + .value() + return results + +taiga = @.taiga +taiga.PageMixin = PageMixin From c2ac5c0d9eb6d7c683de494e5c1d57e279ae25b3 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Wed, 18 Jun 2014 14:55:04 +0200 Subject: [PATCH 46/64] Minor changes on locales. --- app/coffee/app.coffee | 1 + app/coffee/modules/base/i18n.coffee | 12 ++++++------ app/locales/en/app.json | 14 ++++++++++++++ gulpfile.coffee | 5 +++-- 4 files changed, 24 insertions(+), 8 deletions(-) diff --git a/app/coffee/app.coffee b/app/coffee/app.coffee index 54e622ae..4907cd66 100644 --- a/app/coffee/app.coffee +++ b/app/coffee/app.coffee @@ -56,6 +56,7 @@ modules = [ "taigaConfig", "taigaBase", "taigaResources", + "taigaLocales", # Specific Modules "taigaBacklog", diff --git a/app/coffee/modules/base/i18n.coffee b/app/coffee/modules/base/i18n.coffee index 553d847f..d749bb07 100644 --- a/app/coffee/modules/base/i18n.coffee +++ b/app/coffee/modules/base/i18n.coffee @@ -29,8 +29,7 @@ defaults = { } -class I18nService extends taiga.TaigaService - @.$inject = ["$rootScope", "localeEnglish"] +class I18nService extends taiga.Service constructor: (@rootscope, @localeEn) -> setLanguage: (language) -> @@ -46,6 +45,7 @@ class I18nService extends taiga.TaigaService options.resStore = { en: { app: @localeEn } } + i18n.init(options) @rootscope.t = i18n.t @@ -60,17 +60,17 @@ I18nDirective = ($rootscope, $i18n) -> for v in values if v.indexOf(":") == -1 - element.html($scope.t(v, opts)) + $el.html($scope.t(v, opts)) else [ns, v] = v.split(":") - element.attr(ns, $scope.t(v, opts)) + $el.attr(ns, $scope.t(v, opts)) - bindOnce(scope, "t", applyTranslation) + bindOnce($scope, "t", applyTranslation) $scope.$on("i18n:changeLang", applyTranslation) return {link: link} module = angular.module("taigaBase") -module.service("$tgI18n", ["$rootScope", I18nService]) +module.service("$tgI18n", ["$rootScope", "localesEnglish", I18nService]) module.directive("tgI18n", ["$rootScope", "$tgI18n", I18nDirective]) diff --git a/app/locales/en/app.json b/app/locales/en/app.json index 4790f011..ed1a3318 100644 --- a/app/locales/en/app.json +++ b/app/locales/en/app.json @@ -27,5 +27,19 @@ "pagination": { "next": "Next", "prev": "Previous" + }, + "common": { + "subject": "Subject" + "save": "Save", + "blocked": "Blocked", + "cancel": "Cancel", + "status": "Status", + "new-bulk": "New bulk insert", + "one-item-line": "One item per line..." + }, + "us": { + "title-new": "New User Story", + "team-requirement": "Ream Requirement", + "client-requirement": "Client Requirement" } } diff --git a/gulpfile.coffee b/gulpfile.coffee index 48b73721..94cdd81e 100644 --- a/gulpfile.coffee +++ b/gulpfile.coffee @@ -36,10 +36,11 @@ paths = { coffee: ["app/coffee/app.coffee", "config/main.coffee", "app/coffee/*.coffee", + "app/coffee/modules/controllerMixins.coffee", "app/coffee/modules/*.coffee", + "app/coffee/modules/locales/*.coffee", "app/coffee/modules/base/*.coffee", - "app/coffee/modules/resources/*.coffee", - "app/coffee/**/*.coffee"] + "app/coffee/modules/resources/*.coffee"] } From d8ba3e328babb33838567aac9b94a78ce76603a7 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Wed, 18 Jun 2014 14:55:22 +0200 Subject: [PATCH 47/64] Add mixOff function. --- app/coffee/utils.coffee | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/coffee/utils.coffee b/app/coffee/utils.coffee index 3fe4d186..a4710cdf 100644 --- a/app/coffee/utils.coffee +++ b/app/coffee/utils.coffee @@ -31,5 +31,15 @@ bindOnce = (scope, attr, continuation) => delBind() if delBind +mixOf = (base, mixins...) -> + class Mixed extends base + + for mixin in mixins by -1 #earlier mixins override later ones + for name, method of mixin:: + Mixed::[name] = method + Mixed + + taiga = @.taiga taiga.bindOnce = bindOnce +taiga.mixOf = mixOf From 79ca84c08362ebe821526d11e7dee5797e0cfef0 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Wed, 18 Jun 2014 14:55:37 +0200 Subject: [PATCH 48/64] Improved backlog and change base classes names. --- app/coffee/classes.coffee | 6 +- app/coffee/modules/auth.coffee | 2 +- app/coffee/modules/backlog.coffee | 98 +++++++++++++++---- app/coffee/modules/base/confirm.coffee | 2 +- app/coffee/modules/base/http.coffee | 2 +- app/coffee/modules/base/model.coffee | 2 +- app/coffee/modules/base/repository.coffee | 2 +- app/coffee/modules/base/storage.coffee | 2 +- app/coffee/modules/base/urls.coffee | 4 +- app/coffee/modules/resources.coffee | 2 +- app/coffee/modules/resources/projects.coffee | 8 ++ .../modules/resources/userstories.coffee | 9 +- 12 files changed, 105 insertions(+), 34 deletions(-) diff --git a/app/coffee/classes.coffee b/app/coffee/classes.coffee index 99de96df..be724271 100644 --- a/app/coffee/classes.coffee +++ b/app/coffee/classes.coffee @@ -19,6 +19,6 @@ class TaigaBase class TaigaService extends TaigaBase class TaigaController extends TaigaBase -@.taiga.TaigaBase = TaigaBase -@.taiga.TaigaService = TaigaService -@.taiga.TaigaController = TaigaController +@.taiga.Base = TaigaBase +@.taiga.Service = TaigaService +@.taiga.Controller = TaigaController diff --git a/app/coffee/modules/auth.coffee b/app/coffee/modules/auth.coffee index e189946e..a4249769 100644 --- a/app/coffee/modules/auth.coffee +++ b/app/coffee/modules/auth.coffee @@ -17,7 +17,7 @@ taiga = @.taiga -class AuthService extends taiga.TaigaService +class AuthService extends taiga.Service @.$inject = ["$rootScope", "$tgStorage", "$tgModel", "$tgHttp"] constructor: (@rootScope, @storage, @model, @http) -> diff --git a/app/coffee/modules/backlog.coffee b/app/coffee/modules/backlog.coffee index d31729a3..b1af367a 100644 --- a/app/coffee/modules/backlog.coffee +++ b/app/coffee/modules/backlog.coffee @@ -20,13 +20,17 @@ ### taiga = @.taiga +mixOf = @.taiga.mixOf -class BacklogController extends taiga.TaigaController - constructor: (@scope, @repo, @confirm, @rs, @params, @q) -> +class BacklogController extends mixOf(taiga.Controller, taiga.PageMixin) + constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q) -> + _.bindAll(@) promise = @.loadInitialData() promise.then null, => console.log "FAIL" + @rootscope.$on("usform:bulk:success", @.loadUserstories) + loadSprints: -> return @rs.sprints.list(@scope.projectId).then (sprints) => @scope.sprints = sprints @@ -43,19 +47,22 @@ class BacklogController extends taiga.TaigaController @.loadUserstories() ]) + loadProject: -> + return @rs.projects.get(@scope.projectId).then (project) => + @scope.project = project + @scope.points = _.sortBy(project.points, "order") + @scope.statusList = _.sortBy(project.us_statuses, "id") + return project + loadInitialData: -> # Resolve project slug promise = @repo.resolve({pslug: @params.pslug}).then (data) => - console.log "resolve", data.project @scope.projectId = data.project - return @rs.projects.get(@scope.projectId) + return data - # Load project - promise = promise.then (project) => - @scope.project = project - return @.loadBacklog() - - return promise + return promise.then(=> @.loadProject()) + .then(=> @.loadUsersAndRoles()) + .then(=> @.loadBacklog()) ## Template actions @@ -68,8 +75,8 @@ class BacklogController extends taiga.TaigaController addNewUs: (type) -> switch type - when "standard" then @rootscope.$emit("usform:new") - when "bulk" then @rootscope.$emit("usform:bulk") + when "standard" then @rootscope.$broadcast("usform:new") + when "bulk" then @rootscope.$broadcast("usform:bulk") BacklogDirective = ($compile, $templateCache) -> @@ -99,30 +106,79 @@ SprintDirective = ($compile, $templateCache) -> # Lightboxes ########################################################################################### - CreateEditUserstoryDirective = ($repo, $model) -> link = ($scope, $el, attrs) -> + $scope.us = {"tags": ["kaka", "pedo", "pis"]} # TODO: defaults $scope.$on "usform:new", -> - $scope.us = {} + $scope.us = {"subject": "KAKA"} $el.removeClass("hidden") - console.log "usform new requested" $scope.$on "usform:change", (ctx, us) -> + $el.removeClass("hidden") $scope.us = us - - return { - scope: {} - link: link - } + + $scope.$on "$destroy", -> + $el.off() + + # Dom Event Handlers + $el.on "click", ".markdown-preview a", (event) -> + event.preventDefault() + target = angular.element(event.currentTarget) + + target.parent().find("a").removeClass("active") + target.addClass("active") + + $el.on "click", ".close", (event) -> + event.preventDefault() + $el.addClass("hidden") + + $el.on "click", ".button-green", (event) -> + event.preventDefault() + console.log $scope.us + + return {link: link} + +CreateBulkUserstroriesDirective = ($repo, $rs, $rootscope) -> + link = ($scope, $el, attrs) -> + $scope.form = {data: ""} + + $scope.$on "usform:bulk", -> + $el.removeClass("hidden") + $scope.form = {data: ""} + + $el.on "click", ".close", (event) -> + event.preventDefault() + $el.addClass("hidden") + + $el.on "click", ".button-green", (event) -> + event.preventDefault() + + data = $scope.form.data + projectId = $scope.projectId + + $rs.userstories.bulkCreate(projectId, data).then (result) -> + $rootscope.$broadcast("usform:bulk:success", result) + $el.addClass("hidden") + + return {link: link} module = angular.module("taigaBacklog", []) module.directive("tgBacklog", ["$compile", "$templateCache", BacklogDirective]) module.directive("tgSprint", ["$compile", SprintDirective]) -module.directive("tgLightboxCreateEditUserstory", ["$tgRepo", "$tgModel", CreateEditUserstoryDirective]) +module.directive("tgLbCreateEditUserstory", ["$tgRepo", "$tgModel", CreateEditUserstoryDirective]) + +module.directive("tgLbCreateBulkUserstories", [ + "$tgRepo", + "$tgResources", + "$rootScope", + CreateBulkUserstroriesDirective +]) + module.controller("BacklogController", [ "$scope", + "$rootScope", "$tgRepo", "$tgConfirm", "$tgResources", diff --git a/app/coffee/modules/base/confirm.coffee b/app/coffee/modules/base/confirm.coffee index d7b59d45..9dc5afd3 100644 --- a/app/coffee/modules/base/confirm.coffee +++ b/app/coffee/modules/base/confirm.coffee @@ -21,7 +21,7 @@ taiga = @.taiga -class ConfirmService extends taiga.TaigaService +class ConfirmService extends taiga.Service @.$inject = ["$q"] constructor: (@q) -> diff --git a/app/coffee/modules/base/http.coffee b/app/coffee/modules/base/http.coffee index d8277976..c9af10ec 100644 --- a/app/coffee/modules/base/http.coffee +++ b/app/coffee/modules/base/http.coffee @@ -21,7 +21,7 @@ taiga = @.taiga -class HttpService extends taiga.TaigaService +class HttpService extends taiga.Service @.$inject = ["$http", "$q", "$tgStorage"] headers: -> diff --git a/app/coffee/modules/base/model.coffee b/app/coffee/modules/base/model.coffee index 9229918f..6bf52738 100644 --- a/app/coffee/modules/base/model.coffee +++ b/app/coffee/modules/base/model.coffee @@ -117,7 +117,7 @@ class Model taiga = @.taiga -class ModelService extends taiga.TaigaService +class ModelService extends taiga.Service @.$inject = ["$q", "$tgUrls", "$tgStorage", "$tgHttp"] constructor: (@q, @urls, @storage, @http) -> diff --git a/app/coffee/modules/base/repository.coffee b/app/coffee/modules/base/repository.coffee index 7893f87f..a430f643 100644 --- a/app/coffee/modules/base/repository.coffee +++ b/app/coffee/modules/base/repository.coffee @@ -21,7 +21,7 @@ taiga = @.taiga -class RepositoryService extends taiga.TaigaService +class RepositoryService extends taiga.Service @.$inject = ["$q", "$tgModel", "$tgStorage", "$tgHttp", "$tgUrls"] constructor: (@q, @model, @storage, @http, @urls) -> diff --git a/app/coffee/modules/base/storage.coffee b/app/coffee/modules/base/storage.coffee index 1bf30291..2eafb2f3 100644 --- a/app/coffee/modules/base/storage.coffee +++ b/app/coffee/modules/base/storage.coffee @@ -21,7 +21,7 @@ taiga = @.taiga -class StorageService extends taiga.TaigaService +class StorageService extends taiga.Service @.$inject = ["$rootScope"] constructor: ($rootScope) -> diff --git a/app/coffee/modules/base/urls.coffee b/app/coffee/modules/base/urls.coffee index 6d580f56..edac0b5e 100644 --- a/app/coffee/modules/base/urls.coffee +++ b/app/coffee/modules/base/urls.coffee @@ -23,7 +23,9 @@ format = (fmt, obj) -> obj = _.clone(obj) return fmt.replace /%s/g, (match) -> String(obj.shift()) -class UrlsService +taiga = @.taiga + +class UrlsService extends taiga.Service @.$inject = ["$tgConfig"] constructor: (@config) -> diff --git a/app/coffee/modules/resources.coffee b/app/coffee/modules/resources.coffee index 2398f5a8..9a979aa7 100644 --- a/app/coffee/modules/resources.coffee +++ b/app/coffee/modules/resources.coffee @@ -21,7 +21,7 @@ taiga = @.taiga -class ResourcesService extends taiga.TaigaService +class ResourcesService extends taiga.Service initUrls = (urls) -> urls.update({ diff --git a/app/coffee/modules/resources/projects.coffee b/app/coffee/modules/resources/projects.coffee index 9ae30981..fb536a9a 100644 --- a/app/coffee/modules/resources/projects.coffee +++ b/app/coffee/modules/resources/projects.coffee @@ -31,6 +31,14 @@ resourceProvider = ($repo) -> service.list = -> return $repo.queryMany("projects") + service.usersList = (projectId) -> + params = {"project": projectId} + return $repo.queryMany("users", params) + + service.rolesList = (projectId) -> + params = {"project": projectId} + return $repo.queryMany("roles", params) + return (instance) -> instance.projects = service diff --git a/app/coffee/modules/resources/userstories.coffee b/app/coffee/modules/resources/userstories.coffee index 9f1ca2f5..b8cb3934 100644 --- a/app/coffee/modules/resources/userstories.coffee +++ b/app/coffee/modules/resources/userstories.coffee @@ -21,15 +21,20 @@ taiga = @.taiga -resourceProvider = ($repo) -> +resourceProvider = ($repo, $http, $urls) -> service = {} service.listUnassigned = (projectId) -> params = {"project": projectId, "milestone": "null"} return $repo.queryMany("userstories", params) + service.bulkCreate = (projectId, data) -> + url = $urls.resolve("bulk-create-us") + params = {projectId: projectId, bulkStories: data} + return $http.post(url, params) + return (instance) -> instance.userstories = service module = angular.module("taigaResources") -module.factory("$tgUserstoriesResourcesProvider", ["$tgRepo", resourceProvider]) +module.factory("$tgUserstoriesResourcesProvider", ["$tgRepo", "$tgHttp", "$tgUrls", resourceProvider]) From 6a3622ad15e7c3e658dfc635a6805a365a8aa2c7 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Wed, 18 Jun 2014 14:56:10 +0200 Subject: [PATCH 49/64] Minor changes on lightboxes css. --- app/styles/modules/lightbox.scss | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/app/styles/modules/lightbox.scss b/app/styles/modules/lightbox.scss index c3583d18..1a28c714 100644 --- a/app/styles/modules/lightbox.scss +++ b/app/styles/modules/lightbox.scss @@ -103,12 +103,12 @@ border: 1px solid $fresh-taiga; color: $white; } - } - .requirement-selected { - @include transition(all .2s ease-in); - background: $green-taiga; - border: 1px solid $green-taiga; - color: $white; + &.selected { + @include transition(all .2s ease-in); + background: $green-taiga; + border: 1px solid $green-taiga; + color: $white; + } } .blocked { &:hover { @@ -117,12 +117,12 @@ border: 1px solid $red-light; color: $white; } - } - .blocked-selected { - @include transition(all .2s ease-in); - background: $red; - border: 1px solid $red; - color: $white; + &.selected { + @include transition(all .2s ease-in); + background: $red; + border: 1px solid $red; + color: $white; + } } input[type="checkbox"] { display: none; From 64083eb78a6d1eaa4b0b5dc1566d191d4e985e2e Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Wed, 18 Jun 2014 14:56:43 +0200 Subject: [PATCH 50/64] Changes on lightbox templates. --- app/partials/backlog.jade | 4 +- app/partials/views/components/summary.jade | 38 +++++++++---------- .../views/modules/lightbox_add-bulk.jade | 8 ++-- .../views/modules/lightbox_add-new-us.jade | 33 ++++++++-------- 4 files changed, 43 insertions(+), 40 deletions(-) diff --git a/app/partials/backlog.jade b/app/partials/backlog.jade index 82fc55ac..d6a42475 100644 --- a/app/partials/backlog.jade +++ b/app/partials/backlog.jade @@ -25,9 +25,9 @@ block content include views/modules/backlog-table sidebar.menu-secondary.sidebar include views/modules/sprints - div.lightbox.lightbox_add-new-us.hidden(tg-lightbox-create-edit-userstory) + div.lightbox.lightbox_add-new-us.hidden(tg-lb-create-edit-userstory) include views/modules/lightbox_add-new-us - div.lightbox.lightbox_add-bulk.hidden + div.lightbox.lightbox_add-bulk.hidden(tg-lb-create-bulk-userstories) include views/modules/lightbox_add-bulk div.lightbox.lightbox_add-sprint.hidden include views/modules/lightbox_add-sprint diff --git a/app/partials/views/components/summary.jade b/app/partials/views/components/summary.jade index d8355d28..50650191 100644 --- a/app/partials/views/components/summary.jade +++ b/app/partials/views/components/summary.jade @@ -1,19 +1,19 @@ -div.summary - div.summary-progress-bar - div.current-progress - div.data - span.number 30% - span.description completed - ul - li - span.number 12 - span.description project
points - li - span.number 23 - span.description defined
points - li - span.number 12 - span.description assigned
points - li - span.number 23 - span.description closed
points +div.summary(tg-backlog-summary) + div.summary-progress-bar + div.current-progress + div.data + span.number 30% + span.description completed + ul + li + span.number 12 + span.description project
points + li + span.number 23 + span.description defined
points + li + span.number 12 + span.description assigned
points + li + span.number 23 + span.description closed
points diff --git a/app/partials/views/modules/lightbox_add-bulk.jade b/app/partials/views/modules/lightbox_add-bulk.jade index 8ed503c5..e630f230 100644 --- a/app/partials/views/modules/lightbox_add-bulk.jade +++ b/app/partials/views/modules/lightbox_add-bulk.jade @@ -1,8 +1,8 @@ a.close(href="", title="close") span.icon.icon-delete form - h2.title New Bulk + h2.title(tg-i18n="common.new-bulk") fieldset - textarea(placeholder="One user story per line") - a.button.button-green(href="", title="Save") - span Create + textarea(tg-i18n="placeholder:common.one-item-line", ng-model="form.data") + a.button.button-green(href="", tg-i18n="title:common.save") + span(tg-i18n="common.save") diff --git a/app/partials/views/modules/lightbox_add-new-us.jade b/app/partials/views/modules/lightbox_add-new-us.jade index 70485679..199c1883 100644 --- a/app/partials/views/modules/lightbox_add-new-us.jade +++ b/app/partials/views/modules/lightbox_add-new-us.jade @@ -1,29 +1,32 @@ a.close(href="", title="close") span.icon.icon-delete form - h2.title New User Story + h2.title(tg-i18n="us.title-new") fieldset - input(type="text", placeholder="Subject") + input(type="text", ng-model="us.subject", tg-i18n="placeholder:common.subject") fieldset - select - option(selected, value="open") Open - option(selected, value="closed") Closed + select(ng-model="us.status", ng-options="s.name for s in statusList", + tg-i18n="placeholder:common.status") fieldset - input(type="text", placeholder="Tags") + input(type="text", placeholder="Tags", tg-tags, ng-model="us.tags") fieldset div.markdown-preview - a.active(href="", title="Edit") Edit - a(href="", title="Preview") Preview - textarea(placeholder="One user story per line") + a.edit.active(href="", title="Edit") Edit + a.preview(href="", title="Preview") Preview + textarea(placeholder="One user story per line", ng-model="us.description") div.new-us-settings fieldset - label.requirement(for="team-requirement") Team Requirement - input(type="checkbox", name="team-requirement", id="team-requirement") + label.requirement(for="team-requirement", tg-i18n="us.team-requirement") + input( + type="checkbox", ng-model="us.team_requirement", + name="team-requirement", id="team-requirement") fieldset - label.requirement(for="client-requirement") Team Requirement - input(type="checkbox", name="client-requirement", id="client-requirement") + label.requirement(for="client-requirement", tg-i18n="us.client-requirement") + input( + type="checkbox", ng-model="us.client_requirement", + name="client-requirement", id="client-requirement") fieldset - label.blocked(for="blocked-us") Blocked - input(type="checkbox", name="blocked-us", id="blocked-us") + label.blocked(for="blocked-us", tg-i18n="common.blocked") + input(type="checkbox", ng-model="us.blocked", name="blocked-us", id="blocked-us") a.button.button-green(href="", title="Save") span Create From 2aa95c6e3d440bfaec5df4465c1bb30297e40ff5 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Wed, 18 Jun 2014 17:09:31 +0200 Subject: [PATCH 51/64] Separate backlog modules in 3 files. --- app/coffee/modules/backlog.coffee | 166 ------------------- app/coffee/modules/backlog/lightboxes.coffee | 88 ++++++++++ app/coffee/modules/backlog/main.coffee | 121 ++++++++++++++ app/partials/views/modules/sprints.jade | 2 +- gulpfile.coffee | 2 +- 5 files changed, 211 insertions(+), 168 deletions(-) create mode 100644 app/coffee/modules/backlog/lightboxes.coffee create mode 100644 app/coffee/modules/backlog/main.coffee diff --git a/app/coffee/modules/backlog.coffee b/app/coffee/modules/backlog.coffee index b1af367a..f2c769f0 100644 --- a/app/coffee/modules/backlog.coffee +++ b/app/coffee/modules/backlog.coffee @@ -19,170 +19,4 @@ # File: modules/backlog.coffee ### -taiga = @.taiga -mixOf = @.taiga.mixOf - -class BacklogController extends mixOf(taiga.Controller, taiga.PageMixin) - constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q) -> - _.bindAll(@) - promise = @.loadInitialData() - promise.then null, => - console.log "FAIL" - - @rootscope.$on("usform:bulk:success", @.loadUserstories) - - loadSprints: -> - return @rs.sprints.list(@scope.projectId).then (sprints) => - @scope.sprints = sprints - return sprints - - loadUserstories: -> - return @rs.userstories.listUnassigned(@scope.projectId).then (userstories) => - @scope.userstories = userstories - return userstories - - loadBacklog: -> - return @q.all([ - @.loadSprints(), - @.loadUserstories() - ]) - - loadProject: -> - return @rs.projects.get(@scope.projectId).then (project) => - @scope.project = project - @scope.points = _.sortBy(project.points, "order") - @scope.statusList = _.sortBy(project.us_statuses, "id") - return project - - loadInitialData: -> - # Resolve project slug - promise = @repo.resolve({pslug: @params.pslug}).then (data) => - @scope.projectId = data.project - return data - - return promise.then(=> @.loadProject()) - .then(=> @.loadUsersAndRoles()) - .then(=> @.loadBacklog()) - - ## Template actions - - deleteUserStory: (us) -> - title = "Delete User Story" - subtitle = us.subject - - @confirm.ask(title, subtitle).then => - console.log "#TODO" - - addNewUs: (type) -> - switch type - when "standard" then @rootscope.$broadcast("usform:new") - when "bulk" then @rootscope.$broadcast("usform:bulk") - - -BacklogDirective = ($compile, $templateCache) -> - link = ($scope, $el, $attrs) -> - $ctrl = $el.controller() - - return {link: link} - - -SprintDirective = ($compile, $templateCache) -> - link = (scope, element, attrs) -> - sprint = scope.$eval(attrs.tgSprint) - if scope.$first - element.addClass("sprint-current") - - if sprint.closed - element.addClass("sprint-closed") - - # Event Handlers - element.on "click", ".sprint-summary > a", (event) -> - element.find(".sprint-table").toggle() - - return {link: link} - - -########################################################################################### -# Lightboxes -########################################################################################### - -CreateEditUserstoryDirective = ($repo, $model) -> - link = ($scope, $el, attrs) -> - $scope.us = {"tags": ["kaka", "pedo", "pis"]} - # TODO: defaults - $scope.$on "usform:new", -> - $scope.us = {"subject": "KAKA"} - $el.removeClass("hidden") - - $scope.$on "usform:change", (ctx, us) -> - $el.removeClass("hidden") - $scope.us = us - - $scope.$on "$destroy", -> - $el.off() - - # Dom Event Handlers - $el.on "click", ".markdown-preview a", (event) -> - event.preventDefault() - target = angular.element(event.currentTarget) - - target.parent().find("a").removeClass("active") - target.addClass("active") - - $el.on "click", ".close", (event) -> - event.preventDefault() - $el.addClass("hidden") - - $el.on "click", ".button-green", (event) -> - event.preventDefault() - console.log $scope.us - - return {link: link} - -CreateBulkUserstroriesDirective = ($repo, $rs, $rootscope) -> - link = ($scope, $el, attrs) -> - $scope.form = {data: ""} - - $scope.$on "usform:bulk", -> - $el.removeClass("hidden") - $scope.form = {data: ""} - - $el.on "click", ".close", (event) -> - event.preventDefault() - $el.addClass("hidden") - - $el.on "click", ".button-green", (event) -> - event.preventDefault() - - data = $scope.form.data - projectId = $scope.projectId - - $rs.userstories.bulkCreate(projectId, data).then (result) -> - $rootscope.$broadcast("usform:bulk:success", result) - $el.addClass("hidden") - - return {link: link} - - module = angular.module("taigaBacklog", []) -module.directive("tgBacklog", ["$compile", "$templateCache", BacklogDirective]) -module.directive("tgSprint", ["$compile", SprintDirective]) -module.directive("tgLbCreateEditUserstory", ["$tgRepo", "$tgModel", CreateEditUserstoryDirective]) - -module.directive("tgLbCreateBulkUserstories", [ - "$tgRepo", - "$tgResources", - "$rootScope", - CreateBulkUserstroriesDirective -]) - -module.controller("BacklogController", [ - "$scope", - "$rootScope", - "$tgRepo", - "$tgConfirm", - "$tgResources", - "$routeParams", - "$q", - BacklogController -]) diff --git a/app/coffee/modules/backlog/lightboxes.coffee b/app/coffee/modules/backlog/lightboxes.coffee new file mode 100644 index 00000000..27544d95 --- /dev/null +++ b/app/coffee/modules/backlog/lightboxes.coffee @@ -0,0 +1,88 @@ +### +# Copyright (C) 2014 Andrey Antukh +# Copyright (C) 2014 Jesús Espino Garcia +# Copyright (C) 2014 David Barragán Merino +# +# 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 . +# +# File: modules/backlog/lightboxes.coffee +### + +CreateEditUserstoryDirective = ($repo, $model) -> + link = ($scope, $el, attrs) -> + $scope.us = {"tags": ["kaka", "pedo", "pis"]} + # TODO: defaults + $scope.$on "usform:new", -> + $scope.us = {"subject": "KAKA"} + $el.removeClass("hidden") + + $scope.$on "usform:change", (ctx, us) -> + $el.removeClass("hidden") + $scope.us = us + + $scope.$on "$destroy", -> + $el.off() + + # Dom Event Handlers + $el.on "click", ".markdown-preview a", (event) -> + event.preventDefault() + target = angular.element(event.currentTarget) + + target.parent().find("a").removeClass("active") + target.addClass("active") + + $el.on "click", ".close", (event) -> + event.preventDefault() + $el.addClass("hidden") + + $el.on "click", ".button-green", (event) -> + event.preventDefault() + console.log $scope.us + + return {link: link} + +CreateBulkUserstroriesDirective = ($repo, $rs, $rootscope) -> + link = ($scope, $el, attrs) -> + $scope.form = {data: ""} + + $scope.$on "usform:bulk", -> + $el.removeClass("hidden") + $scope.form = {data: ""} + + $el.on "click", ".close", (event) -> + event.preventDefault() + $el.addClass("hidden") + + $el.on "click", ".button-green", (event) -> + event.preventDefault() + + data = $scope.form.data + projectId = $scope.projectId + + $rs.userstories.bulkCreate(projectId, data).then (result) -> + $rootscope.$broadcast("usform:bulk:success", result) + $el.addClass("hidden") + + return {link: link} + +module = angular.module("taigaBacklog") +module.directive("tgLbCreateEditUserstory", ["$tgRepo", "$tgModel", CreateEditUserstoryDirective]) +module.directive("tgLbCreateBulkUserstories", [ + "$tgRepo", + "$tgResources", + "$rootScope", + CreateBulkUserstroriesDirective +]) + + diff --git a/app/coffee/modules/backlog/main.coffee b/app/coffee/modules/backlog/main.coffee new file mode 100644 index 00000000..10fd7809 --- /dev/null +++ b/app/coffee/modules/backlog/main.coffee @@ -0,0 +1,121 @@ +### +# Copyright (C) 2014 Andrey Antukh +# Copyright (C) 2014 Jesús Espino Garcia +# Copyright (C) 2014 David Barragán Merino +# +# 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 . +# +# File: modules/backlog/main.coffee +### + +taiga = @.taiga +mixOf = @.taiga.mixOf + +class BacklogController extends mixOf(taiga.Controller, taiga.PageMixin) + constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q) -> + _.bindAll(@) + promise = @.loadInitialData() + promise.then null, => + console.log "FAIL" + + @rootscope.$on("usform:bulk:success", @.loadUserstories) + + loadSprints: -> + return @rs.sprints.list(@scope.projectId).then (sprints) => + @scope.sprints = sprints + return sprints + + loadUserstories: -> + return @rs.userstories.listUnassigned(@scope.projectId).then (userstories) => + @scope.userstories = userstories + return userstories + + loadBacklog: -> + return @q.all([ + @.loadSprints(), + @.loadUserstories() + ]) + + loadProject: -> + return @rs.projects.get(@scope.projectId).then (project) => + @scope.project = project + @scope.points = _.sortBy(project.points, "order") + @scope.statusList = _.sortBy(project.us_statuses, "id") + return project + + loadInitialData: -> + # Resolve project slug + promise = @repo.resolve({pslug: @params.pslug}).then (data) => + @scope.projectId = data.project + return data + + return promise.then(=> @.loadProject()) + .then(=> @.loadUsersAndRoles()) + .then(=> @.loadBacklog()) + + ## Template actions + + deleteUserStory: (us) -> + title = "Delete User Story" + subtitle = us.subject + + @confirm.ask(title, subtitle).then => + console.log "#TODO" + + addNewUs: (type) -> + switch type + when "standard" then @rootscope.$broadcast("usform:new") + when "bulk" then @rootscope.$broadcast("usform:bulk") + + +BacklogDirective = -> + link = ($scope, $el, $attrs) -> + $ctrl = $el.controller() + return {link: link} + +BacklogSummaryDirective = -> + link = ($scope, $el, $attrs) -> + return {link:link} + +BacklogSprintDirective = -> + link = (scope, element, attrs) -> + sprint = scope.$eval(attrs.tgBacklogSprint) + if scope.$first + element.addClass("sprint-current") + + if sprint.closed + element.addClass("sprint-closed") + + # Event Handlers + element.on "click", ".sprint-summary > a", (event) -> + element.find(".sprint-table").toggle() + + return {link: link} + + +module = angular.module("taigaBacklog") +module.directive("tgBacklog", BacklogDirective) +module.directive("tgBacklogSprint", BacklogSprintDirective) +module.directive("tgBacklogSummary", BacklogSummaryDirective) + +module.controller("BacklogController", [ + "$scope", + "$rootScope", + "$tgRepo", + "$tgConfirm", + "$tgResources", + "$routeParams", + "$q", + BacklogController +]) diff --git a/app/partials/views/modules/sprints.jade b/app/partials/views/modules/sprints.jade index 8475ae4e..7367ef35 100644 --- a/app/partials/views/modules/sprints.jade +++ b/app/partials/views/modules/sprints.jade @@ -10,7 +10,7 @@ section.sprints a.button-green(href="", title="Add New US") span.text + New sprint - section.sprint(ng-repeat="sprint in sprints track by sprint.id", tg-sprint="sprint") + section.sprint(ng-repeat="sprint in sprints track by sprint.id", tg-backlog-sprint="sprint") header div.sprint-summary a.icon.icon-arrow-up(href="", title="compact Sprint") diff --git a/gulpfile.coffee b/gulpfile.coffee index 94cdd81e..4651a996 100644 --- a/gulpfile.coffee +++ b/gulpfile.coffee @@ -8,7 +8,6 @@ plumber = require("gulp-plumber") wrap = require("gulp-wrap") rename = require("gulp-rename") -newer = require("gulp-newer") minifyHTML = require("gulp-minify-html") sass = require("gulp-ruby-sass") csslint = require("gulp-csslint") @@ -38,6 +37,7 @@ paths = { "app/coffee/*.coffee", "app/coffee/modules/controllerMixins.coffee", "app/coffee/modules/*.coffee", + "app/coffee/modules/backlog/*.coffee", "app/coffee/modules/locales/*.coffee", "app/coffee/modules/base/*.coffee", "app/coffee/modules/resources/*.coffee"] From 171aaa1f6b210296051353c911c90542362f6943 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Wed, 18 Jun 2014 19:02:17 +0200 Subject: [PATCH 52/64] Implement navigation url service. --- app/coffee/app.coffee | 3 + app/coffee/modules/auth.coffee | 16 ++- app/coffee/modules/base/navurl.coffee | 78 +++++++++++++++ app/coffee/modules/common.coffee | 0 app/coffee/modules/navigation.coffee | 38 ++++++++ app/coffee/modules/resources.coffee | 123 +++++++++++++----------- app/coffee/utils.coffee | 5 + app/partials/views/modules/sprints.jade | 3 +- 8 files changed, 203 insertions(+), 63 deletions(-) create mode 100644 app/coffee/modules/base/navurl.coffee delete mode 100644 app/coffee/modules/common.coffee create mode 100644 app/coffee/modules/navigation.coffee diff --git a/app/coffee/app.coffee b/app/coffee/app.coffee index 4907cd66..0271385e 100644 --- a/app/coffee/app.coffee +++ b/app/coffee/app.coffee @@ -57,6 +57,9 @@ modules = [ "taigaBase", "taigaResources", "taigaLocales", + "taigaAuth", + + "taigaNavigation", # Specific Modules "taigaBacklog", diff --git a/app/coffee/modules/auth.coffee b/app/coffee/modules/auth.coffee index a4249769..0483af77 100644 --- a/app/coffee/modules/auth.coffee +++ b/app/coffee/modules/auth.coffee @@ -20,22 +20,28 @@ taiga = @.taiga class AuthService extends taiga.Service @.$inject = ["$rootScope", "$tgStorage", "$tgModel", "$tgHttp"] - constructor: (@rootScope, @storage, @model, @http) -> + constructor: (@rootscope, @storage, @model, @http) -> super() getUser: -> + if @rootscope.user + return @rootscope.user + userData = @storage.get("userInfo") if userData - return @model.make_model("users", userData) + user = @model.make_model("users", userData) + @rootscope.user = user + return user + return null setUser: (user) -> - @rootScope.auth = user - @rootScope.$broadcast("i18n:change", user.default_language) + @rootscope.auth = user + @rootscope.$broadcast("i18n:change", user.default_language) @storage.set("userInfo", user.getAttrs()) clear: -> - @rootScope.auth = null + @rootscope.auth = null @storage.remove("userInfo") setToken: (token) -> diff --git a/app/coffee/modules/base/navurl.coffee b/app/coffee/modules/base/navurl.coffee new file mode 100644 index 00000000..d2c9f8c6 --- /dev/null +++ b/app/coffee/modules/base/navurl.coffee @@ -0,0 +1,78 @@ +### +# Copyright (C) 2014 Andrey Antukh +# Copyright (C) 2014 Jesús Espino Garcia +# Copyright (C) 2014 David Barragán Merino +# +# 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 . +# +# File: modules/base/navurl.coffee +### + + +taiga = @.taiga +trim = @.taiga.trim + +parseNav = (data, scope) -> + options = {} + + [name, params] = _.map(data.split(":"), trim) + params = _.map(params.split(","), trim) + + for item in params + [key, value] = _.map(item.split("="), trim) + options[key] = scope.$eval(value) + + return [name, options] + +formatUrl = (url, ctx={}) -> + replacer = (match) -> + match = trim(match, ":") + return ctx[match] or "undefined" + return url.replace(/(:\w+)/g, replacer) + + +class NavigationUrlsService extends taiga.Service + constructor: -> + @.urls = {} + + update: (urls) -> + @.urls = _.merge({}, @.urls, urls or {}) + + resolve: (name) -> + return @.urls[name] + + +NavigationUrlsDirective = ($navurls, $auth) -> + # Example: + # link(tg-nav="project-backlog:project='sss',") + + link = ($scope, $el, $attrs) -> + [name, options] = parseNav($attrs.tgNav, $scope) + + user = $auth.getUser() + options.user = user.username if user + + url = $navurls.resolve(name) + fullUrl = formatUrl(url, options) + + $el.attr("href", fullUrl) + + return {link: link} + + +module = angular.module("taigaBase") +module.service("$tgNavUrls", NavigationUrlsService) +module.directive("tgNav", ["$tgNavUrls", "$tgAuth", NavigationUrlsDirective]) + + diff --git a/app/coffee/modules/common.coffee b/app/coffee/modules/common.coffee deleted file mode 100644 index e69de29b..00000000 diff --git a/app/coffee/modules/navigation.coffee b/app/coffee/modules/navigation.coffee new file mode 100644 index 00000000..b66c456f --- /dev/null +++ b/app/coffee/modules/navigation.coffee @@ -0,0 +1,38 @@ +### +# Copyright (C) 2014 Andrey Antukh +# Copyright (C) 2014 Jesús Espino Garcia +# Copyright (C) 2014 David Barragán Merino +# +# 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 . +# +# File: modules/navigation.coffee +### + +# Simple module that uses navurls service and register +# navigation urls for taiga. + +urls = { + "home": "/", + "profile": "/:user", + "project": "/:user/:project", + "project-backlog": "/:user/:project/backlog", + "project-taskboard": "/:user/:project/taskboard/:sprint", +} + +init = ($log, $navurls) -> + $log.debug "Initialize navigation urls" + $navurls.update(urls) + +module = angular.module("taigaNavigation", ["taigaBase"]) +module.run(["$log", "$tgNavUrls", init]) diff --git a/app/coffee/modules/resources.coffee b/app/coffee/modules/resources.coffee index 9a979aa7..532a6691 100644 --- a/app/coffee/modules/resources.coffee +++ b/app/coffee/modules/resources.coffee @@ -21,66 +21,75 @@ taiga = @.taiga + + + + class ResourcesService extends taiga.Service -initUrls = (urls) -> - urls.update({ - "auth": "/api/v1/auth" - "auth-register": "/api/v1/auth/register" - "permissions": "/api/v1/permissions" - "roles": "/api/v1/roles" - "projects": "/api/v1/projects" - "memberships": "/api/v1/memberships" - "milestones": "/api/v1/milestones" - "userstories": "/api/v1/userstories" - "bulk-create-us": "/api/v1/userstories/bulk_create" - "bulk-update-us-order": "/api/v1/userstories/bulk_update_order" - "userstories-restore": "/api/v1/userstories/%s/restore" - "tasks": "/api/v1/tasks" - "bulk-create-tasks": "/api/v1/tasks/bulk_create" - "tasks-restore": "/api/v1/tasks/%s/restore" - "issues": "/api/v1/issues" - "issues-restore": "/api/v1/issues/%s/restore" - "wiki": "/api/v1/wiki" - "wiki-restore": "/api/v1/wiki/%s/restore" - "choices/userstory-statuses": "/api/v1/userstory-statuses" - "choices/userstory-statuses/bulk-update-order": "/api/v1/userstory-statuses/bulk_update_order" - "choices/points": "/api/v1/points" - "choices/points/bulk-update-order": "/api/v1/points/bulk_update_order" - "choices/task-statuses": "/api/v1/task-statuses" - "choices/task-statuses/bulk-update-order": "/api/v1/task-statuses/bulk_update_order" - "choices/issue-statuses": "/api/v1/issue-statuses" - "choices/issue-statuses/bulk-update-order": "/api/v1/issue-statuses/bulk_update_order" - "choices/issue-types": "/api/v1/issue-types" - "choices/issue-types/bulk-update-order": "/api/v1/issue-types/bulk_update_order" - "choices/priorities": "/api/v1/priorities" - "choices/priorities/bulk-update-order": "/api/v1/priorities/bulk_update_order" - "choices/severities": "/api/v1/severities" - "choices/severities/bulk-update-order": "/api/v1/severities/bulk_update_order" - "search": "/api/v1/search" - "sites": "/api/v1/sites" - "project-templates": "/api/v1/project-templates" - "site-members": "/api/v1/site-members" - "site-projects": "/api/v1/site-projects" - "users": "/api/v1/users" - "users-password-recovery": "/api/v1/users/password_recovery" - "users-change-password-from-recovery": "/api/v1/users/change_password_from_recovery" - "users-change-password": "/api/v1/users/change_password" - "resolver": "/api/v1/resolver" - "wiki-attachment": "/media/attachment-files/%s/wikipage/%s" - # History - "history/userstory": "/api/v1/history/userstory" - "history/issue": "/api/v1/history/issue" - "history/task": "/api/v1/history/task" - "history/wiki": "/api/v1/history/wiki" +urls = { + "auth": "/api/v1/auth" + "auth-register": "/api/v1/auth/register" + "permissions": "/api/v1/permissions" + "roles": "/api/v1/roles" + "projects": "/api/v1/projects" + "memberships": "/api/v1/memberships" + "milestones": "/api/v1/milestones" + "userstories": "/api/v1/userstories" + "bulk-create-us": "/api/v1/userstories/bulk_create" + "bulk-update-us-order": "/api/v1/userstories/bulk_update_order" + "userstories-restore": "/api/v1/userstories/%s/restore" + "tasks": "/api/v1/tasks" + "bulk-create-tasks": "/api/v1/tasks/bulk_create" + "tasks-restore": "/api/v1/tasks/%s/restore" + "issues": "/api/v1/issues" + "issues-restore": "/api/v1/issues/%s/restore" + "wiki": "/api/v1/wiki" + "wiki-restore": "/api/v1/wiki/%s/restore" + "choices/userstory-statuses": "/api/v1/userstory-statuses" + "choices/userstory-statuses/bulk-update-order": "/api/v1/userstory-statuses/bulk_update_order" + "choices/points": "/api/v1/points" + "choices/points/bulk-update-order": "/api/v1/points/bulk_update_order" + "choices/task-statuses": "/api/v1/task-statuses" + "choices/task-statuses/bulk-update-order": "/api/v1/task-statuses/bulk_update_order" + "choices/issue-statuses": "/api/v1/issue-statuses" + "choices/issue-statuses/bulk-update-order": "/api/v1/issue-statuses/bulk_update_order" + "choices/issue-types": "/api/v1/issue-types" + "choices/issue-types/bulk-update-order": "/api/v1/issue-types/bulk_update_order" + "choices/priorities": "/api/v1/priorities" + "choices/priorities/bulk-update-order": "/api/v1/priorities/bulk_update_order" + "choices/severities": "/api/v1/severities" + "choices/severities/bulk-update-order": "/api/v1/severities/bulk_update_order" + "search": "/api/v1/search" + "sites": "/api/v1/sites" + "project-templates": "/api/v1/project-templates" + "site-members": "/api/v1/site-members" + "site-projects": "/api/v1/site-projects" + "users": "/api/v1/users" + "users-password-recovery": "/api/v1/users/password_recovery" + "users-change-password-from-recovery": "/api/v1/users/change_password_from_recovery" + "users-change-password": "/api/v1/users/change_password" + "resolver": "/api/v1/resolver" + "wiki-attachment": "/media/attachment-files/%s/wikipage/%s" - # Attachments - "userstories/attachments": "/api/v1/userstories/attachments" - "issues/attachments": "/api/v1/issues/attachments" - "tasks/attachments": "/api/v1/tasks/attachments" - "wiki/attachments": "/api/v1/wiki/attachments" - }) + # History + "history/userstory": "/api/v1/history/userstory" + "history/issue": "/api/v1/history/issue" + "history/task": "/api/v1/history/task" + "history/wiki": "/api/v1/history/wiki" + + # Attachments + "userstories/attachments": "/api/v1/userstories/attachments" + "issues/attachments": "/api/v1/issues/attachments" + "tasks/attachments": "/api/v1/tasks/attachments" + "wiki/attachments": "/api/v1/wiki/attachments" +} + +# Initialize api urls service +initUrls = ($log, $urls) -> + $log.debug "Initialize api urls" + $urls.update(urls) # Initialize resources service populating it with methods # defined in separated files. @@ -95,7 +104,7 @@ module = angular.module("taigaResources", ["taigaBase"]) module.service("$tgResources", ResourcesService) # Module entry point -module.run(["$tgUrls", initUrls]) +module.run(["$log", "$tgUrls", initUrls]) module.run([ "$log", "$tgResources", diff --git a/app/coffee/utils.coffee b/app/coffee/utils.coffee index a4710cdf..6593271e 100644 --- a/app/coffee/utils.coffee +++ b/app/coffee/utils.coffee @@ -40,6 +40,11 @@ mixOf = (base, mixins...) -> Mixed +trim = (data, char) -> + return _.str.trim(data, char) + + taiga = @.taiga taiga.bindOnce = bindOnce taiga.mixOf = mixOf +taiga.trim = trim diff --git a/app/partials/views/modules/sprints.jade b/app/partials/views/modules/sprints.jade index 7367ef35..230349cd 100644 --- a/app/partials/views/modules/sprints.jade +++ b/app/partials/views/modules/sprints.jade @@ -32,7 +32,8 @@ section.sprints span(tg-bo-ref="us.ref") span(tg-bo-html="us.subject") div.column-points.width-1(tg-bo-html="us.total_points") - a.button.button-gray(href="", title="Current Sprint Taskboard") + a.button.button-gray(href="", tg-nav="project-taskboard:project=projectId,sprint=sprint.id", + title="Current Sprint Taskboard") span Sprint Taskboard // If is current sprint From de0e6ef5f3e4f42fd8dd78d54e4eebc32f2226f8 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Wed, 18 Jun 2014 19:13:34 +0200 Subject: [PATCH 53/64] Add proper license header on files when it missing. --- app/coffee/app.coffee | 4 ++++ app/coffee/classes.coffee | 4 ++++ app/coffee/config.coffee | 4 ++++ app/coffee/modules/auth.coffee | 4 ++++ app/coffee/modules/base/model.coffee | 4 ++++ 5 files changed, 20 insertions(+) diff --git a/app/coffee/app.coffee b/app/coffee/app.coffee index 0271385e..0d61fa61 100644 --- a/app/coffee/app.coffee +++ b/app/coffee/app.coffee @@ -1,3 +1,4 @@ +### # Copyright (C) 2014 Andrey Antukh # Copyright (C) 2014 Jesús Espino Garcia # Copyright (C) 2014 David Barragán Merino @@ -14,6 +15,9 @@ # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . +# +# File: app.coffee +### @taiga = taiga = {} diff --git a/app/coffee/classes.coffee b/app/coffee/classes.coffee index be724271..14ffc5ec 100644 --- a/app/coffee/classes.coffee +++ b/app/coffee/classes.coffee @@ -1,3 +1,4 @@ +### # Copyright (C) 2014 Andrey Antukh # Copyright (C) 2014 Jesús Espino Garcia # Copyright (C) 2014 David Barragán Merino @@ -14,6 +15,9 @@ # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . +# +# File: classes.coffee +### class TaigaBase class TaigaService extends TaigaBase diff --git a/app/coffee/config.coffee b/app/coffee/config.coffee index d3660e2c..a907d50f 100644 --- a/app/coffee/config.coffee +++ b/app/coffee/config.coffee @@ -1,3 +1,4 @@ +### # Copyright (C) 2014 Andrey Antukh # Copyright (C) 2014 Jesús Espino Garcia # Copyright (C) 2014 David Barragán Merino @@ -14,6 +15,9 @@ # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . +# +# File: config.coffee +### class ConfigService defaults: { diff --git a/app/coffee/modules/auth.coffee b/app/coffee/modules/auth.coffee index 0483af77..64b3be9e 100644 --- a/app/coffee/modules/auth.coffee +++ b/app/coffee/modules/auth.coffee @@ -1,3 +1,4 @@ +### # Copyright (C) 2014 Andrey Antukh # Copyright (C) 2014 Jesús Espino Garcia # Copyright (C) 2014 David Barragán Merino @@ -14,6 +15,9 @@ # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . +# +# File: modules/auth.coffee +### taiga = @.taiga diff --git a/app/coffee/modules/base/model.coffee b/app/coffee/modules/base/model.coffee index 6bf52738..f17022c9 100644 --- a/app/coffee/modules/base/model.coffee +++ b/app/coffee/modules/base/model.coffee @@ -1,3 +1,4 @@ +### # Copyright (C) 2014 Andrey Antukh # Copyright (C) 2014 Jesús Espino Garcia # Copyright (C) 2014 David Barragán Merino @@ -14,6 +15,9 @@ # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . +# +# File: modules/base/model.coffee +### class Model constructor: (name, data, dataTypes) -> From ad58f609cef3164d296b5ec2642d24e828240690 Mon Sep 17 00:00:00 2001 From: Juanfran Date: Fri, 20 Jun 2014 12:30:47 +0200 Subject: [PATCH 54/64] project functionalities --- app/partials/functionalities.jade | 63 +++++++++++++++++++ app/styles/main.scss | 1 + app/styles/modules/admin-functionalities.scss | 32 ++++++++++ 3 files changed, 96 insertions(+) create mode 100644 app/partials/functionalities.jade create mode 100644 app/styles/modules/admin-functionalities.scss diff --git a/app/partials/functionalities.jade b/app/partials/functionalities.jade new file mode 100644 index 00000000..11f99240 --- /dev/null +++ b/app/partials/functionalities.jade @@ -0,0 +1,63 @@ +extends layout + +block head + title Taiga Project management web application with scrum in mind! + +block content + div.wrapper + sidebar.menu-secondary.sidebar + include views/modules/admin-menu + sidebar.menu-tertiary.sidebar + include views/modules/admin-submenu + + section.main.admin-functionalities + header + include views/components/mainTitle + + section + div.functionality + div.icon.icon-backlog + div.desc + p + span Backlog + | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean sagittis quam augue, quis bibendum lectus porta eget. Nunc dictum imperdiet venenatis. Curabitur vitae augue ut est rhoncus pellentesque. Nunc sed ultricies est, tincidunt euismod nunc. Nunc nec posuere metus. + + div.functionality.active + div.icon.icon-kanban + div.desc + p + span Kanban + | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean sagittis quam augue, quis bibendum lectus porta eget. Nunc dictum imperdiet venenatis. Curabitur vitae augue ut est rhoncus pellentesque. Nunc sed ultricies est, tincidunt euismod nunc. Nunc nec posuere metus. + + div.functionality + div.icon.icon-issues + div.desc + p + span Issues + | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean sagittis quam augue, quis bibendum lectus porta eget. Nunc dictum imperdiet venenatis. Curabitur vitae augue ut est rhoncus pellentesque. Nunc sed ultricies est, tincidunt euismod nunc. Nunc nec posuere metus. + + div.functionality.active + div.icon.icon-wiki + div.desc + p + span Wiki + | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean sagittis quam augue, quis bibendum lectus porta eget. Nunc dictum imperdiet venenatis. Curabitur vitae augue ut est rhoncus pellentesque. Nunc sed ultricies est, tincidunt euismod nunc. Nunc nec posuere metus. + + div.functionality.active + div.icon.icon-video + div.desc + p + span Video + | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean sagittis quam augue, quis bibendum lectus porta eget. Nunc dictum imperdiet venenatis. Curabitur vitae augue ut est rhoncus pellentesque. Nunc sed ultricies est, tincidunt euismod nunc. Nunc nec posuere metus. + + select + option Option 1 + option Option 2 + option Option 3 + option Option 4 + + select + option Option 1 + option Option 2 + option Option 3 + option Option 4 diff --git a/app/styles/main.scss b/app/styles/main.scss index f2b5f961..c828796a 100755 --- a/app/styles/main.scss +++ b/app/styles/main.scss @@ -39,6 +39,7 @@ $prefix-for-spec: true; @import 'modules/admin-submenu'; @import 'modules/admin-membership'; @import 'modules/admin-roles'; +@import 'modules/admin-functionalities'; @import 'modules/category-config'; @import 'modules/project-details'; diff --git a/app/styles/modules/admin-functionalities.scss b/app/styles/modules/admin-functionalities.scss new file mode 100644 index 00000000..16e0902b --- /dev/null +++ b/app/styles/modules/admin-functionalities.scss @@ -0,0 +1,32 @@ +.admin-functionalities { + .functionality { + background-color: $whitish; + display: flex; + margin-bottom: 1rem; + padding: 2rem; + .icon, + .desc { + opacity: .5; + } + p { + margin-bottom: 0; + } + span { + font-weight: bold; + } + select { + margin-top: 1rem; + } + &.active { + background-color: #e9f0da; + div, + p { + opacity: 1; + } + } + } + .icon { + @extend %xxlarge; + margin-right: 2rem; + } +} From 27c8ba8a9259c878cb492f3be1e0bb51f31cea48 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Fri, 20 Jun 2014 13:39:05 +0200 Subject: [PATCH 55/64] Now drag and drop works on backlog. --- app/coffee/modules/backlog/main.coffee | 188 +++++- app/coffee/modules/base/model.coffee | 6 +- app/coffee/modules/base/repository.coffee | 14 +- app/js/Sortable.js | 538 ++++++++++++++++++ .../views/components/backlog-row.jade | 2 +- app/partials/views/modules/sprints.jade | 2 +- gulpfile.coffee | 26 +- 7 files changed, 735 insertions(+), 41 deletions(-) create mode 100644 app/js/Sortable.js diff --git a/app/coffee/modules/backlog/main.coffee b/app/coffee/modules/backlog/main.coffee index 10fd7809..44110645 100644 --- a/app/coffee/modules/backlog/main.coffee +++ b/app/coffee/modules/backlog/main.coffee @@ -79,34 +79,184 @@ class BacklogController extends mixOf(taiga.Controller, taiga.PageMixin) when "bulk" then @rootscope.$broadcast("usform:bulk") -BacklogDirective = -> +BacklogDirective = ($repo) -> + linkSortable = ($scope, $el, $attrs, $ctrl) -> + resortAndSave = -> + toSave = [] + for item, i in $scope.userstories + if item.order == i + continue + item.order = i + + toSave = _.filter($scope.userstories, (x) -> x.isModified()) + $repo.saveAll(toSave).then -> + console.log "FINISHED", arguments + + onUpdateItem = (event) -> + console.log "onUpdate", event + + item = angular.element(event.item) + itemScope = item.scope() + + ids = _.map($scope.userstories, "id") + index = ids.indexOf(itemScope.us.id) + + $scope.userstories.splice(index, 1) + $scope.userstories.splice(item.index(), 0, itemScope.us) + + resortAndSave() + + onAddItem = (event) -> + console.log "BacklogDirective:onAdd", event + + item = angular.element(event.item) + itemScope = item.scope() + itemIndex = item.index() + + itemScope.us.milestone = null + userstories = $scope.userstories + userstories.splice(itemIndex, 0, itemScope.us) + + item.remove() + item.off() + + $scope.$apply() + resortAndSave() + + onRemoveItem = (event) -> + item = angular.element(event.item) + itemScope = item.scope() + + ids = _.map($scope.userstories, "id") + index = ids.indexOf(itemScope.us.id) + console.log "BacklogDirective:onRemove:0:", itemScope.us.id, index + + if index != -1 + userstories = $scope.userstories + userstories.splice(index, 1) + + item.off() + itemScope.$destroy() + console.log "BacklogDirective:onRemove:1:", ids + console.log "BacklogDirective:onRemove:2:", _.map($scope.userstories, "id") + + dom = $el.find(".backlog-table-body") + sortable = new Sortable(dom[0], { + group: "Kaka", + selector: ".us-item-row", + onUpdate: onUpdateItem + onAdd: onAddItem + onRemove: onRemoveItem + }) + link = ($scope, $el, $attrs) -> $ctrl = $el.controller() + linkSortable($scope, $el, $attrs, $ctrl) + return {link: link} + +BacklogSprintDirective = ($repo) -> + link = ($scope, $el, $attrs) -> + $ctrl = $el.closest("div.wrapper").controller() + console.log $ctrl + + sprint = $scope.$eval($attrs.tgBacklogSprint) + if $scope.$first + $el.addClass("sprint-current") + + # if sprint.closed + # $el.addClass("sprint-closed") + + # Event Handlers + $el.on "click", ".sprint-summary > a", (event) -> + $el.find(".sprint-table").toggle() + + $scope.$on "$destroy", -> + $el.off() + + # Drag & Drop + + resortAndSave = -> + toSave = [] + for item, i in $scope.sprint.user_stories + if item.order == i + continue + item.order = i + + toSave = _.filter($scope.sprint.user_stories, (x) -> x.isModified()) + $repo.saveAll(toSave).then -> + console.log "FINISHED", arguments + + onUpdateItem = (event) -> + console.log "onUpdate", event + + item = angular.element(event.item) + itemScope = item.scope() + + ids = _.map($scope.sprint.user_stories, {"id": itemScope.us.id}) + index = ids.indexOf(itemScope.us.id) + + $scope.sprint.user_stories.splice(index, 1) + $scope.sprint.user_stories.splice(item.index(), 0, itemScope.us) + resortAndSave() + + onAddItem = (event) -> + console.log "onAdd", event + + item = angular.element(event.item) + itemScope = item.scope() + itemIndex = item.index() + + itemScope.us.milestone = $scope.sprint.id + userstories = $scope.sprint.user_stories + userstories.splice(itemIndex, 0, itemScope.us) + + item.remove() + item.off() + + $scope.$apply() + resortAndSave() + + onRemoveItem = (event) -> + console.log "BacklogSprintDirective:onRemove", event + + item = angular.element(event.item) + itemScope = item.scope() + + ids = _.map($scope.sprint.user_stories, "id") + index = ids.indexOf(itemScope.us.id) + + console.log "BacklogSprintDirective:onRemove:0:", itemScope.us.id, index + + if index != -1 + userstories = $scope.sprint.user_stories + userstories.splice(index, 1) + + item.off() + itemScope.$destroy() + console.log "BacklogSprintDirective:onRemove:1", ids + console.log "BacklogSprintDirective:onRemove:2", _.map($scope.sprint.user_stories, "id") + + dom = $el.find(".sprint-table") + sortable = new Sortable(dom[0], { + group: "Kaka", + selector: ".milestone-us-item-row", + onUpdate: onUpdateItem, + onAdd: onAddItem, + onRemove: onRemoveItem, + }) + + return {link: link} + + BacklogSummaryDirective = -> link = ($scope, $el, $attrs) -> return {link:link} -BacklogSprintDirective = -> - link = (scope, element, attrs) -> - sprint = scope.$eval(attrs.tgBacklogSprint) - if scope.$first - element.addClass("sprint-current") - - if sprint.closed - element.addClass("sprint-closed") - - # Event Handlers - element.on "click", ".sprint-summary > a", (event) -> - element.find(".sprint-table").toggle() - - return {link: link} - - module = angular.module("taigaBacklog") -module.directive("tgBacklog", BacklogDirective) -module.directive("tgBacklogSprint", BacklogSprintDirective) +module.directive("tgBacklog", ["$tgRepo", BacklogDirective]) +module.directive("tgBacklogSprint", ["$tgRepo", BacklogSprintDirective]) module.directive("tgBacklogSummary", BacklogSummaryDirective) module.controller("BacklogController", [ diff --git a/app/coffee/modules/base/model.coffee b/app/coffee/modules/base/model.coffee index f17022c9..9deee420 100644 --- a/app/coffee/modules/base/model.coffee +++ b/app/coffee/modules/base/model.coffee @@ -39,8 +39,8 @@ class Model getIdAttrName: -> return "id" - getUrl: -> - return "#{$gmUrls.api(@_name)}/#{@.getAttrs()[@.getIdAttrName()]}" + getName: -> + return @._name getAttrs: (patch=false) -> if patch @@ -101,7 +101,7 @@ class Model return JSON.stringify(data) - isModified: () -> + isModified: -> return this._isModified markSaved: () -> diff --git a/app/coffee/modules/base/repository.coffee b/app/coffee/modules/base/repository.coffee index a430f643..731d4d5a 100644 --- a/app/coffee/modules/base/repository.coffee +++ b/app/coffee/modules/base/repository.coffee @@ -29,7 +29,7 @@ class RepositoryService extends taiga.Service resolveUrlForModel: (model) -> idAttrName = model.getIdAttrName() - return "#{@urls.resolve(model.name)}/#{model[idAttrName]}" + return "#{@urls.resolve(model.getName())}/#{model[idAttrName]}" create: (name, data, dataTypes={}, extraParams={}) -> defered = @q.defer() @@ -45,7 +45,7 @@ class RepositoryService extends taiga.Service return defered.promise remove: (model) -> - defered = $q.defer() + defered = @q.defer() url = @.resolveUrlForModel(model) promise = @http.delete(url) @@ -57,8 +57,12 @@ class RepositoryService extends taiga.Service return defered.promise - save: (model, extraParams, patch=true) -> - defered = $q.defer() + saveAll: (models, patch=true) -> + promises = _.map(models, (x) => @.save(x, true)) + return @q.all.apply(@q, promises) + + save: (model, patch=true) -> + defered = @q.defer() if not model.isModified() and patch defered.resolve(model) @@ -86,7 +90,7 @@ class RepositoryService extends taiga.Service return defered.promise refresh: (model) -> - defered = $q.defer() + defered = @q.defer() url = @.resolveUrlForModel(model) promise = @http.get(url) diff --git a/app/js/Sortable.js b/app/js/Sortable.js new file mode 100644 index 00000000..cb5d0cfa --- /dev/null +++ b/app/js/Sortable.js @@ -0,0 +1,538 @@ +/**! + * Sortable + * @author RubaXa + * @license MIT + */ + + +(function (factory){ + "use strict"; + + if( typeof define === "function" && define.amd ){ + define(factory); + } + else if( typeof module != "undefined" && typeof module.exports != "undefined" ){ + module.exports = factory(); + } + else { + window["Sortable"] = factory(); + } +})(function (){ + "use strict"; + + var + dragEl + , ghostEl + , rootEl + , nextEl + + , lastEl + , lastCSS + , lastRect + + , activeGroup + + , tapEvt + , touchEvt + + , expando = 'Sortable' + (new Date).getTime() + + , win = window + , document = win.document + , parseInt = win.parseInt + , _silent = false + + , _createEvent = function (event/**String*/, item/**HTMLElement*/){ + var evt = document.createEvent('Event'); + evt.initEvent(event, true, true); + evt.item = item; + return evt; + } + + , noop = function (){} + , slice = [].slice + + , touchDragOverListeners = [] + ; + + + /** + * @class Sortable + * @param {HTMLElement} el + * @param {Object} [options] + * @constructor + */ + function Sortable(el, options){ + this.el = el; // root element + this.options = options = (options || {}); + + + // Defaults + options.group = options.group || Math.random(); + options.handle = options.handle || null; + options.draggable = options.draggable || el.children[0] && el.children[0].nodeName || (/[uo]l/i.test(el.nodeName) ? 'li' : '*'); + options.ghostClass = options.ghostClass || 'sortable-ghost'; + + options.onAdd = _bind(this, options.onAdd || noop); + options.onUpdate = _bind(this, options.onUpdate || noop); + options.onRemove = _bind(this, options.onRemove || noop); + + + // Export group name + el[expando] = options.group; + + + // Bind all private methods + for( var fn in this ){ + if( fn.charAt(0) === '_' ){ + this[fn] = _bind(this, this[fn]); + } + } + + + // Bind events + _on(el, 'add', options.onAdd); + _on(el, 'update', options.onUpdate); + _on(el, 'remove', options.onRemove); + + _on(el, 'mousedown', this._onTapStart); + _on(el, 'touchstart', this._onTapStart); + _on(el, 'selectstart', this._onTapStart); + + _on(el, 'dragover', this._onDragOver); + _on(el, 'dragenter', this._onDragOver); + + touchDragOverListeners.push(this._onDragOver); + } + + + Sortable.prototype = { + constructor: Sortable, + + + _applyEffects: function (){ + _toggleClass(dragEl, this.options.ghostClass, true); + }, + + + _onTapStart: function (evt/**Event|TouchEvent*/){ + var + touch = evt.touches && evt.touches[0] + , target = (touch || evt).target + , options = this.options + , el = this.el + ; + + if( options.handle ){ + target = _closest(target, options.handle, el); + } + + target = _closest(target, options.draggable, el); + + // IE 9 Support + // if( target && evt.type == 'selectstart' ){ + // if( target.tagName != 'A' && target.tagName != 'IMG'){ + // target.dragDrop(); + // } + // } + + if( target && !dragEl && (target.parentNode === el) ){ + tapEvt = evt; + target.draggable = true; + + + // Disable "draggable" + _find(target, 'a', _disableDraggable); + _find(target, 'img', _disableDraggable); + + + if( touch ){ + // Touch device support + tapEvt = { + target: target + , clientX: touch.clientX + , clientY: touch.clientY + }; + this._onDragStart(tapEvt, true); + evt.preventDefault(); + } + + + _on(this.el, 'dragstart', this._onDragStart); + _on(this.el, 'dragend', this._onDrop); + _on(document, 'dragover', _globalDragOver); + + + try { + if( document.selection ){ + document.selection.empty(); + } else { + window.getSelection().removeAllRanges() + } + } catch (err){ } + } + }, + + + _emulateDragOver: function (){ + if( touchEvt ){ + _css(ghostEl, 'display', 'none'); + + var + target = document.elementFromPoint(touchEvt.clientX, touchEvt.clientY) + , parent = target + , group = this.options.group + , i = touchDragOverListeners.length + ; + + do { + if( parent[expando] === group ){ + while( i-- ){ + touchDragOverListeners[i]({ + clientX: touchEvt.clientX, + clientY: touchEvt.clientY, + target: target, + rootEl: parent + }); + } + break; + } + + target = parent; // store last element + } + while( parent = parent.parentNode ); + + _css(ghostEl, 'display', ''); + } + }, + + + _onTouchMove: function (evt/**TouchEvent*/){ + if( tapEvt ){ + var + touch = evt.touches[0] + , dx = touch.clientX - tapEvt.clientX + , dy = touch.clientY - tapEvt.clientY + ; + + touchEvt = touch; + _css(ghostEl, 'webkitTransform', 'translate3d('+dx+'px,'+dy+'px,0)'); + } + }, + + + _onDragStart: function (evt/**Event*/, isTouch/**Boolean*/){ + var + target = evt.target + , dataTransfer = evt.dataTransfer + ; + + rootEl = this.el; + dragEl = target; + nextEl = target.nextSibling; + activeGroup = this.options.group; + + if( isTouch ){ + var + rect = target.getBoundingClientRect() + , css = _css(target) + , ghostRect + ; + + ghostEl = target.cloneNode(true); + + _css(ghostEl, 'top', rect.top - parseInt(css.marginTop, 10)); + _css(ghostEl, 'left', rect.left - parseInt(css.marginLeft, 10)); + _css(ghostEl, 'width', rect.width); + _css(ghostEl, 'height', rect.height); + _css(ghostEl, 'opacity', '0.8'); + _css(ghostEl, 'position', 'fixed'); + _css(ghostEl, 'zIndex', '100000'); + + rootEl.appendChild(ghostEl); + + // Fixing dimensions. + ghostRect = ghostEl.getBoundingClientRect(); + _css(ghostEl, 'width', rect.width*2 - ghostRect.width); + _css(ghostEl, 'height', rect.height*2 - ghostRect.height); + + // Bind touch events + _on(document, 'touchmove', this._onTouchMove); + _on(document, 'touchend', this._onDrop); + + this._loopId = setInterval(this._emulateDragOver, 150); + } + else { + dataTransfer.effectAllowed = 'move'; + dataTransfer.setData('Text', target.textContent); + + _on(document, 'drop', this._onDrop); + } + + setTimeout(this._applyEffects); + }, + + + _onDragOver: function (evt/**Event*/){ + if( !_silent && (activeGroup === this.options.group) && (evt.rootEl === void 0 || evt.rootEl === this.el) ){ + var + el = this.el + , target = _closest(evt.target, this.options.draggable, el) + ; + + if( el.children.length === 0 || el.children[0] === ghostEl || (el === evt.target) && _ghostInBottom(el, evt) ){ + el.appendChild(dragEl); + } + else if( target && target !== dragEl && (target.parentNode[expando] !== void 0) ){ + if( lastEl !== target ){ + lastEl = target; + lastCSS = _css(target); + lastRect = target.getBoundingClientRect(); + } + + + var + rect = lastRect + , width = rect.right - rect.left + , height = rect.bottom - rect.top + , floating = /left|right|inline/.test(lastCSS.cssFloat + lastCSS.display) + , skew = (floating ? (evt.clientX - rect.left)/width : (evt.clientY - rect.top)/height) > .5 + , isWide = (target.offsetWidth > dragEl.offsetWidth) + , isLong = (target.offsetHeight > dragEl.offsetHeight) + , nextSibling = target.nextSibling + , after + ; + + _silent = true; + setTimeout(_unsilent, 30); + + if( floating ){ + after = (target.previousElementSibling === dragEl) && !isWide || (skew > .5) && isWide + } else { + after = (target.nextElementSibling !== dragEl) && !isLong || (skew > .5) && isLong; + } + + if( after && !nextSibling ){ + el.appendChild(dragEl); + } else { + target.parentNode.insertBefore(dragEl, after ? nextSibling : target); + } + } + } + }, + + + _onDrop: function (evt/**Event*/){ + clearInterval(this._loopId); + + // Unbind events + _off(document, 'drop', this._onDrop); + _off(document, 'dragover', _globalDragOver); + + _off(this.el, 'dragend', this._onDrop); + _off(this.el, 'dragstart', this._onDragStart); + _off(this.el, 'selectstart', this._onTapStart); + + _off(document, 'touchmove', this._onTouchMove); + _off(document, 'touchend', this._onDrop); + + + if( evt ){ + evt.preventDefault(); + evt.stopPropagation(); + + if( ghostEl ){ + ghostEl.parentNode.removeChild(ghostEl); + } + + if( dragEl ){ + _toggleClass(dragEl, this.options.ghostClass, false); + + if( !rootEl.contains(dragEl) ){ + // Remove event + rootEl.dispatchEvent(_createEvent('remove', dragEl)); + + // Add event + dragEl.dispatchEvent(_createEvent('add', dragEl)); + } + else if( dragEl.nextSibling !== nextEl ){ + // Update event + dragEl.dispatchEvent(_createEvent('update', dragEl)); + } + } + + // Set NULL + rootEl = + dragEl = + ghostEl = + nextEl = + + tapEvt = + touchEvt = + + lastEl = + lastCSS = + + activeGroup = null; + } + }, + + + destroy: function (){ + var el = this.el, options = this.options; + + _off(el, 'add', options.onAdd); + _off(el, 'update', options.onUpdate); + _off(el, 'remove', options.onRemove); + + _off(el, 'mousedown', this._onTapStart); + _off(el, 'touchstart', this._onTapStart); + _off(el, 'selectstart', this._onTapStart); + + _off(el, 'dragover', this._onDragOver); + _off(el, 'dragenter', this._onDragOver); + + //remove draggable attributes + Array.prototype.forEach.call(el.querySelectorAll('[draggable]'), function(el) { + el.removeAttribute('draggable'); + }); + + touchDragOverListeners.splice(touchDragOverListeners.indexOf(this._onDragOver), 1); + + this._onDrop(); + + this.el = null; + } + }; + + + function _bind(ctx, fn){ + var args = slice.call(arguments, 2); + return fn.bind ? fn.bind.apply(fn, [ctx].concat(args)) : function (){ + return fn.apply(ctx, args.concat(slice.call(arguments))); + }; + } + + + function _closest(el, selector, ctx){ + if( selector === '*' ){ + return el; + } + else if( el ){ + ctx = ctx || document; + selector = selector.split('.'); + + var + tag = selector.shift().toUpperCase() + , re = new RegExp('\\s('+selector.join('|')+')\\s', 'g') + ; + + do { + if( + (tag === '' || el.nodeName == tag) + && (!selector.length || ((' '+el.className+' ').match(re) || []).length == selector.length) + ){ + return el; + } + } + while( el !== ctx && (el = el.parentNode) ); + } + + return null; + } + + + function _globalDragOver(evt){ + evt.dataTransfer.dropEffect = 'move'; + evt.preventDefault(); + } + + + function _on(el, event, fn){ + el.addEventListener(event, fn, false); + } + + + function _off(el, event, fn){ + el.removeEventListener(event, fn, false); + } + + + function _toggleClass(el, name, state){ + if( el ){ + if( el.classList ){ + el.classList[state ? 'add' : 'remove'](name); + } + else { + var className = (' '+el.className+' ').replace(/\s+/g, ' ').replace(' '+name+' ', ''); + el.className = className + (state ? ' '+name : '') + } + } + } + + + function _css(el, prop, val){ + if( el && el.style ){ + if( val === void 0 ){ + if( document.defaultView && document.defaultView.getComputedStyle ){ + val = document.defaultView.getComputedStyle(el, ''); + } + else if( el.currentStyle ){ + val = el.currentStyle; + } + return prop === void 0 ? val : val[prop]; + } else { + el.style[prop] = val + (typeof val === 'string' ? '' : 'px'); + } + } + } + + + function _find(ctx, tagName, iterator){ + if( ctx ){ + var list = ctx.getElementsByTagName(tagName), i = 0, n = list.length; + if( iterator ){ + for( ; i < n; i++ ){ + iterator(list[i], i); + } + } + return list; + } + return []; + } + + + function _disableDraggable(el){ + return el.draggable = false; + } + + + function _unsilent(){ + _silent = false; + } + + + function _ghostInBottom(el, evt){ + var last = el.lastElementChild.getBoundingClientRect(); + return evt.clientY - (last.top + last.height) > 5; // min delta + } + + + + // Export utils + Sortable.utils = { + on: _on, + off: _off, + css: _css, + find: _find, + bind: _bind, + closest: _closest, + toggleClass: _toggleClass + }; + + + Sortable.version = '0.1.8'; + + // Export + return Sortable; +}); diff --git a/app/partials/views/components/backlog-row.jade b/app/partials/views/components/backlog-row.jade index 0bf700f6..4eb592c4 100644 --- a/app/partials/views/components/backlog-row.jade +++ b/app/partials/views/components/backlog-row.jade @@ -1,4 +1,4 @@ -div.row(ng-repeat="us in userstories") +div.row.us-item-row(ng-repeat="us in userstories track by us.id") div.user-stories div.user-story-name input(type="checkbox", name="") diff --git a/app/partials/views/modules/sprints.jade b/app/partials/views/modules/sprints.jade index 230349cd..553045d2 100644 --- a/app/partials/views/modules/sprints.jade +++ b/app/partials/views/modules/sprints.jade @@ -26,7 +26,7 @@ section.sprints div.sprint-progress-bar div.current-progress div.sprint-table - div.row(ng-repeat="us in sprint.user_stories track by us.id") + div.row.milestone-us-item-row(ng-repeat="us in sprint.user_stories track by us.id") div.column-us.width-8 a.us-name(href="", title="") span(tg-bo-ref="us.ref") diff --git a/gulpfile.coffee b/gulpfile.coffee index 4651a996..c761bb0a 100644 --- a/gulpfile.coffee +++ b/gulpfile.coffee @@ -41,21 +41,22 @@ paths = { "app/coffee/modules/locales/*.coffee", "app/coffee/modules/base/*.coffee", "app/coffee/modules/resources/*.coffee"] + vendorJsLibs: [ + "app/vendor/jquery/dist/jquery.js", + "app/vendor/lodash/dist/lodash.js", + "app/vendor/emoticons/lib/emoticons.js", + "app/vendor/underscore.string/lib/underscore.string.js", + "app/vendor/angular/angular.js", + "app/vendor/angular-route/angular-route.js", + "app/vendor/angular-sanitize/angular-sanitize.js", + "app/vendor/angular-animate/angular-animate.js", + "app/vendor/i18next/i18next.js", + "app/js/Sortable.js" + ] } # Ordered list of vendor/external libraries. -vendorJsLibs = [ - "app/vendor/jquery/dist/jquery.js", - "app/vendor/lodash/dist/lodash.js", - "app/vendor/emoticons/lib/emoticons.js", - "app/vendor/underscore.string/lib/underscore.string.js", - "app/vendor/angular/angular.js", - "app/vendor/angular-route/angular-route.js", - "app/vendor/angular-sanitize/angular-sanitize.js", - "app/vendor/angular-animate/angular-animate.js", - "app/vendor/i18next/i18next.js" -] ############################################################################## @@ -123,7 +124,7 @@ gulp.task "coffee", -> .pipe(gulp.dest("dist/js/")) gulp.task "jslibs", -> - gulp.src(vendorJsLibs) + gulp.src(paths.vendorJsLibs) .pipe(plumber()) .pipe(concat("libs.js")) .pipe(gulp.dest("dist/js/")) @@ -166,6 +167,7 @@ gulp.task "watch", -> gulp.watch(paths.jade, ["jade"]) gulp.watch(paths.appStyles, ["scss-lint", "sass", "css"]) gulp.watch(paths.coffee, ["coffee"]) + gulp.watch(paths.vendorJsLibs, ["jslibs"]) gulp.watch(paths.locales, ["locales"]) From 97e1038b5d4c1dc4fbe03572efd0de34bf275752 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Fri, 20 Jun 2014 13:49:26 +0200 Subject: [PATCH 56/64] Remove console logs. --- app/coffee/modules/backlog/main.coffee | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/app/coffee/modules/backlog/main.coffee b/app/coffee/modules/backlog/main.coffee index 44110645..65d2b119 100644 --- a/app/coffee/modules/backlog/main.coffee +++ b/app/coffee/modules/backlog/main.coffee @@ -107,8 +107,6 @@ BacklogDirective = ($repo) -> resortAndSave() onAddItem = (event) -> - console.log "BacklogDirective:onAdd", event - item = angular.element(event.item) itemScope = item.scope() itemIndex = item.index() @@ -129,7 +127,6 @@ BacklogDirective = ($repo) -> ids = _.map($scope.userstories, "id") index = ids.indexOf(itemScope.us.id) - console.log "BacklogDirective:onRemove:0:", itemScope.us.id, index if index != -1 userstories = $scope.userstories @@ -137,12 +134,10 @@ BacklogDirective = ($repo) -> item.off() itemScope.$destroy() - console.log "BacklogDirective:onRemove:1:", ids - console.log "BacklogDirective:onRemove:2:", _.map($scope.userstories, "id") dom = $el.find(".backlog-table-body") sortable = new Sortable(dom[0], { - group: "Kaka", + group: "backlog", selector: ".us-item-row", onUpdate: onUpdateItem onAdd: onAddItem @@ -159,14 +154,13 @@ BacklogDirective = ($repo) -> BacklogSprintDirective = ($repo) -> link = ($scope, $el, $attrs) -> $ctrl = $el.closest("div.wrapper").controller() - console.log $ctrl sprint = $scope.$eval($attrs.tgBacklogSprint) if $scope.$first $el.addClass("sprint-current") - # if sprint.closed - # $el.addClass("sprint-closed") + if sprint.closed + $el.addClass("sprint-closed") # Event Handlers $el.on "click", ".sprint-summary > a", (event) -> @@ -189,8 +183,6 @@ BacklogSprintDirective = ($repo) -> console.log "FINISHED", arguments onUpdateItem = (event) -> - console.log "onUpdate", event - item = angular.element(event.item) itemScope = item.scope() @@ -202,8 +194,6 @@ BacklogSprintDirective = ($repo) -> resortAndSave() onAddItem = (event) -> - console.log "onAdd", event - item = angular.element(event.item) itemScope = item.scope() itemIndex = item.index() @@ -219,28 +209,22 @@ BacklogSprintDirective = ($repo) -> resortAndSave() onRemoveItem = (event) -> - console.log "BacklogSprintDirective:onRemove", event - item = angular.element(event.item) itemScope = item.scope() ids = _.map($scope.sprint.user_stories, "id") index = ids.indexOf(itemScope.us.id) - console.log "BacklogSprintDirective:onRemove:0:", itemScope.us.id, index - if index != -1 userstories = $scope.sprint.user_stories userstories.splice(index, 1) item.off() itemScope.$destroy() - console.log "BacklogSprintDirective:onRemove:1", ids - console.log "BacklogSprintDirective:onRemove:2", _.map($scope.sprint.user_stories, "id") dom = $el.find(".sprint-table") sortable = new Sortable(dom[0], { - group: "Kaka", + group: "backlog", selector: ".milestone-us-item-row", onUpdate: onUpdateItem, onAdd: onAddItem, From f6cd65998c5743b840f0dd102bb2a1601c732172 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Fri, 20 Jun 2014 15:15:30 +0200 Subject: [PATCH 57/64] Initial work on filters. --- app/coffee/modules/backlog/main.coffee | 20 ++++++++++++++++ app/coffee/modules/base/filters.coffee | 32 ++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 app/coffee/modules/base/filters.coffee diff --git a/app/coffee/modules/backlog/main.coffee b/app/coffee/modules/backlog/main.coffee index 65d2b119..f8091c8e 100644 --- a/app/coffee/modules/backlog/main.coffee +++ b/app/coffee/modules/backlog/main.coffee @@ -79,7 +79,16 @@ class BacklogController extends mixOf(taiga.Controller, taiga.PageMixin) when "bulk" then @rootscope.$broadcast("usform:bulk") +############################################################################# +## Backlog Directive +############################################################################# + BacklogDirective = ($repo) -> + + ######################### + ## Drag & Drop Link + ######################### + linkSortable = ($scope, $el, $attrs, $ctrl) -> resortAndSave = -> toSave = [] @@ -144,12 +153,23 @@ BacklogDirective = ($repo) -> onRemove: onRemoveItem }) + ######################### + ## Filters Link + ######################### + + linkFilters = ($scope, $el, $attrs, $ctrl) -> + console.log "TODO" + link = ($scope, $el, $attrs) -> $ctrl = $el.controller() linkSortable($scope, $el, $attrs, $ctrl) + linkFilters($scope, $el, $attrs, $ctrl) return {link: link} +############################################################################# +## Sprint Directive +############################################################################# BacklogSprintDirective = ($repo) -> link = ($scope, $el, $attrs) -> diff --git a/app/coffee/modules/base/filters.coffee b/app/coffee/modules/base/filters.coffee new file mode 100644 index 00000000..8cb68479 --- /dev/null +++ b/app/coffee/modules/base/filters.coffee @@ -0,0 +1,32 @@ +### +# Copyright (C) 2014 Andrey Antukh +# Copyright (C) 2014 Jesús Espino Garcia +# Copyright (C) 2014 David Barragán Merino +# +# 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 . +# +# File: modules/base/filters.coffee +### + + +taiga = @.taiga + +class FiltersStorageService extends taiga.Service + @.$inject = ["$tgStorage", "$routeParams"] + + constructor: (@storage, @params) -> + + generateHash: (components=[]) -> + components = _.map(components, (x) -> JSON.stringify(x)) + return hex_sha1(components.join(":")) From 210b0db1bb9a50196c7110d49bdebb5409aaeee2 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Sat, 21 Jun 2014 11:48:38 +0200 Subject: [PATCH 58/64] Properly inheritance on config service. --- app/coffee/config.coffee | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/coffee/config.coffee b/app/coffee/config.coffee index a907d50f..fcc145e1 100644 --- a/app/coffee/config.coffee +++ b/app/coffee/config.coffee @@ -19,7 +19,9 @@ # File: config.coffee ### -class ConfigService +taiga = @.taiga + +class ConfigService extends taiga.Service defaults: { host: "localhost:8000" scheme: "http" From c43197420aa0912bbe39b2a1d83b0be53586482b Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Sat, 21 Jun 2014 11:49:04 +0200 Subject: [PATCH 59/64] Initial version of filters on backlog. --- app/coffee/modules/backlog/main.coffee | 42 ++++++++++++++++++- app/partials/backlog.jade | 2 +- .../views/components/backlog-row.jade | 2 +- app/partials/views/components/filter.jade | 2 + app/partials/views/modules/filters.jade | 8 ++-- app/styles/components/filter.scss | 5 +++ 6 files changed, 54 insertions(+), 7 deletions(-) diff --git a/app/coffee/modules/backlog/main.coffee b/app/coffee/modules/backlog/main.coffee index f8091c8e..6ba3f686 100644 --- a/app/coffee/modules/backlog/main.coffee +++ b/app/coffee/modules/backlog/main.coffee @@ -39,6 +39,9 @@ class BacklogController extends mixOf(taiga.Controller, taiga.PageMixin) loadUserstories: -> return @rs.userstories.listUnassigned(@scope.projectId).then (userstories) => @scope.userstories = userstories + @scope.filters = @.generateFilters() + + @.filterVisibleUserstories() return userstories loadBacklog: -> @@ -64,6 +67,27 @@ class BacklogController extends mixOf(taiga.Controller, taiga.PageMixin) .then(=> @.loadUsersAndRoles()) .then(=> @.loadBacklog()) + filterVisibleUserstories: -> + selectedTags = _.filter(@scope.filters.tags, "selected") + selectedTags = _.map(selectedTags, "name") + + @scope.visibleUserstories = [] + + if selectedTags.length == 0 + @scope.visibleUserstories = _.clone(@scope.userstories, false) + else + @scope.visibleUserstories = _.reject @scope.userstories, (us) => + if _.intersection(selectedTags, us.tags).length == 0 + return true + else + return false + + generateFilters: -> + filters = {} + plainTags = _.flatten(_.map(@scope.userstories, "tags")) + filters.tags = _.map(_.countBy(plainTags), (v, k) -> {name: k, count:v}) + return filters + ## Template actions deleteUserStory: (us) -> @@ -84,7 +108,6 @@ class BacklogController extends mixOf(taiga.Controller, taiga.PageMixin) ############################################################################# BacklogDirective = ($repo) -> - ######################### ## Drag & Drop Link ######################### @@ -158,13 +181,28 @@ BacklogDirective = ($repo) -> ######################### linkFilters = ($scope, $el, $attrs, $ctrl) -> - console.log "TODO" + $scope.filtersSearch = {} + $el.on "click", "#show-filters-button", (event) -> + event.preventDefault() + $el.find("sidebar.filters-bar").toggle() + + $el.on "click", "section.filters a.single-filter", (event) -> + event.preventDefault() + target = angular.element(event.currentTarget) + targetScope = target.scope() + + $scope.$apply -> + targetScope.tag.selected = not (targetScope.tag.selected or false) + $ctrl.filterVisibleUserstories() link = ($scope, $el, $attrs) -> $ctrl = $el.controller() linkSortable($scope, $el, $attrs, $ctrl) linkFilters($scope, $el, $attrs, $ctrl) + $scope.$on "$destroy", -> + $el.off() + return {link: link} ############################################################################# diff --git a/app/partials/backlog.jade b/app/partials/backlog.jade index d6a42475..7d3ebc06 100644 --- a/app/partials/backlog.jade +++ b/app/partials/backlog.jade @@ -15,7 +15,7 @@ block content a.trans-button(href="", title="Move to Current Sprint") span.icon.icon-move span.text Move to current Sprint - a.trans-button(href="", title="Show Filters") + a.trans-button(href="", title="Show Filters", id="show-filters-button") span.icon.icon-filter span.text Show Filters a.trans-button(href="", title="Show Tags") diff --git a/app/partials/views/components/backlog-row.jade b/app/partials/views/components/backlog-row.jade index 4eb592c4..213d19e8 100644 --- a/app/partials/views/components/backlog-row.jade +++ b/app/partials/views/components/backlog-row.jade @@ -1,4 +1,4 @@ -div.row.us-item-row(ng-repeat="us in userstories track by us.id") +div.row.us-item-row(ng-repeat="us in visibleUserstories track by us.id") div.user-stories div.user-story-name input(type="checkbox", name="") diff --git a/app/partials/views/components/filter.jade b/app/partials/views/components/filter.jade index a11c32f0..19d8392f 100644 --- a/app/partials/views/components/filter.jade +++ b/app/partials/views/components/filter.jade @@ -1,3 +1,5 @@ +// Depreacted, should be removed when any +// other static template not need it. a.single-filter(href="", title="filter") span.name filter span.number 23 diff --git a/app/partials/views/modules/filters.jade b/app/partials/views/modules/filters.jade index 89363622..c4bfc1d3 100644 --- a/app/partials/views/modules/filters.jade +++ b/app/partials/views/modules/filters.jade @@ -3,8 +3,10 @@ section.filters h1 filters form fieldset - input(type="text", placeholder="Filter Filters") + input(type="text", placeholder="Filter Filters", ng-model="filtersSearch.$") a.icon.icon-search(href="", title="search") div.filter-list - - for (var x = 0; x < 10; x++) - include ../components/filter + a.single-filter(ng-repeat="tag in filters.tags|filter:filtersSearch:strict" + ng-class="{selected: tag.selected}") + span.name(tg-bo-html="tag.name") + span.number(tg-bo-html="tag.count") diff --git a/app/styles/components/filter.scss b/app/styles/components/filter.scss index 66daead2..1e65b688 100644 --- a/app/styles/components/filter.scss +++ b/app/styles/components/filter.scss @@ -12,6 +12,11 @@ color: $grayer; opacity: 1; } + &.selected { + @include transition (opacity .2s linear); + color: $grayer; + opacity: 1; + } .name, .number { padding: 8px 10px; From d7b0b6d1b6d010952c54effb055febbc5491fa27 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Sat, 21 Jun 2014 12:10:48 +0200 Subject: [PATCH 60/64] Open edit form when edit us button clicked. --- app/coffee/modules/backlog/lightboxes.coffee | 2 +- app/coffee/modules/backlog/main.coffee | 3 +++ app/partials/views/components/backlog-row.jade | 2 +- app/partials/views/modules/lightbox_add-new-us.jade | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/coffee/modules/backlog/lightboxes.coffee b/app/coffee/modules/backlog/lightboxes.coffee index 27544d95..47a27275 100644 --- a/app/coffee/modules/backlog/lightboxes.coffee +++ b/app/coffee/modules/backlog/lightboxes.coffee @@ -27,7 +27,7 @@ CreateEditUserstoryDirective = ($repo, $model) -> $scope.us = {"subject": "KAKA"} $el.removeClass("hidden") - $scope.$on "usform:change", (ctx, us) -> + $scope.$on "usform:edit", (ctx, us) -> $el.removeClass("hidden") $scope.us = us diff --git a/app/coffee/modules/backlog/main.coffee b/app/coffee/modules/backlog/main.coffee index 6ba3f686..a66313c2 100644 --- a/app/coffee/modules/backlog/main.coffee +++ b/app/coffee/modules/backlog/main.coffee @@ -90,6 +90,9 @@ class BacklogController extends mixOf(taiga.Controller, taiga.PageMixin) ## Template actions + editUserStory: (us) -> + @rootscope.$broadcast("usform:edit", us) + deleteUserStory: (us) -> title = "Delete User Story" subtitle = us.subject diff --git a/app/partials/views/components/backlog-row.jade b/app/partials/views/components/backlog-row.jade index 213d19e8..6584d786 100644 --- a/app/partials/views/components/backlog-row.jade +++ b/app/partials/views/components/backlog-row.jade @@ -4,7 +4,7 @@ div.row.us-item-row(ng-repeat="us in visibleUserstories track by us.id") input(type="checkbox", name="") a(href="") {{ us.subject }} span.us-settings - a.icon.icon-edit(href="", ng-click="ctrl.deleteUserStory(us)", title="Edit") + a.icon.icon-edit(href="", ng-click="ctrl.editUserStory(us)", title="Edit") a.icon.icon-delete(href="", ng-click="ctrl.deleteUserStory(us)", title="Delete") div.user-story-tags span.tag Tag name diff --git a/app/partials/views/modules/lightbox_add-new-us.jade b/app/partials/views/modules/lightbox_add-new-us.jade index 199c1883..1912f53a 100644 --- a/app/partials/views/modules/lightbox_add-new-us.jade +++ b/app/partials/views/modules/lightbox_add-new-us.jade @@ -5,7 +5,7 @@ form fieldset input(type="text", ng-model="us.subject", tg-i18n="placeholder:common.subject") fieldset - select(ng-model="us.status", ng-options="s.name for s in statusList", + select(ng-model="us.status", ng-options="s.id as s.name for s in statusList", tg-i18n="placeholder:common.status") fieldset input(type="text", placeholder="Tags", tg-tags, ng-model="us.tags") From c6a0f23ef94d551d1bb62f7cb92b3799825619e2 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Sat, 21 Jun 2014 12:15:15 +0200 Subject: [PATCH 61/64] Remove defaults form lightboxes directives scope. --- app/coffee/modules/backlog/lightboxes.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/coffee/modules/backlog/lightboxes.coffee b/app/coffee/modules/backlog/lightboxes.coffee index 47a27275..ec7c74db 100644 --- a/app/coffee/modules/backlog/lightboxes.coffee +++ b/app/coffee/modules/backlog/lightboxes.coffee @@ -21,10 +21,10 @@ CreateEditUserstoryDirective = ($repo, $model) -> link = ($scope, $el, attrs) -> - $scope.us = {"tags": ["kaka", "pedo", "pis"]} + $scope.us = {} # TODO: defaults $scope.$on "usform:new", -> - $scope.us = {"subject": "KAKA"} + $scope.us = {} $el.removeClass("hidden") $scope.$on "usform:edit", (ctx, us) -> From 72407144dbc5a195ba4be90a18cb9c1e1f0e1f86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Barrag=C3=A1n=20Merino?= Date: Sat, 21 Jun 2014 20:26:23 +0200 Subject: [PATCH 62/64] Add LICENSE file --- LICENSE | 661 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 661 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..dba13ed2 --- /dev/null +++ b/LICENSE @@ -0,0 +1,661 @@ + GNU AFFERO GENERAL PUBLIC LICENSE + Version 3, 19 November 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU Affero General Public License is a free, copyleft license for +software and other kinds of works, specifically designed to ensure +cooperation with the community in the case of network server software. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +our General Public Licenses are intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + Developers that use our General Public Licenses protect your rights +with two steps: (1) assert copyright on the software, and (2) offer +you this License which gives you legal permission to copy, distribute +and/or modify the software. + + A secondary benefit of defending all users' freedom is that +improvements made in alternate versions of the program, if they +receive widespread use, become available for other developers to +incorporate. Many developers of free software are heartened and +encouraged by the resulting cooperation. However, in the case of +software used on network servers, this result may fail to come about. +The GNU General Public License permits making a modified version and +letting the public access it on a server without ever releasing its +source code to the public. + + The GNU Affero General Public License is designed specifically to +ensure that, in such cases, the modified source code becomes available +to the community. It requires the operator of a network server to +provide the source code of the modified version running there to the +users of that server. Therefore, public use of a modified version, on +a publicly accessible server, gives the public access to the source +code of the modified version. + + An older license, called the Affero General Public License and +published by Affero, was designed to accomplish similar goals. This is +a different license, not a version of the Affero GPL, but Affero has +released a new version of the Affero GPL which permits relicensing under +this license. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU Affero General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Remote Network Interaction; Use with the GNU General Public License. + + Notwithstanding any other provision of this License, if you modify the +Program, your modified version must prominently offer all users +interacting with it remotely through a computer network (if your version +supports such interaction) an opportunity to receive the Corresponding +Source of your version by providing access to the Corresponding Source +from a network server at no charge, through some standard or customary +means of facilitating copying of software. This Corresponding Source +shall include the Corresponding Source for any work covered by version 3 +of the GNU General Public License that is incorporated pursuant to the +following paragraph. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the work with which it is combined will remain governed by version +3 of the GNU General Public License. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU Affero General Public License from time to time. Such new versions +will be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU Affero General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU Affero General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU Affero General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + 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 . + +Also add information on how to contact you by electronic and paper mail. + + If your software can interact with users remotely through a computer +network, you should also make sure that it provides a way for users to +get its source. For example, if your program is a web application, its +interface could display a "Source" link that leads users to an archive +of the code. There are many ways you could offer source, and different +solutions will be better for different programs; see section 13 for the +specific requirements. + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU AGPL, see +. From 5b12eb42bbf7791b1bf002b5033f33ef9bb9c6dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Barrag=C3=A1n=20Merino?= Date: Sat, 21 Jun 2014 20:27:43 +0200 Subject: [PATCH 63/64] Fix license --- package.json | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 19b84508..b8b681a3 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "TaigaIO", "version": "0.0.1", - "description": "Landing page for Taiga", + "description": "Taiga project management system (frontend)", "main": "index.js", "keywords": [ "Taiga", @@ -9,8 +9,13 @@ "Project Management", "Github" ], - "author": "Kaleidos", - "license": "ISC", + "author": "Kaleidos OpenSource SL", + "licenses": [ + { + "type": "AGPL-3.0", + "url": "https://github.com/taigaio/taiga-front/blob/master/LICENSE" + } + ], "devDependencies": { "gulp": "^3.8.0", "coffee-script": "^1.7.1", From c2ed0186ee85bc50f43928b448d0ab88a11f64be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Barrag=C3=A1n=20Merino?= Date: Sat, 21 Jun 2014 20:28:25 +0200 Subject: [PATCH 64/64] Add AUTHORS file --- AUTHORS.rst | 20 ++++++++++++++++++++ bower.json | 12 ++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 AUTHORS.rst diff --git a/AUTHORS.rst b/AUTHORS.rst new file mode 100644 index 00000000..6da52a15 --- /dev/null +++ b/AUTHORS.rst @@ -0,0 +1,20 @@ +The PRIMARY AUTHORS are: + +- Andrey Antukh +- Jesus Espino Garcia +- David Barragán Merino +- Xavi Julian +- Alejandro Alonso +- Anler Hernández +- Juan Francisco Alcántara + +Special thanks to Kaleidos Open Source S.L. for provice time for taiga +development. + +And here is an inevitably incomplete list of MUCH-APPRECIATED CONTRIBUTORS -- +people who have submitted patches, reported bugs, added translations, helped +answer newbie questions, and generally made taiga that much better: + +- Pilar Esteban +- Guilhem Got + ... diff --git a/bower.json b/bower.json index bcb6b133..0fed52cb 100644 --- a/bower.json +++ b/bower.json @@ -18,6 +18,18 @@ { "name": "Xavi Julian", "email": "xavier.julian@kaleidos.net" + }, + { + "name": "Alejandro Alonso", + "email": "alejandro.alonso@kaleidos.net" + }, + { + "name": "Anler Hernández", + "email": "hello@anler.me" + }, + { + "name": "Juan Francisco Alcántara", + "email": "juanfran.alcantara@kaleidos.net" } ], "description": "Taiga project management system (frontend)",