Merge branch 'master' into stable

stable
Alejandro Alonso 2016-01-29 10:42:40 +01:00
commit 907c13b34e
441 changed files with 13214 additions and 2647 deletions

View File

@ -1,4 +1,3 @@
sudo: false
language: node_js language: node_js
node_js: node_js:
- "4.1" - "4.1"

View File

@ -1,6 +1,6 @@
The PRIMARY AUTHORS are: The PRIMARY AUTHORS are:
- Andrey Antukh <niwi@niwi.be> - Andrey Antukh <niwi@niwi.nz>
- Jesus Espino Garcia <jespinog@gmail.com> - Jesus Espino Garcia <jespinog@gmail.com>
- David Barragán Merino <bameda@dbarragan.com> - David Barragán Merino <bameda@dbarragan.com>
- Xavi Julian <xavier.julian@kaleidos.net> - Xavi Julian <xavier.julian@kaleidos.net>
@ -16,16 +16,17 @@ And here is an inevitably incomplete list of MUCH-APPRECIATED CONTRIBUTORS --
people who have submitted patches, reported bugs, added translations, helped people who have submitted patches, reported bugs, added translations, helped
answer newbie questions, and generally made Taiga that much better: answer newbie questions, and generally made Taiga that much better:
- Pilar Esteban <pilar.esteban@gmail.com> - Allister Antosik <me@allisterantosik.com>
- Guilhem Got <guilhem.got@gmail.com>
- Ramiro Sánchez <ramiro.sanzhez@kaleidos.net>
- Miguel de la Cruz <miguel.delacruz@kaleidos.net>
- Andrea Stagi <stagi.andrea@gmail.com> - Andrea Stagi <stagi.andrea@gmail.com>
- Jordan Rinke - Brett Profitt <brett.profitt@gmail.com>
- Wil Wade - Chris Wilson <chris.wilson@aridhia.com>
- Daniel Koch - Daniel Koch
- Florian Bezagu - Florian Bezagu
- Guilhem Got <guilhem.got@gmail.com>
- Jordan Rinke
- Miguel de la Cruz <miguel.delacruz@kaleidos.net>
- Pilar Esteban <pilar.esteban@gmail.com>
- Ramiro Sánchez <ramiro.sanzhez@kaleidos.net>
- Ryan Swanstrom - Ryan Swanstrom
- Chris Wilson <chris.wilson@aridhia.com>
- Brett Profitt <brett.profitt@gmail.com>
- Vlad Topala <topalavlad@gmail.com> - Vlad Topala <topalavlad@gmail.com>
- Wil Wade

View File

@ -1,8 +1,38 @@
# Changelog # # Changelog #
## 1.10.0 Dryas Octopetala (2016-01-30)
### Features
- New design for the detail pages slidebar.
- Added 'Assign to me' button in User Stories, Tasks and Issues detail pages. (thanks to [@allistera](https://github.com/allistera)).
- Attachments:
- Upload attachments on US/issue/task lightbox.
- Attachments image gallery view mode in detail pages.
- Drag files from desktop to attachments section.
- Drag files from desktop in wysiwyg textareas.
- Project:
- Add a logo to your project.
- Denotes that your project is looking for people and add an explanation.
- Discover section:
- List most liked and most active project (last week/month/year or all time).
- List featured project.
- Search projects:
- Full text search with priorities over title, tags and description fields.
- Order results alphabeticaly, by most liked or more actived.
- Filter by 'use kanban', 'use scrum' or 'looking for people'.
- i18n.
- Add swedish (sv) translation.
- Add turkish (tr) translation.
### Misc
- Sticky project navigation bar.
- Lots of small and not so small bugfixes.
## 1.9.1 Taiga Tribe (2016-01-05) ## 1.9.1 Taiga Tribe (2016-01-05)
### Features
- [118n] Now taiga plugins can be translatable. - [118n] Now taiga plugins can be translatable.
- New Taiga plugins system. - New Taiga plugins system.
- Now superadmins can send notifications (live announcement) to the user (through taiga-events). - Now superadmins can send notifications (live announcement) to the user (through taiga-events).

77
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,77 @@
# Contributing
#### Where to start ####
There are many different ways to contribute to Taiga's development, just find the one that best fits with your skills. Examples of contributions we would love to receive include:
- **Code patches**
- **Documentation improvements**
- **Translations**
- **Bug reports**
- **Patch reviews**
- **UI enhancements**
Big features are also welcome but if you want to see your contributions included in Taiga codebase we strongly recommend you start by initiating a chat though our [mailing list](http://groups.google.co.uk/d/forum/taigaio)
#### Code of Conduct ####
Help us keep the Taiga Community open and inclusive. Please read and follow our [Code of Conduct](https://github.com/taigaio/code-of-conduct/blob/master/CODE_OF_CONDUCT.md).
#### License ####
Every code patch accepted in taiga codebase is licensed under [AGPL v3.0](http://www.gnu.org/licenses/agpl-3.0.html). You must be careful to not include any code that can not be licensed under this license.
Please read carefully [our license](https://github.com/taigaio/taiga-front/blob/master/LICENSE) and ask us if you have any questions.
#### Bug reports, enhancements and support ####
If you **need help to setup Taiga**, want to **talk about some cool enhancemnt** or you have **some questions**, please write us to our [mailing list](http://groups.google.com/d/forum/taigaio).
If you **find a bug** in Taiga you can always report it:
- in our [mailing list](http://groups.google.com/d/forum/taigaio).
- in [github issues](https://github.com/taigaio/taiga-front/issues).
- send us a mail to support@taiga.io if is a bug related to [tree.taiga.io](https://tree.taiga.io).
- send a mail to security@taiga.io if is a **security bug**.
One of our fellow Taiga developers will search, find and hunt it as soon as possible.
Please, before reporting a bug write down how can we reproduce it, your operating system, your browser and version, and if it's possible, a screenshot. Sometimes it takes less time to fix a bug if the developer knows how to find it and we will solve your problem as fast as possible.
#### Documentation improvements ####
We are gathering lots of information from our users to build and enhance our documentation. If you use the documentation to install or develop with Taiga and find any mistakes, omissions or confused sequences, it is enormously helpful to report it. Or better still, if you believe you can author additions, please make a pull-request to taiga project.
Currently, we have authored three main documentation hubs:
- **[API Docs](https://github.com/taigaio/taiga-doc)**: Our API documentation and reference for developing from Taiga API.
- **[Installation Guide](https://github.com/taigaio/taiga-doc)**: If you need to install Taiga on your own server, this is the place to find some guides.
- **[Taiga Support](https://github.com/taigaio/taiga-doc)**: This page is intended to be the support reference page for the users. If you find any mistake, please report it.
#### Translation ####
We are ready now to accept your help translating Taiga. It's easy (and fun!) just access our team of translators with the link below, set up an account in Transifex and start contributing. Join us to make sure your language is covered! **[Help Taiga to translate content](https://www.transifex.com/signup/ "Help Taiga to trasnlatecontent")**
#### Code patches ####
Taiga will always be glad to receive code patches to update, fix or improve its code.
If you know how to improve our code base or you found a bug, a security vulnerability or a performance issue and you think you can solve it, we will be very happy to accept your pull-request. If your code requires considerable changes, we recommend you first talk to us directly. We will find the best way to help.
#### UI enhancements ####
Taiga is made for developers and designers. We care enormously about UI because usability and design are both critical aspects of the Taiga experience.
There are two possible ways to contribute to our UI:
- **Bugs**: If you find a bug regarding front-end, please report it as previously indicated in the Bug reports section or send a pull-request as indicated in the Code Patches section.
- **Enhancements**: If its a design or UX bug or enhancement we will love to receive your feedback. Please send us your enhancement, with the reason and, if possible, an example. Our design and UX team will review your enhancement and fix it as soon as possible. We recommend you to use our [mailing list](http://groups.google.co.uk/d/forum/taigaio) so we can have a lot of different opinions and debate.
- **Language Localization**: We are eager to offer localized versions of Taiga. Some members of the community have already volunteered to work to provide a variety of languages. We are working to implement some changes to allow for this and expect to accept these requests in the near future.

View File

@ -28,6 +28,11 @@ There are many different ways to contribute to Taiga's development, just find th
Big features are also welcome but if you want to see your contributions included in Taiga codebase we strongly recommend you start by initiating a chat though our [mailing list](http://groups.google.co.uk/d/forum/taigaio) Big features are also welcome but if you want to see your contributions included in Taiga codebase we strongly recommend you start by initiating a chat though our [mailing list](http://groups.google.co.uk/d/forum/taigaio)
#### Code of Conduct ####
Help us keep the Taiga Community open and inclusive. Please read and follow our [Code of Conduct](https://github.com/taigaio/code-of-conduct/blob/master/CODE_OF_CONDUCT.md).
#### License #### #### License ####
Every code patch accepted in taiga codebase is licensed under [AGPL v3.0](http://www.gnu.org/licenses/agpl-3.0.html). You must be careful to not include any code that can not be licensed under this license. Every code patch accepted in taiga codebase is licensed under [AGPL v3.0](http://www.gnu.org/licenses/agpl-3.0.html). You must be careful to not include any code that can not be licensed under this license.
@ -43,7 +48,7 @@ If you **find a bug** in Taiga you can always report it:
- in our [mailing list](http://groups.google.com/d/forum/taigaio). - in our [mailing list](http://groups.google.com/d/forum/taigaio).
- in [github issues](https://github.com/taigaio/taiga-front/issues). - in [github issues](https://github.com/taigaio/taiga-front/issues).
- send us a mail to support@taiga.io if is a bug related to tree.taiga.io. - send us a mail to support@taiga.io if is a bug related to [tree.taiga.io](https://tree.taiga.io).
- send a mail to security@taiga.io if is a **security bug**. - send a mail to security@taiga.io if is a **security bug**.
One of our fellow Taiga developers will search, find and hunt it as soon as possible. One of our fellow Taiga developers will search, find and hunt it as soon as possible.
@ -80,7 +85,7 @@ Taiga is made for developers and designers. We care enormously about UI because
There are two possible ways to contribute to our UI: There are two possible ways to contribute to our UI:
- **Bugs**: If you find a bug regarding front-end, please report it as previously indicated in the Bug reports section or send a pull-request as indicated in the Code Patches section. - **Bugs**: If you find a bug regarding front-end, please report it as previously indicated in the Bug reports section or send a pull-request as indicated in the Code Patches section.
- **Enhancements**: If its a design or UX bug or enhancement we will love to receive your feedback. Please send us your enhancement, with the reason and, if possible, an example. Our design and UX team will review your enhancement and fix it as soon as possible. We recommend you to use our [mailing list](http://groups.google.co.uk/d/forum/taigaio){target="_blank"} so we can have a lot of different opinions and debate. - **Enhancements**: If its a design or UX bug or enhancement we will love to receive your feedback. Please send us your enhancement, with the reason and, if possible, an example. Our design and UX team will review your enhancement and fix it as soon as possible. We recommend you to use our [mailing list](http://groups.google.co.uk/d/forum/taigaio) so we can have a lot of different opinions and debate.
- **Language Localization**: We are eager to offer localized versions of Taiga. Some members of the community have already volunteered to work to provide a variety of languages. We are working to implement some changes to allow for this and expect to accept these requests in the near future. - **Language Localization**: We are eager to offer localized versions of Taiga. Some members of the community have already volunteered to work to provide a variety of languages. We are working to implement some changes to allow for this and expect to accept these requests in the near future.

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
@ -63,9 +66,8 @@ configure = ($routeProvider, $locationProvider, $httpProvider, $provide, $tgEven
$routeProvider.when("/", $routeProvider.when("/",
{ {
templateUrl: "home/home.html", templateUrl: "home/home.html",
access: { controller: "Home",
requiresLogin: true controllerAs: "vm"
},
loader: true, loader: true,
title: "HOME.PAGE_TITLE", title: "HOME.PAGE_TITLE",
loader: true, loader: true,
@ -74,6 +76,27 @@ configure = ($routeProvider, $locationProvider, $httpProvider, $provide, $tgEven
} }
) )
$routeProvider.when("/discover",
{
templateUrl: "discover/discover-home/discover-home.html",
controller: "DiscoverHome",
controllerAs: "vm",
title: "PROJECT.NAVIGATION.DISCOVER",
loader: true
}
)
$routeProvider.when("/discover/search",
{
templateUrl: "discover/discover-search/discover-search.html",
title: "PROJECT.NAVIGATION.DISCOVER",
loader: true,
controller: "DiscoverSearch",
controllerAs: "vm",
reloadOnSearch: false
}
)
$routeProvider.when("/projects/", $routeProvider.when("/projects/",
{ {
templateUrl: "projects/listing/projects-listing.html", templateUrl: "projects/listing/projects-listing.html",
@ -661,6 +684,7 @@ modules = [
"taigaHome", "taigaHome",
"taigaUserTimeline", "taigaUserTimeline",
"taigaExternalApps", "taigaExternalApps",
"taigaDiscover",
# template cache # template cache
"templates", "templates",

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
@ -446,3 +449,64 @@ CsvIssueDirective = ($translate) ->
} }
module.directive("tgCsvIssue", ["$translate", CsvIssueDirective]) module.directive("tgCsvIssue", ["$translate", CsvIssueDirective])
#############################################################################
## Project Logo Directive
#############################################################################
ProjectLogoDirective = ($auth, $model, $rs, $confirm) ->
link = ($scope, $el, $attrs) ->
showSizeInfo = ->
$el.find(".size-info").addClass("active")
onSuccess = (response) ->
project = $model.make_model("projects", response.data)
$scope.project = project
$el.find('.loading-overlay').removeClass('active')
$confirm.notify('success')
onError = (response) ->
showSizeInfo() if response.status == 413
$el.find('.loading-overlay').removeClass('active')
$confirm.notify('error', response.data._error_message)
# Change photo
$el.on "click", ".js-change-logo", ->
$el.find("#logo-field").click()
$el.on "change", "#logo-field", (event) ->
if $scope.logoAttachment
$el.find('.loading-overlay').addClass("active")
$rs.projects.changeLogo($scope.project.id, $scope.logoAttachment).then(onSuccess, onError)
# Use default photo
$el.on "click", "a.js-use-default-logo", (event) ->
$el.find('.loading-overlay').addClass("active")
$rs.projects.removeLogo($scope.project.id).then(onSuccess, onError)
$scope.$on "$destroy", ->
$el.off()
return {link:link}
module.directive("tgProjectLogo", ["$tgAuth", "$tgModel", "$tgResources", "$tgConfirm", ProjectLogoDirective])
#############################################################################
## Project Logo Model Directive
#############################################################################
ProjectLogoModelDirective = ($parse) ->
link = ($scope, $el, $attrs) ->
model = $parse($attrs.tgProjectLogoModel)
modelSetter = model.assign
$el.bind 'change', ->
$scope.$apply ->
modelSetter($scope, $el[0].files[0])
return {link:link}
module.directive('tgProjectLogoModel', ['$parse', ProjectLogoModelDirective])

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
@ -200,14 +203,21 @@ module.service("$tgAuth", AuthService)
# Directive that manages the visualization of public register # Directive that manages the visualization of public register
# message/link on login page. # message/link on login page.
PublicRegisterMessageDirective = ($config, $navUrls, templates) -> PublicRegisterMessageDirective = ($config, $navUrls, $routeParams, templates) ->
template = templates.get("auth/login-text.html", true) template = templates.get("auth/login-text.html", true)
templateFn = -> templateFn = ->
publicRegisterEnabled = $config.get("publicRegisterEnabled") publicRegisterEnabled = $config.get("publicRegisterEnabled")
if not publicRegisterEnabled if not publicRegisterEnabled
return "" return ""
return template({url:$navUrls.resolve("register")})
url = $navUrls.resolve("register")
if $routeParams['next'] and $routeParams['next'] != $navUrls.resolve("register")
nextUrl = encodeURIComponent($routeParams['next'])
console.log "-----", nextUrl
url += "?next=#{nextUrl}"
return template({url:url})
return { return {
restrict: "AE" restrict: "AE"
@ -215,22 +225,22 @@ PublicRegisterMessageDirective = ($config, $navUrls, templates) ->
template: templateFn template: templateFn
} }
module.directive("tgPublicRegisterMessage", ["$tgConfig", "$tgNavUrls", "$tgTemplate", module.directive("tgPublicRegisterMessage", ["$tgConfig", "$tgNavUrls", "$routeParams",
PublicRegisterMessageDirective]) "$tgTemplate", PublicRegisterMessageDirective])
LoginDirective = ($auth, $confirm, $location, $config, $routeParams, $navUrls, $events, $translate) -> LoginDirective = ($auth, $confirm, $location, $config, $routeParams, $navUrls, $events, $translate) ->
link = ($scope, $el, $attrs) -> link = ($scope, $el, $attrs) ->
form = new checksley.Form($el.find("form.login-form")) form = new checksley.Form($el.find("form.login-form"))
onSuccess = (response) ->
if $routeParams['next'] and $routeParams['next'] != $navUrls.resolve("login") if $routeParams['next'] and $routeParams['next'] != $navUrls.resolve("login")
nextUrl = decodeURIComponent($routeParams['next']) $scope.nextUrl = decodeURIComponent($routeParams['next'])
else else
nextUrl = $navUrls.resolve("home") $scope.nextUrl = $navUrls.resolve("home")
onSuccess = (response) ->
$events.setupConnection() $events.setupConnection()
$location.url(nextUrl) $location.url($scope.nextUrl)
onError = (response) -> onError = (response) ->
$confirm.notify("light-error", $translate.instant("LOGIN_FORM.ERROR_AUTH_INCORRECT")) $confirm.notify("light-error", $translate.instant("LOGIN_FORM.ERROR_AUTH_INCORRECT"))
@ -268,7 +278,7 @@ module.directive("tgLogin", ["$tgAuth", "$tgConfirm", "$tgLocation", "$tgConfig"
## Register Directive ## Register Directive
############################################################################# #############################################################################
RegisterDirective = ($auth, $confirm, $location, $navUrls, $config, $analytics, $translate) -> RegisterDirective = ($auth, $confirm, $location, $navUrls, $config, $routeParams, $analytics, $translate) ->
link = ($scope, $el, $attrs) -> link = ($scope, $el, $attrs) ->
if not $config.get("publicRegisterEnabled") if not $config.get("publicRegisterEnabled")
$location.path($navUrls.resolve("not-found")) $location.path($navUrls.resolve("not-found"))
@ -277,12 +287,17 @@ RegisterDirective = ($auth, $confirm, $location, $navUrls, $config, $analytics,
$scope.data = {} $scope.data = {}
form = $el.find("form").checksley({onlyOneErrorElement: true}) form = $el.find("form").checksley({onlyOneErrorElement: true})
if $routeParams['next'] and $routeParams['next'] != $navUrls.resolve("register")
$scope.nextUrl = decodeURIComponent($routeParams['next'])
else
$scope.nextUrl = $navUrls.resolve("home")
onSuccessSubmit = (response) -> onSuccessSubmit = (response) ->
$analytics.trackEvent("auth", "register", "user registration", 1) $analytics.trackEvent("auth", "register", "user registration", 1)
$confirm.notify("success", $translate.instant("LOGIN_FORM.SUCCESS")) $confirm.notify("success", $translate.instant("LOGIN_FORM.SUCCESS"))
$location.path($navUrls.resolve("home")) $location.url($scope.nextUrl)
onErrorSubmit = (response) -> onErrorSubmit = (response) ->
if response.data._error_message if response.data._error_message
@ -310,7 +325,7 @@ RegisterDirective = ($auth, $confirm, $location, $navUrls, $config, $analytics,
return {link:link} return {link:link}
module.directive("tgRegister", ["$tgAuth", "$tgConfirm", "$tgLocation", "$tgNavUrls", "$tgConfig", module.directive("tgRegister", ["$tgAuth", "$tgConfirm", "$tgLocation", "$tgNavUrls", "$tgConfig",
"$tgAnalytics", "$translate", RegisterDirective]) "$routeParams", "$tgAnalytics", "$translate", RegisterDirective])
############################################################################# #############################################################################
@ -437,9 +452,7 @@ InvitationDirective = ($auth, $confirm, $location, $params, $navUrls, $analytics
$confirm.notify("success", text) $confirm.notify("success", text)
onErrorSubmitLogin = (response) -> onErrorSubmitLogin = (response) ->
text = $translate.instant("INVITATION_LOGIN_FORM.ERROR") $confirm.notify("light-error", response.data._error_message)
$confirm.notify("light-error", text)
submitLogin = debounce 2000, (event) => submitLogin = debounce 2000, (event) =>
event.preventDefault() event.preventDefault()

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
@ -51,11 +54,12 @@ class BacklogController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.F
"$tgEvents", "$tgEvents",
"$tgAnalytics", "$tgAnalytics",
"$translate", "$translate",
"$tgLoading" "$tgLoading",
"tgResources"
] ]
constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q,
@location, @appMetaService, @navUrls, @events, @analytics, @translate, @loading) -> @location, @appMetaService, @navUrls, @events, @analytics, @translate, @loading, @rs2) ->
bindMethods(@) bindMethods(@)
@scope.sectionName = @translate.instant("BACKLOG.SECTION_NAME") @scope.sectionName = @translate.instant("BACKLOG.SECTION_NAME")
@ -198,6 +202,9 @@ class BacklogController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.F
@scope.sprintsCounter = sprints.length @scope.sprintsCounter = sprints.length
@scope.sprintsById = groupBy(sprints, (x) -> x.id) @scope.sprintsById = groupBy(sprints, (x) -> x.id)
@rootscope.$broadcast("sprints:loaded", sprints) @rootscope.$broadcast("sprints:loaded", sprints)
@scope.currentSprint = @.findCurrentSprint()
return sprints return sprints
restoreFilters: -> restoreFilters: ->
@ -560,9 +567,9 @@ class BacklogController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.F
.timeout(200) .timeout(200)
.start() .start()
@rs.userstories.getByRef(projectId, ref).then (us) => return @rs.userstories.getByRef(projectId, ref).then (us) =>
@rootscope.$broadcast("usform:edit", us) @rs2.attachments.list("us", us.id, projectId).then (attachments) =>
@rootscope.$broadcast("usform:edit", us, attachments.toJS())
currentLoading.finish() currentLoading.finish()
deleteUserStory: (us) -> deleteUserStory: (us) ->
@ -591,6 +598,15 @@ class BacklogController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.F
addNewSprint: () -> addNewSprint: () ->
@rootscope.$broadcast("sprintform:create", @scope.projectId) @rootscope.$broadcast("sprintform:create", @scope.projectId)
findCurrentSprint: () ->
currentDate = new Date().getTime()
return _.find @scope.sprints, (sprint) ->
start = moment(sprint.estimated_start, 'YYYY-MM-DD').format('x')
end = moment(sprint.estimated_finish, 'YYYY-MM-DD').format('x')
return currentDate >= start && currentDate <= end
module.controller("BacklogController", BacklogController) module.controller("BacklogController", BacklogController)
############################################################################# #############################################################################
@ -641,7 +657,17 @@ BacklogDirective = ($repo, $rootscope, $translate) ->
## Move to current sprint link ## Move to current sprint link
linkToolbar = ($scope, $el, $attrs, $ctrl) -> linkToolbar = ($scope, $el, $attrs, $ctrl) ->
moveToCurrentSprint = (selectedUss) -> getUsToMove = () ->
# Calculating the us's to be modified
ussDom = $el.find(".backlog-table-body input:checkbox:checked")
return _.map ussDom, (item) ->
item = $(item).closest('.tg-scope')
itemScope = item.scope()
itemScope.us.milestone = $scope.sprints[0].id
return itemScope.us
moveUssToSprint = (selectedUss, sprint) ->
ussCurrent = _($scope.userstories) ussCurrent = _($scope.userstories)
# Remove them from backlog # Remove them from backlog
@ -651,30 +677,36 @@ BacklogDirective = ($repo, $rootscope, $translate) ->
totalExtraPoints = _.reduce(extraPoints, (acc, num) -> acc + num) totalExtraPoints = _.reduce(extraPoints, (acc, num) -> acc + num)
# Add them to current sprint # Add them to current sprint
$scope.sprints[0].user_stories = _.union($scope.sprints[0].user_stories, selectedUss) sprint.user_stories = _.union(sprint.user_stories, selectedUss)
# Update the total of points # Update the total of points
$scope.sprints[0].total_points += totalExtraPoints sprint.total_points += totalExtraPoints
$repo.saveAll(selectedUss).then -> $repo.saveAll(selectedUss).then ->
$ctrl.loadSprints() $ctrl.loadSprints()
$ctrl.loadProjectStats() $ctrl.loadProjectStats()
$el.find(".move-to-sprint").hide()
moveToCurrentSprint = (selectedUss) ->
moveUssToSprint(selectedUss, $scope.currentSprint)
moveToLatestSprint = (selectedUss) ->
moveUssToSprint(selectedUss, $scope.sprints[0])
shiftPressed = false shiftPressed = false
lastChecked = null lastChecked = null
checkSelected = (target) -> checkSelected = (target) ->
lastChecked = target.closest(".us-item-row") lastChecked = target.closest(".us-item-row")
moveToCurrentSprintDom = $el.find("#move-to-current-sprint") target.closest('.us-item-row').toggleClass('ui-multisortable-multiple')
moveToSprintDom = $el.find(".move-to-sprint")
selectedUsDom = $el.find(".backlog-table-body input:checkbox:checked") selectedUsDom = $el.find(".backlog-table-body input:checkbox:checked")
if selectedUsDom.length > 0 and $scope.sprints.length > 0 if selectedUsDom.length > 0 and $scope.sprints.length > 0
moveToCurrentSprintDom.show() moveToSprintDom.show()
else else
moveToCurrentSprintDom.hide() moveToSprintDom.hide()
target.closest('.us-item-row').toggleClass('ui-multisortable-multiple')
$(window).on "keydown.shift-pressed keyup.shift-pressed", (event) -> $(window).on "keydown.shift-pressed keyup.shift-pressed", (event) ->
shiftPressed = !!event.shiftKey shiftPressed = !!event.shiftKey
@ -704,15 +736,13 @@ BacklogDirective = ($repo, $rootscope, $translate) ->
target.closest(".us-item-row").toggleClass('is-checked') target.closest(".us-item-row").toggleClass('is-checked')
checkSelected(target) checkSelected(target)
$el.on "click", "#move-to-current-sprint", (event) => $el.on "click", "#move-to-latest-sprint", (event) =>
# Calculating the us's to be modified ussToMove = getUsToMove()
ussDom = $el.find(".backlog-table-body input:checkbox:checked")
ussToMove = _.map ussDom, (item) -> $scope.$apply(_.partial(moveToLatestSprint, ussToMove))
item = $(item).closest('.tg-scope')
itemScope = item.scope() $el.on "click", "#move-to-current-sprint", (event) =>
itemScope.us.milestone = $scope.sprints[0].id ussToMove = getUsToMove()
return itemScope.us
$scope.$apply(_.partial(moveToCurrentSprint, ussToMove)) $scope.$apply(_.partial(moveToCurrentSprint, ussToMove))

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
@ -49,6 +52,9 @@ urls = {
"not-found": "/not-found" "not-found": "/not-found"
"permission-denied": "/permission-denied" "permission-denied": "/permission-denied"
"discover": "/discover"
"discover-search": "/discover/search"
"login": "/login" "login": "/login"
"forgot-password": "/forgot-password" "forgot-password": "/forgot-password"
"change-password": "/change-password/:token" "change-password": "/change-password/:token"

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
@ -114,7 +117,7 @@ NavigationUrlsDirective = ($navurls, $auth, $q, $location) ->
$el.on "mouseenter", (event) -> $el.on "mouseenter", (event) ->
target = $(event.currentTarget) target = $(event.currentTarget)
if !target.data("fullUrl") if !target.data("fullUrl") || $attrs.tgNavGetParams != target.data("params")
parseNav($attrs.tgNav, $scope).then (result) -> parseNav($attrs.tgNav, $scope).then (result) ->
[name, options] = result [name, options] = result
user = $auth.getUser() user = $auth.getUser()
@ -128,6 +131,8 @@ NavigationUrlsDirective = ($navurls, $auth, $q, $location) ->
getURLParamsStr = $.param(getURLParams) getURLParamsStr = $.param(getURLParams)
fullUrl = "#{fullUrl}?#{getURLParamsStr}" fullUrl = "#{fullUrl}?#{getURLParamsStr}"
target.data("params", $attrs.tgNavGetParams)
target.data("fullUrl", fullUrl) target.data("fullUrl", fullUrl)
if target.is("a") if target.is("a")

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
@ -93,22 +96,38 @@ module.factory("$selectedText", ["$window", "$document", SelectedText])
## Permission directive, hide elements when necessary ## Permission directive, hide elements when necessary
############################################################################# #############################################################################
CheckPermissionDirective = -> CheckPermissionDirective = (projectService) ->
render = ($el, project, permission) -> render = ($el, project, permission) ->
$el.removeClass('hidden') if project.my_permissions.indexOf(permission) > -1 if project && permission
$el.removeClass('hidden') if project.get('my_permissions').indexOf(permission) > -1
link = ($scope, $el, $attrs) -> link = ($scope, $el, $attrs) ->
$el.addClass('hidden') $el.addClass('hidden')
permission = $attrs.tgCheckPermission permission = $attrs.tgCheckPermission
$scope.$watch "project", (project) -> unwatch = $scope.$watch () ->
render($el, project, permission) if project? return projectService.project
, () ->
return if !projectService.project
render($el, projectService.project, permission)
unwatch()
unObserve = $attrs.$observe "tgCheckPermission", (permission) ->
return if !permission
render($el, projectService.project, permission)
unObserve()
$scope.$on "$destroy", -> $scope.$on "$destroy", ->
$el.off() $el.off()
return {link:link} return {link:link}
CheckPermissionDirective.$inject = [
"tgProjectService"
]
module.directive("tgCheckPermission", CheckPermissionDirective) module.directive("tgCheckPermission", CheckPermissionDirective)
############################################################################# #############################################################################

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,340 +0,0 @@
###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# File: modules/common/attachments.coffee
###
taiga = @.taiga
sizeFormat = @.taiga.sizeFormat
bindOnce = @.taiga.bindOnce
bindMethods = @.taiga.bindMethods
module = angular.module("taigaCommon")
class AttachmentsController extends taiga.Controller
@.$inject = ["$scope", "$rootScope", "$tgRepo", "$tgResources", "$tgConfirm", "$q", "$translate"]
constructor: (@scope, @rootscope, @repo, @rs, @confirm, @q, @translate) ->
bindMethods(@)
@.type = null
@.objectId = null
@.projectId = null
@.uploadingAttachments = []
@.attachments = []
@.attachmentsCount = 0
@.deprecatedAttachmentsCount = 0
@.showDeprecated = false
initialize: (type, objectId) ->
@.type = type
@.objectId = objectId
@.projectId = @scope.projectId
loadAttachments: ->
return @.attachments if not @.objectId
urlname = "attachments/#{@.type}"
return @rs.attachments.list(urlname, @.objectId, @.projectId).then (attachments) =>
@.attachments = _.sortBy(attachments, "order")
@.updateCounters()
return attachments
updateCounters: ->
@.attachmentsCount = @.attachments.length
@.deprecatedAttachmentsCount = _.filter(@.attachments, {is_deprecated: true}).length
_createAttachment: (attachment) ->
urlName = "attachments/#{@.type}"
promise = @rs.attachments.create(urlName, @.projectId, @.objectId, attachment)
promise = promise.then (data) =>
data.isCreatedRightNow = true
index = @.uploadingAttachments.indexOf(attachment)
@.uploadingAttachments.splice(index, 1)
@.attachments.push(data)
@rootscope.$broadcast("attachment:create")
promise = promise.then null, (data) =>
@scope.$emit("attachments:size-error") if data.status == 413
index = @.uploadingAttachments.indexOf(attachment)
@.uploadingAttachments.splice(index, 1)
message = @translate.instant("ATTACHMENT.ERROR_UPLOAD_ATTACHMENT", {
fileName: attachment.name, errorMessage: data.data._error_message})
@confirm.notify("error", message)
return @q.reject(data)
return promise
# Create attachments in bulk
createAttachments: (attachments) ->
promises = _.map(attachments, (x) => @._createAttachment(x))
return @q.all(promises).then =>
@.updateCounters()
# Add uploading attachment tracking.
addUploadingAttachments: (attachments) ->
@.uploadingAttachments = _.union(@.uploadingAttachments, attachments)
# Change order of attachment in a ordered list.
# This function is mainly executed after sortable ends.
reorderAttachment: (attachment, newIndex) ->
oldIndex = @.attachments.indexOf(attachment)
return if oldIndex == newIndex
@.attachments.splice(oldIndex, 1)
@.attachments.splice(newIndex, 0, attachment)
_.each(@.attachments, (x,i) -> x.order = i+1)
# Persist one concrete attachment.
# This function is mainly used when user clicks
# to save button for save one unique attachment.
updateAttachment: (attachment) ->
onSuccess = =>
@.updateCounters()
@rootscope.$broadcast("attachment:edit")
onError = (response) =>
$scope.$emit("attachments:size-error") if response.status == 413
@confirm.notify("error")
return @q.reject()
return @repo.save(attachment).then(onSuccess, onError)
# Persist all pending modifications on attachments.
# This function is used mainly for persist the order
# after sorting.
saveAttachments: ->
return @repo.saveAll(@.attachments).then null, =>
for item in @.attachments
item.revert()
@.attachments = _.sortBy(@.attachments, "order")
# Remove one concrete attachment.
removeAttachment: (attachment) ->
title = @translate.instant("ATTACHMENT.TITLE_LIGHTBOX_DELETE_ATTACHMENT")
message = @translate.instant("ATTACHMENT.MSG_LIGHTBOX_DELETE_ATTACHMENT", {fileName: attachment.name})
return @confirm.askOnDelete(title, message).then (askResponse) =>
onSuccess = =>
askResponse.finish()
index = @.attachments.indexOf(attachment)
@.attachments.splice(index, 1)
@.updateCounters()
@rootscope.$broadcast("attachment:delete")
onError = =>
askResponse.finish(false)
message = @translate.instant("ATTACHMENT.ERROR_DELETE_ATTACHMENT", {errorMessage: message})
@confirm.notify("error", null, message)
return @q.reject()
return @repo.remove(attachment).then(onSuccess, onError)
# Function used in template for filter visible attachments
filterAttachments: (item) ->
if @.showDeprecated
return true
return not item.is_deprecated
AttachmentsDirective = ($config, $confirm, $templates, $translate) ->
template = $templates.get("attachment/attachments.html", true)
link = ($scope, $el, $attrs, $ctrls) ->
$ctrl = $ctrls[0]
$model = $ctrls[1]
bindOnce $scope, $attrs.ngModel, (value) ->
$ctrl.initialize($attrs.type, value.id)
$ctrl.loadAttachments()
tdom = $el.find("div.attachment-body.sortable")
tdom.sortable({
items: "div.single-attachment"
handle: "a.settings.icon.icon-drag-v"
containment: ".attachments"
dropOnEmpty: true
scroll: false
tolerance: "pointer"
placeholder: "sortable-placeholder single-attachment"
})
tdom.on "sortstop", (event, ui) ->
attachment = ui.item.scope().attach
newIndex = ui.item.index()
$ctrl.reorderAttachment(attachment, newIndex)
$ctrl.saveAttachments().then ->
$scope.$emit("attachment:edit")
showSizeInfo = ->
$el.find(".size-info").removeClass("hidden")
$scope.$on "attachments:size-error", ->
showSizeInfo()
$el.on "change", ".attachments-header input", (event) ->
files = _.toArray(event.target.files)
return if files.length < 1
$scope.$apply ->
$ctrl.addUploadingAttachments(files)
$ctrl.createAttachments(files)
$el.on "click", ".more-attachments", (event) ->
event.preventDefault()
target = angular.element(event.currentTarget)
$scope.$apply ->
$ctrl.showDeprecated = not $ctrl.showDeprecated
target.find("span.text").addClass("hidden")
if $ctrl.showDeprecated
target.find("span[data-type=hide]").removeClass("hidden")
target.find("more-attachments-num").addClass("hidden")
else
target.find("span[data-type=show]").removeClass("hidden")
target.find("more-attachments-num").removeClass("hidden")
$scope.$on "$destroy", ->
$el.off()
templateFn = ($el, $attrs) ->
maxFileSize = $config.get("maxUploadFileSize", null)
maxFileSize = sizeFormat(maxFileSize) if maxFileSize
maxFileSizeMsg = if maxFileSize then $translate.instant("ATTACHMENT.MAX_UPLOAD_SIZE", {maxFileSize: maxFileSize}) else ""
ctx = {
type: $attrs.type
maxFileSize: maxFileSize
maxFileSizeMsg: maxFileSizeMsg
}
return template(ctx)
return {
require: ["tgAttachments", "ngModel"]
controller: AttachmentsController
controllerAs: "ctrl"
restrict: "AE"
scope: true
link: link
template: templateFn
}
module.directive("tgAttachments", ["$tgConfig", "$tgConfirm", "$tgTemplate", "$translate", AttachmentsDirective])
AttachmentDirective = ($template, $compile, $translate, $rootScope) ->
template = $template.get("attachment/attachment.html", true)
templateEdit = $template.get("attachment/attachment-edit.html", true)
link = ($scope, $el, $attrs, $ctrl) ->
render = (attachment, edit=false) ->
permissions = $scope.project.my_permissions
modifyPermission = permissions.indexOf("modify_#{$ctrl.type}") > -1
ctx = {
id: attachment.id
name: attachment.name
title : $translate.instant("ATTACHMENT.TITLE", {
fileName: attachment.name,
date: moment(attachment.created_date).format($translate.instant("ATTACHMENT.DATE"))})
url: attachment.url
size: sizeFormat(attachment.size)
description: attachment.description
isDeprecated: attachment.is_deprecated
modifyPermission: modifyPermission
}
if edit
html = $compile(templateEdit(ctx))($scope)
else
html = $compile(template(ctx))($scope)
$el.html(html)
if attachment.is_deprecated
$el.addClass("deprecated")
$el.find("input:checkbox").prop('checked', true)
else
$el.removeClass("deprecated")
saveAttachment = ->
attachment.description = $el.find("input[name='description']").val()
attachment.is_deprecated = $el.find("input[name='is-deprecated']").prop("checked")
attachment.isCreatedRightNow = false
$scope.$apply ->
$ctrl.updateAttachment(attachment).then ->
render(attachment, false)
## Actions (on edit mode)
$el.on "click", "a.editable-settings.icon-floppy", (event) ->
event.preventDefault()
saveAttachment()
$el.on "keyup", "input[name=description]", (event) ->
if event.keyCode == 13
saveAttachment()
else if event.keyCode == 27
$scope.$apply -> render(attachment, false)
$el.on "click", "a.editable-settings.icon-delete", (event) ->
event.preventDefault()
render(attachment, false)
## Actions (on view mode)
$el.on "click", "a.settings.icon-edit", (event) ->
event.preventDefault()
render(attachment, true)
$el.find("input[name='description']").focus().select()
$el.on "click", "a.settings.icon-delete", (event) ->
event.preventDefault()
$scope.$apply ->
$ctrl.removeAttachment(attachment)
$el.on "click", "div.attachment-name a", (event) ->
if null != attachment.name.match(/\.(jpe?g|png|gif|gifv|webm)/i)
event.preventDefault()
$scope.$apply ->
$rootScope.$broadcast("attachment:preview", attachment)
$scope.$on "$destroy", ->
$el.off()
# Bootstrap
attachment = $scope.$eval($attrs.tgAttachment)
render(attachment, attachment.isCreatedRightNow)
if attachment.isCreatedRightNow
$el.find("input[name='description']").focus().select()
return {
link: link
require: "^tgAttachments"
restrict: "AE"
}
module.directive("tgAttachment", ["$tgTemplate", "$compile", "$translate", "$rootScope", AttachmentDirective])

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
@ -182,13 +185,13 @@ WatchersDirective = ($rootscope, $confirm, $repo, $qqueue, $template, $compile,
promise = $repo.save($model.$modelValue) promise = $repo.save($model.$modelValue)
promise.then -> promise.then ->
$confirm.notify("success")
watchers = _.map(watchers, (watcherId) -> $scope.usersById[watcherId]) watchers = _.map(watchers, (watcherId) -> $scope.usersById[watcherId])
renderWatchers(watchers) renderWatchers(watchers)
$rootscope.$broadcast("object:updated") $rootscope.$broadcast("object:updated")
promise.then null, -> promise.then null, ->
$model.$modelValue.revert() $model.$modelValue.revert()
$confirm.notify("error")
deleteWatcher = $qqueue.bindAdd (watcherIds) => deleteWatcher = $qqueue.bindAdd (watcherIds) =>
item = $model.$modelValue.clone() item = $model.$modelValue.clone()
@ -197,7 +200,6 @@ WatchersDirective = ($rootscope, $confirm, $repo, $qqueue, $template, $compile,
promise = $repo.save($model.$modelValue) promise = $repo.save($model.$modelValue)
promise.then -> promise.then ->
$confirm.notify("success")
watchers = _.map(item.watchers, (watcherId) -> $scope.usersById[watcherId]) watchers = _.map(item.watchers, (watcherId) -> $scope.usersById[watcherId])
renderWatchers(watchers) renderWatchers(watchers)
$rootscope.$broadcast("object:updated") $rootscope.$broadcast("object:updated")
@ -205,7 +207,6 @@ WatchersDirective = ($rootscope, $confirm, $repo, $qqueue, $template, $compile,
item.revert() item.revert()
$confirm.notify("error") $confirm.notify("error")
renderWatchers = (watchers) -> renderWatchers = (watchers) ->
ctx = { ctx = {
watchers: watchers watchers: watchers
@ -232,12 +233,6 @@ WatchersDirective = ($rootscope, $confirm, $repo, $qqueue, $template, $compile,
deleteWatcher(watcherIds) deleteWatcher(watcherIds)
$el.on "click", ".js-add-watcher", (event) ->
event.preventDefault()
return if not isEditable()
$scope.$apply ->
$rootscope.$broadcast("watcher:add", $model.$modelValue)
$scope.$on "watcher:added", (ctx, watcherId) -> $scope.$on "watcher:added", (ctx, watcherId) ->
watchers = _.clone($model.$modelValue.watchers, false) watchers = _.clone($model.$modelValue.watchers, false)
watchers.push(watcherId) watchers.push(watcherId)
@ -263,7 +258,7 @@ module.directive("tgWatchers", ["$rootScope", "$tgConfirm", "$tgRepo", "$tgQqueu
## Assigned to directive ## Assigned to directive
############################################################################# #############################################################################
AssignedToDirective = ($rootscope, $confirm, $repo, $loading, $qqueue, $template, $translate, $compile) -> AssignedToDirective = ($rootscope, $confirm, $repo, $loading, $qqueue, $template, $translate, $compile, $currentUserService) ->
# You have to include a div with the tg-lb-assignedto directive in the page # You have to include a div with the tg-lb-assignedto directive in the page
# where use this directive # where use this directive
template = $template.get("common/components/assigned-to.html", true) template = $template.get("common/components/assigned-to.html", true)
@ -282,7 +277,6 @@ AssignedToDirective = ($rootscope, $confirm, $repo, $loading, $qqueue, $template
promise = $repo.save($model.$modelValue) promise = $repo.save($model.$modelValue)
promise.then -> promise.then ->
currentLoading.finish() currentLoading.finish()
$confirm.notify("success")
renderAssignedTo($model.$modelValue) renderAssignedTo($model.$modelValue)
$rootscope.$broadcast("object:updated") $rootscope.$broadcast("object:updated")
promise.then null, -> promise.then null, ->
@ -292,13 +286,24 @@ AssignedToDirective = ($rootscope, $confirm, $repo, $loading, $qqueue, $template
return promise return promise
renderAssignedTo = (issue) -> renderAssignedTo = (assignedObject) ->
assignedToId = issue?.assigned_to if assignedObject?.assigned_to?
assignedTo = if assignedToId? then $scope.usersById[assignedToId] else null fullName = assignedObject.assigned_to_extra_info.full_name_display
photo = assignedObject.assigned_to_extra_info.photo
isUnassigned = false
else
fullName = $translate.instant("COMMON.ASSIGNED_TO.ASSIGN")
photo = "/#{window._version}/images/unnamed.png"
isUnassigned = true
isIocaine = assignedObject?.is_iocaine
ctx = { ctx = {
assignedTo: assignedTo fullName: fullName
photo: photo
isUnassigned: isUnassigned
isEditable: isEditable() isEditable: isEditable()
isIocaine: isIocaine
} }
html = $compile(template(ctx))($scope) html = $compile(template(ctx))($scope)
$el.html(html) $el.html(html)
@ -309,6 +314,12 @@ AssignedToDirective = ($rootscope, $confirm, $repo, $loading, $qqueue, $template
$scope.$apply -> $scope.$apply ->
$rootscope.$broadcast("assigned-to:add", $model.$modelValue) $rootscope.$broadcast("assigned-to:add", $model.$modelValue)
$el.on "click", ".assign-to-me", (event) ->
event.preventDefault()
return if not isEditable()
$model.$modelValue.assigned_to = $currentUserService.getUser().get('id')
save($currentUserService.getUser().get('id'))
$el.on "click", ".icon-delete", (event) -> $el.on "click", ".icon-delete", (event) ->
event.preventDefault() event.preventDefault()
return if not isEditable() return if not isEditable()
@ -335,7 +346,7 @@ AssignedToDirective = ($rootscope, $confirm, $repo, $loading, $qqueue, $template
require:"ngModel" require:"ngModel"
} }
module.directive("tgAssignedTo", ["$rootScope", "$tgConfirm", "$tgRepo", "$tgLoading", "$tgQqueue", "$tgTemplate", "$translate", "$compile", module.directive("tgAssignedTo", ["$rootScope", "$tgConfirm", "$tgRepo", "$tgLoading", "$tgQqueue", "$tgTemplate", "$translate", "$compile","tgCurrentUserService",
AssignedToDirective]) AssignedToDirective])
@ -357,11 +368,11 @@ BlockButtonDirective = ($rootscope, $loading, $template) ->
$el.find('.item-block').addClass('editable') $el.find('.item-block').addClass('editable')
if item.is_blocked if item.is_blocked
$el.find('.item-block').hide() $el.find('.item-block').removeClass('is-active')
$el.find('.item-unblock').show() $el.find('.item-unblock').addClass('is-active')
else else
$el.find('.item-block').show() $el.find('.item-block').addClass('is-active')
$el.find('.item-unblock').hide() $el.find('.item-unblock').removeClass('is-active')
$el.on "click", ".item-block", (event) -> $el.on "click", ".item-block", (event) ->
event.preventDefault() event.preventDefault()
@ -604,8 +615,78 @@ EditableDescriptionDirective = ($rootscope, $repo, $confirm, $compile, $loading,
template: template template: template
} }
module.directive("tgEditableDescription", ["$rootScope", "$tgRepo", "$tgConfirm", "$compile", "$tgLoading", module.directive("tgEditableDescription", [
"$selectedText", "$tgQqueue", "$tgTemplate", EditableDescriptionDirective]) "$rootScope",
"$tgRepo",
"$tgConfirm",
"$compile",
"$tgLoading",
"$selectedText",
"$tgQqueue",
"$tgTemplate", EditableDescriptionDirective])
EditableWysiwyg = (attachmentsService, attachmentsFullService) ->
link = ($scope, $el, $attrs, $model) ->
isInEditMode = ->
return $el.find('textarea').is(':visible')
uploadFile = (file, type) ->
return if !attachmentsService.validate(file)
return attachmentsFullService.addAttachment($model.$modelValue.project, $model.$modelValue.id, type, file).then (result) ->
if taiga.isImage(result.getIn(['file', 'name']))
return '![' + result.getIn(['file', 'name']) + '](' + result.getIn(['file', 'url']) + ')'
else
return '[' + result.getIn(['file', 'name']) + '](' + result.getIn(['file', 'url']) + ')'
$el.on 'dragover', (e) ->
textarea = $el.find('textarea').focus()
return false
$el.on 'drop', (e) ->
e.stopPropagation()
e.preventDefault()
if isInEditMode()
dataTransfer = e.dataTransfer || (e.originalEvent && e.originalEvent.dataTransfer)
textarea = $el.find('textarea')
textarea.addClass('in-progress')
type = $model.$modelValue['_name']
if type == "userstories"
type = "us"
else if type == "tasks"
type = "task"
else if type == "issues"
type = "issue"
else if type == "wiki"
type = "wiki_page"
promises = _.map dataTransfer.files, (file) ->
return uploadFile(file, type)
Promise.all(promises).then (result) ->
textarea = $el.find('textarea')
$.markItUp({ replaceWith: result.join(' ') })
textarea.removeClass('in-progress')
return {
link: link
restrict: "EA"
require: "ngModel"
}
module.directive("tgEditableWysiwyg", ["tgAttachmentsService", "tgAttachmentsFullService", EditableWysiwyg])
############################################################################# #############################################################################
@ -637,13 +718,16 @@ ListItemTaskStatusDirective = ->
module.directive("tgListitemTaskStatus", ListItemTaskStatusDirective) module.directive("tgListitemTaskStatus", ListItemTaskStatusDirective)
ListItemAssignedtoDirective = ($template) -> ListItemAssignedtoDirective = ($template, $translate) ->
template = $template.get("common/components/list-item-assigned-to-avatar.html", true) template = $template.get("common/components/list-item-assigned-to-avatar.html", true)
link = ($scope, $el, $attrs) -> link = ($scope, $el, $attrs) ->
bindOnce $scope, "usersById", (usersById) -> bindOnce $scope, "usersById", (usersById) ->
item = $scope.$eval($attrs.tgListitemAssignedto) item = $scope.$eval($attrs.tgListitemAssignedto)
ctx = {name: "Unassigned", imgurl: "/" + window._version + "/images/unnamed.png"} ctx = {
name: $translate.instant("COMMON.ASSIGNED_TO.NOT_ASSIGNED"),
imgurl: "/#{window._version}/images/unnamed.png"
}
member = usersById[item.assigned_to] member = usersById[item.assigned_to]
if member if member
@ -654,7 +738,7 @@ ListItemAssignedtoDirective = ($template) ->
return {link:link} return {link:link}
module.directive("tgListitemAssignedto", ["$tgTemplate", ListItemAssignedtoDirective]) module.directive("tgListitemAssignedto", ["$tgTemplate", "$translate", ListItemAssignedtoDirective])
ListItemIssueStatusDirective = -> ListItemIssueStatusDirective = ->
@ -770,7 +854,7 @@ module.directive("tgProgressBar", ["$tgTemplate", TgProgressBarDirective])
TgMainTitleDirective = ($translate) -> TgMainTitleDirective = ($translate) ->
link = ($scope, $el, $attrs) -> link = ($scope, $el, $attrs) ->
$attrs.$observe "i18nSectionName", (i18nSectionName) -> $attrs.$observe "i18nSectionName", (i18nSectionName) ->
$scope.sectionName = $translate.instant(i18nSectionName) $scope.sectionName = i18nSectionName
$scope.$on "$destroy", -> $scope.$on "$destroy", ->
$el.off() $el.off()

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
@ -28,7 +31,7 @@ module = angular.module("taigaCommon")
## User story estimation directive (for Lightboxes) ## User story estimation directive (for Lightboxes)
############################################################################# #############################################################################
LbUsEstimationDirective = ($tgEstimationsService, $rootScope, $repo, $confirm, $template, $compile) -> LbUsEstimationDirective = ($tgEstimationsService, $rootScope, $repo, $template, $compile) ->
# Display the points of a US and you can edit it. # Display the points of a US and you can edit it.
# #
# Example: # Example:
@ -69,14 +72,15 @@ LbUsEstimationDirective = ($tgEstimationsService, $rootScope, $repo, $confirm, $
require: "ngModel" require: "ngModel"
} }
module.directive("tgLbUsEstimation", ["$tgEstimationsService", "$rootScope", "$tgRepo", "$tgConfirm", "$tgTemplate", "$compile", LbUsEstimationDirective]) module.directive("tgLbUsEstimation", ["$tgEstimationsService", "$rootScope", "$tgRepo", "$tgTemplate",
"$compile", LbUsEstimationDirective])
############################################################################# #############################################################################
## User story estimation directive ## User story estimation directive
############################################################################# #############################################################################
UsEstimationDirective = ($tgEstimationsService, $rootScope, $repo, $confirm, $qqueue, $template, $compile) -> UsEstimationDirective = ($tgEstimationsService, $rootScope, $repo, $qqueue, $template, $compile) ->
# Display the points of a US and you can edit it. # Display the points of a US and you can edit it.
# #
# Example: # Example:
@ -117,8 +121,8 @@ UsEstimationDirective = ($tgEstimationsService, $rootScope, $repo, $confirm, $qq
require: "ngModel" require: "ngModel"
} }
module.directive("tgUsEstimation", ["$tgEstimationsService", "$rootScope", "$tgRepo", "$tgConfirm", "$tgQqueue", "$tgTemplate", "$compile" module.directive("tgUsEstimation", ["$tgEstimationsService", "$rootScope", "$tgRepo", "$tgQqueue",
UsEstimationDirective]) "$tgTemplate", "$compile", UsEstimationDirective])
############################################################################# #############################################################################
@ -142,7 +146,6 @@ EstimationsService = ($template, $qqueue, $repo, $confirm, $q) ->
$qqueue.add () => $qqueue.add () =>
onSuccess = => onSuccess = =>
deferred.resolve() deferred.resolve()
$confirm.notify("success")
onError = => onError = =>
$confirm.notify("error") $confirm.notify("error")
@ -244,4 +247,5 @@ EstimationsService = ($template, $qqueue, $repo, $confirm, $q) ->
create: create create: create
} }
module.factory("$tgEstimationsService", ["$tgTemplate", "$tgQqueue", "$tgRepo", "$tgConfirm", "$q", EstimationsService]) module.factory("$tgEstimationsService", ["$tgTemplate", "$tgQqueue", "$tgRepo", "$tgConfirm",
"$q", EstimationsService])

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
@ -65,3 +68,9 @@ momentFromNow = ->
return "" return ""
module.filter("momentFromNow", momentFromNow) module.filter("momentFromNow", momentFromNow)
sizeFormat = =>
return @.taiga.sizeFormat
module.filter("sizeFormat", sizeFormat)

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
@ -302,6 +305,7 @@ HistoryDirective = ($log, $loading, $qqueue, $template, $confirm, $translate, $c
changesText: renderChangesHelperText(comment) changesText: renderChangesHelperText(comment)
changes: renderChangeEntries(comment) changes: renderChangeEntries(comment)
mode: "comment" mode: "comment"
deleteCommentActionTitle: $translate.instant("COMMENTS.DELETE")
deleteCommentDate: moment(comment.delete_comment_date).format(getPrettyDateFormat()) if comment.delete_comment_date deleteCommentDate: moment(comment.delete_comment_date).format(getPrettyDateFormat()) if comment.delete_comment_date
deleteCommentUser: comment.delete_comment_user.name if comment.delete_comment_user?.name deleteCommentUser: comment.delete_comment_user.name if comment.delete_comment_user?.name
activityId: comment.id activityId: comment.id

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
@ -24,6 +27,7 @@ module = angular.module("taigaCommon")
bindOnce = @.taiga.bindOnce bindOnce = @.taiga.bindOnce
timeout = @.taiga.timeout timeout = @.taiga.timeout
debounce = @.taiga.debounce debounce = @.taiga.debounce
sizeFormat = @.taiga.sizeFormat
############################################################################# #############################################################################
## Common Lightbox Services ## Common Lightbox Services
@ -262,13 +266,30 @@ module.directive("tgBlockingMessageInput", ["$log", "$tgTemplate", "$compile", B
## Create/Edit Userstory Lightbox Directive ## Create/Edit Userstory Lightbox Directive
############################################################################# #############################################################################
CreateEditUserstoryDirective = ($repo, $model, $rs, $rootScope, lightboxService, $loading, $translate) -> CreateEditUserstoryDirective = ($repo, $model, $rs, $rootScope, lightboxService, $loading, $translate, $confirm, $q, attachmentsService) ->
link = ($scope, $el, attrs) -> link = ($scope, $el, attrs) ->
$scope.createEditUs = {}
$scope.isNew = true $scope.isNew = true
attachmentsToAdd = Immutable.List()
attachmentsToDelete = Immutable.List()
resetAttachments = () ->
attachmentsToAdd = Immutable.List()
attachmentsToDelete = Immutable.List()
$scope.addAttachment = (attachment) ->
attachmentsToAdd = attachmentsToAdd.push(attachment)
$scope.deleteAttachment = (attachment) ->
attachmentsToDelete = attachmentsToDelete.push(attachment)
$scope.$on "usform:new", (ctx, projectId, status, statusList) -> $scope.$on "usform:new", (ctx, projectId, status, statusList) ->
$scope.isNew = true $scope.isNew = true
$scope.usStatusList = statusList $scope.usStatusList = statusList
$scope.attachments = Immutable.List()
resetAttachments()
$scope.us = $model.make_model("userstories", { $scope.us = $model.make_model("userstories", {
project: projectId project: projectId
@ -290,10 +311,13 @@ CreateEditUserstoryDirective = ($repo, $model, $rs, $rootScope, lightboxService,
lightboxService.open($el) lightboxService.open($el)
$scope.$on "usform:edit", (ctx, us) -> $scope.$on "usform:edit", (ctx, us, attachments) ->
$scope.us = us $scope.us = us
$scope.attachments = Immutable.fromJS(attachments)
$scope.isNew = false $scope.isNew = false
resetAttachments()
# Update texts for edition # Update texts for edition
$el.find(".button-green").html($translate.instant("COMMON.SAVE")) $el.find(".button-green").html($translate.instant("COMMON.SAVE"))
$el.find(".title").html($translate.instant("LIGHTBOX.CREATE_EDIT_US.EDIT_US")) $el.find(".title").html($translate.instant("LIGHTBOX.CREATE_EDIT_US.EDIT_US"))
@ -318,6 +342,18 @@ CreateEditUserstoryDirective = ($repo, $model, $rs, $rootScope, lightboxService,
lightboxService.open($el) lightboxService.open($el)
createAttachments = (obj) ->
promises = _.map attachmentsToAdd.toJS(), (attachment) ->
attachmentsService.upload(attachment.file, obj.id, $scope.us.project, 'us')
return $q.all(promises)
deleteAttachments = (obj) ->
promises = _.map attachmentsToDelete.toJS(), (attachment) ->
return attachmentsService.delete("us", attachment.id)
return $q.all(promises)
submit = debounce 2000, (event) => submit = debounce 2000, (event) =>
event.preventDefault() event.preventDefault()
@ -336,6 +372,11 @@ CreateEditUserstoryDirective = ($repo, $model, $rs, $rootScope, lightboxService,
promise = $repo.save($scope.us) promise = $repo.save($scope.us)
broadcastEvent = "usform:edit:success" broadcastEvent = "usform:edit:success"
promise.then (data) ->
deleteAttachments(data).then () => createAttachments(data)
return data
promise.then (data) -> promise.then (data) ->
currentLoading.finish() currentLoading.finish()
lightboxService.close($el) lightboxService.close($el)
@ -377,6 +418,9 @@ module.directive("tgLbCreateEditUserstory", [
"lightboxService", "lightboxService",
"$tgLoading", "$tgLoading",
"$translate", "$translate",
"$tgConfirm",
"$q",
"tgAttachmentsService",
CreateEditUserstoryDirective CreateEditUserstoryDirective
]) ])
@ -629,30 +673,14 @@ module.directive("tgLbWatchers", ["$tgRepo", "lightboxService", "lightboxKeyboar
## Attachment Preview Lighbox ## Attachment Preview Lighbox
############################################################################# #############################################################################
AttachmentPreviewLightboxDirective = ($repo, lightboxService, lightboxKeyboardNavigationService, $template, $compile) -> AttachmentPreviewLightboxDirective = (lightboxService, $template, $compile) ->
link = ($scope, $el, attrs) -> link = ($scope, $el, attrs) ->
template = $template.get("common/lightbox/lightbox-attachment-preview.html", true)
$scope.$on "attachment:preview", (event, attachment) ->
lightboxService.open($el) lightboxService.open($el)
render(attachment)
$scope.$on "$destroy", ->
$el.off()
render = (attachment) ->
ctx = {
url: attachment.url,
title: attachment.description,
name: attachment.name
}
html = template(ctx)
html = $compile(html)($scope)
$el.html(html)
return { return {
link: link templateUrl: 'common/lightbox/lightbox-attachment-preview.html',
link: link,
scope: true
} }
module.directive("tgLbAttachmentPreview", ["$tgRepo", "lightboxService", "lightboxKeyboardNavigationService", "$tgTemplate", "$compile", AttachmentPreviewLightboxDirective]) module.directive("tgLbAttachmentPreview", ["lightboxService", "$tgTemplate", "$compile", AttachmentPreviewLightboxDirective])

View File

@ -1,9 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net> # Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net> # Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
@ -109,7 +112,7 @@ LoadingDirective = ($loading) ->
if showLoading if showLoading
currentLoading = $loading() currentLoading = $loading()
.target($el) .target($el)
.timeout(50) .timeout(100)
.template(template) .template(template)
.scope($scope) .scope($scope)
.start() .start()

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
@ -283,10 +286,11 @@ TagLineDirective = ($rootScope, $repo, $rs, $confirm, $qqueue, $template, $compi
$confirm.notify("error") $confirm.notify("error")
model.revert() model.revert()
$model.$setViewValue(model) $model.$setViewValue(model)
$repo.save(model).then(onSuccess, onError)
hideSaveButton() hideSaveButton()
return $repo.save(model).then(onSuccess, onError)
deleteValue = $qqueue.bindAdd (value) -> deleteValue = $qqueue.bindAdd (value) ->
value = trim(value.toLowerCase()) value = trim(value.toLowerCase())
return if value.length == 0 return if value.length == 0

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
@ -279,11 +282,10 @@ IssueStatusButtonDirective = ($rootScope, $repo, $confirm, $loading, $qqueue, $t
issue.status = statusId issue.status = statusId
currentLoading = $loading() currentLoading = $loading()
.target($el.find(".level-name")) .target($el)
.start() .start()
onSuccess = -> onSuccess = ->
$confirm.notify("success")
$model.$setViewValue(issue) $model.$setViewValue(issue)
$rootScope.$broadcast("object:updated") $rootScope.$broadcast("object:updated")
currentLoading.finish() currentLoading.finish()
@ -296,7 +298,7 @@ IssueStatusButtonDirective = ($rootScope, $repo, $confirm, $loading, $qqueue, $t
$repo.save(issue).then(onSuccess, onError) $repo.save(issue).then(onSuccess, onError)
$el.on "click", ".status-data", (event) -> $el.on "click", ".js-edit-status", (event) ->
event.preventDefault() event.preventDefault()
event.stopPropagation() event.stopPropagation()
return if not isEditable() return if not isEditable()
@ -370,7 +372,6 @@ IssueTypeButtonDirective = ($rootScope, $repo, $confirm, $loading, $qqueue, $tem
.start() .start()
onSuccess = -> onSuccess = ->
$confirm.notify("success")
$model.$setViewValue(issue) $model.$setViewValue(issue)
$rootScope.$broadcast("object:updated") $rootScope.$broadcast("object:updated")
currentLoading.finish() currentLoading.finish()
@ -459,7 +460,6 @@ IssueSeverityButtonDirective = ($rootScope, $repo, $confirm, $loading, $qqueue,
.start() .start()
onSuccess = -> onSuccess = ->
$confirm.notify("success")
$model.$setViewValue(issue) $model.$setViewValue(issue)
$rootScope.$broadcast("object:updated") $rootScope.$broadcast("object:updated")
currentLoading.finish() currentLoading.finish()
@ -548,7 +548,6 @@ IssuePriorityButtonDirective = ($rootScope, $repo, $confirm, $loading, $qqueue,
.start() .start()
onSuccess = -> onSuccess = ->
$confirm.notify("success")
$model.$setViewValue(issue) $model.$setViewValue(issue)
$rootScope.$broadcast("object:updated") $rootScope.$broadcast("object:updated")
currentLoading.finish() currentLoading.finish()

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
@ -29,12 +32,15 @@ module = angular.module("taigaIssues")
## Issue Create Lightbox Directive ## Issue Create Lightbox Directive
############################################################################# #############################################################################
CreateIssueDirective = ($repo, $confirm, $rootscope, lightboxService, $loading) -> CreateIssueDirective = ($repo, $confirm, $rootscope, lightboxService, $loading, $q, attachmentsService) ->
link = ($scope, $el, $attrs) -> link = ($scope, $el, $attrs) ->
form = $el.find("form").checksley() form = $el.find("form").checksley()
$scope.issue = {} $scope.issue = {}
$scope.attachments = Immutable.List()
$scope.$on "issueform:new", (ctx, project)-> $scope.$on "issueform:new", (ctx, project)->
attachmentsToAdd = Immutable.List()
$el.find(".tag-input").val("") $el.find(".tag-input").val("")
lightboxService.open($el) lightboxService.open($el)
@ -52,6 +58,21 @@ CreateIssueDirective = ($repo, $confirm, $rootscope, lightboxService, $loading)
$scope.$on "$destroy", -> $scope.$on "$destroy", ->
$el.off() $el.off()
createAttachments = (obj) ->
promises = _.map attachmentsToAdd.toJS(), (attachment) ->
return attachmentsService.upload(attachment.file, obj.id, $scope.issue.project, 'issue')
return $q.all(promises)
attachmentsToAdd = Immutable.List()
resetAttachments = () ->
attachmentsToAdd = Immutable.List()
$scope.addAttachment = (attachment) ->
attachmentsToAdd = attachmentsToAdd.push(attachment)
submit = debounce 2000, (event) => submit = debounce 2000, (event) =>
event.preventDefault() event.preventDefault()
@ -64,6 +85,9 @@ CreateIssueDirective = ($repo, $confirm, $rootscope, lightboxService, $loading)
promise = $repo.create("issues", $scope.issue) promise = $repo.create("issues", $scope.issue)
promise.then (data) ->
return createAttachments(data)
promise.then (data) -> promise.then (data) ->
currentLoading.finish() currentLoading.finish()
$rootscope.$broadcast("issueform:new:success", data) $rootscope.$broadcast("issueform:new:success", data)
@ -82,7 +106,7 @@ CreateIssueDirective = ($repo, $confirm, $rootscope, lightboxService, $loading)
return {link:link} return {link:link}
module.directive("tgLbCreateIssue", ["$tgRepo", "$tgConfirm", "$rootScope", "lightboxService", "$tgLoading", module.directive("tgLbCreateIssue", ["$tgRepo", "$tgConfirm", "$rootScope", "lightboxService", "$tgLoading", "$q", "tgAttachmentsService",
CreateIssueDirective]) CreateIssueDirective])

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
@ -775,7 +778,7 @@ module.directive("tgIssueStatusInlineEdition", ["$tgRepo", "$tgTemplate", "$root
## Issue assigned to Directive ## Issue assigned to Directive
############################################################################# #############################################################################
IssueAssignedToInlineEditionDirective = ($repo, $rootscope, popoverService) -> IssueAssignedToInlineEditionDirective = ($repo, $rootscope, $translate) ->
template = _.template(""" template = _.template("""
<img src="<%- imgurl %>" alt="<%- name %>"/> <img src="<%- imgurl %>" alt="<%- name %>"/>
<figcaption><%- name %></figcaption> <figcaption><%- name %></figcaption>
@ -783,11 +786,15 @@ IssueAssignedToInlineEditionDirective = ($repo, $rootscope, popoverService) ->
link = ($scope, $el, $attrs) -> link = ($scope, $el, $attrs) ->
updateIssue = (issue) -> updateIssue = (issue) ->
ctx = {name: "Unassigned", imgurl: "/" + window._version + "/images/unnamed.png"} ctx = {
name: $translate.instant("COMMON.ASSIGNED_TO.NOT_ASSIGNED"),
imgurl: "/#{window._version}/images/unnamed.png"
}
member = $scope.usersById[issue.assigned_to] member = $scope.usersById[issue.assigned_to]
if member if member
ctx.imgurl = member.photo
ctx.name = member.full_name_display ctx.name = member.full_name_display
ctx.imgurl = member.photo
$el.find(".avatar").html(template(ctx)) $el.find(".avatar").html(template(ctx))
$el.find(".issue-assignedto").attr('title', ctx.name) $el.find(".issue-assignedto").attr('title', ctx.name)
@ -819,5 +826,5 @@ IssueAssignedToInlineEditionDirective = ($repo, $rootscope, popoverService) ->
return {link: link} return {link: link}
module.directive("tgIssueAssignedToInlineEdition", ["$tgRepo", "$rootScope", module.directive("tgIssueAssignedToInlineEdition", ["$tgRepo", "$rootScope", "$translate"
IssueAssignedToInlineEditionDirective]) IssueAssignedToInlineEditionDirective])

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
@ -413,7 +416,7 @@ module.directive("tgKanbanArchivedStatusIntro", ["$translate", KanbanArchivedSta
## Kanban User Story Directive ## Kanban User Story Directive
############################################################################# #############################################################################
KanbanUserstoryDirective = ($rootscope, $loading, $rs) -> KanbanUserstoryDirective = ($rootscope, $loading, $rs, $rs2) ->
link = ($scope, $el, $attrs, $model) -> link = ($scope, $el, $attrs, $model) ->
$el.disableSelection() $el.disableSelection()
@ -437,7 +440,8 @@ KanbanUserstoryDirective = ($rootscope, $loading, $rs) ->
us = $model.$modelValue us = $model.$modelValue
$rs.userstories.getByRef(us.project, us.ref).then (editingUserStory) => $rs.userstories.getByRef(us.project, us.ref).then (editingUserStory) =>
$rootscope.$broadcast("usform:edit", editingUserStory) $rs2.attachments.list("us", us.id, us.project).then (attachments) =>
$rootscope.$broadcast("usform:edit", editingUserStory, attachments.toJS())
currentLoading.finish() currentLoading.finish()
$scope.getTemplateUrl = () -> $scope.getTemplateUrl = () ->
@ -455,7 +459,7 @@ KanbanUserstoryDirective = ($rootscope, $loading, $rs) ->
require: "ngModel" require: "ngModel"
} }
module.directive("tgKanbanUserstory", ["$rootScope", "$tgLoading", "$tgResources", KanbanUserstoryDirective]) module.directive("tgKanbanUserstory", ["$rootScope", "$tgLoading", "$tgResources", "tgResources", KanbanUserstoryDirective])
############################################################################# #############################################################################
## Kanban Squish Column Directive ## Kanban Squish Column Directive
@ -523,7 +527,7 @@ module.directive("tgKanbanWipLimit", KanbanWipLimitDirective)
## Kanban User Directive ## Kanban User Directive
############################################################################# #############################################################################
KanbanUserDirective = ($log, $compile) -> KanbanUserDirective = ($log, $compile, $translate) ->
template = _.template(""" template = _.template("""
<figure class="avatar"> <figure class="avatar">
<a href="#" title="{{'US.ASSIGN' | translate}}" <% if (!clickable) {%>class="not-clickable"<% } %>> <a href="#" title="{{'US.ASSIGN' | translate}}" <% if (!clickable) {%>class="not-clickable"<% } %>>
@ -551,9 +555,17 @@ KanbanUserDirective = ($log, $compile) ->
render = (user) -> render = (user) ->
if user is undefined if user is undefined
ctx = {name: "Unassigned", imgurl: "/" + window._version + "/images/unnamed.png", clickable: clickable} ctx = {
name: $translate.instant("COMMON.ASSIGNED_TO.NOT_ASSIGNED"),
imgurl: "/#{window._version}/images/unnamed.png",
clickable: clickable
}
else else
ctx = {name: user.full_name_display, imgurl: user.photo, clickable: clickable} ctx = {
name: user.full_name_display,
imgurl: user.photo,
clickable: clickable
}
html = $compile(template(ctx))($scope) html = $compile(template(ctx))($scope)
$el.html(html) $el.html(html)
@ -584,4 +596,4 @@ KanbanUserDirective = ($log, $compile) ->
return {link: link, require:"ngModel"} return {link: link, require:"ngModel"}
module.directive("tgKanbanUserAvatar", ["$log", "$compile", KanbanUserDirective]) module.directive("tgKanbanUserAvatar", ["$log", "$compile", "$translate", KanbanUserDirective])

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
@ -25,6 +28,7 @@ debounce = @.taiga.debounce
module = angular.module("taigaRelatedTasks", []) module = angular.module("taigaRelatedTasks", [])
RelatedTaskRowDirective = ($repo, $compile, $confirm, $rootscope, $loading, $template, $translate) -> RelatedTaskRowDirective = ($repo, $compile, $confirm, $rootscope, $loading, $template, $translate) ->
templateView = $template.get("task/related-task-row.html", true) templateView = $template.get("task/related-task-row.html", true)
templateEdit = $template.get("task/related-task-row-edit.html", true) templateEdit = $template.get("task/related-task-row-edit.html", true)
@ -40,7 +44,6 @@ RelatedTaskRowDirective = ($repo, $compile, $confirm, $rootscope, $loading, $tem
promise = $repo.save(task) promise = $repo.save(task)
promise.then => promise.then =>
currentLoading.finish() currentLoading.finish()
$confirm.notify("success")
$rootscope.$broadcast("related-tasks:update") $rootscope.$broadcast("related-tasks:update")
promise.then null, => promise.then null, =>
@ -89,7 +92,6 @@ RelatedTaskRowDirective = ($repo, $compile, $confirm, $rootscope, $loading, $tem
promise = $repo.remove(task) promise = $repo.remove(task)
promise.then -> promise.then ->
askResponse.finish() askResponse.finish()
$confirm.notify("success")
$scope.$emit("related-tasks:delete") $scope.$emit("related-tasks:delete")
promise.then null, -> promise.then null, ->
@ -111,7 +113,9 @@ RelatedTaskRowDirective = ($repo, $compile, $confirm, $rootscope, $loading, $tem
return {link:link, require:"ngModel"} return {link:link, require:"ngModel"}
module.directive("tgRelatedTaskRow", ["$tgRepo", "$compile", "$tgConfirm", "$rootScope", "$tgLoading", "$tgTemplate", "$translate", RelatedTaskRowDirective]) module.directive("tgRelatedTaskRow", ["$tgRepo", "$compile", "$tgConfirm", "$rootScope", "$tgLoading",
"$tgTemplate", "$translate", RelatedTaskRowDirective])
RelatedTaskCreateFormDirective = ($repo, $compile, $confirm, $tgmodel, $loading, $analytics, $template) -> RelatedTaskCreateFormDirective = ($repo, $compile, $confirm, $tgmodel, $loading, $analytics, $template) ->
template = $template.get("task/related-task-create-form.html", true) template = $template.get("task/related-task-create-form.html", true)
@ -138,7 +142,6 @@ RelatedTaskCreateFormDirective = ($repo, $compile, $confirm, $tgmodel, $loading,
$analytics.trackEvent("task", "create", "create task on userstory", 1) $analytics.trackEvent("task", "create", "create task on userstory", 1)
currentLoading.finish() currentLoading.finish()
$scope.$emit("related-tasks:add") $scope.$emit("related-tasks:add")
$confirm.notify("success")
promise.then null, -> promise.then null, ->
$el.find('input').val(task.subject) $el.find('input').val(task.subject)
@ -188,12 +191,13 @@ RelatedTaskCreateFormDirective = ($repo, $compile, $confirm, $tgmodel, $loading,
$el.off() $el.off()
return {link: link} return {link: link}
module.directive("tgRelatedTaskCreateForm", ["$tgRepo", "$compile", "$tgConfirm", "$tgModel", "$tgLoading", "$tgAnalytics", "$tgTemplate", RelatedTaskCreateFormDirective])
RelatedTaskCreateButtonDirective = ($repo, $compile, $confirm, $tgmodel) -> module.directive("tgRelatedTaskCreateForm", ["$tgRepo", "$compile", "$tgConfirm", "$tgModel", "$tgLoading",
template = _.template(""" "$tgAnalytics", "$tgTemplate", RelatedTaskCreateFormDirective])
<a ng-show="!newRelatedTaskFormOpen" class="icon icon-plus related-tasks-buttons ng-animate-disabled"></a>
""")
RelatedTaskCreateButtonDirective = ($repo, $compile, $confirm, $tgmodel, $template) ->
template = $template.get("common/components/add-button.html", true)
link = ($scope, $el, $attrs) -> link = ($scope, $el, $attrs) ->
$scope.$watch "project", (val) -> $scope.$watch "project", (val) ->
@ -204,14 +208,17 @@ RelatedTaskCreateButtonDirective = ($repo, $compile, $confirm, $tgmodel) ->
else else
$el.html("") $el.html("")
$el.on "click", ".icon", (event)-> $el.on "click", ".add-button", (event)->
$scope.$emit("related-tasks:add-new-clicked") $scope.$emit("related-tasks:add-new-clicked")
$scope.$on "$destroy", -> $scope.$on "$destroy", ->
$el.off() $el.off()
return {link: link} return {link: link}
module.directive("tgRelatedTaskCreateButton", ["$tgRepo", "$compile", "$tgConfirm", "$tgModel", RelatedTaskCreateButtonDirective])
module.directive("tgRelatedTaskCreateButton", ["$tgRepo", "$compile", "$tgConfirm", "$tgModel",
"$tgTemplate", RelatedTaskCreateButtonDirective])
RelatedTasksDirective = ($repo, $rs, $rootscope) -> RelatedTasksDirective = ($repo, $rs, $rootscope) ->
link = ($scope, $el, $attrs) -> link = ($scope, $el, $attrs) ->
@ -238,9 +245,11 @@ RelatedTasksDirective = ($repo, $rs, $rootscope) ->
$el.off() $el.off()
return {link: link} return {link: link}
module.directive("tgRelatedTasks", ["$tgRepo", "$tgResources", "$rootScope", RelatedTasksDirective]) module.directive("tgRelatedTasks", ["$tgRepo", "$tgResources", "$rootScope", RelatedTasksDirective])
RelatedTaskAssignedToInlineEditionDirective = ($repo, $rootscope, popoverService) ->
RelatedTaskAssignedToInlineEditionDirective = ($repo, $rootscope, $translate) ->
template = _.template(""" template = _.template("""
<img src="<%- imgurl %>" alt="<%- name %>"/> <img src="<%- imgurl %>" alt="<%- name %>"/>
<figcaption><%- name %></figcaption> <figcaption><%- name %></figcaption>
@ -248,7 +257,10 @@ RelatedTaskAssignedToInlineEditionDirective = ($repo, $rootscope, popoverService
link = ($scope, $el, $attrs) -> link = ($scope, $el, $attrs) ->
updateRelatedTask = (task) -> updateRelatedTask = (task) ->
ctx = {name: "Unassigned", imgurl: "/" + window._version + "/images/unnamed.png"} ctx = {
name: $translate.instant("COMMON.ASSIGNED_TO.NOT_ASSIGNED"),
imgurl: "/" + window._version + "/images/unnamed.png"
}
member = $scope.usersById[task.assigned_to] member = $scope.usersById[task.assigned_to]
if member if member
ctx.imgurl = member.photo ctx.imgurl = member.photo
@ -286,4 +298,5 @@ RelatedTaskAssignedToInlineEditionDirective = ($repo, $rootscope, popoverService
return {link: link} return {link: link}
module.directive("tgRelatedTaskAssignedToInlineEdition", ["$tgRepo", "$rootScope", RelatedTaskAssignedToInlineEditionDirective]) module.directive("tgRelatedTaskAssignedToInlineEdition", ["$tgRepo", "$rootScope", "$translate",
RelatedTaskAssignedToInlineEditionDirective])

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
@ -172,6 +175,9 @@ urls = {
# Application tokens # Application tokens
"applications": "/applications" "applications": "/applications"
"application-tokens": "/application-tokens" "application-tokens": "/application-tokens"
# Stats
"stats-discover": "/stats/discover"
} }
# Initialize api urls service # Initialize api urls service
@ -210,7 +216,6 @@ module.run([
"$tgIssuesResourcesProvider", "$tgIssuesResourcesProvider",
"$tgWikiResourcesProvider", "$tgWikiResourcesProvider",
"$tgSearchResourcesProvider", "$tgSearchResourcesProvider",
"$tgAttachmentsResourcesProvider",
"$tgMdRenderResourcesProvider", "$tgMdRenderResourcesProvider",
"$tgHistoryResourcesProvider", "$tgHistoryResourcesProvider",
"$tgKanbanResourcesProvider", "$tgKanbanResourcesProvider",

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
@ -150,6 +153,31 @@ resourceProvider = ($config, $repo, $http, $urls, $auth, $q, $translate) ->
return defered.promise return defered.promise
service.changeLogo = (projectId, file) ->
maxFileSize = $config.get("maxUploadFileSize", null)
if maxFileSize and file.size > maxFileSize
response = {
status: 413,
data: _error_message: "'#{file.name}' (#{sizeFormat(file.size)}) is too heavy for our oompa
loompas, try it with a smaller than (#{sizeFormat(maxFileSize)})"
}
defered = $q.defer()
defered.reject(response)
return defered.promise
data = new FormData()
data.append('logo', file)
options = {
transformRequest: angular.identity,
headers: {'Content-Type': undefined}
}
url = "#{$urls.resolve("projects")}/#{projectId}/change_logo"
return $http.post(url, data, {}, options)
service.removeLogo = (projectId) ->
url = "#{$urls.resolve("projects")}/#{projectId}/remove_logo"
return $http.post(url)
return (instance) -> return (instance) ->
instance.projects = service instance.projects = service

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
@ -174,7 +177,7 @@ SearchDirective = ($log, $compile, $templatecache, $routeparams, $location) ->
linkTable = ($scope, $el, $attrs, $ctrl) -> linkTable = ($scope, $el, $attrs, $ctrl) ->
applyAutoTab = true applyAutoTab = true
activeSectionName = "userstories" activeSectionName = "userstories"
tabsDom = $el.find("section.search-filter") tabsDom = $el.find(".search-filter")
lastSearchResults = null lastSearchResults = null
getActiveSection = (data) -> getActiveSection = (data) ->
@ -197,7 +200,7 @@ SearchDirective = ($log, $compile, $templatecache, $routeparams, $location) ->
maxVal = value.length maxVal = value.length
selectedSection.name = name selectedSection.name = name
selectedSection.value = value selectedSection.value = value
break; break
if maxVal == 0 if maxVal == 0
return selectedSection return selectedSection
@ -206,7 +209,7 @@ SearchDirective = ($log, $compile, $templatecache, $routeparams, $location) ->
renderFilterTabs = (data) -> renderFilterTabs = (data) ->
for name, value of data for name, value of data
continue if name == "count" tabsDom.find("li.#{name}").show()
tabsDom.find("li.#{name} .num").html(value.length) tabsDom.find("li.#{name} .num").html(value.length)
markSectionTabActive = (section) -> markSectionTabActive = (section) ->

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
@ -23,10 +26,36 @@ taiga = @.taiga
bindOnce = @.taiga.bindOnce bindOnce = @.taiga.bindOnce
debounce = @.taiga.debounce debounce = @.taiga.debounce
CreateEditTaskDirective = ($repo, $model, $rs, $rootscope, $loading, lightboxService, $translate) -> CreateEditTaskDirective = ($repo, $model, $rs, $rootscope, $loading, lightboxService, $translate, $q, attachmentsService) ->
link = ($scope, $el, attrs) -> link = ($scope, $el, attrs) ->
$scope.isNew = true $scope.isNew = true
attachmentsToAdd = Immutable.List()
attachmentsToDelete = Immutable.List()
resetAttachments = () ->
attachmentsToAdd = Immutable.List()
attachmentsToDelete = Immutable.List()
$scope.addAttachment = (attachment) ->
attachmentsToAdd = attachmentsToAdd.push(attachment)
$scope.deleteAttachment = (attachment) ->
attachmentsToDelete = attachmentsToDelete.push(attachment)
createAttachments = (obj) ->
promises = _.map attachmentsToAdd.toJS(), (attachment) ->
attachmentsService.upload(attachment.file, obj.id, $scope.task.project, 'task')
return $q.all(promises)
deleteAttachments = (obj) ->
console.log attachmentsToDelete.toJS()
promises = _.map attachmentsToDelete.toJS(), (attachment) ->
return attachmentsService.delete("task", attachment.id)
return $q.all(promises)
$scope.$on "taskform:new", (ctx, sprintId, usId) -> $scope.$on "taskform:new", (ctx, sprintId, usId) ->
$scope.task = { $scope.task = {
project: $scope.projectId project: $scope.projectId
@ -38,6 +67,9 @@ CreateEditTaskDirective = ($repo, $model, $rs, $rootscope, $loading, lightboxSer
tags: [] tags: []
} }
$scope.isNew = true $scope.isNew = true
$scope.attachments = Immutable.List()
resetAttachments()
# Update texts for creation # Update texts for creation
create = $translate.instant("COMMON.CREATE") create = $translate.instant("COMMON.CREATE")
@ -49,10 +81,14 @@ CreateEditTaskDirective = ($repo, $model, $rs, $rootscope, $loading, lightboxSer
$el.find(".tag-input").val("") $el.find(".tag-input").val("")
lightboxService.open($el) lightboxService.open($el)
$scope.$on "taskform:edit", (ctx, task) -> $scope.$on "taskform:edit", (ctx, task, attachments) ->
$scope.task = task $scope.task = task
$scope.isNew = false $scope.isNew = false
$scope.attachments = Immutable.fromJS(attachments)
resetAttachments()
# Update texts for edition # Update texts for edition
save = $translate.instant("COMMON.SAVE") save = $translate.instant("COMMON.SAVE")
edit = $translate.instant("LIGHTBOX.CREATE_EDIT_TASK.ACTION_EDIT") edit = $translate.instant("LIGHTBOX.CREATE_EDIT_TASK.ACTION_EDIT")
@ -80,6 +116,12 @@ CreateEditTaskDirective = ($repo, $model, $rs, $rootscope, $loading, lightboxSer
promise = $repo.save($scope.task) promise = $repo.save($scope.task)
broadcastEvent = "taskform:edit:success" broadcastEvent = "taskform:edit:success"
promise.then (data) ->
createAttachments(data)
deleteAttachments(data)
return data
currentLoading = $loading() currentLoading = $loading()
.target(submitButton) .target(submitButton)
.start() .start()
@ -152,7 +194,9 @@ module.directive("tgLbCreateEditTask", [
"$rootScope", "$rootScope",
"$tgLoading", "$tgLoading",
"lightboxService", "lightboxService",
"$translate" "$translate",
"$q",
"tgAttachmentsService",
CreateEditTaskDirective CreateEditTaskDirective
]) ])

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
@ -304,7 +307,7 @@ module.directive("tgTaskboard", ["$rootScope", TaskboardDirective])
## Taskboard Task Directive ## Taskboard Task Directive
############################################################################# #############################################################################
TaskboardTaskDirective = ($rootscope, $loading, $rs) -> TaskboardTaskDirective = ($rootscope, $loading, $rs, $rs2) ->
link = ($scope, $el, $attrs, $model) -> link = ($scope, $el, $attrs, $model) ->
$el.disableSelection() $el.disableSelection()
@ -327,14 +330,16 @@ TaskboardTaskDirective = ($rootscope, $loading, $rs) ->
.start() .start()
task = $scope.task task = $scope.task
$rs.tasks.getByRef(task.project, task.ref).then (editingTask) => $rs.tasks.getByRef(task.project, task.ref).then (editingTask) =>
$rootscope.$broadcast("taskform:edit", editingTask) $rs2.attachments.list("task", editingTask.id, editingTask.project).then (attachments) =>
$rootscope.$broadcast("taskform:edit", editingTask, attachments.toJS())
currentLoading.finish() currentLoading.finish()
return {link:link} return {link:link}
module.directive("tgTaskboardTask", ["$rootScope", "$tgLoading", "$tgResources", TaskboardTaskDirective]) module.directive("tgTaskboardTask", ["$rootScope", "$tgLoading", "$tgResources", "tgResources", TaskboardTaskDirective])
############################################################################# #############################################################################
## Taskboard Squish Column Directive ## Taskboard Squish Column Directive
@ -431,7 +436,7 @@ module.directive("tgTaskboardSquishColumn", ["$tgResources", TaskboardSquishColu
## Taskboard User Directive ## Taskboard User Directive
############################################################################# #############################################################################
TaskboardUserDirective = ($log) -> TaskboardUserDirective = ($log, $translate) ->
clickable = false clickable = false
link = ($scope, $el, $attrs) -> link = ($scope, $el, $attrs) ->
@ -442,9 +447,17 @@ TaskboardUserDirective = ($log) ->
user = $scope.usersById[assigned_to] user = $scope.usersById[assigned_to]
if user is undefined if user is undefined
_.assign($scope, {name: "Unassigned", imgurl: "/" + window._version + "/images/unnamed.png", clickable: clickable}) _.assign($scope, {
name: $translate.instant("COMMON.ASSIGNED_TO.NOT_ASSIGNED"),
imgurl: "/#{window._version}/images/unnamed.png",
clickable: clickable
})
else else
_.assign($scope, {name: user.full_name_display, imgurl: user.photo, clickable: clickable}) _.assign($scope, {
name: user.full_name_display,
imgurl: user.photo,
clickable: clickable
})
username_label.text($scope.name) username_label.text($scope.name)
@ -479,4 +492,4 @@ TaskboardUserDirective = ($log) ->
} }
module.directive("tgTaskboardUserAvatar", ["$log", TaskboardUserDirective]) module.directive("tgTaskboardUserAvatar", ["$log", "$translate", TaskboardUserDirective])

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
@ -275,12 +278,11 @@ TaskStatusButtonDirective = ($rootScope, $repo, $confirm, $loading, $qqueue, $co
task.status = status task.status = status
currentLoading = $loading() currentLoading = $loading()
.target($el.find(".level-name")) .target($el)
.start() .start()
onSuccess = -> onSuccess = ->
$model.$setViewValue(task) $model.$setViewValue(task)
$confirm.notify("success")
$rootScope.$broadcast("object:updated") $rootScope.$broadcast("object:updated")
currentLoading.finish() currentLoading.finish()
@ -290,7 +292,7 @@ TaskStatusButtonDirective = ($rootScope, $repo, $confirm, $loading, $qqueue, $co
$repo.save(task).then(onSuccess, onError) $repo.save(task).then(onSuccess, onError)
$el.on "click", ".status-data", (event) -> $el.on "click", ".js-edit-status", (event) ->
event.preventDefault() event.preventDefault()
event.stopPropagation() event.stopPropagation()
return if not isEditable() return if not isEditable()
@ -324,17 +326,8 @@ module.directive("tgTaskStatusButton", ["$rootScope", "$tgRepo", "$tgConfirm", "
"$compile", "$translate", "$tgTemplate", TaskStatusButtonDirective]) "$compile", "$translate", "$tgTemplate", TaskStatusButtonDirective])
TaskIsIocaineButtonDirective = ($rootscope, $tgrepo, $confirm, $loading, $qqueue, $compile) -> TaskIsIocaineButtonDirective = ($rootscope, $tgrepo, $confirm, $loading, $qqueue, $compile, $template) ->
template = _.template(""" template = $template.get("issue/iocaine-button.html", true)
<fieldset title="{{ 'TASK.TITLE_ACTION_IOCAINE' | translate }}">
<label for="is-iocaine"
translate="TASK.ACTION_IOCAINE"
class="button button-gray is-iocaine <% if(isEditable){ %>editable<% }; %> <% if(isIocaine){ %>active<% }; %>">
Iocaine
</label>
<input type="checkbox" id="is-iocaine" name="is-iocaine"/>
</fieldset>
""")
link = ($scope, $el, $attrs, $model) -> link = ($scope, $el, $attrs, $model) ->
isEditable = -> isEditable = ->
@ -364,7 +357,6 @@ TaskIsIocaineButtonDirective = ($rootscope, $tgrepo, $confirm, $loading, $qqueue
promise.then -> promise.then ->
$model.$setViewValue(task) $model.$setViewValue(task)
$confirm.notify("success")
$rootscope.$broadcast("object:updated") $rootscope.$broadcast("object:updated")
promise.then null, -> promise.then null, ->
@ -392,4 +384,4 @@ TaskIsIocaineButtonDirective = ($rootscope, $tgrepo, $confirm, $loading, $qqueue
} }
module.directive("tgTaskIsIocaineButton", ["$rootScope", "$tgRepo", "$tgConfirm", "$tgLoading", "$tgQqueue", module.directive("tgTaskIsIocaineButton", ["$rootScope", "$tgRepo", "$tgConfirm", "$tgLoading", "$tgQqueue",
"$compile", TaskIsIocaineButtonDirective]) "$compile", "$tgTemplate", TaskIsIocaineButtonDirective])

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

View File

@ -1,7 +1,10 @@
### ###
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014-2016 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com> # Copyright (C) 2014-2016 David Barragán Merino <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Juan Francisco Alcántara <juanfran.alcantara@kaleidos.net>
# Copyright (C) 2014-2016 Xavi Julian <xavier.julian@kaleidos.net>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
@ -145,12 +148,12 @@ UserAvatarDirective = ($auth, $model, $rs, $confirm) ->
$auth.setUser(user) $auth.setUser(user)
$scope.user = user $scope.user = user
$el.find('.overlay').addClass('hidden') $el.find('.loading-overlay').removeClass('active')
$confirm.notify('success') $confirm.notify('success')
onError = (response) -> onError = (response) ->
showSizeInfo() if response.status == 413 showSizeInfo() if response.status == 413
$el.find('.overlay').addClass('hidden') $el.find('.loading-overlay').removeClass('active')
$confirm.notify('error', response.data._error_message) $confirm.notify('error', response.data._error_message)
# Change photo # Change photo
@ -159,12 +162,12 @@ UserAvatarDirective = ($auth, $model, $rs, $confirm) ->
$el.on "change", "#avatar-field", (event) -> $el.on "change", "#avatar-field", (event) ->
if $scope.avatarAttachment if $scope.avatarAttachment
$el.find('.overlay').removeClass('hidden') $el.find('.loading-overlay').addClass("active")
$rs.userSettings.changeAvatar($scope.avatarAttachment).then(onSuccess, onError) $rs.userSettings.changeAvatar($scope.avatarAttachment).then(onSuccess, onError)
# Use gravatar photo # Use gravatar photo
$el.on "click", "a.use-gravatar", (event) -> $el.on "click", "a.js-use-gravatar", (event) ->
$el.find('.overlay').removeClass('hidden') $el.find('.loading-overlay').addClass("active")
$rs.userSettings.removeAvatar().then(onSuccess, onError) $rs.userSettings.removeAvatar().then(onSuccess, onError)
$scope.$on "$destroy", -> $scope.$on "$destroy", ->

Some files were not shown because too many files have changed in this diff Show More