branch feature/pollen-riot-js updated (ebe2603 -> b91ed54)
This is an automated email from the git hooks/post-receive script. New change to branch feature/pollen-riot-js in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git from ebe2603 revert changes to fix tests new b91ed54 upgrade all poms to 3.0 + remove old js folders The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit b91ed540eac52cd788d1bfef48aa6af8128f4f77 Author: Kevin Morin <morin@codelutin.com> Date: Fri Feb 24 11:46:16 2017 +0100 upgrade all poms to 3.0 + remove old js folders Summary of changes: pollen-bundle/pom.xml | 2 +- pollen-persistence/pom.xml | 2 +- pollen-rest-api/pom.xml | 2 +- pollen-services/pom.xml | 2 +- pollen-ui-angular/.bowerrc | 5 - pollen-ui-angular/.gitignore | 9 - pollen-ui-angular/INSTALL.txt | 17 - pollen-ui-angular/LICENSE.txt | 661 ------- pollen-ui-angular/README.md | 14 - pollen-ui-angular/bower.json | 30 - pollen-ui-angular/package.json | 22 - pollen-ui-angular/pom.xml | 254 --- pollen-ui-angular/src/main/version.txt | 1 - pollen-ui-angular/src/main/webapp/WEB-INF/web.xml | 31 - pollen-ui-angular/src/main/webapp/i18n/en.js | 343 ---- pollen-ui-angular/src/main/webapp/i18n/fr.js | 342 ---- .../src/main/webapp/img/chart-icon.png | Bin 610 -> 0 bytes pollen-ui-angular/src/main/webapp/img/en.png | Bin 599 -> 0 bytes pollen-ui-angular/src/main/webapp/img/fr.png | Bin 545 -> 0 bytes pollen-ui-angular/src/main/webapp/img/pie-icon.png | Bin 1292 -> 0 bytes pollen-ui-angular/src/main/webapp/img/pollen.png | Bin 610 -> 0 bytes pollen-ui-angular/src/main/webapp/index.html | 192 -- pollen-ui-angular/src/main/webapp/js/app.js | 146 -- .../src/main/webapp/js/conf.js.example | 48 - .../src/main/webapp/js/controllers/alertCtrl.js | 208 --- .../main/webapp/js/controllers/favoriteListCtrl.js | 241 --- .../src/main/webapp/js/controllers/localeCtrl.js | 70 - .../src/main/webapp/js/controllers/mainCtrl.js | 35 - .../src/main/webapp/js/controllers/pollCtrl.js | 1953 -------------------- .../src/main/webapp/js/controllers/userCtrl.js | 292 --- pollen-ui-angular/src/main/webapp/js/directives.js | 727 -------- .../src/main/webapp/js/libs/ckeditor/config.js | 36 - .../main/webapp/js/scripts/sticky-inline-poll.js | 35 - pollen-ui-angular/src/main/webapp/js/services.js | 487 ----- pollen-ui-angular/src/main/webapp/less/style.less | 659 ------- .../src/main/webapp/less/variables.less | 122 -- .../src/main/webapp/partials/alerts.html | 37 - .../src/main/webapp/partials/big-poll.html | 79 - .../src/main/webapp/partials/dateTimePicker.html | 30 - .../main/webapp/partials/favoriteList-edit.html | 82 - .../main/webapp/partials/favoriteList-list.html | 32 - .../src/main/webapp/partials/home.html | 36 - .../src/main/webapp/partials/inline-poll.html | 156 -- .../src/main/webapp/partials/pagination.html | 33 - .../src/main/webapp/partials/poll-comment.html | 96 - .../src/main/webapp/partials/poll-info.html | 70 - .../src/main/webapp/partials/poll-link.html | 90 - .../src/main/webapp/partials/poll-list.html | 46 - .../main/webapp/partials/poll-listParticipant.html | 117 -- .../src/main/webapp/partials/poll-poll.html | 45 - .../src/main/webapp/partials/poll-popupChoice.html | 76 - .../src/main/webapp/partials/poll-result.html | 89 - .../src/main/webapp/partials/poll-settings.html | 307 --- .../src/main/webapp/partials/poll.html | 117 -- .../src/main/webapp/partials/printResource.html | 40 - .../src/main/webapp/partials/user-admin-list.html | 58 - .../webapp/partials/user-edit-editProfile.html | 65 - .../main/webapp/partials/user-edit-password.html | 64 - .../webapp/partials/user-edit-viewProfile.html | 46 - .../src/main/webapp/partials/user-edit.html | 29 - .../src/main/webapp/partials/user-login.html | 50 - .../main/webapp/partials/user-lostPassword.html | 43 - .../src/main/webapp/partials/user-register.html | 85 - pollen-ui-angular/src/test/karma.conf.ci.js | 38 - pollen-ui-angular/src/test/karma.conf.js | 112 -- .../src/test/unit/alertControllersTest.js | 141 -- .../src/test/unit/pollControllersTest.js | 522 ------ pollen-ui-js/.gitignore | 2 - pollen-ui-js/LICENSE.txt | 661 ------- pollen-ui-js/README.txt | 58 - pollen-ui-js/changelog.txt | 40 - pollen-ui-js/pom.xml | 95 - .../src/main/resources/nuiton-js/wro.properties | 26 - pollen-ui-js/src/main/resources/nuiton-js/wro.xml | 42 - .../src/main/webapp/bundle/Messages.properties | 196 -- .../webapp/css/bootstrap-datetimepicker.min.css | 8 - pollen-ui-js/src/main/webapp/css/style.css | 104 -- .../src/main/webapp/img/glyphicons_050_link.png | Bin 1410 -> 0 bytes pollen-ui-js/src/main/webapp/img/pollen.png | Bin 28557 -> 0 bytes pollen-ui-js/src/main/webapp/index.html | 102 - pollen-ui-js/src/main/webapp/js/controls/menu.js | 59 - .../src/main/webapp/js/controls/poll_form.js | 176 -- .../src/main/webapp/js/controls/poll_list.js | 53 - .../src/main/webapp/js/controls/poll_summary.js | 55 - .../src/main/webapp/js/controls/user_form.js | 122 -- pollen-ui-js/src/main/webapp/js/controls/vote.js | 183 -- .../webapp/js/libs/bootstrap-datetimepicker.min.js | 26 - .../src/main/webapp/js/libs/jquery.scrollto.js | 54 - pollen-ui-js/src/main/webapp/js/models/choices.js | 27 - pollen-ui-js/src/main/webapp/js/models/comments.js | 70 - pollen-ui-js/src/main/webapp/js/models/polls.js | 104 -- pollen-ui-js/src/main/webapp/js/models/users.js | 102 - pollen-ui-js/src/main/webapp/js/models/votes.js | 168 -- pollen-ui-js/src/main/webapp/js/pollen-utils.js | 33 - pollen-ui-js/src/main/webapp/js/route.js | 36 - pollen-ui-js/src/main/webapp/views/menu.ejs | 69 - pollen-ui-js/src/main/webapp/views/poll_form.ejs | 339 ---- pollen-ui-js/src/main/webapp/views/poll_list.ejs | 11 - pollen-ui-js/src/main/webapp/views/summary.ejs | 36 - pollen-ui-js/src/main/webapp/views/user_form.ejs | 75 - pollen-ui-js/src/main/webapp/views/vote.ejs | 192 -- pollen-ui-riot-js/pom.xml | 2 +- pollen-votecounting-aggregator/pom.xml | 2 +- pollen-votecounting-api/pom.xml | 2 +- pollen-votecounting-borda/pom.xml | 2 +- pollen-votecounting-condorcet/pom.xml | 2 +- pollen-votecounting-coombs/pom.xml | 2 +- pollen-votecounting-instant-runoff/pom.xml | 2 +- pollen-votecounting-normal/pom.xml | 2 +- pollen-votecounting-number/pom.xml | 2 +- pollen-votecounting-percentage/pom.xml | 2 +- 111 files changed, 14 insertions(+), 13149 deletions(-) delete mode 100644 pollen-ui-angular/.bowerrc delete mode 100644 pollen-ui-angular/.gitignore delete mode 100644 pollen-ui-angular/INSTALL.txt delete mode 100644 pollen-ui-angular/LICENSE.txt delete mode 100644 pollen-ui-angular/README.md delete mode 100644 pollen-ui-angular/bower.json delete mode 100644 pollen-ui-angular/package.json delete mode 100644 pollen-ui-angular/pom.xml delete mode 100644 pollen-ui-angular/src/main/version.txt delete mode 100644 pollen-ui-angular/src/main/webapp/WEB-INF/web.xml delete mode 100644 pollen-ui-angular/src/main/webapp/i18n/en.js delete mode 100644 pollen-ui-angular/src/main/webapp/i18n/fr.js delete mode 100644 pollen-ui-angular/src/main/webapp/img/chart-icon.png delete mode 100644 pollen-ui-angular/src/main/webapp/img/en.png delete mode 100644 pollen-ui-angular/src/main/webapp/img/fr.png delete mode 100644 pollen-ui-angular/src/main/webapp/img/pie-icon.png delete mode 100644 pollen-ui-angular/src/main/webapp/img/pollen.png delete mode 100644 pollen-ui-angular/src/main/webapp/index.html delete mode 100644 pollen-ui-angular/src/main/webapp/js/app.js delete mode 100644 pollen-ui-angular/src/main/webapp/js/conf.js.example delete mode 100644 pollen-ui-angular/src/main/webapp/js/controllers/alertCtrl.js delete mode 100644 pollen-ui-angular/src/main/webapp/js/controllers/favoriteListCtrl.js delete mode 100644 pollen-ui-angular/src/main/webapp/js/controllers/localeCtrl.js delete mode 100644 pollen-ui-angular/src/main/webapp/js/controllers/mainCtrl.js delete mode 100644 pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js delete mode 100644 pollen-ui-angular/src/main/webapp/js/controllers/userCtrl.js delete mode 100644 pollen-ui-angular/src/main/webapp/js/directives.js delete mode 100644 pollen-ui-angular/src/main/webapp/js/libs/ckeditor/config.js delete mode 100644 pollen-ui-angular/src/main/webapp/js/scripts/sticky-inline-poll.js delete mode 100644 pollen-ui-angular/src/main/webapp/js/services.js delete mode 100644 pollen-ui-angular/src/main/webapp/less/style.less delete mode 100644 pollen-ui-angular/src/main/webapp/less/variables.less delete mode 100644 pollen-ui-angular/src/main/webapp/partials/alerts.html delete mode 100644 pollen-ui-angular/src/main/webapp/partials/big-poll.html delete mode 100644 pollen-ui-angular/src/main/webapp/partials/dateTimePicker.html delete mode 100644 pollen-ui-angular/src/main/webapp/partials/favoriteList-edit.html delete mode 100644 pollen-ui-angular/src/main/webapp/partials/favoriteList-list.html delete mode 100644 pollen-ui-angular/src/main/webapp/partials/home.html delete mode 100644 pollen-ui-angular/src/main/webapp/partials/inline-poll.html delete mode 100644 pollen-ui-angular/src/main/webapp/partials/pagination.html delete mode 100644 pollen-ui-angular/src/main/webapp/partials/poll-comment.html delete mode 100644 pollen-ui-angular/src/main/webapp/partials/poll-info.html delete mode 100644 pollen-ui-angular/src/main/webapp/partials/poll-link.html delete mode 100644 pollen-ui-angular/src/main/webapp/partials/poll-list.html delete mode 100644 pollen-ui-angular/src/main/webapp/partials/poll-listParticipant.html delete mode 100644 pollen-ui-angular/src/main/webapp/partials/poll-poll.html delete mode 100644 pollen-ui-angular/src/main/webapp/partials/poll-popupChoice.html delete mode 100644 pollen-ui-angular/src/main/webapp/partials/poll-result.html delete mode 100644 pollen-ui-angular/src/main/webapp/partials/poll-settings.html delete mode 100644 pollen-ui-angular/src/main/webapp/partials/poll.html delete mode 100644 pollen-ui-angular/src/main/webapp/partials/printResource.html delete mode 100644 pollen-ui-angular/src/main/webapp/partials/user-admin-list.html delete mode 100644 pollen-ui-angular/src/main/webapp/partials/user-edit-editProfile.html delete mode 100644 pollen-ui-angular/src/main/webapp/partials/user-edit-password.html delete mode 100644 pollen-ui-angular/src/main/webapp/partials/user-edit-viewProfile.html delete mode 100644 pollen-ui-angular/src/main/webapp/partials/user-edit.html delete mode 100644 pollen-ui-angular/src/main/webapp/partials/user-login.html delete mode 100644 pollen-ui-angular/src/main/webapp/partials/user-lostPassword.html delete mode 100644 pollen-ui-angular/src/main/webapp/partials/user-register.html delete mode 100644 pollen-ui-angular/src/test/karma.conf.ci.js delete mode 100644 pollen-ui-angular/src/test/karma.conf.js delete mode 100644 pollen-ui-angular/src/test/unit/alertControllersTest.js delete mode 100644 pollen-ui-angular/src/test/unit/pollControllersTest.js delete mode 100644 pollen-ui-js/.gitignore delete mode 100644 pollen-ui-js/LICENSE.txt delete mode 100644 pollen-ui-js/README.txt delete mode 100644 pollen-ui-js/changelog.txt delete mode 100644 pollen-ui-js/pom.xml delete mode 100644 pollen-ui-js/src/main/resources/nuiton-js/wro.properties delete mode 100644 pollen-ui-js/src/main/resources/nuiton-js/wro.xml delete mode 100644 pollen-ui-js/src/main/webapp/bundle/Messages.properties delete mode 100644 pollen-ui-js/src/main/webapp/css/bootstrap-datetimepicker.min.css delete mode 100644 pollen-ui-js/src/main/webapp/css/style.css delete mode 100644 pollen-ui-js/src/main/webapp/img/glyphicons_050_link.png delete mode 100644 pollen-ui-js/src/main/webapp/img/pollen.png delete mode 100644 pollen-ui-js/src/main/webapp/index.html delete mode 100644 pollen-ui-js/src/main/webapp/js/controls/menu.js delete mode 100644 pollen-ui-js/src/main/webapp/js/controls/poll_form.js delete mode 100644 pollen-ui-js/src/main/webapp/js/controls/poll_list.js delete mode 100644 pollen-ui-js/src/main/webapp/js/controls/poll_summary.js delete mode 100644 pollen-ui-js/src/main/webapp/js/controls/user_form.js delete mode 100644 pollen-ui-js/src/main/webapp/js/controls/vote.js delete mode 100644 pollen-ui-js/src/main/webapp/js/libs/bootstrap-datetimepicker.min.js delete mode 100644 pollen-ui-js/src/main/webapp/js/libs/jquery.scrollto.js delete mode 100644 pollen-ui-js/src/main/webapp/js/models/choices.js delete mode 100644 pollen-ui-js/src/main/webapp/js/models/comments.js delete mode 100644 pollen-ui-js/src/main/webapp/js/models/polls.js delete mode 100644 pollen-ui-js/src/main/webapp/js/models/users.js delete mode 100644 pollen-ui-js/src/main/webapp/js/models/votes.js delete mode 100644 pollen-ui-js/src/main/webapp/js/pollen-utils.js delete mode 100644 pollen-ui-js/src/main/webapp/js/route.js delete mode 100644 pollen-ui-js/src/main/webapp/views/menu.ejs delete mode 100644 pollen-ui-js/src/main/webapp/views/poll_form.ejs delete mode 100644 pollen-ui-js/src/main/webapp/views/poll_list.ejs delete mode 100644 pollen-ui-js/src/main/webapp/views/summary.ejs delete mode 100644 pollen-ui-js/src/main/webapp/views/user_form.ejs delete mode 100644 pollen-ui-js/src/main/webapp/views/vote.ejs -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch feature/pollen-riot-js in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git commit b91ed540eac52cd788d1bfef48aa6af8128f4f77 Author: Kevin Morin <morin@codelutin.com> Date: Fri Feb 24 11:46:16 2017 +0100 upgrade all poms to 3.0 + remove old js folders --- pollen-bundle/pom.xml | 2 +- pollen-persistence/pom.xml | 2 +- pollen-rest-api/pom.xml | 2 +- pollen-services/pom.xml | 2 +- pollen-ui-angular/.bowerrc | 5 - pollen-ui-angular/.gitignore | 9 - pollen-ui-angular/INSTALL.txt | 17 - pollen-ui-angular/LICENSE.txt | 661 ------- pollen-ui-angular/README.md | 14 - pollen-ui-angular/bower.json | 30 - pollen-ui-angular/package.json | 22 - pollen-ui-angular/pom.xml | 254 --- pollen-ui-angular/src/main/version.txt | 1 - pollen-ui-angular/src/main/webapp/WEB-INF/web.xml | 31 - pollen-ui-angular/src/main/webapp/i18n/en.js | 343 ---- pollen-ui-angular/src/main/webapp/i18n/fr.js | 342 ---- .../src/main/webapp/img/chart-icon.png | Bin 610 -> 0 bytes pollen-ui-angular/src/main/webapp/img/en.png | Bin 599 -> 0 bytes pollen-ui-angular/src/main/webapp/img/fr.png | Bin 545 -> 0 bytes pollen-ui-angular/src/main/webapp/img/pie-icon.png | Bin 1292 -> 0 bytes pollen-ui-angular/src/main/webapp/img/pollen.png | Bin 610 -> 0 bytes pollen-ui-angular/src/main/webapp/index.html | 192 -- pollen-ui-angular/src/main/webapp/js/app.js | 146 -- .../src/main/webapp/js/conf.js.example | 48 - .../src/main/webapp/js/controllers/alertCtrl.js | 208 --- .../main/webapp/js/controllers/favoriteListCtrl.js | 241 --- .../src/main/webapp/js/controllers/localeCtrl.js | 70 - .../src/main/webapp/js/controllers/mainCtrl.js | 35 - .../src/main/webapp/js/controllers/pollCtrl.js | 1953 -------------------- .../src/main/webapp/js/controllers/userCtrl.js | 292 --- pollen-ui-angular/src/main/webapp/js/directives.js | 727 -------- .../src/main/webapp/js/libs/ckeditor/config.js | 36 - .../main/webapp/js/scripts/sticky-inline-poll.js | 35 - pollen-ui-angular/src/main/webapp/js/services.js | 487 ----- pollen-ui-angular/src/main/webapp/less/style.less | 659 ------- .../src/main/webapp/less/variables.less | 122 -- .../src/main/webapp/partials/alerts.html | 37 - .../src/main/webapp/partials/big-poll.html | 79 - .../src/main/webapp/partials/dateTimePicker.html | 30 - .../main/webapp/partials/favoriteList-edit.html | 82 - .../main/webapp/partials/favoriteList-list.html | 32 - .../src/main/webapp/partials/home.html | 36 - .../src/main/webapp/partials/inline-poll.html | 156 -- .../src/main/webapp/partials/pagination.html | 33 - .../src/main/webapp/partials/poll-comment.html | 96 - .../src/main/webapp/partials/poll-info.html | 70 - .../src/main/webapp/partials/poll-link.html | 90 - .../src/main/webapp/partials/poll-list.html | 46 - .../main/webapp/partials/poll-listParticipant.html | 117 -- .../src/main/webapp/partials/poll-poll.html | 45 - .../src/main/webapp/partials/poll-popupChoice.html | 76 - .../src/main/webapp/partials/poll-result.html | 89 - .../src/main/webapp/partials/poll-settings.html | 307 --- .../src/main/webapp/partials/poll.html | 117 -- .../src/main/webapp/partials/printResource.html | 40 - .../src/main/webapp/partials/user-admin-list.html | 58 - .../webapp/partials/user-edit-editProfile.html | 65 - .../main/webapp/partials/user-edit-password.html | 64 - .../webapp/partials/user-edit-viewProfile.html | 46 - .../src/main/webapp/partials/user-edit.html | 29 - .../src/main/webapp/partials/user-login.html | 50 - .../main/webapp/partials/user-lostPassword.html | 43 - .../src/main/webapp/partials/user-register.html | 85 - pollen-ui-angular/src/test/karma.conf.ci.js | 38 - pollen-ui-angular/src/test/karma.conf.js | 112 -- .../src/test/unit/alertControllersTest.js | 141 -- .../src/test/unit/pollControllersTest.js | 522 ------ pollen-ui-js/.gitignore | 2 - pollen-ui-js/LICENSE.txt | 661 ------- pollen-ui-js/README.txt | 58 - pollen-ui-js/changelog.txt | 40 - pollen-ui-js/pom.xml | 95 - .../src/main/resources/nuiton-js/wro.properties | 26 - pollen-ui-js/src/main/resources/nuiton-js/wro.xml | 42 - .../src/main/webapp/bundle/Messages.properties | 196 -- .../webapp/css/bootstrap-datetimepicker.min.css | 8 - pollen-ui-js/src/main/webapp/css/style.css | 104 -- .../src/main/webapp/img/glyphicons_050_link.png | Bin 1410 -> 0 bytes pollen-ui-js/src/main/webapp/img/pollen.png | Bin 28557 -> 0 bytes pollen-ui-js/src/main/webapp/index.html | 102 - pollen-ui-js/src/main/webapp/js/controls/menu.js | 59 - .../src/main/webapp/js/controls/poll_form.js | 176 -- .../src/main/webapp/js/controls/poll_list.js | 53 - .../src/main/webapp/js/controls/poll_summary.js | 55 - .../src/main/webapp/js/controls/user_form.js | 122 -- pollen-ui-js/src/main/webapp/js/controls/vote.js | 183 -- .../webapp/js/libs/bootstrap-datetimepicker.min.js | 26 - .../src/main/webapp/js/libs/jquery.scrollto.js | 54 - pollen-ui-js/src/main/webapp/js/models/choices.js | 27 - pollen-ui-js/src/main/webapp/js/models/comments.js | 70 - pollen-ui-js/src/main/webapp/js/models/polls.js | 104 -- pollen-ui-js/src/main/webapp/js/models/users.js | 102 - pollen-ui-js/src/main/webapp/js/models/votes.js | 168 -- pollen-ui-js/src/main/webapp/js/pollen-utils.js | 33 - pollen-ui-js/src/main/webapp/js/route.js | 36 - pollen-ui-js/src/main/webapp/views/menu.ejs | 69 - pollen-ui-js/src/main/webapp/views/poll_form.ejs | 339 ---- pollen-ui-js/src/main/webapp/views/poll_list.ejs | 11 - pollen-ui-js/src/main/webapp/views/summary.ejs | 36 - pollen-ui-js/src/main/webapp/views/user_form.ejs | 75 - pollen-ui-js/src/main/webapp/views/vote.ejs | 192 -- pollen-ui-riot-js/pom.xml | 2 +- pollen-votecounting-aggregator/pom.xml | 2 +- pollen-votecounting-api/pom.xml | 2 +- pollen-votecounting-borda/pom.xml | 2 +- pollen-votecounting-condorcet/pom.xml | 2 +- pollen-votecounting-coombs/pom.xml | 2 +- pollen-votecounting-instant-runoff/pom.xml | 2 +- pollen-votecounting-normal/pom.xml | 2 +- pollen-votecounting-number/pom.xml | 2 +- pollen-votecounting-percentage/pom.xml | 2 +- 111 files changed, 14 insertions(+), 13149 deletions(-) diff --git a/pollen-bundle/pom.xml b/pollen-bundle/pom.xml index 9a9ddd7..94cf865 100644 --- a/pollen-bundle/pom.xml +++ b/pollen-bundle/pom.xml @@ -27,7 +27,7 @@ <parent> <groupId>org.chorem</groupId> <artifactId>pollen</artifactId> - <version>2.0-SNAPSHOT</version> + <version>3.0-SNAPSHOT</version> </parent> <groupId>org.chorem.pollen</groupId> diff --git a/pollen-persistence/pom.xml b/pollen-persistence/pom.xml index 3a79514..35567db 100644 --- a/pollen-persistence/pom.xml +++ b/pollen-persistence/pom.xml @@ -27,7 +27,7 @@ <parent> <groupId>org.chorem</groupId> <artifactId>pollen</artifactId> - <version>2.0-SNAPSHOT</version> + <version>3.0-SNAPSHOT</version> </parent> <groupId>org.chorem.pollen</groupId> diff --git a/pollen-rest-api/pom.xml b/pollen-rest-api/pom.xml index d5ab2fa..41fadf6 100644 --- a/pollen-rest-api/pom.xml +++ b/pollen-rest-api/pom.xml @@ -27,7 +27,7 @@ <parent> <groupId>org.chorem</groupId> <artifactId>pollen</artifactId> - <version>2.0-SNAPSHOT</version> + <version>3.0-SNAPSHOT</version> </parent> <groupId>org.chorem.pollen</groupId> diff --git a/pollen-services/pom.xml b/pollen-services/pom.xml index 5255520..9b0ba84 100644 --- a/pollen-services/pom.xml +++ b/pollen-services/pom.xml @@ -27,7 +27,7 @@ <parent> <groupId>org.chorem</groupId> <artifactId>pollen</artifactId> - <version>2.0-SNAPSHOT</version> + <version>3.0-SNAPSHOT</version> </parent> <groupId>org.chorem.pollen</groupId> diff --git a/pollen-ui-angular/.bowerrc b/pollen-ui-angular/.bowerrc deleted file mode 100644 index 80c5b33..0000000 --- a/pollen-ui-angular/.bowerrc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "directory" : "./src/main/webapp/lib", - "analytics": false -} - diff --git a/pollen-ui-angular/.gitignore b/pollen-ui-angular/.gitignore deleted file mode 100644 index 30f945d..0000000 --- a/pollen-ui-angular/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -*.iml -node/* -node_modules/* -src/main/webapp/lib -src/main/webapp/css/style.css -src/main/webapp/js/conf.js -src/main/webapp/version.txt - -/target/ diff --git a/pollen-ui-angular/INSTALL.txt b/pollen-ui-angular/INSTALL.txt deleted file mode 100644 index 13ba347..0000000 --- a/pollen-ui-angular/INSTALL.txt +++ /dev/null @@ -1,17 +0,0 @@ -INSTALLATION ------------- - -Pour installer l'interface utilisateur de l'application il suffit de déployer l'archive war dans un -conteneur Web comme Tomcat. - -Un fichier de conf est a ajouter dans src/main/webapp/js/conf.js que vous pouvez copier depuis conf.js.example -Il faut définir conf.restURL avec l'adresse du serveur comme par exemple : http://localhost:8080/pollen-rest-api/v1 - - -Il est possible de mettre le fichier de conf hors du war en ajoutant un redirection directement dans le serveur apache : - -``` -Alias /pollen-ui-angular/js/conf.js /etc/pollen-ui-angular.js - -ProxyPass /pollen-ui-angular-latest/js/conf.js ! -``` \ No newline at end of file diff --git a/pollen-ui-angular/LICENSE.txt b/pollen-ui-angular/LICENSE.txt deleted file mode 100644 index dba13ed..0000000 --- a/pollen-ui-angular/LICENSE.txt +++ /dev/null @@ -1,661 +0,0 @@ - GNU AFFERO GENERAL PUBLIC LICENSE - Version 3, 19 November 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU Affero General Public License is a free, copyleft license for -software and other kinds of works, specifically designed to ensure -cooperation with the community in the case of network server software. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -our General Public Licenses are intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - Developers that use our General Public Licenses protect your rights -with two steps: (1) assert copyright on the software, and (2) offer -you this License which gives you legal permission to copy, distribute -and/or modify the software. - - A secondary benefit of defending all users' freedom is that -improvements made in alternate versions of the program, if they -receive widespread use, become available for other developers to -incorporate. Many developers of free software are heartened and -encouraged by the resulting cooperation. However, in the case of -software used on network servers, this result may fail to come about. -The GNU General Public License permits making a modified version and -letting the public access it on a server without ever releasing its -source code to the public. - - The GNU Affero General Public License is designed specifically to -ensure that, in such cases, the modified source code becomes available -to the community. It requires the operator of a network server to -provide the source code of the modified version running there to the -users of that server. Therefore, public use of a modified version, on -a publicly accessible server, gives the public access to the source -code of the modified version. - - An older license, called the Affero General Public License and -published by Affero, was designed to accomplish similar goals. This is -a different license, not a version of the Affero GPL, but Affero has -released a new version of the Affero GPL which permits relicensing under -this license. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU Affero General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Remote Network Interaction; Use with the GNU General Public License. - - Notwithstanding any other provision of this License, if you modify the -Program, your modified version must prominently offer all users -interacting with it remotely through a computer network (if your version -supports such interaction) an opportunity to receive the Corresponding -Source of your version by providing access to the Corresponding Source -from a network server at no charge, through some standard or customary -means of facilitating copying of software. This Corresponding Source -shall include the Corresponding Source for any work covered by version 3 -of the GNU General Public License that is incorporated pursuant to the -following paragraph. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the work with which it is combined will remain governed by version -3 of the GNU General Public License. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU Affero General Public License from time to time. Such new versions -will be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU Affero General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU Affero General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU Affero General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - <one line to give the program's name and a brief idea of what it does.> - Copyright (C) <year> <name of author> - - 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/>. - -Also add information on how to contact you by electronic and paper mail. - - If your software can interact with users remotely through a computer -network, you should also make sure that it provides a way for users to -get its source. For example, if your program is a web application, its -interface could display a "Source" link that leads users to an archive -of the code. There are many ways you could offer source, and different -solutions will be better for different programs; see section 13 for the -specific requirements. - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU AGPL, see -<http://www.gnu.org/licenses/>. diff --git a/pollen-ui-angular/README.md b/pollen-ui-angular/README.md deleted file mode 100644 index 4b539b5..0000000 --- a/pollen-ui-angular/README.md +++ /dev/null @@ -1,14 +0,0 @@ -POLLEN ------- - -Pollen est une application Web de sondages en ligne qui permet de créer et de -gérer des sondages avec différents types de choix (texte, date, image). -Les votants peuvent participer au sondage en suivant un lien qui identifie le -sondage. - - -INSTALLATION ------------- - -Voir le fichier INSTALL.txt - diff --git a/pollen-ui-angular/bower.json b/pollen-ui-angular/bower.json deleted file mode 100644 index b8fdb75..0000000 --- a/pollen-ui-angular/bower.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "name": "pollen-ui-angular", - "version": "2.0", - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "test", - "tests" - ], - "dependencies": { - "angular": "1.2.23", - "angular-route": "1.2.23", - "angular-resource": "1.2.23", - "angular-animate": "1.2.23", - "angular-translate": "2.0.0", - "angular-bootstrap": "0.11.0", - "bootstrap": "3.1.1", - "jquery": "2.1.1", - "ckeditor": "4.4.2", - "less": "1.7.3", - "jqplot-bower": "1.0.8", - "moment": "2.8.1", - "bootstrap-datetimepicker": "dralagen/bootstrap-datetimepicker#3.1.3", - "font-awesome": "4.2.0" - }, - "devDependencies": { - "angular-mocks": "1.2.23" - } -} diff --git a/pollen-ui-angular/package.json b/pollen-ui-angular/package.json deleted file mode 100644 index c073423..0000000 --- a/pollen-ui-angular/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "Pollen-test", - "version": "2.0.0", - "description": "", - "main": "src/test/karma.conf.js", - "devDependencies": { - "karma": "^0.12.17", - "karma-chrome-launcher": "^0.1.4", - "karma-firefox-launcher": "^0.1.3", - "karma-jasmine": "^0.1.5", - "karma-junit-reporter": "^0.2.2", - "karma-phantomjs-launcher": "^0.1.4" - }, - "scripts": { - "test": "karma start src/test/karma.conf.js" - }, - "author": "garandel", - "license": "AGPL", - "dependencies": { - "bower": "^1.3.9" - } -} diff --git a/pollen-ui-angular/pom.xml b/pollen-ui-angular/pom.xml deleted file mode 100644 index f2156cc..0000000 --- a/pollen-ui-angular/pom.xml +++ /dev/null @@ -1,254 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - #%L - Pollen :: UI (Angular) - %% - Copyright (C) 2009 - 2017 Code Lutin, Tony Chemit - %% - 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 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/>. - #L% - --> - -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - - <parent> - <groupId>org.chorem</groupId> - <artifactId>pollen</artifactId> - <version>2.0-SNAPSHOT</version> - </parent> - - <groupId>org.chorem.pollen</groupId> - <artifactId>pollen-ui-angular</artifactId> - <packaging>war</packaging> - - <name>Pollen :: UI (Angular)</name> - <description>Pollen UI</description> - - <properties> - - <!-- attach release files (deploy on redmine) --> - <redmine.releaseFiles> - ${project.build.directory}/${project.build.finalName}.war - </redmine.releaseFiles> - - <maven.deploy.skip>true</maven.deploy.skip> - - </properties> - - <build> - <plugins> - - <!-- Clean js libs directory content to avoid any conflict with previous install --> - <plugin> - <artifactId>maven-clean-plugin</artifactId> - <executions> - <execution> - <id>clean-js-libs</id> - <goals> - <goal>clean</goal> - </goals> - <phase>clean</phase> - <configuration> - <filesets> - <fileset> - <directory>src/main/webapp/lib</directory> - <includes> - <include>**/*</include> - </includes> - </fileset> - </filesets> - </configuration> - </execution> - - </executions> - </plugin> - <plugin> - <groupId>com.github.eirslett</groupId> - <artifactId>frontend-maven-plugin</artifactId> - <version>0.0.22</version> - - <!-- optional --> - <configuration> - <workingDirectory>${project.basedir}</workingDirectory> - </configuration> - - <executions> - <execution> - <id>install node and npm</id> - <goals> - <goal>install-node-and-npm</goal> - </goals> - <phase>generate-resources</phase> - <configuration> - <nodeVersion>v0.10.18</nodeVersion> - <npmVersion>1.3.8</npmVersion> - </configuration> - </execution> - - <execution> - <id>npm install</id> - <goals> - <goal>npm</goal> - </goals> - <phase>generate-resources</phase> - <configuration> - <arguments>install</arguments> - </configuration> - </execution> - - <execution> - <id>javascript tests</id> - <goals> - <goal>karma</goal> - </goals> - <phase>test</phase> - <configuration> - <skipTests>${skipTests}</skipTests> - <!-- optional: the default is "karma.conf.js" in your working directory --> - <karmaConfPath>src/test/karma.conf.ci.js</karmaConfPath> - </configuration> - </execution> - </executions> - </plugin> - - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>exec-maven-plugin</artifactId> - <executions> - <!--<execution> - <id>npm</id> - <phase>generate-sources</phase> - <goals> - <goal>exec</goal> - </goals> - <configuration> - <executable>npm</executable> - <arguments> - <argument>install</argument> - </arguments> - <workingDirectory>${basedir}</workingDirectory> - </configuration> - </execution>--> - - <execution> - <id>bower</id> - <phase>generate-resources</phase> - <goals> - <goal>exec</goal> - </goals> - <configuration> - <executable>${basedir}/node/node</executable> - <arguments> - <argument>${basedir}/node_modules/bower/bin/bower</argument> - <argument>install</argument> - </arguments> - <workingDirectory>${basedir}</workingDirectory> - </configuration> - </execution> - </executions> - </plugin> - - <plugin> - <groupId>org.lesscss</groupId> - <artifactId>lesscss-maven-plugin</artifactId> - <version>1.3.3</version> - <configuration> - <lessJs>${project.basedir}/src/main/webapp/lib/less/dist/less-1.7.3.min.js</lessJs> - <sourceDirectory>${project.basedir}/src/main/webapp/less</sourceDirectory> - <outputDirectory>${project.basedir}/src/main/webapp/css</outputDirectory> - <compress>true</compress> - <includes> - <include>style.less</include> - </includes> - </configuration> - <executions> - <execution> - <goals> - <goal>compile</goal> - </goals> - <phase>compile</phase> - </execution> - </executions> - </plugin> - - <!--<plugin> - <groupId>com.kelveden</groupId> - <artifactId>maven-karma-plugin</artifactId> - <version>1.6</version> - <executions> - <execution> - <phase>test</phase> - <goals> - <goal>start</goal> - </goals> - </execution> - </executions> - <configuration> - <karmaExecutable>${basedir}/node/node ${basedir}/node_modules/karma/bin/karma</karmaExecutable> - <configFile>src/test/karma.conf.js</configFile> - <reportsDirectory>${project.build.directory}/karma-reports</reportsDirectory> - <browsers>PhantomJS</browsers> - <autoWatch>false</autoWatch> - <singleRun>true</singleRun> - <colors>true</colors> - <skipKarma>${maven.test.skip}</skipKarma> - <skipTests>${maven.test.skip}</skipTests> - <karmaFailureIgnore>${maven.test.failure.ignore}</karmaFailureIgnore> - <reporters>dots,junit</reporters> - </configuration> - </plugin>--> - - <plugin> - <artifactId>maven-resources-plugin</artifactId> - <executions> - <execution> - <id>copy-version-file</id> - <goals> - <goal>copy-resources</goal> - </goals> - <phase>generate-resources</phase> - <configuration> - <outputDirectory>src/main/webapp</outputDirectory> - <resources> - <resource> - <directory>src/main</directory> - <!--<targetPath>src/main/webapp</targetPath>--> - <includes> - <include>version.txt</include> - </includes> - <filtering>true</filtering> - </resource> - </resources> - </configuration> - </execution> - </executions> - </plugin> - - </plugins> - </build> - - <profiles> - - <profile> - <!--To deploy the ui-angular module (for demo instance)--> - <id>deploy-ui-angular</id> - <properties> - <deployFiles>target/${project.build.finalName}.war</deployFiles> - </properties> - </profile> - - </profiles> -</project> diff --git a/pollen-ui-angular/src/main/version.txt b/pollen-ui-angular/src/main/version.txt deleted file mode 100644 index f2ab45c..0000000 --- a/pollen-ui-angular/src/main/version.txt +++ /dev/null @@ -1 +0,0 @@ -${project.version} \ No newline at end of file diff --git a/pollen-ui-angular/src/main/webapp/WEB-INF/web.xml b/pollen-ui-angular/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index 659c043..0000000 --- a/pollen-ui-angular/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - #%L - Pollen :: UI (Angular) - %% - Copyright (C) 2009 - 2017 Code Lutin, Tony Chemit - %% - 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 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/>. - #L% - --> - - -<web-app version="3.0" id="pollen-ui-angular" - xmlns="http://java.sun.com/xml/ns/javaee" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://java.sun.com/xml/ns/javaee - http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"> - - <display-name>Pollen UI (Angular)</display-name> -</web-app> diff --git a/pollen-ui-angular/src/main/webapp/i18n/en.js b/pollen-ui-angular/src/main/webapp/i18n/en.js deleted file mode 100644 index 192ea67..0000000 --- a/pollen-ui-angular/src/main/webapp/i18n/en.js +++ /dev/null @@ -1,343 +0,0 @@ -/* - * #%L - * Pollen :: UI (Angular) - * %% - * Copyright (C) 2009 - 2017 Code Lutin, Tony Chemit - * %% - * 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 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/>. - * #L% - */ -var translateEN = { - -'title.home' : 'Home', -'title.poll.create' : 'Create new poll', -'title.poll.edit' : 'Edit poll', -'title.poll.vote' : 'Vote', -'title.poll.comment' : 'Comment', -'title.poll.comments' : 'Comments', -'title.poll.result' : 'Result of poll', -'title.poll.list' : 'List of poll', -'title.user.register' : 'Register', -'title.user.edit' : 'Edit Profile', -'title.user.forgotPassword' : 'Forget Password', -'title.user.list' : 'List of user', - -'home.title' : 'Pollen, Poll Application', -'home.description' : 'Create now your poll. Share the vote link. And show the result.', -'home.newPoll' : 'Create a poll', -'home.register' : 'Sign-in now', - -'admin' : 'Administration', -'admin.listPoll' : 'List of Polls', -'admin.listUser' : 'List of Users', -'admin.config' : 'Configuration', - -'user.edit' : 'Profile', -'user.listPollCreated' : 'Created Poll', -'user.listPollParticiped' : 'Participed Poll', -'user.listPollInvited' : 'Invited Poll', - -'user.name' : 'Name', -'user.myName' : 'Your name', -'user.mail' : 'e-mail', -'user.myMail' : 'Your e-mail', -'user.isAdmin' : 'Is an administrator', -'user.password' : 'Password', -'user.password2' : 'Confirm', -'user.passwordNew' : 'New password', -'user.passwordCurrent' : 'Current password', -'user.rememberMe' : 'Remember Me', -'user.forgotPassword' : 'Forgot Password', -'user.register.success' : 'Register with success', -'user.edit.success' : 'Save with success', -'user.forgotPassword.success' : 'Password send by email', -'user.favoriteList' : 'Favorite list', -'user.disableMe' : 'Disable me', -'user.disableMe.success' : 'Disable successfull', -'user.disableUser' : 'Disable user', -'user.disableUser.success' : 'Disable user successfull', -'user.delete.success' : 'Delete user successfull', -'user.generatePassword' : 'Generate new password', -'user.generatePassword.success' : 'E-mail send with new password', -'user.validate.success' : 'You just validate you email, you can login now', -'user.validate.error' : 'Email already validate or invalid', -'user.tab.viewProfile' : 'View profile', -'user.tab.editProfile' : 'Edit profile', -'user.tab.editPassword' : 'Edit Password', -'user.warning.emailNotValidate' : 'Your don\'t have validate your email', -'user.error.password.diff' : 'Passwords not equal', -'user.error.mail.notFound' : 'E-mail not found', -'user.error.mail.empty' : 'E-mail can not be empty', -'user.error.login' : 'Error in e-mail or password', -'user.error.login.mandatory' : 'You must be connected', -'user.error.logout.mandatory' : 'You must be disconnected', -'user.error.listEmpty' : 'No user found', - -'poll.tab.vote' : 'Vote', -'poll.tab.comment' : 'Comment', -'poll.tab.result' : 'Result', -'poll.tab.create' : 'Create', -'poll.tab.edit' : 'Edit', -'poll.tab.conf' : 'Configuration', -'poll.tab.participant' : 'Participants', - -'poll.popupChoice.title.add' : 'Add a choice', -'poll.popupChoice.title.edit' : 'Édition du choix', -'poll.popupChoice.choiceType.label' : 'Choice type:', -'poll.popupChoice.text.label' : 'Text', -'poll.popupChoice.date.label' : 'Date', -'poll.popupChoice.resource.label' : 'Resource', -'poll.popupChoice.text.value' : 'Label:', -'poll.popupChoice.date.value' : 'Date:', -'poll.popupChoice.resource.value' : 'Resource:', -'poll.popupChoice.description.label' : 'Description:', - -'poll.link.toMaxify' : 'Maxify sidebar', -'poll.link.toMinify' : 'Minify sidebar', -'poll.link.edit' : 'Edit poll', -'poll.link.vote' : 'Vote', -'poll.link.result' : 'Result of poll', -'poll.link.comment' : 'Comments of poll', -'poll.link.clone' : 'Clone this poll', -'poll.link.export' : 'Export this poll', -'poll.link.close' : 'Close this poll', -'poll.link.delete' : 'Delete this poll', - -'poll.new' : 'New Poll', -'poll.edit' : 'Click to edit', -'poll.edit.choice' : 'Click to edit the choice', -'poll.edit.description' : 'Description', -'poll.edit.title' : 'Title', -'poll.desc' : 'Description is optional. This message will not visible in vote page.', -'poll.saved' : 'Poll saved.', -'poll.created.printLink' : 'You can modify your poll to using this address when you are not connected: {{url}}', -'poll.cloned' : 'Poll cloned', -'poll.closed' : 'Poll closed', -'poll.deleted' : 'Poll deleted', -'poll.noComment' : 'No comment', -'poll.restricted.name' : 'Name', -'poll.restricted.mail' : 'E-mail', -'poll.restricted.weight' : 'Weight', -'poll.restricted.free' : 'Free', -'poll.restricted.restricted' : 'Restricted', -'poll.restricted.group' : 'Group', -'poll.restricted.pollType' : 'Who can vote ?', -'poll.result.choice' : 'Choice', -'poll.result.score' : 'Score', -'poll.result.title.zero' : 'No result', -'poll.result.title.one' : 'Result : One voter', -'poll.result.title.other' : 'Result : {{nbVoter}} Voters', -'poll.result.title.group.zero' : 'No result', -'poll.result.title.group.one' : 'Result : One group', -'poll.result.title.group.other' : 'Result : {{nbVoter}} Groups', -'poll.result.group.title.zero' : 'Group : {{name}}, no voter', -'poll.result.group.title.one' : 'Group : {{name}}, one voter', -'poll.result.group.title.other' : 'Group : {{name}}, {{nbVoter}} voters', -'poll.config.title.creator' : 'Creator information', -'poll.config.title.poll' : 'Global config', -'poll.config.title.choice' : 'Choice config', -'poll.config.title.vote' : 'Vote config', -'poll.config.label.creatorName' : 'Your name', -'poll.config.label.creatorEmail' : 'Your e-mail', -'poll.config.label.creatorEmail.help' : 'This e-mail is use for notify', -'poll.config.label.beginDate' : 'Begin date', -'poll.config.label.endDate' : 'End date', -'poll.config.label.resultVisibility' : 'Result visibility', -'poll.config.label.continuousResults' : 'Continuous results', -'poll.config.label.choiceAddAllowed' : 'Add choice allowed', -'poll.config.label.beginChoiceDate' : 'Add choice begin date', -'poll.config.label.endChoiceDate' : 'Add choice end date', -'poll.config.label.limitedVote' : 'Limited choice', -'poll.config.label.maxChoiceNumber' : 'Max number of choice', -'poll.config.label.voteCountingType' : 'Vote counting Type', -'poll.config.label.voteVisibility' : 'Vote visibility', -'poll.config.label.anonymousVoteAllowed' : 'Anonymous vote allowed', -'poll.config.label.commentVisibility' : 'Comment visibility', -'poll.config.value.visibility.everybody' : 'Everybody', -'poll.config.value.visibility.voter' : 'Voter', -'poll.config.value.visibility.creator' : 'Creator', -'poll.config.value.visibility.anonymous' : 'Anonymous', -'poll.config.value.visibility.nobody' : 'Nobody', -'poll.info.closed' : 'Poll is closed', -'poll.info.timeoutVote' : 'Poll is finish since {{time}}', -'poll.info.beginVote' : 'Start of voting {{time}}', -'poll.info.endVote' : 'End of voting {{time}}', -'poll.info.noEndDate' : 'No End Date is fixed', -'poll.info.beginAddChoiceAllowed' : 'Start adding choice will be allowed {{time}}', -'poll.info.endAddChoiceAllowed' : 'End adding choice will be allowed {{time}}', -'poll.info.addChoiceAllowed.waring' : 'The period for adding choice and vote overlays', -'poll.info.addChoiceAllowed.waring.help' : 'Votes may can\'t be representative of reality', -'poll.info.vote.noViewChoice' : 'This choice does not exist in the vote', -'poll.info.voteCountingType' : 'Vote Counting : {{name}}', -'poll.info.limitedChoice' : 'This poll has limited the number of choices at {{nb}} choice(s)', -'poll.error.noResource' : 'No resource has send', -'poll.error.listEmpty' : 'No poll find', -'poll.error.notNumberValid' : 'Not a Number valid', - -'vote.added' : 'Vote added.', -'vote.added.printLink' : 'You can modify your vote to using this address when you are not connected: {{url}}', - -'comment' : 'Comment', -'comment.added' : 'Comment added.', -'comment.added.printLink' : 'You can modify your comment to using this address when you are not connected: {{url}}', -'comment.order.toDesc' : 'Ordered by newer date', -'comment.order.toAsc' : 'Ordered by older date', -'comment.none' : 'No comment', -'comment.edit' : 'Edit the comment', -'comment.delete' : 'Delete the comment', - -'action.logout' : 'Logout', -'action.login' : 'Login', -'action.register' : 'Register', -'action.recovered' : 'Recovered', -'action.send' : 'Send', -'action.return' : 'Return', -'action.cancel' : 'Cancel', -'action.save' : 'Save', -'action.edit' : 'Edit', -'action.delete' : 'Delete', -'action.vote' : 'Vote', -'action.search' : 'Search', -'action.comment' : 'Comment', -'action.restricted.addVoter' : 'Add a Voter', -'action.restricted.deleteVoter' : 'Delete the Voter', -'action.restricted.addGroup' : 'Add a Group', -'action.restricted.deleteGroup' : 'Delete the Group', -'action.restricted.notify' : 'Notify', -'action.favoriteList.import.addGroup' : 'Import in new group', -'action.favoriteList.import.inGroup' : 'Import in this group', -'action.favoriteList.import.fromCSV' : 'Import this CSV file', -'action.favoriteList.add' : 'Add favorite list', -'action.favoriteList.delete' : 'Delete the favorite list', -'action.favoriteList.addMember' : 'Add a member', -'action.favoriteList.deleteMember' : 'Delete the member', -'action.selectAll' : 'Select All', -'action.unselectAll' : 'Unselect All', -'action.toggleSelectAll' : 'Toggle the select', -'action.deleteSelected' : 'Delete the selected', -'action.choice.add' : 'Add a choice', - -'action.message.confirmDelete' : 'Are you sure to delete it?', -'action.message.confirmClose' : 'Are you sure to close it?', - -'error.form' : 'Form error', -'error.forbidden' : 'Access forbidden', -'error.notFound' : 'Not found resource', -'error.noServer' : 'No connexion with the server', -'error.reader.noFile' : 'Error no file', -'info.load' : 'Loading' - -}; - -// -// Source i18n : https://github.com/angular/bower-angular-i18n/blob/v1.2.19-build.267%2Bsha.4... -// - -var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"}; -var i18n_EN = { - "DATETIME_FORMATS": { - "AMPMS": [ - "AM", - "PM" - ], - "DAY": [ - "Sunday", - "Monday", - "Tuesday", - "Wednesday", - "Thursday", - "Friday", - "Saturday" - ], - "MONTH": [ - "January", - "February", - "March", - "April", - "May", - "June", - "July", - "August", - "September", - "October", - "November", - "December" - ], - "SHORTDAY": [ - "Sun", - "Mon", - "Tue", - "Wed", - "Thu", - "Fri", - "Sat" - ], - "SHORTMONTH": [ - "Jan", - "Feb", - "Mar", - "Apr", - "May", - "Jun", - "Jul", - "Aug", - "Sep", - "Oct", - "Nov", - "Dec" - ], - "fullDate": "EEEE, MMMM d, y", - "longDate": "MMMM d, y", - "medium": "MMM d, y h:mm:ss a", - "mediumDate": "MMM d, y", - "mediumTime": "h:mm:ss a", - "short": "M/d/yy h:mm a", - "shortDate": "M/d/yy", - "shortTime": "h:mm a" - }, - "NUMBER_FORMATS": { - "CURRENCY_SYM": "$", - "DECIMAL_SEP": ".", - "GROUP_SEP": ",", - "PATTERNS": [ - { - "gSize": 3, - "lgSize": 3, - "macFrac": 0, - "maxFrac": 3, - "minFrac": 0, - "minInt": 1, - "negPre": "-", - "negSuf": "", - "posPre": "", - "posSuf": "" - }, - { - "gSize": 3, - "lgSize": 3, - "macFrac": 0, - "maxFrac": 2, - "minFrac": 2, - "minInt": 1, - "negPre": "(\u00a4", - "negSuf": ")", - "posPre": "\u00a4", - "posSuf": "" - } - ] - }, - "id": "en", - "pluralCat": function (n) { if (n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;} -}; - diff --git a/pollen-ui-angular/src/main/webapp/i18n/fr.js b/pollen-ui-angular/src/main/webapp/i18n/fr.js deleted file mode 100644 index 7825f2a..0000000 --- a/pollen-ui-angular/src/main/webapp/i18n/fr.js +++ /dev/null @@ -1,342 +0,0 @@ -/* - * #%L - * Pollen :: UI (Angular) - * %% - * Copyright (C) 2009 - 2017 Code Lutin, Tony Chemit - * %% - * 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 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/>. - * #L% - */ -var translateFR = { - -'title.home' : 'Accueil', -'title.poll.create' : 'Création d\'un nouveau sondage', -'title.poll.edit' : 'Edition du sondage', -'title.poll.vote' : 'Voter', -'title.poll.comment' : 'Laisser un commentaire', -'title.poll.comments' : 'Commentaires', -'title.poll.result' : 'Résultat du sondage', -'title.poll.list' : 'Liste des sondages', -'title.user.register' : 'Inscription', -'title.user.edit' : 'Modification de votre profil', -'title.user.forgotPassword' : 'Récupération du mot de passe', -'title.user.list' : 'Liste des utilisateurs', - -'home.title' : 'Pollen : application de sondage', -'home.description' : 'Créer dès maintenant votre sondage gratuitement. Partager le lien de vote. Et regarder le résultat.', -'home.newPoll' : 'Créer dès maintenant un sondage gratuitement', -'home.register' : 'Créer un compte gratuitement', - -'admin' : 'Administration', -'admin.listPoll' : 'Liste des sondages', -'admin.listUser' : 'Liste des utilisateurs', -'admin.config' : 'Configuration', - -'user.edit' : 'Profil', -'user.listPollCreated' : 'Sondages créés', -'user.listPollParticiped' : 'Sondages participés', -'user.listPollInvited' : 'Sondages invités', - -'user.name' : 'Nom d\'utilisateur', -'user.myName' : 'Votre nom', -'user.mail' : 'Courriel', -'user.myMail' : 'Votre courriel', -'user.isAdmin' : 'Est administrateur', -'user.password' : 'Mot de passe', -'user.password2' : 'Confirmation', -'user.passwordNew' : 'Nouveau mot de passe', -'user.passwordCurrent' : 'Mot de passe actuel', -'user.rememberMe' : 'Connexion automatique', -'user.forgotPassword' : 'Mot de passe oublié', -'user.register.success' : 'Compte enregisté, un mail de validation vient d\'être envoyé..', -'user.edit.success' : 'Modification effectuée..', -'user.forgotPassword.success' : 'Un mail de changement de mot de passe vient d\'être envoyé..', -'user.favoriteList' : 'Liste de Diffusion Favorite', -'user.disableMe' : 'Désactiver mon compte', -'user.disableMe.success' : 'Désactivation de mon compte avec succès', -'user.disableUser' : 'Désactiver l\'utilisateur', -'user.disableUser.success' : 'Désactivation de l\'utilisateur avec succès', -'user.delete.success' : 'Suppression de l\'utilisateur avec succès', -'user.generatePassword' : 'Générer un nouveau mot de passe', -'user.generatePassword.success' : 'Un mail avec le nouveau mot de passe vient d\'être envoyé.', -'user.validate.success' : 'Vous venez de valider votre courriel, connectez-vous dès maintenants.', -'user.validate.error' : 'Erreur lors de la validation, courriel déjà validé ou invalide', -'user.tab.viewProfile' : 'Voir son profile', -'user.tab.editProfile' : 'Modifier son profile', -'user.tab.editPassword' : 'Modifier son Password', -'user.warning.emailNotValidate' : 'Vous n\'avez pas validé votre email', -'user.error.password.diff' : 'Mot de passe différent', -'user.error.mail.notFound' : 'Courriel n\'a pas été trouvé', -'user.error.mail.empty' : 'Courriel ne peux pas être vide', -'user.error.login' : 'Erreur sur le nom d\'utilisateur ou le mot de passe', -'user.error.login.mandatory' : 'Accès refusé, vous devez êtes connecté(e)', -'user.error.logout.mandatory' : 'Accès refusé, vous êtes connecté(e)', -'user.error.listEmpty' : 'Aucun utilisateur trouvé', - -'poll.tab.vote' : 'Voter', -'poll.tab.comment' : 'Commentaires', -'poll.tab.result' : 'Résultat', -'poll.tab.create' : 'Créer', -'poll.tab.edit' : 'Modifier', -'poll.tab.conf' : 'Configuration', -'poll.tab.participant' : 'Participants', - -'poll.popupChoice.title.add' : 'Ajout d\'un choix', -'poll.popupChoice.title.edit' : 'Édition du choix', -'poll.popupChoice.choiceType.label' : 'Type de choix :', -'poll.popupChoice.text.label' : 'Texte', -'poll.popupChoice.date.label' : 'Date', -'poll.popupChoice.resource.label' : 'Resource', -'poll.popupChoice.text.value' : 'Libellé :', -'poll.popupChoice.date.value' : 'Date :', -'poll.popupChoice.resource.value' : 'Resource :', -'poll.popupChoice.description.label' : 'Description :', - -'poll.link.toMaxify' : 'Agrandir le cadre', -'poll.link.toMinify' : 'Réduire le cadre', -'poll.link.edit' : 'Lien d\'édition', -'poll.link.vote' : 'Lien de partage pour le vote', -'poll.link.result' : 'Lien du résultat du sondage', -'poll.link.comment' : 'Commentaires du sondage', -'poll.link.clone' : 'Cloner le sondage', -'poll.link.export' : 'Exporter le sondage', -'poll.link.close' : 'Clore les votes du sondage', -'poll.link.delete' : 'Supprimer le sondage', - -'poll.new' : 'Nouveau sondage', -'poll.edit' : 'Cliquez pour modifier', -'poll.edit.choice' : 'Cliquez pour modifier le choix', -'poll.edit.description' : 'Description', -'poll.edit.title' : 'Titre', -'poll.desc' : 'Description (facultative). Ce cadre n\'apparait pas si aucune description n\'est saisie.', -'poll.saved' : 'Sondage sauvegardé', -'poll.created.printLink' : 'Garder le lien suivant pour pouvoir modifier votre sondage plus tard, lorsque vous n\'êtes pas connecté : {{url}}', -'poll.cloned' : 'Sondage cloné', -'poll.closed' : 'Sondage clos', -'poll.deleted' : 'Sondage supprimé', -'poll.noComment' : 'Aucun commentaire', -'poll.restricted.name' : 'Nom du votant', -'poll.restricted.mail' : 'Courriel du votant', -'poll.restricted.weight' : 'Poids', -'poll.restricted.free' : 'Tout le monde', -'poll.restricted.restricted' : 'Restreint', -'poll.restricted.group' : 'Groupe', -'poll.restricted.pollType' : 'Qui peut voter ?', -'poll.result.choice' : 'Choix', -'poll.result.score' : 'Score', -'poll.result.title.zero' : 'Aucun Résultat', -'poll.result.title.one' : 'Résultat : Un votant', -'poll.result.title.other' : 'Résultat : {{nbVoter}} Votants', -'poll.result.title.group.zero' : 'Aucun résultat', -'poll.result.title.group.one' : 'Résultat : un groupe', -'poll.result.title.group.other' : 'Résultat : {{nbVoter}} groupes', -'poll.result.group.title.zero' : 'Groupe : {{name}}, aucun votant', -'poll.result.group.title.one' : 'Groupe : {{name}}, un votant', -'poll.result.group.title.other' : 'Groupe : {{name}}, {{nbVoter}} votants', -'poll.config.title.creator' : 'Information du créateur', -'poll.config.title.poll' : 'Configuration globale', -'poll.config.title.choice' : 'Configuration des choix', -'poll.config.title.vote' : 'Configuration des votes', -'poll.config.label.creatorName' : 'Votre nom', -'poll.config.label.creatorEmail' : 'Votre courriel', -'poll.config.label.creatorEmail.help' : 'Cette adresse servira pour les notifications', -'poll.config.label.beginDate' : 'Date de début', -'poll.config.label.endDate' : 'Date de fin', -'poll.config.label.resultVisibility' : 'Visibilité des résultats', -'poll.config.label.continuousResults' : 'Résultats continus', -'poll.config.label.choiceAddAllowed' : 'Ajout de choix par les votants', -'poll.config.label.beginChoiceDate' : 'Date de début d\'ajout de choix', -'poll.config.label.endChoiceDate' : 'Date de fin d\'ajout de choix', -'poll.config.label.limitedVote' : 'Limiter les votes', -'poll.config.label.maxChoiceNumber' : 'Nombre maximum de votes', -'poll.config.label.voteCountingType' : 'Type de scrutin', -'poll.config.label.voteVisibility' : 'Visibilité des votes', -'poll.config.label.anonymousVoteAllowed' : 'Autoriser les votes anonymes', -'poll.config.label.commentVisibility' : 'Visibilité des commentaires', -'poll.config.value.visibility.everybody' : 'Public', -'poll.config.value.visibility.voter' : 'Votants / Participants', -'poll.config.value.visibility.creator' : 'Créateur', -'poll.config.value.visibility.anonymous' : 'Anonyme', -'poll.config.value.visibility.nobody' : 'Personne', -'poll.info.closed' : 'Le Sondage est clos', -'poll.info.timeoutVote' : 'Le Sondage est finis depuis le {{time}}', -'poll.info.beginVote' : 'Début des votes {{time}}', -'poll.info.endVote' : 'Fin des votes {{time}}', -'poll.info.noEndDate' : 'Aucune date de fin de vote fixé.', -'poll.info.beginAddChoiceAllowed' : 'Début d\'ajout de choix {{time}}', -'poll.info.endAddChoiceAllowed' : 'Fin d\'ajout de choix {{time}}', -'poll.info.addChoiceAllowed.waring' : 'La période d\'ajout de choix et de vote se superpose', -'poll.info.addChoiceAllowed.waring.help' : 'Les votes peuvent ne pas être représentatif de la réalité.', -'poll.info.vote.noViewChoice' : 'Ce choix n\'existait pas lors du vote', -'poll.info.voteCountingType' : 'Type de scrutin : {{name}}', -'poll.info.limitedChoice' : 'Le nombre de choix est limité à {{nb}} choix', -'poll.error.noResource' : 'Aucune ressource à envoyer', -'poll.error.listEmpty' : 'Aucun sondage trouvé', -'poll.error.notNumberValid' : 'N\'est pas un nombre valide', - -'vote.added' : 'Vote effectué', -'vote.added.printLink' : 'Garder le lien suivant pour pouvoir modifier votre vote plus tard, lorsque vous n\'êtes pas connecté : {{url}}', - -'comment' : 'Commentaire', -'comment.added' : 'Commentaire effectué', -'comment.added.printLink' : 'Garder le lien suivant pour pouvoir modifier votre commentaire, lorsque vous n\'êtes pas connecté : {{url}}', -'comment.order.toDesc' : 'Ordonner du plus récent au plus ancien', -'comment.order.toAsc' : 'Ordonner du plus ancien au plus récent', -'comment.none' : 'Aucun commentaire', -'comment.edit' : 'Modifier le commentaire', -'comment.delete' : 'Supprimer le commentaire', - -'action.logout' : 'Se déconnecter', -'action.login' : 'Se connecter', -'action.register' : 'S\'enregistrer', -'action.recovered' : 'Récupérer', -'action.send' : 'Envoyer', -'action.return' : 'Retour', -'action.cancel' : 'Annuler', -'action.save' : 'Enregistrer', -'action.edit' : 'Modifier', -'action.delete' : 'Supprimer', -'action.vote' : 'Voter', -'action.comment' : 'Commenter', -'action.search' : 'Rechercher', -'action.restricted.addVoter' : 'Ajouter un votant', -'action.restricted.deleteVoter' : 'Supprimer le votant', -'action.restricted.addGroup' : 'Ajouter un groupe de votants', -'action.restricted.deleteGroup' : 'Supprimer le groupe de votants', -'action.restricted.notify' : 'Envoyer un mail', -'action.favoriteList.import.addGroup' : 'Importer dans un nouveau groupe', -'action.favoriteList.import.inGroup' : 'Importer dans ce groupe', -'action.favoriteList.import.fromCSV' : 'Importer ce fichier CSV', -'action.favoriteList.add' : 'Créer une nouvelle liste de diffusion', -'action.favoriteList.delete' : 'Supprimer la liste de diffusion', -'action.favoriteList.addMember' : 'Ajouter un membre', -'action.favoriteList.deleteMember' : 'Supprimer le membre', -'action.selectAll' : 'Sélectionner tous', -'action.unselectAll' : 'Déselectionner tous', -'action.toggleSelectAll' : 'Inverser la sélection', -'action.deleteSelected' : 'Supprimer la sélection', -'action.choice.add' : 'Ajouter un choix', - -'action.message.confirmDelete' : 'Êtes vous sûr de vouloir le supprimer ?', -'action.message.confirmClose' : 'Êtes vous sûr de vouloir le fermer ?', - -'error.form' : 'Erreur de formulaire', -'error.forbidden' : 'Accès interdit', -'error.notFound' : 'Aucune ressource trouvée', -'error.noServer' : 'Erreur de connexion avec le serveur', -'error.reader.noFile' : 'Erreur aucun fichier', -'info.load' : 'Chargement en cours' - -}; - -// -// Source i18n : https://github.com/angular/bower-angular-i18n/blob/v1.2.19-build.267%2Bsha.4... -// - -var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"}; -var i18n_FR = { - "DATETIME_FORMATS": { - "AMPMS": [ - "AM", - "PM" - ], - "DAY": [ - "dimanche", - "lundi", - "mardi", - "mercredi", - "jeudi", - "vendredi", - "samedi" - ], - "MONTH": [ - "janvier", - "f\u00e9vrier", - "mars", - "avril", - "mai", - "juin", - "juillet", - "ao\u00fbt", - "septembre", - "octobre", - "novembre", - "d\u00e9cembre" - ], - "SHORTDAY": [ - "dim.", - "lun.", - "mar.", - "mer.", - "jeu.", - "ven.", - "sam." - ], - "SHORTMONTH": [ - "janv.", - "f\u00e9vr.", - "mars", - "avr.", - "mai", - "juin", - "juil.", - "ao\u00fbt", - "sept.", - "oct.", - "nov.", - "d\u00e9c." - ], - "fullDate": "EEEE d MMMM y", - "longDate": "d MMMM y", - "medium": "d MMM y HH:mm:ss", - "mediumDate": "d MMM y", - "mediumTime": "HH:mm:ss", - "short": "dd/MM/yy HH:mm", - "shortDate": "dd/MM/yy", - "shortTime": "HH:mm" - }, - "NUMBER_FORMATS": { - "CURRENCY_SYM": "\u20ac", - "DECIMAL_SEP": ",", - "GROUP_SEP": "\u00a0", - "PATTERNS": [ - { - "gSize": 3, - "lgSize": 3, - "macFrac": 0, - "maxFrac": 3, - "minFrac": 0, - "minInt": 1, - "negPre": "-", - "negSuf": "", - "posPre": "", - "posSuf": "" - }, - { - "gSize": 3, - "lgSize": 3, - "macFrac": 0, - "maxFrac": 2, - "minFrac": 2, - "minInt": 1, - "negPre": "(", - "negSuf": "\u00a0\u00a4)", - "posPre": "", - "posSuf": "\u00a0\u00a4" - } - ] - }, - "id": "fr", - "pluralCat": function (n) { if (n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER; } -} diff --git a/pollen-ui-angular/src/main/webapp/img/chart-icon.png b/pollen-ui-angular/src/main/webapp/img/chart-icon.png deleted file mode 100644 index 152442c..0000000 Binary files a/pollen-ui-angular/src/main/webapp/img/chart-icon.png and /dev/null differ diff --git a/pollen-ui-angular/src/main/webapp/img/en.png b/pollen-ui-angular/src/main/webapp/img/en.png deleted file mode 100644 index ff701e1..0000000 Binary files a/pollen-ui-angular/src/main/webapp/img/en.png and /dev/null differ diff --git a/pollen-ui-angular/src/main/webapp/img/fr.png b/pollen-ui-angular/src/main/webapp/img/fr.png deleted file mode 100644 index 8332c4e..0000000 Binary files a/pollen-ui-angular/src/main/webapp/img/fr.png and /dev/null differ diff --git a/pollen-ui-angular/src/main/webapp/img/pie-icon.png b/pollen-ui-angular/src/main/webapp/img/pie-icon.png deleted file mode 100644 index fba9dd7..0000000 Binary files a/pollen-ui-angular/src/main/webapp/img/pie-icon.png and /dev/null differ diff --git a/pollen-ui-angular/src/main/webapp/img/pollen.png b/pollen-ui-angular/src/main/webapp/img/pollen.png deleted file mode 100644 index ed749df..0000000 Binary files a/pollen-ui-angular/src/main/webapp/img/pollen.png and /dev/null differ diff --git a/pollen-ui-angular/src/main/webapp/index.html b/pollen-ui-angular/src/main/webapp/index.html deleted file mode 100644 index b945612..0000000 --- a/pollen-ui-angular/src/main/webapp/index.html +++ /dev/null @@ -1,192 +0,0 @@ -<!-- - #%L - Pollen :: UI (Angular) - %% - Copyright (C) 2009 - 2017 Code Lutin, Tony Chemit - %% - 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 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/>. - #L% - --> - -<html ng-app="pollen" ng-controller="MainCtrl"> -<head> - <title>{{ title || "Pollen" }}</title> - <meta charset="utf-8" /> - - <link rel="icon" type="image/png" href="img/pollen.png" /> - - <link rel="stylesheet" type="text/css" href="lib/bootstrap/dist/css/bootstrap.min.css" /> - <link rel="stylesheet" type="text/css" href="lib/bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css" /> - <link rel="stylesheet" type="text/css" href="lib/jqplot-bower/dist/jquery.jqplot.min.css" /> - <link rel="stylesheet" type="text/css" href="lib/font-awesome/css/font-awesome.min.css" /> - <!-- TODO : compile less to css - $ lessc -x less/style.less css/style.css - ou - $ mvn compile - --> - <!--<link rel="stylesheet/less" type="text/css" href="less/style.less" />--> - <!--<script language="javascript" type="text/javascript" src="lib/less/dist/less-1.7.3.min.js"></script>--> - <link rel="stylesheet" type="text/css" href="css/style.css"/> - -</head> -<body> - -<nav id="pollenMenu" class="navbar navbar-inverse navbar-static-top"> - <div class="container-fluid"> - <div class="navbar-header"> - <a class="navbar-brand" href="#">Pollen</a> - </div> - <ul class="nav navbar-nav pull-right" ng-controller="LocaleCtrl"> - <li dropdown class="dropdown-toggle"> - <a> <img ng:attr-src="img/{{locale}}.png" /></a> - <ul class="dropdown-menu"> - <li><a ng-click="switchLocale('fr')"><img src="img/fr.png" /> Français </a></li> - <li><a ng-click="switchLocale('en')"><img src="img/en.png" /> English </a> </li> - </ul> - </li> - </ul> - <div class="collapse navbar-collapse" ng-controller="UserLoginCtrl"> - <ul class="nav navbar-nav"> - <li><a href="#/poll/create"> {{ 'poll.new' | translate }}</a></li> - </ul> - <ul class="nav navbar-nav pull-right"> - <li ng-show="!currentUser.id"> - <a href="#/user/register/"> {{ 'action.register' | translate }} </a> - </li> - - <li class="divider-vertical" ng-show="!currentUser.id"></li> - - <li ng-show="!currentUser.id" dropdown> - <a href="#" role="button" class="dropdown-toggle"> - {{ 'action.login' | translate }} <strong class="caret"></strong> - </a> - - <div class="dropdown-menu form" role="menu" ng-click="$event.stopPropagation()"> - <div ng-include="'./partials/user-login.html'"></div> - </div> - </li> - - <li class="dropdown" ng-show="currentUser.administrator"> - <a href="#" role="button" class="dropdown-toggle"> - {{ 'admin' | translate }} <strong class="caret"></strong> - </a> - - <ul class="dropdown-menu" role="menu"> - <li><a href="#/poll/list">{{ 'admin.listPoll' | translate }}</a></li> - <li><a href="#/user/list">{{ 'admin.listUser' | translate }}</a></li> - <li><a href="#/conf">{{ 'admin.config' | translate }}</a></li> - </ul> - </li> - - <li class="dropdown" ng-show="currentUser.id"> - <a href="#" role="button" class="dropdown-toggle"> - {{ currentUser.name || currentUser.email }} <strong class="caret"></strong> - </a> - - <ul class="dropdown-menu" role="menu"> - <li> - <a href="#/user/edit">{{ 'user.edit' | translate }}</a> - </li> - - <li class="divider"></li> - - <li> - <a href="#/favoriteList">{{ 'user.favoriteList' | translate }}</a> - </li> - - <li class="divider"></li> - - <li> - <a href="#/poll/list/created"> {{ 'user.listPollCreated' | translate }} </a> - </li> - - <li> - <a href="#/poll/list/participated"> {{ 'user.listPollParticiped' | translate }} </a> - </li> - - <li> - <a href="#/poll/list/invited"> {{ 'user.listPollInvited' | translate }} </a> - </li> - - <li class="divider"></li> - - <li> - <a href="#" ng-click="logout()">{{ 'action.logout' | translate }}</a> - </li> - - </ul> - </li> - </ul> - </div> - </div> -</nav> - -<div ng-include="'partials/alerts.html'" ng-controller="printAlertCtrl"></div> - -<div ng-view class='container-fluid' id="content"></div> - -<footer> - <a href="https://doc.chorem.org/pollen" target="_blank">Pollen</a> - <a href="https://forge.chorem.org/projects/pollen/files" target="_blank">{{version}}</a> - <span class="separator">-</span> - <a href="http://www.gnu.org/licenses/agpl.html" target="_blank">Licence</a> - <span class="separator">-</span> - ©2009-2014 - <a href="http://www.codelutin.com/" target="_blank">Code Lutin</a> - <span class="separator">-</span> - <a href="https://forge.chorem.org/projects/pollen/issues" target="_blank">Rapport de bug</a> - <span class="separator">-</span> - <a href="http://list.chorem.org/cgi-bin/mailman/listinfo/pollen-users" target="_blank">Support utilisateur</a> -</footer> - - - - <script language="javascript" type="text/javascript" src="js/conf.js"></script> - - <script language="javascript" type="text/javascript" src="lib/jquery/dist/jquery.min.js"></script> - <script language="javascript" type="text/javascript" src="lib/jqplot-bower/dist//jquery.jqplot.min.js"></script> - <script language="javascript" type="text/javascript" src="lib/jqplot-bower/dist//plugins/jqplot.barRenderer.min.js"></script> - <script language="javascript" type="text/javascript" src="lib/jqplot-bower/dist//plugins/jqplot.pieRenderer.min.js"></script> - <script language="javascript" type="text/javascript" src="lib/jqplot-bower/dist//plugins/jqplot.categoryAxisRenderer.min.js"></script> - <script language="javascript" type="text/javascript" src="lib/jqplot-bower/dist//plugins/jqplot.pointLabels.min.js"></script> - - <script language="javascript" type="text/javascript" src="lib/ckeditor/ckeditor.js"></script> - - <script language="javascript" type="text/javascript" src="lib/angular/angular.min.js"></script> - <script language="javascript" type="text/javascript" src="lib/angular-route/angular-route.min.js"></script> - <script language="javascript" type="text/javascript" src="lib/angular-resource/angular-resource.min.js"></script> - <script language="javascript" type="text/javascript" src="lib/angular-translate/angular-translate.min.js"></script> - <script language="javascript" type="text/javascript" src="lib/angular-animate/angular-animate.min.js"></script> - <script language="javascript" type="text/javascript" src="lib/angular-bootstrap/ui-bootstrap-tpls.min.js"></script> - - <script language="javascript" type="text/javascript" src="lib/moment/min/moment.min.js"></script> - <script language="javascript" type="text/javascript" src="lib/moment/min/locales.min.js"></script> - <script language="javascript" type="text/javascript" src="lib/bootstrap/dist/js/bootstrap.min.js"></script> - <script language="javascript" type="text/javascript" src="lib/bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min.js"></script> - - <script language="javascript" type="text/javascript" src="js/app.js"></script> - <script language="javascript" type="text/javascript" src="js/directives.js"></script> - <script language="javascript" type="text/javascript" src="js/services.js"></script> - <script language="javascript" type="text/javascript" src="js/controllers/mainCtrl.js"></script> - <script language="javascript" type="text/javascript" src="js/controllers/pollCtrl.js"></script> - <script language="javascript" type="text/javascript" src="js/controllers/userCtrl.js"></script> - <script language="javascript" type="text/javascript" src="js/controllers/favoriteListCtrl.js"></script> - <script language="javascript" type="text/javascript" src="js/controllers/localeCtrl.js"></script> - <script language="javascript" type="text/javascript" src="js/controllers/alertCtrl.js"></script> - - <script language="javascript" type="text/javascript" src="i18n/fr.js"></script> - <script language="javascript" type="text/javascript" src="i18n/en.js"></script> - - <script language="javascript" type="text/javascript" src="js/scripts/sticky-inline-poll.js"></script> -</body> -</html> - diff --git a/pollen-ui-angular/src/main/webapp/js/app.js b/pollen-ui-angular/src/main/webapp/js/app.js deleted file mode 100644 index b36e315..0000000 --- a/pollen-ui-angular/src/main/webapp/js/app.js +++ /dev/null @@ -1,146 +0,0 @@ -/* - * #%L - * Pollen :: UI (Angular) - * %% - * Copyright (C) 2009 - 2017 Code Lutin, Tony Chemit - * %% - * 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 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/>. - * #L% - */ - -try { - if (conf.restURL === undefined) { - throw ""; - } -} catch (e) { - var message = "pollen need a global variable who define conf.restURL with the url of the server rest"; - document.getElementsByTagName("body")[0].innerHTML = message; - throw message; - -} - -'use strict'; - -angular.module('pollen', ['pollenDirective', 'pollenServices', 'ngRoute', 'PollenMainControllers', 'pollControllers', 'userControllers', 'favoriteListControllers', 'localeControllers', 'alertControllers', 'ui.bootstrap', 'pascalprecht.translate', 'ngAnimate']) -.config(['$httpProvider', function($httpProvider) { - // edit header for locale and sessionToken - $httpProvider.interceptors.push('httpInterceptor'); - - // edit content-type for send data to the server - $httpProvider.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=utf-8'; -}]) - -.factory('httpInterceptor', ['$q', '$rootScope', '$location', '$timeout', 'SessionStorage', - function ($q, $rootScope, $location, $timeout, SessionStorage) { - if (angular.isUndefined($rootScope.nbRequest)) { - $rootScope.nbRequest = -1; - } - - var startRequest = function () { - if ($rootScope.nbRequest == -1) { - $rootScope.$broadcast('load', $rootScope.nbRequest); - } - $rootScope.nbRequest+=2; - }; - - var finishRequest = function () { - $rootScope.nbRequest--; - $timeout(function () { - $rootScope.nbRequest--; - - if ($rootScope.nbRequest == -1) { - $rootScope.$broadcast('unload'); - } - }, 50); - }; - - - return { - request: function($config) { - var session = SessionStorage.get(); - - // rewrite 'Accept-Language' if locale is defined - if (angular.isDefined(session.locale)) { - $config.headers['Accept-Language'] = session.locale; - } - - // set header for session token - $config.headers['X-Pollen-Session-Token'] = session.token; - - startRequest(); - - return $config; - }, - response: function(response) { - finishRequest(); - - return response; - }, - responseError: function(response) { - finishRequest(); - - if (response.status === 0) { - // no access to server - $rootScope.$broadcast('newError', 'error.noServer'); - } - else if (response.status === 404) { - // not found resource - $rootScope.$broadcast('newError', 'error.notFound'); - } - else if (response.status === 401) { - //error login or sessionToken - $rootScope.$broadcast('sessionExpired'); - } - return $q.reject(response); - } - }; -}]) - -.config(['$routeProvider', function($routeProvider) { - $routeProvider.when('/', {templateUrl: './partials/home.html', controller: "HomeCtrl"}) - .when('/poll/create/:tab?', {templateUrl: './partials/poll.html', controller: "PollCreateCtrl"}) - .when('/poll/edit/:pollId/:pollToken?', {templateUrl: './partials/poll.html', controller:"PollCtrl"}) - .when('/poll/edit/:pollId/:pollToken?/tab/:tab?', {templateUrl: './partials/poll.html', controller:"PollCtrl"}) - .when('/poll/vote/:pollId/:pollToken?', {templateUrl: './partials/poll.html', controller :"PollCtrl"}) - .when('/poll/vote/:pollId/:pollToken?/vote/:voteToken', {templateUrl: './partials/poll.html', controller :"PollCtrl"}) - .when('/poll/result/:pollId/:pollToken?', {templateUrl: './partials/poll.html', controller :"PollCtrl"}) - .when('/poll/comment/:pollId/:pollToken?', {templateUrl: './partials/poll.html', controller :"PollCtrl"}) - .when('/poll/comment/:pollId/:pollToken?/comment/:commentToken', {templateUrl: './partials/poll.html', controller :"PollCtrl"}) - .when('/poll/list/:cmd?', {templateUrl: './partials/poll-list.html', controller :"PollListCtrl"}) - .when('/user/list', {templateUrl: './partials/user-admin-list.html', controller:"UserListCtrl"}) - .when('/user/register', {templateUrl: './partials/user-register.html', controller:"UserRegisterCtrl"}) - .when('/user/edit', {templateUrl: './partials/user-edit.html', controller:"UserEditCtrl"}) - .when('/user/lostpassword', {templateUrl: './partials/user-lostPassword.html', controller:"UserLostPasswordCtrl"}) - .when('/user/:userId/:token', {templateUrl: './partials/home.html', controller:"UserValidateCtrl"}) - .when('/favoriteList', {templateUrl: './partials/favoriteList-list.html', controller:"FavoriteListCtrl"}) - .when('/favoriteList/new', {templateUrl: './partials/favoriteList-edit.html', controller:"FavoriteListEditCtrl"}) - .when('/favoriteList/:favoriteListId', {templateUrl: './partials/favoriteList-edit.html', controller:"FavoriteListEditCtrl"}) - .otherwise({redirectTo: '/'}); - -}]) - -.config(['$translateProvider', function ($translateProvider) { - $translateProvider.translations('en', translateEN); - $translateProvider.translations('fr', translateFR); - - if (angular.isDefined(conf.defaultLanguage)) { - $translateProvider.preferredLanguage(conf.defaultLanguage); - $translateProvider.fallbackLanguage(conf.defaultLanguage); - } - else { - $translateProvider.preferredLanguage('en'); - $translateProvider.fallbackLanguage('en'); - } -}]); - diff --git a/pollen-ui-angular/src/main/webapp/js/conf.js.example b/pollen-ui-angular/src/main/webapp/js/conf.js.example deleted file mode 100644 index 7b2579f..0000000 --- a/pollen-ui-angular/src/main/webapp/js/conf.js.example +++ /dev/null @@ -1,48 +0,0 @@ -var conf = { - // Rest-API Base Url - // This value is Mandatory - restURL : "http://example.com/pollen-rest-api/v1", - - // Poll number per page - pollDefaultPageSize : 10, - - // Comment number per page - commentDefaultPageSize : 10, - - // Favorite list number per page - favoriteListDefaultPageSize : 15, - - // Member in Favorite list number per page - favoriteListMemberDefaultPageSize : 30, - - // Default Language for i18n : 'en' or 'fr' - defaultLanguage: 'en', - - // Time in ms to print alert info - // -1 for infinite time, click or reload for close alert - defaultAlertTimeInfo: 10000, // 10s - - // Time in ms to print alert success - // -1 for infinite time, click or reload for close alert - defaultAlertTimeSuccess: 2000, // 2s - - // Time in ms to print alert warning - // -1 for infinite time, click or reload for close alert - defaultAlertTimeWarning: 5000, // 5s - - // Time in ms to print alert error - // -1 for infinite time, click or reload for close alert - defaultAlertTimeError: -1, // infinite - - // Format Date - // preference : shortDate, mediumDate, longDate, fullDate - defaultDateFormat : "shortDate", - - // Format Time - // preference : shortTime, mediumTime - defaultTimeFormat: "shortTime", - - // Format DateTime - // preference : short, medium - defaultDateTimeFormat: "short", -}; \ No newline at end of file diff --git a/pollen-ui-angular/src/main/webapp/js/controllers/alertCtrl.js b/pollen-ui-angular/src/main/webapp/js/controllers/alertCtrl.js deleted file mode 100644 index fb5ac2c..0000000 --- a/pollen-ui-angular/src/main/webapp/js/controllers/alertCtrl.js +++ /dev/null @@ -1,208 +0,0 @@ -/* - * #%L - * Pollen :: UI (Angular) - * %% - * Copyright (C) 2009 - 2017 Code Lutin, Tony Chemit - * %% - * 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 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/>. - * #L% - */ -'use strict'; - -angular.module('alertControllers', []) -.controller('printAlertCtrl', ['$scope', '$timeout', '$sce', '$filter', - function ($scope, $timeout, $sce, $filter) { - - if (angular.isUndefined($scope.data)) { - $scope.data = {} - } - - $scope.data.alerts = []; - $scope.data.persistentAlerts = []; - - var makeAlert = function (msg, type, icon, id) { - var alert = {msg:msg, type:type}; - - if (icon !== undefined) { - alert.icon = icon; - } - - if (id !== undefined) { - alert.id = id; - } - return alert; - }; - - var getPoolAlert = function (timeout) { - if (angular.isDefined(timeout) && timeout >= 0) { - return $scope.data.alerts; - } else { - return $scope.data.persistentAlerts; - } - }; - - var hideFilterAlert = function (filter) { - var alert = $($scope.data.persistentAlerts).filter(function() { - return filter(this); - }); - - alert.add($($scope.data.alerts).filter(function () { - return filter(this); - })); - - alert.each(function () { - $scope.hideAlert(this); - }); - }; - - $scope.$on('newError', function (event, error, timeout, id) { - var alert = makeAlert(error,'danger','fa fa-info-error', id); - - if (angular.isDefined(timeout)) { - $scope.addAlert(alert, timeout); - } else { - $scope.addAlert(alert, conf.defaultAlertTimeError); - } - }); - - $scope.$on('newWarning', function (event, warning, timeout, id) { - var alert = makeAlert(warning, 'warning', 'fa fa-warning', id); - - if (angular.isDefined(timeout)) { - $scope.addAlert(alert, timeout); - } else { - $scope.addAlert(alert, conf.defaultAlertTimeWarning); - } - }); - - - $scope.$on('newSuccess', function (event, success, timeout, id) { - var alert = makeAlert(success, 'success', 'fa fa-check', id); - - if (angular.isDefined(timeout)) { - $scope.addAlert(alert, timeout); - } else { - $scope.addAlert(alert, conf.defaultAlertTimeSuccess); - } - }); - - $scope.$on('newInfo', function (event, info, timeout, id) { - var alert = makeAlert(info, 'info', 'fa fa-info-circle', id); - - if (angular.isDefined(timeout)) { - $scope.addAlert(alert, timeout); - } else { - $scope.addAlert(alert, conf.defaultAlertTimeInfo); - } - }); - - $scope.$on('load', function () { - if (angular.isUndefined($scope.alert)) { - $scope.alert = {msg: 'info.load', type: 'info', icon: 'fa fa-spin fa-spinner'}; - $scope.data.alerts.push($scope.alert); - } - }); - $scope.$on('unload', function () { - var index = $scope.data.alerts.indexOf($scope.alert); - if (index >= 0) { - $scope.data.alerts.splice(index, 1); - delete $scope.alert; - } - }); - - $scope.$on('hideAlertByMsg', function (event, msg) { - var filter = function (alert) { - return alert.msg === msg; - }; - hideFilterAlert(filter); - }); - - $scope.$on('hideAlertByType', function (event, type) { - var filter = function (alert) { - return alert.type === type; - }; - hideFilterAlert(filter); - }); - - $scope.$on('hideAlertById', function (event, id) { - var filter = function (alert) { - return alert.id === id; - }; - hideFilterAlert(filter); - }); - - $scope.$on('cleanAlert', function(persistent) { - if (persistent === undefined) { - $scope.$emit('cleanAlert', false); - $scope.$emit('cleanAlert', true); - } else if (persistent) { - $scope.data.persistentAlerts = []; - } else { - $scope.data.alerts = []; - } - }); - - $scope.addAlert = function (alert, timeout) { - var alertNotExist = true; - var poolAlert = getPoolAlert(timeout); - - angular.forEach(poolAlert, function (oneAlert) { - if (angular.equals(oneAlert.msg, alert.msg) && angular.equals(oneAlert.type, alert.type)) { - $timeout.cancel(oneAlert.timeoutPromise); - alert = oneAlert; - alertNotExist = false; - } - }); - - if (alertNotExist) { - poolAlert.push(alert); - } - - if (angular.isDefined(timeout) && timeout >= 0) { - alert.timeout = timeout; - alert.timeoutPromise = $timeout(function () { - $scope.hideAlert(alert) - }, timeout); - } else { - alert.timeout = -1; - } - }; - - $scope.hideAlert = function (alert) { - var poolAlert = getPoolAlert(alert.timeout); - - var index = poolAlert.indexOf(alert); - if (index >= 0) { - poolAlert.splice(index, 1); - } - }; - - $scope.hoverAlert = function (alert) { - if (alert.timeout >= 0) { - $timeout.cancel(alert.timeoutPromise); - } - }; - - $scope.leaveAlert = function (alert) { - if (alert.timeout >= 0) { - alert.timeoutPromise = $timeout(function () { - $scope.hideAlert(alert); - }, alert.timeout); - } - }; - - $scope.toHTML = function (msg) { - return $sce.trustAsHtml($filter('translate')(msg)); - } -}]); diff --git a/pollen-ui-angular/src/main/webapp/js/controllers/favoriteListCtrl.js b/pollen-ui-angular/src/main/webapp/js/controllers/favoriteListCtrl.js deleted file mode 100644 index aaa65ed..0000000 --- a/pollen-ui-angular/src/main/webapp/js/controllers/favoriteListCtrl.js +++ /dev/null @@ -1,241 +0,0 @@ -/* - * #%L - * Pollen :: UI (Angular) - * %% - * Copyright (C) 2009 - 2017 Code Lutin, Tony Chemit - * %% - * 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 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/>. - * #L% - */ -'use strict'; - -angular.module('favoriteListControllers', []) -.controller('FavoriteListCtrl', ['$scope', '$rootScope', 'FavoriteList', 'FavoriteListMember', '$translate', '$routeParams', 'Page', '$location', - function ($scope, $rootScope, FavoriteList, FavoriteListMember, $translate, $routeParams, Page, $location) { - $scope.data = {}; - - Page.setTitle('user.favoriteList'); - - var paginationParameter = {pageSize: conf.favoriteListDefaultPageSize}; - if (angular.isUndefined(paginationParameter.pageSize)) { - paginationParameter.pageSize = -1; - } - if (angular.isDefined($routeParams.page)) { - if (angular.isDefined($routeParams.pageSize)) { - paginationParameter = {pageSize:$routeParams.pageSize}; - $scope.pageSize = $routeParams.pageSize; - } - paginationParameter.pageNumber = $routeParams.page; - } - - $scope.$watch('data.favoriteListPagination.currentPage', function (newVal, oldVal) { - // check if the current page has changed - if (angular.isDefined(oldVal) && newVal != oldVal) { - paginationParameter.pageNumber = $scope.data.favoriteListPagination.currentPage; - initFavoriteList(); - } - }); - - var initFavoriteList = function () { - FavoriteList.get({paginationParameter:paginationParameter}, function (data) { - $scope.data.favoriteList = data.elements; - $scope.data.favoriteListPagination = data.pagination; - }, function (error) { - if (error.status === 403) { - $rootScope.$broadcast('newError', 'error.forbidden'); - $location.url('/'); - } - }); - }; initFavoriteList(); - -}]) - -.controller('FavoriteListEditCtrl', ['$scope', '$rootScope', 'FavoriteList', 'FavoriteListMember', '$translate', '$routeParams', '$timeout', '$q', '$location', '$route', - function ($scope, $rootScope, FavoriteList, FavoriteListMember, $translate, $routeParams, $timeout, $q, $location, $route) { - $scope.data = {}; - - var paginationParameter = {pageSize: conf.favoriteListMemberDefaultPageSize}; - if (angular.isUndefined(paginationParameter.pageSize)) { - paginationParameter.pageSize = -1; - } - if (angular.isDefined($routeParams.page)) { - if (angular.isDefined($routeParams.pageSize)) { - paginationParameter = {pageSize:$routeParams.pageSize}; - $scope.pageSize = $routeParams.pageSize; - } - paginationParameter.pageNumber = $routeParams.page; - } - - $scope.$watch('data.favoriteListMemberPagination.currentPage', function (newVal, oldVal) { - // check if the current page has changed - if (angular.isDefined(oldVal) && newVal != paginationParameter.pageNumber) { - paginationParameter.pageNumber = newVal; - initFavoriteListMember(); - } - }); - - var getEmptyFavoriteList = function () { - return {name:'', members: []}; - }; - - var initFavoriteList = function () { - if ($routeParams.favoriteListId) { - FavoriteList.get({favoriteListId:$routeParams.favoriteListId}, function (favList) { - $scope.data.favoriteList = favList; - initFavoriteListMember(); - }, function (error) { - if (error.status === 403) { - $rootScope.$broadcast('newError', 'error.forbidden'); - $location.url('/'); - } - }); - } - else { - $scope.data.favoriteList = getEmptyFavoriteList(); - } - }; initFavoriteList(); - - var initFavoriteListMember = function () { - var deferred = $q.defer(); - FavoriteListMember.get({favoriteListId:$routeParams.favoriteListId, paginationParameter:paginationParameter}, - function (members) { - $timeout(function () { - $scope.data.favoriteList.members = members.elements; - $scope.data.favoriteListMemberPagination = members.pagination; - deferred.resolve(); - }, 100); - }, function (error) { - if (error.status === 403) { - $rootScope('newError', 'error.forbidden'); - $location.url('/'); - } - }); - - return deferred.promise; - }; - - $scope.addMember = function () { - if (angular.isDefined($scope.data.favoriteListMemberPagination) && $scope.data.favoriteListMemberPagination.currentPage < $scope.data.favoriteListMemberPagination.lastPage) { - paginationParameter.pageNumber = $scope.data.favoriteListMemberPagination.lastPage; - initFavoriteListMember().then($scope.addMember); - } else { - $scope.data.favoriteList.members.push({name:'', email:''}); - } - }; - - $scope.saveFavoriteList = function () { - var FavoriteListPromise; - if (angular.isDefined($scope.data.favoriteList.id)) { // edit - FavoriteListPromise = FavoriteList.update({id:$scope.data.favoriteList.id, name:$scope.data.favoriteList.name}, function () { - delete $scope.data.favoriteList.restError; - }, function (error) { - $scope.data.favoriteList.restError = error.data; - }).$promise; - } else { // Create - FavoriteListPromise = FavoriteList.add({name:$scope.data.favoriteList.name}, function (data) { - $scope.data.favoriteList.id = data.id; - delete $scope.data.favoriteList.restError; - angular.forEach($scope.data.favoriteList.members, function (member) { - $scope.saveMember(member); - }); - $location.url('/favoriteList/'+data.id); - }, function (error) { - $scope.data.favoriteList.restError = error.data; - }).$promise; - } - - return FavoriteListPromise; - }; - - $scope.saveMember = function (member) { - if (member.name != '' && member.email != '') { - if (angular.isDefined($scope.data.favoriteList.id)) { - var memberPromise; - if (angular.isDefined(member.id)) { - memberPromise = FavoriteListMember.update({favoriteListId:$scope.data.favoriteList.id}, member).$promise; - } else { - memberPromise = FavoriteListMember.add({favoriteListId:$scope.data.favoriteList.id}, member).$promise; - } - - memberPromise.then(function (data) { - member.id = data.id; - delete member.restError; - }, function (error) { - member.restError = error.data; - }) - } - else { - // create favoriteList - if (angular.isUndefined($scope.data.favoriteList.restError)) { - $scope.saveFavoriteList().then(function () { - $scope.saveMember(member); - }); - } - } - } - }; - - $scope.deleteFavoriteList = function () { - if (angular.isDefined($scope.data.favoriteList.id)) { - var confirmMessage; - $translate('action.message.confirmDelete').then(function (msg) { - confirmMessage = msg; - }).then( function () { - var confirmDelete = confirm(confirmMessage); - if (confirmDelete == true) { - FavoriteList.remove({favoriteListId:$scope.data.favoriteList.id}, function () { - $location.url('/favoriteList'); - }); - } - }); - } - else { - $location.url('/favoriteList'); - } - }; - - $scope.deleteMember = function (member) { - if (angular.isDefined($scope.data.favoriteList.id) && angular.isDefined(member.id)) { - var confirmMessage; - $translate('action.message.confirmDelete').then(function (msg) { - confirmMessage = msg; - }).then( function () { - var confirmDelete = confirm(confirmMessage); - if (confirmDelete == true) { - FavoriteListMember.remove({favoriteListId:$scope.data.favoriteList.id, memberId:member.id}, function () { - var index = $scope.data.favoriteList.members.indexOf(member); - $scope.data.favoriteList.members.splice(index, 1); - }); - } - }); - } - else { - var index = $scope.data.favoriteList.members.indexOf(member); - $scope.data.favoriteList.members.splice(index, 1); - } - }; - - $scope.newFavoriteList = function () { - $scope.data.favoriteList = getEmptyFavoriteList(); - $location.url('/favoriteList/new'); - }; - - var lastRoute = $route.current; - $scope.$on('$locationChangeSuccess', function() { - if (lastRoute.$$route.controller == $route.current.$$route.controller) { - $route.current = lastRoute; - } - }); - -}]); diff --git a/pollen-ui-angular/src/main/webapp/js/controllers/localeCtrl.js b/pollen-ui-angular/src/main/webapp/js/controllers/localeCtrl.js deleted file mode 100644 index fbc64b7..0000000 --- a/pollen-ui-angular/src/main/webapp/js/controllers/localeCtrl.js +++ /dev/null @@ -1,70 +0,0 @@ -/* - * #%L - * Pollen :: UI (Angular) - * %% - * Copyright (C) 2009 - 2017 Code Lutin, Tony Chemit - * %% - * 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 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/>. - * #L% - */ -'use strict'; - -angular.module('localeControllers', []) -.controller('LocaleCtrl', ['$scope', '$rootScope', '$translate', 'SessionStorage', '$locale', function ($scope, $rootScope, $translate, SessionStorage, $locale) { - $scope.locale = SessionStorage.get().locale; - - var locales = []; - locales['fr'] = i18n_FR; - locales['en'] = i18n_EN; - - var loadLocale = function () { - if ($scope.locale == "fr" && angular.isDefined(i18n_FR)) { - angular.copy(i18n_FR, $locale); - moment.locale("fr"); - } - else if (angular.isDefined(i18n_EN)) { - angular.copy(i18n_EN, $locale); - moment.locale("en"); - } - }; - - if (angular.isUndefined($scope.locale)) { - // set locale with browser preference - $scope.locale = navigator.language || navigator.userLanguage; - $scope.locale = $scope.locale.substring(0,2); - - // get locale supported - if ($scope.locale != 'fr' && $scope.locale != 'en') { - $scope.locale = conf.defaultLanguage || 'en'; - } - - SessionStorage.save({locale:$scope.locale}); - } - $translate.use($scope.locale); - loadLocale(); - - $scope.switchLocale = function (locale) { - //change locale - if (locale != $scope.locale) { - SessionStorage.save({locale:locale}); - $scope.locale = locale; - $translate.use(locale); - - loadLocale(); - - $rootScope.$broadcast('switchLocale'); - } - } - -}]); diff --git a/pollen-ui-angular/src/main/webapp/js/controllers/mainCtrl.js b/pollen-ui-angular/src/main/webapp/js/controllers/mainCtrl.js deleted file mode 100644 index 6944347..0000000 --- a/pollen-ui-angular/src/main/webapp/js/controllers/mainCtrl.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * #%L - * Pollen :: UI (Angular) - * %% - * Copyright (C) 2009 - 2017 Code Lutin, Tony Chemit - * %% - * 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 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/>. - * #L% - */ -'use strict'; - -angular.module('PollenMainControllers', ['pollenServices']) -.controller('MainCtrl', ['$scope', '$http', 'Page', - function ($scope, $http, Page) { - - $http.get('version.txt', {'transformResponse':angular.identity}).success(function (data) { - $scope.version = data; - }); - - $scope.$on('titleChange', function () { - $scope.title = Page.title(); - }) -}]); - diff --git a/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js b/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js deleted file mode 100644 index 5b47437..0000000 --- a/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js +++ /dev/null @@ -1,1953 +0,0 @@ -/* - * #%L - * Pollen :: UI (Angular) - * %% - * Copyright (C) 2009 - 2017 Code Lutin, Tony Chemit - * %% - * 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 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/>. - * #L% - */ -'use strict'; - -angular.module('pollControllers', ['ngRoute', 'pollenServices', 'pascalprecht.translate', 'ui.bootstrap']) -.controller('HomeCtrl', ['$scope', 'Poll', 'SessionStorage', 'Page', function ($scope, Poll, SessionStorage, Page) { - Page.setTitle('title.home'); - $scope.isConnected = (SessionStorage.get().user !== undefined); - Poll.skeletonNew(); -}]) - -////////////////////////////////// -// Poll global controller // -////////////////////////////////// - -.controller('PollCtrl', - ['$scope', '$rootScope', '$controller', '$sce', '$timeout', '$routeParams', '$location', 'SessionStorage', '$translate', '$filter', '$route', '$q', 'Poll', 'PollenResource', 'Page', 'DateFormat', - function ( $scope, $rootScope, $controller, $sce, $timeout, $routeParams, $location, SessionStorage, $translate, $filter, $route, $q, Poll, PollenResource, Page, DateFormat) { - $scope.setTab = function (defaultValue) { - if (angular.isDefined($route.current)) { - - if (angular.isDefined($route.current.params.tab)) { - return $route.current.params.tab; - } - - if (angular.isDefined($route.current.$$route) - && angular.isDefined($route.current.$$route.originalPath)) { - var params = $route.current.$$route.originalPath.split('/'); - - return params[2]; - } - } - - if (angular.isDefined(defaultValue)) { - return defaultValue; - } - - return null; - }; - - $scope.tab = $scope.setTab('home'); - - if (angular.isUndefined($scope.globalVariables)) { - $scope.globalVariables = {}; - } - - $scope.session = SessionStorage.get(); - $scope.globalVariables.toDay = new Date(); - $scope.globalVariables.minify = true; - - if (angular.isDefined($scope.session.menuMinify)) { - $scope.globalVariables.minify = $scope.session.menuMinify; - } - - var baseUrl = window.location.protocol+'//'+window.location.hostname; - if (window.location.port != "") { - baseUrl += ':'+window.location.port; - } - baseUrl += window.location.pathname; - - $scope.globalVariables.baseUrl = baseUrl; - - /** - * Sauvegarde du token si non connecté - */ - if (angular.isUndefined($routeParams.pollToken) && angular.isUndefined($scope.session.id)) { // pas de paramètre url et non connecté - if (angular.isDefined($scope.session.pollToken) && $scope.session.pollToken != '') { // existe une permission - $scope.globalVariables.pollToken = $scope.session.pollToken; - } - } - else if (angular.isDefined($scope.session.id)) { // connecté - if (angular.isDefined($scope.session.pollToken)) { // connecté => pas besoin de permission - SessionStorage.remove('pollToken'); - } - } - else { //token dans l'URL - SessionStorage.save({pollToken:$routeParams.pollToken}); - $scope.globalVariables.pollToken = $routeParams.pollToken; - } - - $scope.toggleMinify = function () { - $scope.globalVariables.minify = ! $scope.globalVariables.minify; - SessionStorage.save({'menuMinify': $scope.globalVariables.minify}); - }; - - var setDateFormat = function () { - $scope.globalVariables.dateFormat = DateFormat.getDateFormat(); - $scope.globalVariables.timeFormat = DateFormat.getTimeFormat(); - $scope.globalVariables.dateTimeFormat = DateFormat.getDateTimeFormat(); - }; setDateFormat(); - - $scope.data = {}; - - $scope.pollDeferred = $q.defer(); - - var setVoteCountingType = function () { - $scope.pollDeferred.promise.then(function () { - Poll.voteCountingType({id:$scope.data.poll.voteCountingType}, function (data) { - $scope.data.voteCountingType = data; - $scope.pollDeferred.resolve(); - }) - }); - }; - - if (angular.isDefined($routeParams.pollId)) { - var pollDeferred = $scope.pollDeferred; - Poll.get({pollId:$routeParams.pollId, permission:$scope.globalVariables.pollToken}, function (poll) { - $scope.data.poll = poll; - pollDeferred.resolve('get poll'); - }, function (error) { - Poll.get({pollId:$routeParams.pollId, permission:$routeParams.voteToken}, function (poll) { - $scope.data.poll = poll; - // clean permission - SessionStorage.remove('pollToken'); - delete $scope.globalVariables.pollToken; - - pollDeferred.resolve('bad token') - }, function (error) { - if (error.status == 403) { - $rootScope.$broadcast('newError', 'error.forbidden'); - $location.path("/"); - } - pollDeferred.reject(error); - }); - }); - - pollDeferred.promise.then(function () { - setVoteCountingType(); - initTemplateURL(); - $scope.data.poll.limitedVote = $scope.data.poll.maxChoiceNumber > 0; - }); - - pollDeferred.promise.then(function () { - var baseUrl = $scope.globalVariables.baseUrl; - $scope.globalVariables.linkHome = baseUrl; - $scope.globalVariables.linkVote = baseUrl; - $scope.globalVariables.linkComment = baseUrl; - $scope.globalVariables.linkEdit = baseUrl; - $scope.globalVariables.linkResult = baseUrl; - $scope.globalVariables.linkHome += '#/poll/home/'+$routeParams.pollId; - $scope.globalVariables.linkVote += '#/poll/vote/'+$routeParams.pollId; - $scope.globalVariables.linkComment += '#/poll/comment/'+$routeParams.pollId; - $scope.globalVariables.linkEdit += '#/poll/edit/'+$routeParams.pollId; - $scope.globalVariables.linkResult += '#/poll/result/'+$routeParams.pollId; - - if (angular.isDefined($scope.globalVariables.pollToken)) { - $scope.globalVariables.linkHome += '/'+$scope.globalVariables.pollToken; - $scope.globalVariables.linkEdit += '/'+$scope.globalVariables.pollToken; - $scope.globalVariables.linkConf = $scope.globalVariables.linkEdit+'/tab/conf'; - $scope.globalVariables.linkParticipant = $scope.globalVariables.linkEdit+'/tab/participant'; - } - else { - $scope.globalVariables.linkConf = $scope.globalVariables.linkEdit+'/tab/conf'; - $scope.globalVariables.linkParticipant = $scope.globalVariables.linkEdit+'/tab/participant'; - } - }); - } - - $scope.toHTML = function (data) { - return $sce.trustAsHtml(data); - }; - - $scope.inlineVersion = function () { - $scope.templateURL = './partials/inline-poll.html'; - }; - - $scope.bigVersion = function () { - $scope.templateURL = './partials/big-poll.html'; - }; - - var initTemplateURL = function () { - if (angular.isDefined($scope.data.poll) && angular.isDefined($scope.data.poll.template)) { - if ($scope.data.poll.template == "big") { - $scope.bigVersion(); - } - else { - $scope.inlineVersion(); - } - } - else { - $scope.inlineVersion(); - } - }; initTemplateURL(); - - var lastRoute = $route.current; - $timeout(function() { - $scope.$on('$locationChangeSuccess', function() { - if (lastRoute.$$route.controller == $route.current.$$route.controller) { - $scope.tab = $scope.setTab(); - $route.current = lastRoute; - } - else if (lastRoute.$$route.controller != 'PollCreateCtrl' || $route.current.$$route.controller != 'PollCtrl') { - $rootScope.$broadcast('hideAlertByType', 'warning'); - $rootScope.$broadcast('hideAlertByType', 'success'); - $rootScope.$broadcast('hideAlertByType', 'info'); - } - }); - }); - - - $scope.voteCountingIsBoolean = function () { - if (angular.isDefined($scope.data.voteCountingType)) { - return $scope.data.voteCountingType.renderType == 'checkbox'; - } - return false; - }; - - $scope.getVoteValue = function (voteValue) { - if ($scope.voteCountingIsBoolean()) { - return !!(voteValue); - } - else { - if (voteValue === true) { - return 1.0; - } - else if (voteValue === false) { - return 0.0; - } - else { - return voteValue; - } - } - }; - - $scope.preSendChoice = function (choice) { - if (choice.choiceType == 'DATE') { - if (angular.isDate(choice.choiceValue)) { - choice.choiceValue = choice.choiceValue.getTime(); - } - else if (!angular.isNumber(choice.choiceValue)) { - choice.choiceValue = null; - } - } - else if (choice.choiceType == 'RESOURCE') { - try { - choice.choiceValue = choice.choiceValue.meta.id; - } catch (e) { - choice.choiceValue = null; - } - } - - return choice; - }; - - $scope.postReceiveChoice = function (choice) { - if (choice.choiceType == 'DATE') { - choice.choiceValue = new Date(Number(choice.choiceValue)); - } - else if (choice.choiceType == 'RESOURCE') { - var resourceId = choice.choiceValue; - choice.choiceValue = {meta:{id:resourceId}, data:conf.restURL+'/resources/'+resourceId, id: resourceId}; - PollenResource.getMeta({resourceId : resourceId}, function (meta) { - choice.choiceValue = {meta:meta, data : conf.restURL+'/resources/'+meta.id, id : meta.id}; - }); - } - - return choice; - }; - - $timeout(function () { - $scope.$watch('data.poll.voteCountingType', function (newVal, oldVal) { - if (newVal != oldVal && oldVal !== undefined) { - setVoteCountingType(); - } - }); - - $scope.$watch('data.voteCountingType.renderType', function (newVal) { - if (newVal !== undefined) { - angular.forEach($scope.data.votants, function(votant) { - angular.forEach(votant.choice, function (choice) { - choice.voteValue = $scope.getVoteValue(choice.voteValue); - }); - }); - } - }); - - $scope.$watch('data.poll.title', function (newVal) { - if (angular.isDefined(newVal)) { - Page.setValue(newVal); - } - }); - }); - - $scope.deletePoll = function () { - if (angular.isDefined($scope.data.poll.id)) { - var confirmMessage; - $translate('action.message.confirmDelete').then(function (msg) { - confirmMessage = msg; - }).then( function () { - var confirmDelete = confirm(confirmMessage); - if (confirmDelete == true) { - $scope.data.poll.$remove({permission:$scope.globalVariables.pollToken}, function() { - $rootScope.$broadcast('cleanAlert'); - $rootScope.$broadcast('newSuccess', 'poll.deleted'); - $location.path('/'); - }); - } - }); - } - }; - - $scope.closePoll = function () { - if (angular.isDefined($scope.data.poll.id)) { - var confirmMessage; - $translate('action.message.confirmClose').then(function (msg) { - confirmMessage = msg; - }).then( function () { - var confirmClose = confirm(confirmMessage); - if (confirmClose == true) { - $scope.data.poll.$close({permission:$scope.globalVariables.pollToken}, function() { - $rootScope.$broadcast('cleanAlert'); - $rootScope.$broadcast('newSuccess', 'poll.closed'); - $route.reload(); - }); - } - }); - } - }; - - $scope.clonePoll = function () { - if (angular.isDefined($scope.data.poll.id)) { - Poll.clone({pollId: $scope.data.poll.id, permission: $scope.globalVariables.pollToken}, {}, function (data) { - $rootScope.$broadcast('cleanAlert'); - $rootScope.$broadcast('newInfo', - $filter('translate')('poll.created.printLink', {url: - '<input type="text" class="form-control" value="' + - $scope.globalVariables.baseUrl+'#/poll/edit/'+data.id+'/'+data.permission + - '" readonly />' - }) - , -1, data.id); - $rootScope.$broadcast('newSuccess', 'poll.cloned'); - $location.url('/poll/edit/'+data.id+'/'+data.permission); - $route.reload(); - }); - } - } - -}]) - -.controller('PollInfoCtrl', ['$scope', '$timeout', '$interval', - function($scope, $timeout, $interval) { - - var setPollInfo = function() { - if (angular.isUndefined( $scope.data.poll)) { - return ; - } - var poll = angular.copy($scope.data.poll); - var now = new Date(); - - if (angular.isUndefined(poll.beginDate) || poll.beginDate === null) { - poll.beginDate = now; - } - - $scope.timeOfEndVote = moment(poll.endDate).format('LL'); - - $scope.timeToBeginVote = moment(poll.beginDate).fromNow(); - - $scope.timeToEndVote = {}; - $scope.timeToEndVote.value = (now.getTime() - poll.beginDate) / (poll.endDate - poll.beginDate) * 100; - $scope.timeToEndVote.label = moment(poll.endDate).fromNow(); - $scope.timeToEndVote.type = getType($scope.timeToEndVote.value); - - if (angular.isUndefined(poll.beginChoiceDate) || poll.beginChoiceDate === null) { - poll.beginChoiceDate = poll.beginDate; - } - - if (angular.isUndefined(poll.endChoiceDate) || poll.endChoiceDate === null) { - poll.endChoiceDate = poll.endDate; - } - - $scope.timeToBeginAddChoice = moment(poll.beginChoiceDate).fromNow(); - - $scope.timeToAddChoice = {}; - $scope.timeToAddChoice.value = (now.getTime() - poll.beginChoiceDate) / (poll.endChoiceDate - poll.beginChoiceDate) * 100; - $scope.timeToAddChoice.label = moment(poll.endChoiceDate).fromNow(); - $scope.timeToAddChoice.type = getType($scope.timeToAddChoice.value); - - $scope.now = now; - }; - - var getType = function (value) { - var type; - if (value < 25) { - type = 'success'; - } else if (value < 50) { - type = 'info'; - } else if (value < 75) { - type = 'warning'; - } else { - type = 'danger'; - } - return type; - }; - - $interval(setPollInfo, 5000); - - $timeout(function() { - $scope.$watch('data.poll.beginDate', setPollInfo); - $scope.$watch('data.poll.endDate', setPollInfo); - $scope.$watch('data.poll.beginChoiceDate', setPollInfo); - $scope.$watch('data.poll.endChoiceDate', setPollInfo); - }) - -}]) - -////////////////////////////////// -// Admin choice controller // -////////////////////////////////// - -.controller('PollAdminChoiceCtrl', ['$scope', '$rootScope', '$modal', '$routeParams', 'PollChoice', - function ($scope, $rootScope, $modal, $routeParams, PollChoice) { - - if (angular.isUndefined($scope.globalVariables)) { - $scope.globalVariables = {}; - } - - $scope.globalVariables.lastType = 'TEXT'; - $scope.globalVariables.lastDate = new Date(); - - $scope.initChoice = function () { - return { - choiceType : $scope.globalVariables.lastType, - choiceValue : '', - choiceIsDeletable: true - }; - }; - - $scope.addChoice = function () { - var index = $scope.data.choices.push($scope.initChoice()); - var choice = $scope.data.choices[index-1]; - if (angular.isDefined($scope.restError)) { - delete $scope.restError.choice; - } - popupChoice(choice, 'poll.popupChoice.title.add'); - }; - - $scope.editChoice = function (choice, e) { - popupChoice(choice, 'poll.popupChoice.title.edit'); - if (e) { - e.stopPropagation(); - e.preventDefault(); - } - }; - - - $scope.saveAddChoice = function (choice) { - if (angular.isDefined($routeParams.pollId)) { - var saveChoice = angular.copy(choice); - - saveChoice = $scope.preSendChoice(saveChoice); - - PollChoice.add({pollId:$routeParams.pollId, permission:$scope.globalVariables.pollToken}, saveChoice, function (data) { - delete choice.restError; - choice.id = data.id; - choice.permission = data.permission; - - // add new input in choice input - $scope.data.vote.choice.push({choiceId: data.id, voteValue:$scope.getVoteValue('')}); - - // add null in vote - angular.forEach($scope.data.votants, function (voter) { - voter.choice.push({choiceId: data.id, voteValue : $scope.getVoteValue(null)}); - }); - -// $rootScope.$broadcast('newSuccess', 'poll.saved'); - }, function (error) { - choice.restError = error.data; - }); - } - }; - - $scope.saveEditChoice = function (choice) { - if (angular.isDefined($routeParams.pollId)) { - var saveChoice = angular.copy(choice); - - saveChoice = $scope.preSendChoice(saveChoice); - - PollChoice.update({pollId:$routeParams.pollId, permission:choice.permission}, saveChoice, function() { - delete choice.restError; -// $rootScope.$broadcast('newSuccess', 'poll.saved'); - }, function (error) { - choice.restError = error.data; - }); - } - }; - - $scope.deleteChoice = function (choice) { - var index = $scope.data.choices.indexOf(choice); - if (index > -1) { - $scope.data.choices.splice(index,1); - $scope.data.choicesToDelete.push(choice); - } - }; - - $scope.saveChoice = function (choice) { - if (angular.isDefined(choice)) { - if (angular.isDefined(choice.id) && choice.id != null) { - $scope.saveEditChoice(choice); - } - else { - $scope.saveAddChoice(choice); - } - } - }; - - var popupChoice = function (choiceEdit, title) { - var choice = angular.copy(choiceEdit); - - var modalCallBack = function (choiceEdit, choice) { - if (! angular.equals(choiceEdit.choiceValue, choice.choiceValue) - || - choiceEdit.choiceType != choice.choiceType - || - choiceEdit.description != choice.description) { - - choiceEdit.choiceValue = choice.choiceValue; - choiceEdit.choiceType = choice.choiceType; - choiceEdit.description = choice.description; - -// $scope.saveChoice(choiceEdit); - } - }; - - var modalInstance = $modal.open({ - templateUrl : 'partials/poll-popupChoice.html', - controller : PollPopChoiceCtrl, - resolve : { - title : function () { return title;}, - choice : function () { - if (choice.choiceType == 'TEXT') { - choice.choiceValueText = choice.choiceValue; - } - else if (choice.choiceType == 'DATE') { - choice.choiceValueDate = choice.choiceValue; - } - else if (choice.choiceType == 'RESOURCE') { - choice.choiceValueImage = choice.choiceValue; - } - - // set default date - if (angular.isUndefined(choice.choiceValueDate) || choice.choiceValueDate == "") { - choice.choiceValueDate = $scope.globalVariables.lastDate; - } - - return choice; - }, - dateFormat : function () { return $scope.globalVariables.dateTimeFormat;} - } - }); - - modalInstance.result.then(function () { - $scope.deleteChoice(choiceEdit); - }, function () { - $scope.globalVariables.lastType = choice.choiceType; - - if (choice.choiceType == 'TEXT') { - choice.choiceValue = choice.choiceValueText; - - modalCallBack(choiceEdit, choice); - } - else if (choice.choiceType == 'DATE') { - choice.choiceValue = choice.choiceValueDate; - $scope.globalVariables.lastDate = new Date(choice.choiceValueDate); - - modalCallBack(choiceEdit, choice); - } - else if (choice.choiceType == 'RESOURCE') { - var resourceOldId = angular.copy(choiceEdit.choiceValue.id); - var oldChoiceType = angular.copy(choiceEdit.choiceType); - - delete choiceEdit.choiceValue.id; - choiceEdit.choiceType = 'RESOURCE'; - - try { - choice.choiceValueImage.promise.$promise.then(function () { - if (angular.isUndefined(resourceOldId) - || - angular.isDefined(choice.choiceValueImage) - && - choice.choiceValueImage.id != resourceOldId) { - - choice.choiceValue = choice.choiceValueImage; - - modalCallBack(choiceEdit, choice) - } - else { - choiceEdit.choiceValue.id = resourceOldId; - } - }); - - choiceEdit.choiceValue = {meta: choice.choiceValueImage.meta}; - } - catch (e) { - $rootScope.$broadcast('newError', 'poll.error.noResource'); - - choiceEdit.choiceValue.id = resourceOldId; - choiceEdit.choiceType = oldChoiceType; - } - } - }); - }; - - - var PollPopChoiceCtrl = function ($scope, $modalInstance, title, choice, dateFormat) { - var oldChoice = angular.copy(choice); - - $scope.title = title; - $scope.choice = choice; - $scope.dateFormat = dateFormat; - - - $scope.saveChoice = function () { - $modalInstance.dismiss(); - }; - -// $scope.saveChoiceAndContinue = function () { -//// $modalInstance.dismiss(); -// $scope.addChoice(); -// var index = $scope.data.choices.push($scope.initChoice()); -// var choice = $scope.data.choices[index-1]; -// if (angular.isDefined($scope.restError)) { -// delete $scope.restError.choice; -// } -//// popupChoice(choice, 'Ajout d\'un Choix'); -// }; - - $scope.cancelChoice = function () { - if (angular.isDefined(oldChoice)) { - angular.copy(oldChoice, $scope.choice); - } - $modalInstance.dismiss(); - }; - - $scope.deleteChoice = function (ch) { - $modalInstance.close(ch); - } - - } - -}]) - - -////////////////////////////////// -// Admin poll controller // -////////////////////////////////// - -.controller('PollAdminCtrl', ['$scope', '$rootScope', '$controller', '$timeout', '$routeParams', 'Poll', '$filter', - function ($scope, $rootScope, $controller, $timeout, $routeParams, Poll, $filter) { - $controller('PollAdminChoiceCtrl', {$scope:$scope}); - - - if (angular.isUndefined($scope.globalVariables)) { - $scope.globalVariables = {}; - } - - $scope.globalVariables.editMode = true; - $scope.restError = {}; - - $scope.tabError = function (error) { - if (error.hasOwnProperty('title') || error.hasOwnProperty('choice')) { - $scope.globalVariables.pollError = $filter('translate')('error.form'); - } - - if (error.hasOwnProperty('creator.email') || - error.hasOwnProperty('endDate') || - error.hasOwnProperty('beginChoiceDate') || - error.hasOwnProperty('endChoiceDate') || - error.hasOwnProperty('commentVisibility') || - error.hasOwnProperty('resultVisibility') || - error.hasOwnProperty('voteVisibility') || - error.hasOwnProperty('voteCountingType')) { - - $scope.globalVariables.configError = $filter('translate')('error.form'); - } - - if (error.hasOwnProperty('pollType')) { - $scope.globalVariables.participantError = $filter('translate')('error.form'); - } - }; - - //////////////////////////////// - //// VOTER LIST ///// - //////////////////////////////// - - var newMember = function () { - return {name:'', email:'', weight:1.0}; - }; - - var newGroup = function () { - var members = []; - for (var j = 0; j < 3; j++) { - members.push(newMember()); - } - return {group:{name:'', weight:1.0}, members:members} - }; - - $scope.data.voterList = []; - $scope.data.voterList.push(newGroup()); - - $timeout(function () { - $scope.$watch('data.poll.pollType', function (newVal, oldVal) { - if (newVal != oldVal && newVal == 'RESTRICTED') { - var listMember = []; - for (var i = 0; i < $scope.data.voterList.length; i++) { - for (var j = 0; j < $scope.data.voterList[i].members.length; j++) { - // check if not a empty line - if ($scope.data.voterList[i].members[j].email != '' || $scope.data.voterList[i].members[j].name != '') { - listMember.push($scope.data.voterList[i].members[j]); - } - } - } - - // get the first group - $scope.data.voterList = $scope.data.voterList.splice(0,1); - - // check if one voter is enter in one group - if (listMember.length > 0) { - $scope.data.voterList[0].members = listMember; - } - } - }); - }); - - $scope.addVoter = function (index) { - $scope.data.voterList[index].members.push(newMember()); - }; - - $scope.addGroup = function () { - $scope.data.voterList.push(newGroup()); - }; - - //////////////////////////////// - //// VOTE COUNTING TYPE ///// - //////////////////////////////// - - var initVoteCountingType = function () { - Poll.allVoteCountingType(function (data) { - $scope.data.allVoteCountingType = data; - setHelper(); - }) - }; initVoteCountingType(); - - var setHelper = function () { - if (angular.isDefined($scope.data.poll)) { - angular.forEach($scope.data.allVoteCountingType, function (value) { - if (value.id == $scope.data.poll.voteCountingType) { - $scope.data.voteCountingType = angular.copy(value); - } - }); - } - }; - - $timeout(function () { - $scope.$on('switchLocale', function() { - initVoteCountingType(); - }); - }); - - $timeout(function () { - $scope.$watch('data.poll.voteCountingType', function (newVal) { - if (angular.isDefined(newVal)) { - setHelper(); - } - }) - }); -}]) - - -////////////////////////////////// -// Admin create poll controller // -////////////////////////////////// - -.controller('PollCreateCtrl', ['$scope', '$rootScope', '$controller', '$location', '$filter', 'Poll', 'SessionStorage', 'PollVoterList', 'Page', - function ( $scope, $rootScope, $controller, $location, $filter, Poll, SessionStorage, PollVoterList, Page) { - $controller('PollCtrl', {$scope:$scope}); - $controller('PollAdminCtrl', {$scope:$scope}); - - Page.setTitle('title.poll.create'); - - $scope.globalVariables.create = true; - $scope.globalVariables.minify = true; - - var initPoll = function () { - Poll.skeletonNew(function (poll) { - $scope.data.poll = poll; - }); - - $scope.data.choices = [$scope.initChoice()]; - $scope.data.choicesToDelete = []; - $scope.data.vote = {}; - $scope.data.vote.choices = $scope.data.choices; - }; - initPoll(); - - $scope.savePoll = function () { - var poll = angular.copy($scope.data.poll); - poll.choice = angular.copy($scope.data.choices); - - angular.forEach(poll.choice, function(choice, key) { - poll.choice[key] = $scope.preSendChoice(choice); - }); - - if (angular.isDate(poll.beginDate)) { - poll.beginDate = poll.beginDate.getTime(); - } - if (angular.isDate(poll.endDate)) { - poll.endDate = poll.endDate.getTime(); - } - - if (angular.isDate(poll.beginChoiceDate)) { - poll.beginChoiceDate = poll.beginChoiceDate.getTime(); - } - if (angular.isDate(poll.endChoiceDate)) { - poll.endChoiceDate = poll.endChoiceDate.getTime(); - } - - if (! poll.limitedVote) { - poll.maxChoiceNumber = 0; - } else { - poll.maxChoiceNumber = parseInt(poll.maxChoiceNumber, 10); - $scope.data.poll.maxChoiceNumber = poll.maxChoiceNumber; - } - - Poll.add(poll, function (data) { - $scope.globalVariables.pollError = false; - $scope.globalVariables.configError = false; - $scope.globalVariables.participantError = false; - - $rootScope.$broadcast('hideAlertByType', 'danger'); - - $rootScope.$broadcast('newInfo', - $filter('translate')('poll.created.printLink', {url: - '<input type="text" class="form-control" value="' + - $scope.globalVariables.baseUrl+'#/poll/edit/'+data.id+'/'+data.permission + - '" readonly />' - }) - , -1, data.id); - $rootScope.$broadcast('newSuccess', 'poll.saved'); - if ($scope.data.poll.pollType != 'FREE') { - SessionStorage.save({'voterList':$scope.data.voterList}); - $location.url('/poll/edit/'+data.id+'/'+data.permission); - } - else { - $location.url('/poll/edit/'+data.id+'/'+data.permission); - } - }, function (error) { - - $scope.tabError(error.data); - - $scope.restError = error.data; - angular.forEach($scope.data.choices, function (choice, index) { - if (angular.isDefined(error.data['choice['+index+'].choiceValue'])) { - choice.restError = {choiceValue:error.data['choice['+index+'].choiceValue']}; - $scope.globalVariables.pollError = $filter('translate')('error.form'); - } - else { - delete choice.restError; - } - }); - - if (angular.isDefined(error.data.choice)) { - $rootScope.$broadcast('newError', error.data.choice[0]); - } - }); - }; - - $scope.deletePoll = function () { - $scope.data.poll = initPoll(); - } - -}]) - -////////////////////////////////// -// Admin edit poll controller // -////////////////////////////////// - -.controller('PollEditCtrl', ['$scope', '$rootScope', '$controller', '$routeParams', '$location', '$timeout', '$translate', '$filter', 'Poll', 'PollChoice', 'PollVote', 'PollVoterList', 'PollVoterListMember', 'FavoriteList', 'SessionStorage', 'Page', - function ( $scope, $rootScope, $controller, $routeParams, $location, $timeout, $translate, $filter, Poll, PollChoice, PollVote, PollVoterList, PollVoterListMember, FavoriteList, SessionStorage, Page) { - $controller('PollAdminCtrl', {$scope:$scope}); - - Page.setTitle('title.poll.edit', $scope.data.poll.title); - - //////////////////////////////// - //// VOTER LIST ///// - //////////////////////////////// - - var initVoterList = function () { - if ($scope.data.poll.pollType != 'FREE') { - var session = SessionStorage.get(); - if (angular.isDefined(session.voterList)) { - $scope.data.voterList = session.voterList; - angular.forEach($scope.data.voterList, function (voterList) { - $scope.saveVoterList(voterList); - }); - SessionStorage.remove('voterList'); - } else { - PollVoterList.query({pollId:$routeParams.pollId, permission:$scope.globalVariables.pollToken}, function (voterList) { - if (voterList.length > 0) { - $scope.data.voterList = []; - angular.forEach(voterList, function (list) { - PollVoterListMember.query({pollId:$routeParams.pollId, permission:$scope.globalVariables.pollToken, voterListId: list.id}, function (voterListMember) { - var newVoterList = {group:list, members:voterListMember}; - $scope.data.voterList.push(newVoterList); - }) - }) - } - }); - } - } - }; - - $scope.memberIsEmpty = function (member) { - var isEmpty = true; - try { - if (angular.isDefined(member.name) && member.name != '' - || angular.isDefined(member.email) && member.email != '') { - isEmpty = false; - } - } - catch (e) { } - - return isEmpty; - }; - - var initFavoriteList = function () { - if (angular.isDefined(SessionStorage.get().user)) { - FavoriteList.get({paginationParameter:{pageSize:-1}}, function (data) { - $scope.data.favoriteList = data.elements; - $scope.data.favoriteListImport = null; - }); - } - }; initFavoriteList(); - - $scope.importFavoriteList = function (voterList) { - var pollVoterListPromise; - if (angular.isDefined(voterList.group.id)) { - pollVoterListPromise = PollVoterList.importInGroup({pollId:$routeParams.pollId, voterListId:voterList.group.id, favoriteListId:$scope.data.favoriteListImport}, null).$promise; - } else { - pollVoterListPromise = PollVoterList.importAddGroup({pollId:$routeParams.pollId, favoriteListId:$scope.data.favoriteListImport}, null).$promise; - } - - pollVoterListPromise.then(function (data) { - $scope.data.favoriteListImport = null; - PollVoterList.get({pollId:$routeParams.pollId, permission:$scope.globalVariables.pollToken, voterListId: data.id}, - function (vl) { - voterList.group = vl; - PollVoterListMember.query({pollId:$routeParams.pollId, permission:$scope.globalVariables.pollToken, voterListId: vl.id}, - function(members) { - voterList.members = members; - } - ); - } - ); - }); - }; - - $scope.saveVoterList = function (voterList) { - if (angular.isDefined(voterList.group.id)) { - PollVoterList.update({pollId:$routeParams.pollId, permission:$scope.globalVariables.pollToken, voterListId:voterList.group.id}, voterList.group, function () { - $rootScope.$broadcast('newSuccess', 'poll.saved'); - delete voterList.group.restError; - }, function (error) { - voterList.group.restError = error.data; - $location.url($scope.globalVariables.linkParticipant.split('#')[1]); - }); - } else { // new group - // set default name for restricted poll type - if ($scope.data.poll.pollType == 'RESTRICTED') { - voterList.group.name = 'restricted'; - } - - var vl = {group: voterList.group, members:[]}; - angular.forEach(voterList.members, function(member) { - if (!$scope.memberIsEmpty(member)) { - vl.members.push(member); - } - }); - if (vl.members.length > 0) { - PollVoterList.add({pollId:$routeParams.pollId, permission:$scope.globalVariables.pollToken}, vl, function (data) { - $rootScope.$broadcast('newSuccess', 'poll.saved'); - voterList.group.id = data.id; - delete voterList.group.restError; - - // Get member Id - PollVoterListMember.query({pollId:$routeParams.pollId, permission:$scope.globalVariables.pollToken, voterListId: data.id}, - function (voterListMember) { - angular.forEach(voterListMember, function(member) { - for (var i = 0; i < voterList.members.length; i++) { - if (member.email == voterList.members[i].email) { - voterList.members[i] = member; - i = voterList.members.length; - } - } - }); - }); - }, function (error) { - voterList.group.restError = error.data; - var deltaError = 0; - angular.forEach(voterList.members, function (member, key) { - if (!$scope.memberIsEmpty(member)) { - var index = key - deltaError; - member.restError = {}; - if (angular.isDefined(error.data['member['+index+'].name'])) { - member.restError.name = error.data['member['+index+'].name']; - } - if (angular.isDefined(error.data['member['+index+'].email'])) { - member.restError.email = error.data['member['+index+'].email']; - } - if (angular.isDefined(error.data['member['+index+'].weight'])) { - member.restError.weight = error.data['member['+index+'].weight']; - } - - if (angular.equals(member.restError, {})) { - // no error on this member - delete member.restError; - } - } else { - deltaError++; - } - }); - - $location.url($scope.globalVariables.linkParticipant.split('#')[1]); - }); - } - } - }; - - $scope.saveVoterListMember = function (member, voterList) { - if (!$scope.memberIsEmpty(member)) { - var vlId = voterList.group.id; // Id Voter list - var vlMemberPromise; - if (angular.isDefined(vlId)) { - if (angular.isDefined(member.id)) { - vlMemberPromise = PollVoterListMember.update({pollId:$routeParams.pollId, permission:$scope.globalVariables.pollToken, voterListId:vlId}, member).$promise; - } else { - vlMemberPromise = PollVoterListMember.add({pollId:$routeParams.pollId, permission:$scope.globalVariables.pollToken, voterListId:vlId}, member).$promise; - } - - vlMemberPromise.then(function (data) { - $rootScope.$broadcast('newSuccess', 'poll.saved'); - member.id = data.id; - delete member.restError; - }, function (error) { - member.restError = error.data; - }) - } - else { - // create voter list - if (angular.isUndefined(voterList.group.restError) || angular.isUndefined(voterList.group.restError.name)) { - $scope.saveVoterList(voterList); - } - } - } - }; - - $scope.deleteVoterList = function (voterList) { - if (angular.isDefined(voterList) && angular.isDefined(voterList.group.id)) { - var confirmMessage; - $translate('action.message.confirmDelete').then(function (msg) { - confirmMessage = msg; - }).then( function () { - var confirmDelete = confirm(confirmMessage); - if (confirmDelete == true) { - PollVoterList.remove({pollId:$routeParams.pollId, permission:$scope.globalVariables.pollToken, voterListId:voterList.group.id}, function () { - var index = $scope.data.voterList.indexOf(voterList); - $scope.data.voterList.splice(index, 1); - if ($scope.data.voterList.length == 0 && $scope.data.poll.pollType == 'RESTRICTED') { - $scope.addGroup(); - } - }); - } - }); - } - else { - var index = $scope.data.voterList.indexOf(voterList); - $scope.data.voterList.splice(index, 1); - if ($scope.data.voterList.length == 0 && $scope.data.poll.pollType == 'RESTRICTED') { - $scope.addGroup(); - } - } - }; - - $scope.deleteVoterListMember = function (member, voterList) { - if (angular.isDefined(voterList) && angular.isDefined(voterList.group.id) && angular.isDefined(member.id)) { - var confirmMessage; - $translate('action.message.confirmDelete').then(function (msg) { - confirmMessage = msg; - }).then( function () { - var confirmDelete = confirm(confirmMessage); - if (confirmDelete == true) { - member.$remove({pollId:$routeParams.pollId, permission:$scope.globalVariables.pollToken, voterListId:voterList.group.id}, function () { - var index = voterList.members.indexOf(member); - voterList.members.splice(index, 1); - }); - } - }); - } - else { - var index = voterList.members.indexOf(member); - voterList.members.splice(index, 1); - } - }; - - //////////////////////////////// - //// POLL ///// - //////////////////////////////// - - var initPoll = function () { - initVoterList(); - - PollChoice.query({pollId:$routeParams.pollId, permission:$scope.globalVariables.pollToken}).$promise.then(function (choices) { - angular.forEach(choices, function (ch, key) { - choices[key] = $scope.postReceiveChoice(ch); - }); - $scope.data.choices = choices; - $scope.data.choicesToDelete = []; - $scope.data.vote = {}; - $scope.data.vote.choice = angular.copy($scope.data.choices); - }); - }; - $scope.pollDeferred.promise.then(function () { - if (angular.isDefined($scope.data.poll.permission)) { - initPoll(); - $scope.pollDeferred.resolve(); - } else { - $location.path('/'); - } - }, function () { - $location.path('/'); - }); - - var oldPoll; - $scope.pollDeferred.promise.then(function () { - oldPoll = angular.copy($scope.data.poll); - $scope.pollDeferred.resolve(); - }); - $scope.autoSavePoll = function () { - if (!angular.equals(oldPoll, $scope.data.poll)) { - - if ($scope.data.poll.limitedVote && $scope.data.poll.maxChoiceNumber == 0 || $scope.data.poll.maxChoiceNumber == null) { - - if (angular.isUndefined($scope.restError)) { - $scope.restError = {} - } - - $scope.restError.maxChoiceNumber = [$filter('translate')('poll.error.notNumberValid')]; - return; - } - - $scope.savePoll(); - oldPoll = angular.copy($scope.data.poll); - } - }; - - $scope.savePoll = function () { - var savePoll = angular.copy($scope.data.poll); - savePoll.choice = angular.copy($scope.data.choices); - - angular.forEach(savePoll.choice, function(choice, key) { - $scope.saveChoice(choice); - }); - - angular.forEach($scope.data.choicesToDelete, function(choice, key) { - if (angular.isDefined(choice.id)) { - PollChoice.remove({ - pollId: $routeParams.pollId, - permission: $scope.globalVariables.pollToken, - choiceId: choice.id - }, function() { - var index = $scope.data.choicesToDelete.indexOf(choice); - if (index > -1) { - $scope.data.choicesToDelete.splice(index,1); - } - }, function (error) { - if (error.status == 400) { - angular.extend($scope.restError, error.data); - if (angular.isDefined(error.data.choice)) { - $rootScope.$broadcast('newError', error.data.choice[0]); - } - } - }); - } - }); - - if (angular.isDate(savePoll.beginDate)) { - savePoll.beginDate = savePoll.beginDate.getTime(); - } - if (angular.isDate(savePoll.endDate)) { - savePoll.endDate = savePoll.endDate.getTime(); - } - - if (angular.isDate(savePoll.beginChoiceDate)) { - savePoll.beginChoiceDate = savePoll.beginChoiceDate.getTime(); - } - if (angular.isDate(savePoll.endChoiceDate)) { - savePoll.endChoiceDate = savePoll.endChoiceDate.getTime(); - } - - if (! savePoll.limitedVote) { - savePoll.maxChoiceNumber = 0; - } else { - savePoll.maxChoiceNumber = parseInt(savePoll.maxChoiceNumber, 10); - $scope.data.poll.maxChoiceNumber = savePoll.maxChoiceNumber; - } - - Poll.update({permission:$scope.globalVariables.pollToken}, savePoll, function () { - $scope.globalVariables.pollError = false; - $scope.globalVariables.configError = false; - $scope.globalVariables.participantError = false; - - $rootScope.$broadcast('hideAlertByType', 'danger'); - - $rootScope.$broadcast('newSuccess', 'poll.saved'); - }, function (error) { - $scope.tabError(error.data); - angular.extend($scope.restError, error.data); - }); - } - -}]) - -////////////////////////////////// -// Vote controller // -////////////////////////////////// - -.controller('PollVoteCtrl', ['$scope', '$rootScope', '$q', '$controller', '$routeParams', 'Poll', 'PollChoice', 'PollVote', '$translate', '$filter', '$location', 'Page', - function ($scope, $rootScope, $q, $controller, $routeParams, Poll, PollChoice, PollVote, $translate, $filter, $location, Page) { - $controller('PollAdminChoiceCtrl', {$scope:$scope}); - - if (angular.isUndefined($scope.globalVariables)) { - $scope.globalVariables = {}; - } - - Page.setTitle('title.poll.vote', $scope.data.poll.title); - - var initPoll = function () { - - var pollChoicePromise = PollChoice.query({pollId:$routeParams.pollId}, function (choices) { - angular.forEach(choices, function (ch, key) { - choices[key] = $scope.postReceiveChoice(ch); - }); - - $scope.data.choices = choices; - }).$promise; - - pollChoicePromise.then(function () { - PollVote.query({pollId:$routeParams.pollId, permission:$routeParams.voteToken}, function (votes) { - $scope.data.votants = votes; - angular.forEach($scope.data.votants, function (voter) { - angular.forEach(voter.choice, function (choice) { - choice.voteValue = $scope.getVoteValue(choice.voteValue); - }); - for (var i = voter.choice.length; i < $scope.data.choices.length; ++i) { - voter.choice.push({choiceId: $scope.data.choices[i].id, voteValue : $scope.getVoteValue(null)}); - } - }); - }); - }); - - $q.all([$scope.pollDeferred.promise, pollChoicePromise]).then(function() { - initVote(); - $scope.pollDeferred.resolve(); - }); - }; - $scope.pollDeferred.promise.then(initPoll); - - var initAuthor = function () { - if (angular.isDefined($scope.session.user)) { - if (angular.isDefined($scope.session.user.name)) { - $scope.data.vote.voterName = $scope.session.user.name; - } - else { - $scope.data.vote.voterName = $scope.session.user.email; - } - } - }; - - $scope.globalVariables.editMode = false; - $scope.globalVariables.voteMode = true; - - var initVote = function () { - PollVote.skeletonNew({pollId:$routeParams.pollId}, function (data) { - $scope.data.vote = data; - - initAuthor(); - - var defaultValue = ($scope.voteCountingIsBoolean()) ? false : null; - - for (var i = 0; i < $scope.data.choices.length; ++i) { - - $scope.data.vote.choice.push({'choiceId':$scope.data.choices[i].id, 'voteValue': defaultValue}); - } - }, function () { - $scope.data.poll.canVote = false; - }); - }; - - $scope.voter = function () { - var sendVote = angular.copy($scope.data.vote); - if ($scope.voteCountingIsBoolean()) { - angular.forEach(sendVote.choice, function (choice) { - choice.voteValue = (choice.voteValue)?1.0:0.0; - }); - } else { - angular.forEach(sendVote.choice, function (choice) { - if (choice.voteValue == "") { - choice.voteValue = null; - } - }); - } - - PollVote.add({pollId:$routeParams.pollId, permission:$scope.globalVariables.pollToken}, sendVote, function (returnRequest) { - $scope.data.vote.id = returnRequest.id; - $scope.data.vote.permission = returnRequest.permission; - - PollVote.get({pollId:$routeParams.pollId, voteId:returnRequest.id, permission:returnRequest.permission}, function (newVote) { - angular.forEach(newVote.choice, function (choice) { - choice.voteValue = $scope.getVoteValue(choice.voteValue); - }); - $scope.data.votants.push(newVote); - }); - - var redirect = '/poll/vote/' + $routeParams.pollId; - if (angular.isDefined($scope.globalVariables.pollToken)) { - redirect += '/' + $scope.globalVariables.pollToken; - } - redirect += '/vote/' + returnRequest.permission; - - $rootScope.$broadcast('newInfo', - $filter('translate')('vote.added.printLink', {url: - '<input type="text" class="form-control" value="' + - $scope.globalVariables.baseUrl+'#' + redirect + - '" readonly />'}) - , -1, returnRequest.id); - - $rootScope.$broadcast('newSuccess', 'vote.added'); - initVote(); - - $location.url(redirect); - }, function (error) { - if (error.data.hasOwnProperty("voter.name")) { - $scope.data.vote.restError = { voterName : error.data["voter.name"]}; - } - - if (error.data.hasOwnProperty("vote.totalVoteValue")) { - $rootScope.$broadcast('newError', error.data["vote.totalVoteValue"][0]); - } - - if (error.data.hasOwnProperty("vote.limitedVote")) { - $rootScope.$broadcast('newError', error.data["vote.limitedVote"][0]); - } - - if (error.data.hasOwnProperty("poll")) { - $rootScope.$broadcast('newError', error.data["poll"][0]); - } - - angular.forEach($scope.data.vote.choice, function (choice) { - if (angular.isDefined(error.data["vote.voteValue["+choice.choiceId+"]"])) { - choice.restError = error.data["vote.voteValue["+choice.choiceId+"]"]; - } - else { - delete choice.restError; - } - }); - }); - }; - - var oldVote; - - $scope.editVote = function (vote) { - if (angular.isDefined(oldVote)) { - angular.forEach($scope.data.votants, function(oneVote) { - if (oneVote != vote) { - $scope.cancelVote(oneVote); - } - }); - } - - oldVote = angular.copy(vote); - vote.onEdit = true; - }; - - $scope.cancelVote = function (vote) { - if (angular.isDefined(oldVote) && vote.id == oldVote.id) { - vote.onEdit = false; - - for (var i = 0; i < vote.choice.length; i++) { - vote.choice[i].voteValue = oldVote.choice[i].voteValue; - } - } - }; - - $scope.saveVote = function (vote) { - var sendVote = angular.copy(vote); - if ($scope.voteCountingIsBoolean()) { - angular.forEach(sendVote.choice, function (choice) { - choice.voteValue = (choice.voteValue)?1.0:0.0; - }); - } else { - angular.forEach(sendVote.choice, function (choice) { - if (choice.voteValue == "") { - choice.voteValue = null; - } - }); - } - - - // edit vote - PollVote.update({pollId:$routeParams.pollId}, sendVote, function (data) { - vote.onEdit = false; - for (var i = 0; i < data.choice.length; i++) { - for (var j = 0; j < vote.choice.length; j++) { - if (vote.choice[i].choiceId == data.choice[i].choiceId) { - vote.choice[i].id = data.choice[i].id; - vote.choice[i].voteValue = $scope.getVoteValue(data.choice[i].voteValue); - - break; - } - } - } - - $rootScope.$broadcast('newSuccess', 'vote.added'); - $location.url('/poll/vote/'+$routeParams.pollId+'/'+ data.permission); - }, function (error) { - if (error.data.hasOwnProperty("vote.totalVoteValue")) { - $rootScope.$broadcast('newError', error.data["vote.totalVoteValue"][0]); - } - - if (error.data.hasOwnProperty("vote.limitedVote")) { - $rootScope.$broadcast('newError', error.data["vote.limitedVote"][0]); - } - if (error.data.hasOwnProperty("voter.name")) { - $scope.data.vote.restError = { voterName: error.data["voter.name"]}; - } - }); - }; - - $scope.toggleVoteValue = function (choice, onEdit, event) { - if (onEdit && $scope.voteCountingIsBoolean()) { - if (choice.voteValue == false && $scope.data.poll.limitedVote) { - // compte number of choice - var myVote = $.grep($scope.data.votants, function(e) { return e.id == oldVote.id; }); - myVote = myVote[0]; - var nbChoice = 0; - angular.forEach(myVote.choice, function (ch) { - if (ch.voteValue) { - nbChoice++; - } - }); - if (nbChoice < $scope.data.poll.maxChoiceNumber) { - toggleValue(choice,event); - } - } - else { - toggleValue(choice, event); - } - } - }; - - $scope.deleteVote = function (vote) { - var confirmMessage; - $translate('action.message.confirmDelete').then(function (msg) { - confirmMessage = msg; - }).then( function () { - var confirmDelete = confirm(confirmMessage); - if (confirmDelete == true) { - // delete if edit - if ($scope.data.vote.id == vote.id) { - initVote(); - } - - var index = $scope.data.votants.indexOf(vote); - PollVote.remove({pollId:$routeParams.pollId}, vote, function () { - $rootScope.$broadcast('hideAlertById', vote.id); - $scope.data.votants.splice(index, 1); - }) - } - }); - }; - - $scope.toggleValue = function (choice, event) { - if ($scope.voteCountingIsBoolean()) { - if (choice.voteValue == false && $scope.data.poll.limitedVote) { - var nbChoice = 0; - angular.forEach($scope.data.vote.choice, function (ch) { - if (ch.voteValue) { - nbChoice++; - } - }); - if (nbChoice < $scope.data.poll.maxChoiceNumber) { - toggleValue(choice,event); - } - } else { - toggleValue(choice, event); - } - } - }; - - var toggleValue = function (choice, event) { - if (choice.voteValue == null) { - choice.voteValue = true; - } - else { - choice.voteValue = !choice.voteValue; - } - if (angular.isDefined(event)) { - event.stopPropagation(); - } - }; - -}]) - -////////////////////////////////// -// Comment controller // -////////////////////////////////// - -.controller('PollCommentCtrl', - ['$scope', '$rootScope', '$controller', '$routeParams', 'Poll', 'PollComment', '$translate', '$filter', '$timeout', '$location', 'Page', - function ( $scope, $rootScope, $controller, $routeParams, Poll, PollComment, $translate, $filter, $timeout, $location, Page) { - - if (angular.isUndefined($scope.globalVariables)) { - $scope.globalVariables = {}; - } - - Page.setTitle('title.poll.comments', $scope.data.poll.title); - - if (angular.isDefined($routeParams.commentToken)) { - $scope.commentToken = $routeParams.commentToken; - } - - $scope.comment = {text:'', hideForm : true}; - - var initAuthor = function () { - if (angular.isDefined($scope.session.user)) { - if (angular.isDefined($scope.session.user.name)) { - $scope.comment.authorName = $scope.session.user.name; - } - else { - $scope.comment.authorName = $scope.session.user.email; - } - } else { - $scope.comment.authorName = ''; - } - }; initAuthor(); - - if (angular.isDefined(conf.pollDefaultPageSize)) { - $scope.pageSize = conf.pollDefaultPageSize; - } - else { - $scope.pageSize = -1; - } - - $scope.desc = true; - - $scope.toggleOrder = function () { - $scope.desc = !$scope.desc; - paginationParameter.desc = $scope.desc; - if (angular.isDefined($scope.data.commentsPagination)) { - paginationParameter.pageNumber = $scope.data.commentsPagination.lastPage - $scope.data.commentsPagination.currentPage; - } - initComments(); - }; - - var paginationParameter = {pageSize: $scope.pageSize, order: 'postDate', desc: $scope.desc}; - if (angular.isDefined($routeParams.page)) { - if (angular.isDefined($routeParams.pageSize)) { - paginationParameter = {pageSize:$routeParams.pageSize}; - $scope.pageSize = $routeParams.pageSize; - } - - paginationParameter.pageNumber = $routeParams.page; - } - - var initComments = function () { - return PollComment.get({pollId: $routeParams.pollId, permission: $scope.commentToken, paginationParameter: paginationParameter}, function (data) { - $scope.data.comments = data.elements; - $scope.data.commentsPagination = data.pagination; - console.log("comments " + data.pagination.count); - $scope.data.poll.commentCount = data.pagination.count; - }).$promise; - }; initComments(); - - $timeout(function () { - $scope.$watch('data.commentsPagination.currentPage', function (newVal, oldVal) { - if (angular.isDefined(oldVal) && newVal != oldVal) { // Value change - if (paginationParameter.pageNumber != $scope.data.commentsPagination.currentPage) { // not same page - paginationParameter.pageNumber = $scope.data.commentsPagination.currentPage; - initComments(); - } - } - }); - }); - - $scope.postComment = function () { - delete $scope.restError; - var commentPromise; - if (angular.isDefined($scope.comment.id)) { - // edit - commentPromise = PollComment.update({pollId:$routeParams.pollId}, $scope.comment, function () { - paginationParameter.pageNumber = $scope.comment.page; - initComments(); - initAuthor(); - }).$promise; - - } else { - //Add - commentPromise = PollComment.add({pollId:$routeParams.pollId}, $scope.comment, function (data) { - // save Permission - $scope.commentToken = data.permission; - - var redirect = '/poll/comment/' + $routeParams.pollId; - if (angular.isDefined($scope.globalVariables.pollToken)) { - redirect += '/' + $scope.globalVariables.pollToken; - } - redirect += '/comment/' + data.permission; - - $rootScope.$broadcast('newInfo', - $filter('translate')('comment.added.printLink', {url : - '<input type="text" class="form-control" value="' + - $scope.globalVariables.baseUrl+'#' + redirect + - '" readonly />' }) - , -1, data.id); - - $location.url(redirect); - - // reload comments - if ($scope.data.commentsPagination.desc) { - // change pageNumber without reload - paginationParameter.pageNumber = 0; - // reload - initComments(); - } else { - // change pageNumber without reload - paginationParameter.pageNumber = $scope.data.commentsPagination.lastPage; - // reload and check the last page. - initComments().then( function () { - $scope.data.commentsPagination.currentPage = $scope.data.commentsPagination.lastPage; - }); - } - - }).$promise; - } - - commentPromise.then(function () { - $rootScope.$broadcast('newSuccess', 'comment.added'); - //hide comment form - $scope.comment.hideForm = true; - //clean form - $scope.comment.text = ''; - - delete $scope.comment.postDate; - delete $scope.comment.id; - delete $scope.comment.permission; - - }, function (error) { - $scope.restError = error.data; - }) - }; - - $scope.editPost = function (comment) { - $scope.comment.hideForm = false; - $scope.comment = angular.copy(comment); - $scope.comment.page = paginationParameter.pageNumber; - }; - - $scope.deletePost = function (comment) { - var confirmMessage; - $translate('action.message.confirmDelete').then(function (msg) { - confirmMessage = msg; - }).then( function () { - var confirmDelete = confirm(confirmMessage); - if (confirmDelete == true) { - // check if not on edit - if (comment.id == $scope.comment.id) { - //clean form - $scope.comment.text = ''; - delete $scope.comment.postDate; - delete $scope.comment.id; - delete $scope.comment.permission; - } - - PollComment.remove({pollId:$routeParams.pollId, commentId:comment.id}, function () { - $rootScope.$broadcast('hideAlertById', comment.id); - - // reload comments - initComments().then(function () { - // if no comment then change page if it's possible - if ($scope.data.comments.length == 0 && paginationParameter.pageNumber > 0) { - // no comment and not the first page - $scope.data.commentsPagination.currentPage = paginationParameter.pageNumber - 1; - } - }); - }); - } - }); - } - -}]) - -////////////////////////////////// -// Result of poll controller // -////////////////////////////////// - -.controller('PollResultCtrl', ['$scope', '$q', '$controller', '$route', '$routeParams', 'Poll', 'PollChoice', 'PollVote', 'PollVoterList', '$translate', '$filter', '$timeout', 'Page', - function ($scope, $q, $controller, $route, $routeParams, Poll, PollChoice, PollVote, PollVoterList, $translate, $filter, $timeout, Page) { - if (angular.isUndefined($scope.globalVariables)) { - $scope.globalVariables = {}; - } - - Page.setTitle('title.poll.result', $scope.data.poll.title); - - $scope.pollDeferred.promise.then(function () { - if ($scope.data.poll.pollType == 'GROUP') { - $scope.translateTitle = { - '0' : "{{ 'poll.result.title.group.zero' | translate }}", - 'one' : "{{ 'poll.result.title.group.one' | translate }}", - 'other': "{{ 'poll.result.title.group.other' | translate:{nbVoter:data.result.nbVotants} }}" - }; - } - else { - $scope.translateTitle = { - '0' : "{{ 'poll.result.title.zero' | translate }}", - 'one' : "{{ 'poll.result.title.one' | translate }}", - 'other': "{{ 'poll.result.title.other' | translate:{nbVoter:data.result.nbVotants} }}" - }; - } - }); - - $scope.translateTitleGroup = { - '0' : "{{ 'poll.result.group.title.zero' | translate:{name:result.group.name} }}", - 'one' : "{{ 'poll.result.group.title.one' | translate:{name:result.group.name} }}", - 'other' : "{{ 'poll.result.group.title.other' | translate:{nbVoter:result.nbVotants, name:result.group.name} }}" - }; - - $scope.plot = 'chart'; - - $timeout(function () { - $scope.$on('switchLocale', function() { - $route.reload(); - }); - }); - - var choicesDeferred = $q.defer(); - PollChoice.query({pollId:$routeParams.pollId}, function (choices) { - $scope.data.choices = choices; - angular.forEach(choices, function (choice, key) { - choices[key] = $scope.postReceiveChoice(choice); - }); - choicesDeferred.resolve('choices load'); - }); - - var resultDeferred = $q.defer(); - $scope.pollDeferred.promise.then(function() { - if ($scope.data.poll.pollType == 'GROUP') { - // group result - Poll.groupResult({pollId: $routeParams.pollId}, function (data) { - $scope.data.result = simpleResult(data.mainResult); - $scope.data.groupResult = groupResult(data.groupResult); - }) - } - else { - Poll.result({pollId: $routeParams.pollId}, function (result) { - $scope.data.result = simpleResult(result); - }); - } - - }); - var simpleResult = function(result) { - choicesDeferred.promise.then(function () { - var scores = []; - angular.forEach(result.scores, function (value, key) { - for (var i = 0; i < $scope.data.choices.length; i++) { - if ($scope.data.choices[i].id == value.choiceId) { - value.choice = $scope.data.choices[i]; - - switch (value.choice.choiceType) { - case 'TEXT': - scores.push([value.choice.choiceValue, value.scoreValue]); - break; - - case 'DATE': - scores.push([$filter('date')(value.choice.choiceValue, $scope.globalVariables.dateTimeFormat), value.scoreValue]); - break; - - case 'RESOURCE': - scores.push([value.choice.choiceValue.meta.name, value.scoreValue]); - break; - - default: - scores.push([key, value.scoreValue]); - } - - // finish loop - i = $scope.data.choices.length; - } - } - }); - resultDeferred.resolve('result load'); - - result.scoresChart = scores; - }); - - return result; - }; - - var groupResult = function(groupResult) { - angular.forEach(groupResult, function (result) { - var groupId = result.groupId; - result = simpleResult(result); - PollVoterList.get({pollId:$routeParams.pollId, voterListId:groupId}, function (voterList) { - result.group = voterList; - }); - }); - return groupResult; - }; -}]) - -////////////////////////////////// -// List of poll controller // -////////////////////////////////// - -.controller('PollListCtrl', - ['$scope', '$rootScope', '$controller', '$routeParams', '$timeout', '$location', '$sce', '$q', 'Poll', 'Page', - function ($scope, $rootScope, $controller, $routeParams, $timeout, $location, $sce, $q, Poll, Page) { - $scope.data = {}; - $scope.globalVariables = {}; - - $scope.toHTML = function (data) { - return $sce.trustAsHtml(data); - }; - - $scope.toggleSelect = function (poll, event) { - if (angular.isUndefined(poll.selected)) { - poll.selected = true; - } - else { - poll.selected = !poll.selected; - } - - if (angular.isDefined(event)) { - event.stopPropagation(); - } - }; - - $scope.selectAll = function () { - angular.forEach($scope.data.polls, function (poll) { - poll.selected = true; - }) - }; - - $scope.unselectAll = function () { - angular.forEach($scope.data.polls, function (poll) { - poll.selected = false; - }) - }; - - $scope.toggleSelectAll = function () { - angular.forEach($scope.data.polls, function (poll) { - $scope.toggleSelect(poll); - }) - }; - - $scope.deleteSelected = function () { - var deferred = []; - - angular.forEach($scope.data.polls, function (poll) { - if (poll.selected) { - deferred.push(Poll.remove({pollId: poll.id, permission:poll.permission}).$promise); - - $q.all(deferred).then(function () { - initPolls(); - }); - } - }) - }; - - Page.setTitle('title.poll.list'); - - if (angular.isDefined(conf.pollDefaultPageSize)) { - $scope.pageSize = conf.pollDefaultPageSize; - } - else { - $scope.pageSize = -1; - } - - var paginationParameter = {pageSize:$scope.pageSize}; - if (angular.isDefined($routeParams.page)) { - if (angular.isDefined($routeParams.pageSize)) { - paginationParameter = {pageSize:$routeParams.pageSize}; - $scope.pageSize = $routeParams.pageSize; - } - - paginationParameter.pageNumber = $routeParams.page; - } - - var initPolls = function () { - Poll.get({paginationParameter:paginationParameter, cmd:$routeParams.cmd}, function (data) { - $scope.data.polls = data.elements; - $scope.data.pollsPagination = data.pagination; - - // check if has elements - if (data.elements.length == 0 && data.pagination.currentPage > 0) { - data.pagination.currentPage--; - } - - // check the global right - $scope.globalVariables.hasAllRight = true; - for (var pollIndex in $scope.data.polls) { - if ($scope.data.polls.hasOwnProperty(pollIndex)) { - var poll = $scope.data.polls[pollIndex]; - - if (angular.isUndefined(poll.permission)) { - $scope.globalVariables.hasAllRight = false; - break; - } - } - } - - }, function (error) { - $rootScope.$broadcast('newError', 'error.forbidden'); - $location.url('/'); - }); - }; initPolls(); - - $timeout(function () { - $scope.$watch('data.pollsPagination.currentPage', function (newVal, oldVal) { - // check if the current page has changed - if (angular.isDefined(oldVal) && newVal != oldVal) { - paginationParameter.pageNumber = $scope.data.pollsPagination.currentPage; - initPolls(); - } - }); - }) - -}]); diff --git a/pollen-ui-angular/src/main/webapp/js/controllers/userCtrl.js b/pollen-ui-angular/src/main/webapp/js/controllers/userCtrl.js deleted file mode 100644 index a47e9a9..0000000 --- a/pollen-ui-angular/src/main/webapp/js/controllers/userCtrl.js +++ /dev/null @@ -1,292 +0,0 @@ -/* - * #%L - * Pollen :: UI (Angular) - * %% - * Copyright (C) 2009 - 2017 Code Lutin, Tony Chemit - * %% - * 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 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/>. - * #L% - */ -'use strict'; - -angular.module('userControllers', []) -.controller('UserRegisterCtrl', ['$scope', '$rootScope', '$location', 'User', 'SessionStorage', 'Page', - function ($scope, $rootScope, $location, User, SessionStorage, Page) { - Page.setTitle('title.user.register'); - - if (angular.isDefined(SessionStorage.get().user)) { - $rootScope.$broadcast('newError', 'user.error.logout.mandatory'); - $location.url('/'); - } - - if (!angular.isDefined($scope.data)) { - $scope.data = {}; - } - $scope.data.user = {email:'', password:'', password2:''}; - - $scope.submit = function () { - if ($scope.data.user.password == $scope.data.user.password2) { - User.add({}, $scope.data.user, function () { - $rootScope.$broadcast('newSuccess', 'user.register.success'); - $scope.data.user = {email:'', password:'', password2:''}; - }, function (error) { - $scope.restError = error.data; - }); - } - } - }]) - -.controller('UserLostPasswordCtrl', ['$scope', '$rootScope', '$translate', '$location', 'SessionStorage', 'UserLostPassword', 'Page', - function ($scope, $rootScope, $translate, $location, SessionStorage, UserLostPassword, Page) { - Page.setTitle('title.user.forgotPassword'); - - if (angular.isDefined(SessionStorage.get().user)) { - $rootScope.$broadcast('newError', 'user.error.logout.mandatory'); - $location.url('/'); - } - - $scope.email = ''; - $scope.submit = function () { - if ($scope.email != '') { - UserLostPassword.send({login:$scope.email}, function () { - $rootScope.$broadcast('newSuccess', 'user.forgotPassword.success'); - $scope.email = ''; - }, function () { - $translate('user.error.mail.notFound').then(function (error) { - $scope.restError = {email: [error]}; - }) - }) - } - else { - $translate('user.error.mail.empty').then(function (error) { - $scope.restError = {email: [error]}; - }) - } - } -}]) - -.controller('UserValidateCtrl', ['$scope', '$rootScope', '$routeParams', '$location', 'User', 'SessionStorage', - function ($scope, $rootScope, $routeParams, $location, User, SessionStorage) { - - var currentUser = SessionStorage.get().user; - - if (angular.isDefined($routeParams.userId) && angular.isDefined($routeParams.token)) { - User.validate({userId: $routeParams.userId, token:$routeParams.token}, null, function() { - $rootScope.$broadcast('newSuccess', 'user.validate.success'); - if (currentUser.id == $routeParams.userId) { - currentUser.emailIsValidate = true; - SessionStorage.save({user: currentUser}); - $rootScope.$broadcast('editUser'); - $rootScope.$broadcast('cleanAlert'); - } - $location.url('/'); - }, function () { - $rootScope.$broadcast('newError', 'user.validate.error'); - $location.url('/'); - }); - } -}]) - -.controller('UserEditCtrl', ['$scope', '$rootScope', '$routeParams', '$route', '$location', '$translate', 'User', 'SessionStorage', 'Page', - function ($scope, $rootScope, $routeParams, $route, $location, $translate, User, SessionStorage, Page) { - Page.setTitle('title.user.edit'); - - $scope.tab = "viewProfile"; - - if (angular.isUndefined($scope.data)) { - $scope.data = {user:{}}; - } - - $scope.data.user = angular.copy(SessionStorage.get().user); - - if (angular.isUndefined($scope.data.user)) { - $rootScope.$broadcast('newError', 'user.error.login.mandatory' ); - $location.url('/'); - } - - $scope.data.user.password = ''; - $scope.data.user.newPassword = ''; - $scope.data.user.newPassword2 = ''; - - $scope.editUser = function () { - if ($scope.data.user.name != SessionStorage.get().user.name || $scope.data.user.email != SessionStorage.get().user.email) { - User.update($scope.data.user, function (data) { - SessionStorage.save({user: data}); - $rootScope.$broadcast('editUser'); - $rootScope.$broadcast('newSuccess', 'user.edit.success'); - }, function (error) { - $scope.restError = error.data; - }); - } - }; - - $scope.editPassword = function () { - if ($scope.data.user.newPassword == $scope.data.user.newPassword2) { - User.editPassword($scope.data.user, function () { - $rootScope.$broadcast('newSuccess', 'user.edit.success'); - }, function (error) { - $scope.restError = error.data; - }); - } - }; - - $scope.disableUser = function () { - var confirmMessage; - $translate('action.message.confirmDelete').then(function (msg) { - confirmMessage = msg; - }).then( function () { - var confirmDelete = confirm(confirmMessage); - if (confirmDelete == true) { - User.ban({userId: $scope.data.user.id, anonymize:true}, function () { - $rootScope.$broadcast('newSuccess', 'user.disableMe.success'); - $rootScope.$broadcast('sessionExpired'); - }) - } - }); - } -}]) - -.controller('UserListCtrl', ['$scope', '$rootScope', '$location', '$routeParams', 'User', 'UserLostPassword', 'Page', - function ($scope, $rootScope, $location, $routeParams, User, UserLostPassword, Page) { - - Page.setTitle('title.user.list'); - - if (angular.isUndefined($scope.data)) { - $scope.data = {user:{}}; - } - - if (angular.isDefined(conf.pollDefaultPageSize)) { - $scope.pageSize = conf.pollDefaultPageSize; - } - else { - $scope.pageSize = -1; - } - - var paginationParameter = {pageSize:$scope.pageSize}; - if (angular.isDefined($routeParams.page)) { - if (angular.isDefined($routeParams.pageSize)) { - paginationParameter = {pageSize:$routeParams.pageSize}; - $scope.pageSize = $routeParams.pageSize; - } - - paginationParameter.pageNumber = $routeParams.page; - } - - User.get({paginationParameter:paginationParameter}, function (data) { - $scope.data.users = data.elements; - $scope.data.usersPagination = data.pagination - }, function (error) { - if (error.status == 403) { - $rootScope.$broadcast('newError', 'error.forbidden'); - $location.url('/'); - } - }); - - $scope.saveUser = function (user) { - User.admin(user, function() { - $rootScope.$broadcast('newSuccess', 'user.edit.success'); - }); - }; - - $scope.generatePassword = function (user) { - UserLostPassword.send({login: user.email}, function () { - $rootScope.$broadcast('newSuccess', 'user.generatePassword.success'); - user.isDisabled = false; - }); - }; - - $scope.deleteUser = function (user) { - User.remove({userId:user.id, anonymize:true}, function () { - $rootScope.$broadcast('newSuccess', 'user.delete.success'); - var userIndex = $scope.data.users.indexOf(user); - if (userIndex >= 0) { - $scope.data.users.splice(userIndex, 1); - } - }); - }; - - $scope.banUser = function (user) { - User.ban({userId : user.id, anonymize:true}, function () { - user.isDisabled = true; - $rootScope.$broadcast('newSuccess', 'user.disableUser.success'); - }); - }; -}]) - -.controller('UserLoginCtrl', ['$scope', '$rootScope', 'UserLogin', 'UserLogout', 'User', 'SessionStorage', '$route', '$location', '$translate', '$timeout', - function ($scope, $rootScope, UserLogin, UserLogout, User, SessionStorage, $route, $location, $translate, $timeout) { - if (angular.isUndefined($scope.data)) { - $scope.data = {user:{}}; - } - - $scope.$on('sessionExpired', function() { - $scope.logout(); - }); - - $scope.$on('editUser', function() { - $scope.currentUser = SessionStorage.get().user; - }); - - $scope.currentUser = SessionStorage.get().user; - - $timeout(function () { - if (angular.isDefined($scope.currentUser) && !$scope.currentUser.emailIsValidate) { - $rootScope.$broadcast('newWarning', 'user.warning.emailNotValidate', -1); - } - }); - - $scope.login = function () { - UserLogin.login({}, $scope.data.user, function (data) { - SessionStorage.save({'token':data.permission}); - User.get({userId: data.id}, function (user) { - $scope.currentUser = user; - SessionStorage.save({'user':user}); - - if (angular.isDefined($scope.currentUser) && !$scope.currentUser.emailIsValidate) { - $rootScope.$broadcast('newWarning', 'user.warning.emailNotValidate', -1); - } - - delete $scope.data.user; - // reload page for right user - $route.reload(); - }) - }, function () { - $translate('user.error.login').then(function (error) { - $scope.restError = {connexion: error}; - }) - }); - }; - - $scope.logout = function () { - var currentUser = SessionStorage.get().user; - if (currentUser) { - - UserLogout.logout(); - - $rootScope.$broadcast('cleanAlert'); - - var locale = SessionStorage.get().locale; - - // all information - SessionStorage.remove(); - delete $scope.currentUser; - - // stock the locale - SessionStorage.save({locale : locale}); - - //got to the home - $location.url('/'); - } - } -}]); diff --git a/pollen-ui-angular/src/main/webapp/js/directives.js b/pollen-ui-angular/src/main/webapp/js/directives.js deleted file mode 100644 index 648fa8a..0000000 --- a/pollen-ui-angular/src/main/webapp/js/directives.js +++ /dev/null @@ -1,727 +0,0 @@ -/* - * #%L - * Pollen :: UI (Angular) - * %% - * Copyright (C) 2009 - 2017 Code Lutin, Tony Chemit - * %% - * 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 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/>. - * #L% - */ -'use strict'; - -angular.module('pollenDirective', []) - -////////////////////////////////////// -///// FOCUS ME ///// -////////////////////////////////////// - -.directive('focusMe', ['$timeout', function($timeout) { - return { - link: function($scope, element, attrs) { - $scope.$watch(attrs.focusMe, function(value) { - if(value === true) { - $timeout(function() { - element[0].focus(); - $scope[attrs.focusMe] = true; - }); - } - }); - } - }; -}]) - -////////////////////////////////////// -///// EDIT ME ///// -////////////////////////////////////// - -.directive('editMe', [function() { - return { - restrict:'A', - link: function ($scope, element, attrs) { - element.bind('click', function () { - if ($scope.globalVariables.editMode) { - $scope.$apply(function () { - $scope[attrs.editMe] = true; - $scope.globalVariables.saved = false; - }); - } - }); - } - }; -}]) - -////////////////////////////////////// -///// CKEDITOR ///// -////////////////////////////////////// - -.directive('ckEditor', ['$timeout', function ($timeout) { - return { - require: '?ngModel', - link: function ($scope, element, attrs, ngModel) { - var ck = CKEDITOR.replace(element[0], {customConfig: window.location.origin + window.location.pathname + 'js/libs/ckeditor/config.js'}); - - ck.on('pasteState', function () { - $scope.$apply(function () { - ngModel.$setViewValue(ck.getData()); - }); - }); - - ck.on('instanceReady', function() { - ck.setData(ngModel.$modelValue); - }); - - ngModel.$render = function() { - ck.setData(ngModel.$modelValue); - }; - - if (attrs.focusMe) { - $scope.$watch(attrs.focusMe, function (value) { - if (value === true) { - $timeout(function () { ck.focus(); }); - } - }) - } - } - }; -}]) - -////////////////////////////////////// -///// NG EXIT ///// -////////////////////////////////////// - -.directive('ngExit', [ '$timeout', function ($timeout) { - return { - link: function (scope, element, attrs) { - element.bind("keydown keypress", function (event) { - if(event.which === 27 || event.which === 13) { - scope.$apply(function () { - scope.$eval(attrs.ngExit); - }); - - event.preventDefault(); - } - }); - - element.bind('blur change', function () { - $timeout (function () { - scope.$apply(attrs.ngExit); - }, 150); - }); - } - }; -}]) - -////////////////////////////////////// -///// INFO ERROR ///// -////////////////////////////////////// - -.directive('infoError', ['$timeout', function($timeout) { - return { - restrict:'E', - scope: { - error: '=', - forData: '=data', - appendClass: '@' - }, - template: '<span class="fa fa-info-error danger" ng-class="appendClass" tooltip="{{error}}" ng-if="error"></span>', - link: function (scope) { - $timeout(function () { - scope.$watch('forData', function (newVal, oldVal) { - if (newVal != oldVal) { - delete scope.error; - } - }); - }); - } - }; -}]) - -////////////////////////////////////// -///// INPUT ERROR ///// -////////////////////////////////////// - -.directive('inputError', ['$timeout', function($timeout) { - return { - restrict:'E', - scope: { - error: '=', - forData: '=data' - }, - transclude: true, - template: '<div tooltip={{error}} ng-transclude></div>', - link: function (scope, element, attrs) { - $timeout(function () { - scope.$watch('forData', function (newVal, oldVal) { - if (newVal != oldVal) { - delete scope.error; - } - }); - scope.$watch('error', function (newVal) { - attrs.tooltip = newVal; - if (angular.isDefined(newVal)) { - $(element[0]).addClass('has-error'); - - } - else { - $(element[0]).removeClass('has-error'); - } - }) - }); - } - }; -}]) - -////////////////////////////////////// -///// SELECT ON CLICK ///// -////////////////////////////////////// - -.directive('selectOnClick', [function () { - return { - restrict: 'A', - link: function (scope, element) { - element.css('cursor', 'pointer'); - element.on('click', function () { - this.select(); - }); - } - }; -}]) - -////////////////////////////////////// -///// AUTO SAVE ///// -////////////////////////////////////// - -//.directive('autoSave', ['$timeout', function ($timeout) { -// return { -// restrict : 'A', -// link : function (scope, element, attrs) { -// scope.oldVal = {}; -// scope.change = false; -// scope.timeout = null; -// $timeout(function () { -// scope.oldVal[attrs.ngModel] = scope.$eval(attrs.ngModel); -// scope.$watch(attrs.ngModel, function () { -// scope.change = scope.$eval(attrs.ngModel) != scope.oldVal[attrs.ngModel]; -// }, true); -// }); -// -// var save = function () { -// try { -// scope.$digest(); -// } catch (e) {} -// -// $timeout(function () { -// if (scope.change && !scope.lock) { -// scope.$apply(function () { -// scope.change = false; -// scope.oldVal[attrs.ngModel] = scope.$eval(attrs.ngModel); -// scope.$eval(attrs.autoSave); -// }); -// } -// }, 100); -// }; -// -// element.bind('change', function () { -// if (scope.timeout) { -// $timeout.cancel(scope.timeout) -// } -// scope.timeout = $timeout(save,1000); -// }); -// -// element.bind('dp.show', function() { -// scope.lock = true; -// -// }); -// -// element.bind('dp.hide', function () { -// scope.lock = false; -// if (scope.timeout) { -// $timeout.cancel(scope.timeout); -// } -// -// scope.timeout = $timeout(save, 100); -// }); -// -// element.bind('blur', function () { -// if (scope.timeout) { -// $timeout.cancel(scope.timeout) -// } -// scope.timeout = $timeout(save, 100); -// }); -// } -// } -//}]) - -////////////////////////////////////// -///// MAKE PAGINATION ///// -////////////////////////////////////// - -.directive('makePagination', ['$timeout', function ($timeout) { - return { - restrict: 'E', - scope: { - currentPage: '=', - lastPage: '=', - pageSize: '=' - }, - templateUrl: 'partials/pagination.html', - link: function (scope) { - var setNavPage = function () { - if (scope.currentPage > 0) { - scope.previousPage = scope.currentPage - 1; - } else { - scope.previousPage = 0; - } - - if (scope.currentPage < scope.lastPage) { - scope.nextPage = scope.currentPage + 1; - } else { - scope.nextPage = scope.lastPage; - } - }; - - //set pageList - scope.pageList = []; - $timeout(function () { - scope.$watch('lastPage', function (newVal) { - scope.pageList = []; - for (var i = 0; i <= newVal; i++) { - scope.pageList.push(i); - } - setNavPage(); - }); - }); - - scope.goPage = function (pageNumber) { - scope.currentPage = pageNumber; - setNavPage(); - }; - } - } -}]) - -////////////////////////////////////// -///// JQPLOT CHART ///// -////////////////////////////////////// - -.directive('chart', ['$timeout', function ($timeout) { - return { - restrict : 'E', - scope : { - data:'=' - }, - template:'<div class="jqplot-target"></div>', - link: function(scope, element) { - - var initChart = function () { - if (angular.isDefined(scope.data)) { - $.jqplot.config.enablePlugins = true; - scope.plot = $(element).find('div').jqplot([scope.data], { - // Only animate if we're not using excanvas (not in IE 7 or IE 8).. - animate: !$.jqplot.use_excanvas, - seriesDefaults:{ - renderer:$.jqplot.BarRenderer, - rendererOptions : { - varyBarColor: true - } - }, - axesDefaults: { - showTicks: true, - showTickMarks: true, - tickOptions: { - showGridline: false, - show:true, - showLabel: true - } - }, - axes: { - xaxis: { - renderer: $.jqplot.CategoryAxisRenderer - }, - yaxis: { - label:'Vote' - } - } - }); - - //var imgData = $(element).find('div').jqplotToImageStr({}); - //$(element).html('<img src="' + imgData + '" />') - } - }; - - $timeout( function() { - scope.$watch('data', function () { - if (angular.isDefined(scope.plot)) { - scope.plot.html(''); - initChart() - } else { - initChart(); - } - }); - }); - } - } -}]) - -////////////////////////////////////// -///// JQPLOT PIE ///// -////////////////////////////////////// - -.directive('pie', ['$timeout', function ($timeout) { - return { - restrict : 'E', - scope : { - data:'=' - }, - template:'<div class="jqplot-target"></div>', - link: function(scope, element) { - var initChart = function () { - if (angular.isDefined(scope.data)) { - $.jqplot.config.enablePlugins = true; - $(element).find('div').jqplot([scope.data], { - seriesDefaults:{ - renderer:$.jqplot.PieRenderer, - rendererOptions : { - padding: 8, - sliceMargin: 4, - showDataLabels: true, - varyBarColor: true, - startAngle:-90 - } - }, - legend:{ - show:true - } - }); - - //var imgData = $(element).find('div').jqplotToImageStr({}); - //$(element).html('<img src="' + imgData + '" />') - - } - }; - - $timeout(function () { - scope.$watch('data', function () { - initChart(); - }); - }) - } - } -}]) - - -////////////////////////////////////// -///// UPLOAD FILE ///// -////////////////////////////////////// - -.directive("uploadFile", ["PollenResource", function (PollenResource) { - return { - restrict : "E", - scope: { - ngModel: "=" - }, - template:'<form><input type="file" name="resource" /></form>', - link: function (scope, element) { - element.bind("change", function (changeEvent) { - var reader = new FileReader(); - reader.onload = function () { - var formData = new FormData(element[0].firstChild); - scope.$apply(function () { - scope.ngModel = { meta: changeEvent.target.files[0] }; - }); - - delete scope.ngModel.id; - - scope.ngModel.promise = PollenResource.upload(formData, function (response) { - scope.ngModel.meta.id = response.id; - scope.ngModel.meta.contentType = scope.ngModel.meta.type; - scope.ngModel.id = response.id; - scope.ngModel.data = conf.restURL+'/resources/'+response.id; - }); - }; - try { - reader.readAsDataURL(changeEvent.target.files[0]); - } catch (e) { - scope.$apply(function () { - $rootScope.$broadcast('newError', 'error.reader.noFile'); - }); - } - }); - - } - } -}]) - -////////////////////////////////////// -///// IMPORT CSV ///// -////////////////////////////////////// - - .directive("importCsv", ['$rootScope', 'FavoriteList', '$route', function ($rootScope, FavoriteList, $route) { - return { - restrict : "E", - scope: { - fvId: "=" - }, - template: - '<form class="form-inline">' + - '<input type="file" name="csvFile" />' + - '<button class="btn btn-primary" type="submit"><span class="fa fa-download"></span> {{ \'action.favoriteList.import.fromCSV\' | translate }}</button>' + - '</form>', - link: function (scope, element) { - element.find('button').bind("click", function () { - var reader = new FileReader(); - reader.onload = function () { - var formData = new FormData(element[0].firstChild); - FavoriteList.importcsv({favoriteListId: scope.fvId}, formData, function () { - $route.reload(); - }, function (error) { - $rootScope.$broadcast('newError', error.data.error); - }); - }; - try { - reader.readAsText(element.find('input[type=file]')[0].files[0]); - } catch(e) { - scope.$apply(function () { - $rootScope.$broadcast('newError', 'error.reader.noFile'); - }); - } - }); - } - } - }]) - -////////////////////////////////////// -///// PRINT RESOURCE ///// -////////////////////////////////////// - -.directive("printResource", ['$timeout', '$http', function ($timeout) { - return { - restrict : "E", - scope : { - image : "=", - meta : "=" - }, - transclude : true, - templateUrl : "partials/printResource.html", - link : function (scope, element) { - scope.showImage = false; - - $timeout(function () { - scope.$watch('image', function (newVal) { - if (angular.isDefined(newVal)) { - scope.resourceURL = conf.restURL+"/resources/"+scope.image; - scope.previewURL = scope.resourceURL+"/preview"; - - if (scope.meta.hasOwnProperty("name")) { - scope.resourceURL += "/" + scope.meta.name; - scope.previewURL += "/" + scope.meta.name; - } - - scope.isImage = isImage(scope.meta.contentType); - } - else { - scope.resourceURL = null; - scope.previewURL = null; - } - }); - - scope.$watch('meta', function(newVal) { - if (angular.isDefined(newVal)) { - scope.isImage = isImage(newVal.contentType); - } - }); - }); - - var toggleZoom = function () { - scope.$apply(function() { - scope.showImage = !scope.showImage; - }); - }; - - var isImage = function (type) { - if (type === undefined || type === null) { - scope.meta.class = "fa-spin fa-spinner"; - return false; - } - var allTypeImage = ["image/jpeg", "image/png", "image/gif"]; - - for (var i in allTypeImage) { - if (allTypeImage[i] == type) { - return true; - } - } - - if (type == "application/pdf") { - scope.meta.class = "fa-file-pdf-o"; - } - else if (type == "text/plain") { - scope.meta.class = "fa-file-text-o" - } - else if (type.split("/")[0] == "text") { - scope.meta.class = "fa-file-code-o"; - } - else if (type.split("/")[0] == "audio") { - scope.meta.class = "fa-file-audio-o"; - } - else if (type.split("/")[0] == "video") { - scope.meta.class = "fa-file-video-o"; - } - else { - scope.meta.class = "fa-file-archive-o"; - } - - return false; - }; - - element.bind("click", function () { - if (scope.isImage) { - toggleZoom(); - } - }); - } - } -}]) - -///////////////////////////////////////////////////////// -// DATE TIME PICKER DIRECTIVE // -// http://dralagen.github.io/bootstrap-datetimepicker/ // -///////////////////////////////////////////////////////// -.directive("datetimepicker", ["$timeout", "$route", "SessionStorage", function ($timeout, $route, SessionStorage) { - return { - restrict : "E", - scope : { - ngModel: '=', - focus: '=', - minDate: '=', - maxDate: '=', - forId: '@' - }, - templateUrl:"partials/dateTimePicker.html", - link: function(scope, element) { - scope.dateTimePicker = $(element).find(".datetimepicker"); - scope.dateTimePicker.datetimepicker({ - language: SessionStorage.get().locale, - showPickOnFocus: true, - icons: { - time: "fa fa-clock-o", - date: "fa fa-calendar", - up: "fa fa-chevron-up", - down: "fa fa-chevron-down" - } - }); - - var setDate = function () { - if (angular.isDefined(scope.ngModel) && scope.ngModel != null) { - scope.dateTimePicker.data("DateTimePicker").setDate(new Date(scope.ngModel)); - } - }; setDate(); - - var setMinDate = function () { - if (angular.isDefined(scope.minDate)) { - scope.dateTimePicker.data("DateTimePicker").setMinDate(moment(scope.minDate)); - } - }; setMinDate(); - - scope.$on("switchLocale", function () { - scope.dateTimePicker.data("DateTimePicker").destroy(); - scope.dateTimePicker.datetimepicker({ - language: SessionStorage.get().locale - }); - setDate(); - }); - - var setMaxDate = function () { - if (angular.isDefined(scope.maxDate)) { - scope.dateTimePicker.data("DateTimePicker").setMaxDate(moment(scope.maxDate)); - } - }; setMaxDate(); - - $timeout(function () { - scope.$watch('ngModel', function (newVal, oldVal) { - if (newVal != oldVal) { - setDate(); - } - }); - - scope.$watch('minDate', function (newVal, oldVal) { - if (newVal != oldVal) { - setMinDate(); - } - }); - - scope.$watch('maxDate', function (newVal, oldVal) { - if (newVal != oldVal) { - setMaxDate(); - } - }); - }); - - scope.dateTimePicker.on("change", function() { - var newDate = scope.dateTimePicker.data("DateTimePicker").getDate(); - if (newDate && moment(newDate).isValid) { - scope.ngModel = new Date(newDate).getTime(); - } else { - scope.ngModel = null; - scope.dateTimePicker.data("DateTimePicker").setDate(null); - } - }); - - scope.dateTimePicker.on("dp.show", function() { - // hide other datetimepicker - var id = scope.dateTimePicker.data("DateTimePicker").id; - var allDp = $('.datetimepicker'); - for (var i = 0; i < allDp.length; i++) { - var dp = $(allDp[i]).data("DateTimePicker"); - if (dp.id == id) { - continue; - } - dp.hide(); - } - - // set ngModel if not set - if (scope.ngModel == null) { - scope.ngModel = new Date(scope.dateTimePicker.data("DateTimePicker").getDate()).getTime(); - } - }); - - scope.exit = function() { - element.trigger("blur"); - }; - - scope.remove = function () { - scope.ngModel = null; - scope.dateTimePicker.data("DateTimePicker").setDate(null); - } - } - - }; -}]) - -///////////////////////////////////////////////////////// -// SHOW ON HOVER PARENT // -///////////////////////////////////////////////////////// -.directive('showonhoverparent', - function() { - return { - link : function(scope, element, attrs) { - element.hide(); - element.parent().bind('mouseenter', function() { - element.show(); - }); - element.parent().bind('mouseleave', function() { - element.hide(); - }); - } - }; -}); diff --git a/pollen-ui-angular/src/main/webapp/js/libs/ckeditor/config.js b/pollen-ui-angular/src/main/webapp/js/libs/ckeditor/config.js deleted file mode 100644 index 7810b99..0000000 --- a/pollen-ui-angular/src/main/webapp/js/libs/ckeditor/config.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * #%L - * Pollen :: UI (Angular) - * %% - * Copyright (C) 2009 - 2017 Code Lutin, Tony Chemit - * %% - * 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 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/>. - * #L% - */ -CKEDITOR.editorConfig = function (config) { - config.toolbar = 'PollenToolbar'; - - config.toolbar_PollenToolbar = - [ -// ['Cut', 'Copy', 'Paste', 'PasteText', /*'PasteFromWord'*/, '-', 'Undo', 'Redo', '-', 'Scayt'], -// [ 'Find', 'Replace', '-', 'SelectAll', 'RemoveFormat'], - ['Styles', 'Format'], - ['Bold', 'Italic', 'Strike', 'Underline','Strike','Subscript','Superscript'], - ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote', 'TextColor','BGColor'], -// '/', - ['Table', 'HorizontalRule', 'Smiley', 'SpecialChar'/*, 'PageBreak'*/, 'Link', 'Unlink', 'Anchor' ] - - ]; - -}; diff --git a/pollen-ui-angular/src/main/webapp/js/scripts/sticky-inline-poll.js b/pollen-ui-angular/src/main/webapp/js/scripts/sticky-inline-poll.js deleted file mode 100644 index 544927b..0000000 --- a/pollen-ui-angular/src/main/webapp/js/scripts/sticky-inline-poll.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * #%L - * Pollen :: UI (Angular) - * %% - * Copyright (C) 2009 - 2017 Code Lutin, Tony Chemit - * %% - * 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 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/>. - * #L% - */ - -$(window).scroll(function() { - var pollInline = $('#poll-inline'); - var pollContent = $('#poll-content'); - if (pollInline.length > 0 && pollContent.length > 0) { - var elementPosition = pollInline.offset(); - elementPosition.left -= parseInt(pollContent.css('marginLeft'), 10); - - if ($(window).scrollLeft() > elementPosition.left) { - pollInline.find('tr td:first-child').not('.static').addClass("sticky").css('left', $(window).scrollLeft() - elementPosition.left); - } else { - pollInline.find('tr td:first-child').not('.static').removeClass("sticky"); - } - } -}); diff --git a/pollen-ui-angular/src/main/webapp/js/services.js b/pollen-ui-angular/src/main/webapp/js/services.js deleted file mode 100644 index 1c06d81..0000000 --- a/pollen-ui-angular/src/main/webapp/js/services.js +++ /dev/null @@ -1,487 +0,0 @@ -/* - * #%L - * Pollen :: UI (Angular) - * %% - * Copyright (C) 2009 - 2017 Code Lutin, Tony Chemit - * %% - * 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 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/>. - * #L% - */ -'use strict'; - -angular.module('pollenServices', ['ngResource']) - -////////////////////////////////////// -///// POLL RESOURCE ///// -////////////////////////////////////// - -.factory('Poll', ['$resource', function ($resource) { - return $resource(conf.restURL+'/polls/:pollId/:cmd', {pollId:'@id'}, { - 'skeletonNew' : { - method : 'GET', - url : conf.restURL+'/polls/new' - }, - 'result' : { - method : 'GET', - url : conf.restURL+'/polls/:pollId/results' - }, - 'groupResult' : { - method : 'GET', - url : conf.restURL+'/polls/:pollId/groupResults' - }, - 'add' : { - method : 'POST', - transformRequest : function (data) { - var poll = angular.copy(data); - delete poll.choice; - var choices = angular.copy(data.choice); - return 'poll='+encodeURIComponent(JSON.stringify(poll))+'&choices='+encodeURIComponent(JSON.stringify(choices)); - } - }, - 'update' : { - method : 'POST', - transformRequest : function (data) { - return 'poll='+encodeURIComponent(JSON.stringify(data)); - } - }, - 'close' : { - method : 'PUT', - url : conf.restURL+'/polls/:pollId/close' - }, - 'clone' : { - method : 'POST', - url : conf.restURL+'/polls/:pollId/clone' - }, - 'allVoteCountingType': { - method : 'GET', - isArray: true, - url : conf.restURL+'/voteCountingTypes/:id' - }, - 'voteCountingType': { - method : 'GET', - url : conf.restURL+'/voteCountingTypes/:id' - } - }); -}]) - -.factory('PollChoice', ['$resource', function ($resource) { - var transformParam = function (data) { - return 'choice='+encodeURIComponent(JSON.stringify(data)); - }; - - return $resource(conf.restURL+'/polls/:pollId/choices/:choiceId', {choiceId : '@id'}, - { - 'add' : { - method:'POST', - transformRequest : function (data) { - return transformParam(data); - } - }, - 'update' : - { - method:'POST', - transformRequest : function (data) { - return transformParam(data); - } - } - } - ); -}]) - -.factory('PollVote', ['$resource', function ($resource) { - var transformParam = function (data) { - return 'vote='+encodeURIComponent(JSON.stringify(data)); - }; - - return $resource(conf.restURL+'/polls/:pollId/votes/:voteId', {voteId : '@id', permission : '@permission'}, - { - 'skeletonNew': { - method:'GET', - url:conf.restURL+'/polls/:pollId/votes/new' - }, - 'add' : { - method:'POST', - transformRequest : function (data) { - return transformParam(data); - } - }, - 'update' : - { - method:'POST', - transformRequest : function (data) { - return transformParam(data); - } - } - } - ); -}]) - -.factory('PollComment', ['$resource', function ($resource) { - var transformParam = function (data) { - return 'comment='+encodeURIComponent(JSON.stringify(data)); - }; - - return $resource(conf.restURL+'/polls/:pollId/comments/:commentId', {commentId : '@id', permission : '@permission'}, - { - 'add' : { - method:'POST', - transformRequest : function (data) { - return transformParam(data); - } - }, - 'update' : - { - method:'POST', - transformRequest : function (data) { - return transformParam(data); - } - } - } - ); -}]) - -.factory('PollVoterList', ['$resource', function ($resource) { - - return $resource(conf.restURL+'/polls/:pollId/voterLists/:voterListId', null, - { - 'add' : { - method : 'POST', - transformRequest: function (data) { - return 'voterList='+encodeURIComponent(JSON.stringify(data.group))+'&members='+encodeURIComponent(JSON.stringify(data.members)); - } - }, - 'update' : { - method : 'POST', - transformRequest: function (data) { - return 'voterList='+encodeURIComponent(JSON.stringify(data)); - } - }, - 'importAddGroup': { - method : 'PUT', - url: conf.restURL+'/polls/:pollId/favoriteLists/:favoriteListId' - }, - 'importInGroup': { - method : 'PUT', - url: conf.restURL+'/polls/:pollId/voterLists/:voterListId/favoriteLists/:favoriteListId' - } - - }) -}]) - -.factory('PollVoterListMember', ['$resource', function ($resource) { - var transformParam = function (data) { - return 'member='+encodeURIComponent(JSON.stringify(data)); - }; - return $resource(conf.restURL+'/polls/:pollId/voterLists/:voterListId/members/:memberId', {memberId:'@id'}, - { - 'add' : { - method : 'POST', - transformRequest: function (data) { - return transformParam(data); - } - }, - 'update' : { - method : 'POST', - transformRequest: function (data) { - return transformParam(data); - } - } - }) -}]) - - -////////////////////////////////////// -///// USER RESOURCE ///// -////////////////////////////////////// - -.factory('User', ['$resource', function ($resource) { - var transformParam = function (data) { - var generatePassword = (data.password == ''); - return 'user='+encodeURIComponent(JSON.stringify(data))+'&generatePassword='+generatePassword; - }; - return $resource(conf.restURL+'/users/:userId', {userId : '@id'}, - { - 'add' : { - method : 'POST', - transformRequest: function (data) { - return transformParam(data); - } - }, - 'admin': { - method : 'POST', - url: conf.restURL+'/users/:userId/admin', - transformRequest: function (data) { - return transformParam(data); - } - }, - 'update' : - { - method:'POST', - transformRequest : function (data) { - return transformParam(data); - } - }, - 'editPassword' : { - method:'POST', - url: conf.restURL+'/users/:userId/password', - transformRequest : function (data) { - return 'oldPassword='+encodeURIComponent(data.password)+ - '&newPassword='+encodeURIComponent(data.newPassword); - } - }, - 'ban' : { - method:'DELETE', - url: conf.restURL+'/users/:userId/ban' - }, - 'validate' : { - method:'PUT', - url: conf.restURL+'/users/:userId' - } - } - ); -}]) - -.factory('UserLogin', ['$resource', function ($resource) { - var transformParam = function (data) { - var query = 'login='+encodeURIComponent(data.login); - query += '&password='+encodeURIComponent(data.password); - query += '&rememberMe='; - if (data.rememberMe) { - query += "true" ; - } else { - query += "false"; - } - return query; - }; - return $resource(conf.restURL+'/login', {}, - { - 'login' : { - method: 'POST', - transformRequest: function (data) { - return transformParam(data); - } - } - } - ); -}]) - -.factory('UserLogout', ['$resource', function ($resource) { - return $resource(conf.restURL+'/logout', {}, - { - 'logout' : { - method: 'GET' - } - }) -}]) - -.factory('UserLostPassword', ['$resource', function ($resource) { - return $resource(conf.restURL+'/lostpassword/:login', {}, - { - 'send' : { - method: 'GET' - } - }) -}]) - - -////////////////////////////////////// -///// FAVORITE LIST RESOURCE ///// -////////////////////////////////////// - -.factory('FavoriteList', ['$resource', function ($resource) { - var transformParam = function (data) { - return 'favoriteList='+encodeURIComponent(JSON.stringify(data)); - }; - - return $resource(conf.restURL+'/favoriteLists/:favoriteListId', {favoriteListId:'@id'}, - { - 'add' : { - method:'POST', - transformRequest: function (data) { - return transformParam(data); - } - }, - 'update' : { - method:'POST', - transformRequest: function (data) { - return transformParam(data); - } - }, - 'importcsv': { - method:'POST', - url: conf.restURL + '/favoriteLists/:favoriteListId/importCsv', - transformRequest: angular.identity, - headers:{ - 'Content-Type':undefined - } - } - }) -}]) - -.factory('FavoriteListMember', ['$resource', function ($resource) { - var transformParam = function (data) { - return 'member='+encodeURIComponent(JSON.stringify(data)); - }; - - return $resource(conf.restURL+'/favoriteLists/:favoriteListId/members/:memberId', {memberId:'@id'}, - { - 'add' : { - method:'POST', - transformRequest: function (data) { - return transformParam(data); - } - }, - 'update' : { - method:'POST', - transformRequest: function (data) { - return transformParam(data); - } - } - }) -}]) - -////////////////////////////////////// -///// RESOURCES FILE ///// -////////////////////////////////////// - -.factory('PollenResource', ['$resource', function ($resource) { - return $resource(conf.restURL+'/resources/:resourceId', null, - { - 'getMeta': { - method : 'GET', - url: conf.restURL+'/resources/:resourceId/meta' - }, - 'upload' : { - method: 'POST', - transformRequest: angular.identity, - headers:{ - 'Content-Type':undefined - } - } - }); -}]) - -////////////////////////////////////// -///// SESSION STORAGE RESOURCE ///// -////////////////////////////////////// - -.factory('SessionStorage', [function () { - var storageId='sessionStorage'; - var session = JSON.parse(localStorage.getItem(storageId) || '{}'); - return { - get: function () { - return session; - }, - save: function (data) { - angular.forEach(data, function (value,key) { - session[key] = value; - }); - localStorage.setItem(storageId, JSON.stringify(session)); - }, - append: function (data) { - angular.forEach(data, function (value, key) { - var field = session[key]; - if (angular.isDefined(field)) { - if (angular.isArray(field)) { - field.push(value); - } - else { - field = [field, value]; - } - } - else { - field = value; - } - session[key] = field; - }); - localStorage.setItem(storageId, JSON.stringify(session)); - }, - remove: function (key) { - if (angular.isString(key)) { - delete session[key]; - } - else { - session = {}; - } - localStorage.setItem(storageId, JSON.stringify(session)); - } - } -}]) - -////////////////////////////////////// -///// DATE AND TIME FORMAT ///// -////////////////////////////////////// -.factory('DateFormat', [function() { - return { - getDateFormat : function () { - if (angular.isDefined(conf.defaultDateFormat)) { - return conf.defaultDateFormat; - } - else { - return "shortDate"; - } - }, - - getTimeFormat : function () { - if (angular.isDefined(conf.defaultTimeFormat)) { - return conf.defaultTimeFormat; - } - else { - return "shortTime"; - } - }, - - getDateTimeFormat : function () { - if (angular.isDefined(conf.defaultDateTimeFormat)) { - return conf.defaultDateTimeFormat; - } - else { - return "short"; - } - } - } -}]) - - -////////////////////////////////////// -///// PAGE ///// -////////////////////////////////////// - -.factory('Page', ['$rootScope', '$filter', function ($rootScope, $filter) { - var title = ''; - var value; - return { - title : function () { - var makeTitle = "Pollen"; - if (title) { - makeTitle += " - " + $filter('translate')(title); - } - - if (value) { - makeTitle += " - " + value; - } - - return makeTitle; - }, - setTitle: function(newTitle, newValue) { - title = newTitle; - value = newValue; - $rootScope.$broadcast('titleChange'); - }, - setValue: function(newValue) { - value = newValue; - $rootScope.$broadcast('titleChange'); - } - }; -}]); diff --git a/pollen-ui-angular/src/main/webapp/less/style.less b/pollen-ui-angular/src/main/webapp/less/style.less deleted file mode 100644 index 615e6d3..0000000 --- a/pollen-ui-angular/src/main/webapp/less/style.less +++ /dev/null @@ -1,659 +0,0 @@ -/* - * #%L - * Pollen :: UI (Angular) - * %% - * Copyright (C) 2009 - 2014 CodeLutin - * %% - * 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 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/>. - * #L% - */ - -@import "variables.less"; - -html { - height: 100%; -} - -body { - position:relative; - margin:0; - min-height:100%; - padding-bottom: 4rem; - background-color: @background-color; -} - -#pollenMenu { - position:fixed; - width:100%; - height:@height-pollen-menu; - top:0; - left:0px; -} -#content { - .fade(); - - #poll-content .anim-fade { - .fade(); - } -} - -/* global min width */ -@media screen and (max-width: @responsive-min-width) { - body, footer, #pollenMenu { - width:@responsive-min-width; - } -} - -.navbar .dropdown-menu { - padding: 15px 0 5px; - left:auto; - right:0px; - - &.form { - width:250px; - - > form { - margin: 0; - } - } - - .form-actions { - padding: 15px 20px 20px; - margin-bottom: 0; - border-radius: 0 0 6px 6px; - } - - .control-group { - padding: 0 15px; - margin-bottom: 5px; - } -} - -/* width > @responsive-large-width */ -@media screen and (min-width: (@responsive-large-width + 1px)) { - @width-max : 300px; - @width-min : 35px; - - #poll-link { - position:fixed; - top:0px; - left:0px; - width: @width-max; - height:100%; - padding-top:60px; - padding-left:5px; - padding-right:5px; - border-right:2px solid @border-color; - background-color: @gray-lighter; - overflow:hidden; - z-index:50; - - &.mini-link-remove { - .transition(width linear @short-time-transition); - - ul li .text, ul li input { - display: none; - .opacity(0); - } - } - - &.mini-link { - .transition(width linear @short-time-transition); - - width: @width-min; - - ul li { - margin-bottom:3px; - font-size:1.2em; - - .text, input { - display:none; - } - - &.toMini { - text-align:left; - } - } - } - - ul { - list-style-type:none; - margin-left:0px; - padding-left:0px; - - li { - margin-bottom:30px; - font-size:1.2em; - - &.toMini { - text-align:right; - } - } - } - } - - #poll-content { - margin-right:0px; - margin-left: @width-max; - - &.maxi-content-remove { - .transition(margin linear @short-time-transition); - } - &.maxi-content { - margin-left: @width-min; - - .transition(margin linear @short-time-transition); - } - - } - - - .pool-persistent-alert { - padding-top: @height-pollen-menu + 10px; - margin-left: @width-max + 10px; - margin-right:15px; - - .alert() - } -} - -/* width < @responsive-large-width */ -@media screen and (max-width: @responsive-large-width) { - @foot-height : 100px + @height-footer; - - #poll-link { - text-align:center; - position:absolute; - bottom:0px; - left:0px; - width:100%; - height:@foot-height; - border-top:2px solid @border-color; - background-color:@gray-lighter; - overflow:hidden; - z-index:50; - - ul { - list-style-type:none; - display:inline-block; - margin:0px; - width:33%; - float:left; - - text-align:left; - - li.toMini { - display:none; - } - } - } - - #poll-content { - margin-bottom: @foot-height; - } - - .pool-persistent-alert { - padding-top: @height-pollen-menu + 10px; - margin-left:15px; - margin-right:15px; - - .alert() - } -} - -#poll-content { - .poll-settings { - h4 { - font-weight: bold; - border-left: 8px solid; - padding-left: 4px; - color: @title-setting-color; - } - } - - .poll-info { - background-color: #eee; - border-bottom:1px solid @border-color; - margin-bottom: 30px; - padding:10px 15px 5px 10px; - color: @help-color; - - .anim { - max-height:100px; - overflow:hidden; - - @time:@long-time-transition; - - &.ng-enter { - .transition(all @time linear); - } - - &.ng-leave { - .transition(all @time linear); - } - - &.ng-leave { - max-height:0px; - } - - &.ng-enter, - &.ng-leave.ng-leave-active { - max-height:0px; - } - - &.ng-leave, - &.ng-enter.ng-enter-active { - max-height:100px; - } - } - - } - - .pollTitle, .pollDesc { - margin-top:15px; - padding-left:5px; - margin-bottom:30px; - } - - .pollAnim { - background-color:inherit; - .transition(background @time-transition ease); - - .fade(); - - .voteTrue { - .fade(0); - } - - .voteFalse { - .fade(0); - } - - &:hover { - background:@border-color; - .transition(background @time-transition ease); - - .voteTrue { - background-color: lighten(@brand-success, 15%); - .transition(background @time-transition ease); - } - - .voteFalse { - background-color: lighten(@brand-danger, 15%); - .transition(background @time-transition ease); - } - } - } - - #poll { - text-align:center; - - table { - margin: auto auto 8px; - } - - #poll-inline { - - border-collapse: collapse; - border-spacing: 0px; - - tr { - td { - &.pollChoice { - padding: 10px 5px 5px; - text-align:center; - border: 1px solid @border-color; - - input[type=text]{ - width:@width-input-vote; - } - input[type=checkbox]{ - width:25px; - height:25px; - } - - &.voteTrue { - background-color: lighten(@brand-success, 30%); - .transition(background @time-transition ease); - } - - &.voteFalse { - background-color: lighten(@brand-danger, 30%); - .transition(background @time-transition ease); - } - } - - &:first-child { - background-color: @background-color; - - &.sticky { - position: relative; - display: block; - border-bottom: 0px; - border-right:0px; - } - } - - &.vote-action { - div { - width: 90px; - } - } - - &.vote-input { - height: 60px; - } - } - - &:last-child { - td.sticky { - border-bottom: 1px solid @border-color; - } - } - } - - .btn-large { - height:60px; - width:80px; - span { - font-size: 1.5em; - } - } - - .preview { - img { - max-width: @preview-size; - max-height: @preview-size; - } - - .fa { - font-size: @preview-size/2; - width: @preview-size/2; - height: @preview-size/2; - } - } - } - } - - .pollBigChoice { - border-bottom:1px solid @border-color; - text-align:right; - - h3 { - background-color:rgba(0,0,0,0.1); - padding:5px; - height:40px; - - input[type=text] { - width:99%; - text-align:right; - } - } - - button { - height:30px; - } - - p { - text-align:justify; - white-space:pre-line; - } - textarea { - width:99%; - } - - .pollChoiceInput { - margin-top:20px; - text-align:center; - } - } -} - -.fixe-input .ng-hide { - display:inline-block !important; - visibility:hidden; -} - -.pool-alert { - position: fixed; - top:@height-pollen-menu + 10px; - right:15px; - width:60%; - z-index: 100000; - - .alert(); -} - -.danger { - color: @danger-color; - .transition(color @short-time-transition); - - &:hover, &:focus { - color: @danger-hover-color; - .transition(color @short-time-transition); - } -} - -a { - .transition-duration(@short-time-transition); - - &:hover, &:focus { - .transition-duration(@short-time-transition); - } -} - -.fakeLink { - cursor: pointer; -} - -input[readonly] { - cursor: pointer !important; -} - -.input-mini { - font-size: 8pt; - height:16px; - margin:0px; - padding:0px; -} - -#comments { - margin-top:30px; - width:100%; - border-collapse:collapse; - - tr { - background-color:inherit; - .transition-duration(@time-transition); - - &:hover { - background:@border-color; - .transition-duration(@time-transition); - } - - .fade(0); - - td { - border-bottom:1px solid @border-color; - padding: 5px 5px 15px; - vertical-align:top; - } - - &>td:first-child { - width:200px; - border-right:1px solid @border-color; - } - } -} - -.container .control-group .form-control, .container .control-group .control-label { - margin-bottom:15px; - vertical-align:center; -} - -.voterList { - @width-input : 92px; - @width-action : 53px; - - width:100%; - margin-top:25px; - margin-bottom:15px; - border:3px solid @border-color; - - tr th, tr td { - padding: 8px 5px; - border:1px solid @border-color; - - &.weight { - width: @width-input; - } - - &.action { - width:@width-action; - } - - &.cell-lg { - div { - float: right; - display: inline-block; - margin:3px; - - &:first-child { - float: left; - } - } - } - - input[type=file] { - display: inline-block; - } - } -} - -hr { - border-top:1px solid #CCCCCC; -} - -label.label-block { - display:block !important; -} - -.table-result { - margin: 5px auto 15px; - - tr { - td, th { - padding:8px; - border: 1px solid @border-color; - } - .transition-duration(@time-transition); - - &:hover { - background: @border-color; - .transition-duration(@time-transition); - } - } -} - -.plot { - height:300px; - margin-top:5px; - margin-bottom:15px; -} - -.text-help { - color : @help-color; -} - -.control-group { - margin-top: 5px; -} - -.form-inline { - display: inline; -} - -footer { - position: absolute; - right: 0; - bottom: 0; - left: 0; - height:@height-footer; - width: 100%; - padding: 5px 0; - background-color: #222; - color: #999; - text-align: center; - border-top: 1px solid #080808; - z-index:1000; - - .separator { - padding-left:.75%; - padding-right:.75%; - } - - a { - color: #999; - text-decoration:none; - - &:hover { - color:#fff; - background-color:transparent; - text-decoration:none; - } - } -} - -.full { - position:fixed; - top:0%; - left:0%; - width:100%; - height:100%; - margin:0px; - padding:0px; - z-index:5000; - text-align:center; - background-color:rgba(0,0,0,0.5); - - .full-content { - display:inline-block; - max-width:100%; - max-height:100%; - margin: 1.25% 1.25% 0px; - padding:8px; - background-color:@border-color; - border-radius:8px; - - .transition(width @time-transition linear 0); - .transition(height @time-transition linear 0); - - span { - display:block; - padding-top:2px; - } - img { - max-width:95% !important; - max-height:95% !important; - padding:0; - margin:0; - } - } -} - -.modal { - &.fade .modal-dialog { - .translate(0, 0); - } -} diff --git a/pollen-ui-angular/src/main/webapp/less/variables.less b/pollen-ui-angular/src/main/webapp/less/variables.less deleted file mode 100644 index afd959e..0000000 --- a/pollen-ui-angular/src/main/webapp/less/variables.less +++ /dev/null @@ -1,122 +0,0 @@ -/* - * #%L - * Pollen :: UI (Angular) - * %% - * Copyright (C) 2009 - 2014 CodeLutin - * %% - * 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 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/>. - * #L% - */ - -@import "../lib/bootstrap/less/variables.less"; -@import "../lib/bootstrap/less/mixins.less"; -@import "../lib/font-awesome/less/variables.less"; - -@time-transition : 0.8s; -@short-time-transition : 0.2s; -@long-time-transition : 1.6s; - -@background-color: #fff; - -@border-color : #dddddd; - -@danger-color : @brand-danger; -@danger-hover-color : darken(@danger-color, 15%); -@help-color: #666; -@title-setting-color: #555; - -@height-pollen-menu : 50px; -@height-footer: 30px; - -@responsive-large-width : 1024px; -@responsive-min-width : 800px; -@responsive-height: 600px; - -@preview-size:200px; - -@width-input-vote: 160px; - -.fade(@time) { - &.ng-enter { - .transition(all @time ease @time); - } - - &.ng-leave { - .transition(all @time ease); - } - - &.ng-leave { - height:0; - } - - &.ng-enter, - &.ng-leave.ng-leave-active { - .opacity(0); - } - - &.ng-leave, - &.ng-enter.ng-enter-active { - .opacity(1); - } -} - -.fade() { - .fade(@short-time-transition); -} - - -.alert() { - font-size:1.1em; - font-weight:bold; - - .alert { - .opacity(0.9); - - .transition(opacity @short-time-transition ease); - - &:hover { - .opacity(1); - - .transition(opacity @short-time-transition ease); - } - - .fa { - display:inline-block; - font-size:1.4em; - top:5px; - font-weight:bolder; - margin-right: 15px; - } - - .alert-message { - margin-right:20px; - margin-left: 30px; - margin-top: -20px; - - } - } -} - -/* override fa-remove */ -.@{fa-css-prefix}-remove:before { - content: @fa-var-times; -} - -.@{fa-css-prefix}-return:before { - content: @fa-var-arrow-left; -} - -.@{fa-css-prefix}-info-error:before { - content: @fa-var-exclamation-circle; -} diff --git a/pollen-ui-angular/src/main/webapp/partials/alerts.html b/pollen-ui-angular/src/main/webapp/partials/alerts.html deleted file mode 100644 index bca320e..0000000 --- a/pollen-ui-angular/src/main/webapp/partials/alerts.html +++ /dev/null @@ -1,37 +0,0 @@ -<!-- - #%L - Pollen :: UI (Angular) - %% - Copyright (C) 2009 - 2017 Code Lutin, Tony Chemit - %% - 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 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/>. - #L% - --> -<div class="pool-alert"> - <alert ng-repeat="alert in data.alerts" - type="{{alert.type}}" - ng-mouseenter="hoverAlert(alert)" - ng-mouseleave="leaveAlert(alert)" - close="hideAlert(alert)"><span ng-attr-class="{{alert.icon}}"></span> <div class="alert-message" ng-bind-html="toHTML(alert.msg)"></div> </alert> -</div> - - -<div class="pool-persistent-alert"> - <alert ng-repeat="alert in data.persistentAlerts" - type="{{alert.type}}" - ng-mouseenter="hoverAlert(alert)" - ng-mouseleave="leaveAlert(alert)" - close="hideAlert(alert)"><span ng-attr-class="{{alert.icon}}"></span> <div class="alert-message" ng-bind-html="toHTML(alert.msg)"></div> </alert> -</div> - diff --git a/pollen-ui-angular/src/main/webapp/partials/big-poll.html b/pollen-ui-angular/src/main/webapp/partials/big-poll.html deleted file mode 100644 index 84b2e85..0000000 --- a/pollen-ui-angular/src/main/webapp/partials/big-poll.html +++ /dev/null @@ -1,79 +0,0 @@ -<!-- - #%L - Pollen :: UI (Angular) - %% - Copyright (C) 2009 - 2017 Code Lutin, Tony Chemit - %% - 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 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/>. - #L% - --> - -<div ng-repeat="choice in data.choices" class="row pollBigChoice"> - <div class="col-sm-10"> - - <div ng-click="showChoiceDesc = !showChoiceDesc" > - <div ng-if="choice.choiceType == 'TEXT'"> - <h3 edit-me="showEdit" ng-hide="showEdit" ng-mouseenter="showEditHover = true" ng-mouseleave="showEditHover = false"> - <button class="btn btn-default" ng-if="!globalVariables.voted && globalVariables.editMode" ng-show="showEditHover" ng-click="editChoice(choice)">...</button> - {{choice.name}} - </h3> - <h3 ng-show="showEdit"> - <input type="text" ng-model="choice.name" focus-me="showEdit" ng-exit="showEdit = false" auto-save="saveChoice(choice)" required/> - </h3> - </div> - - <div ng-if="choice.choiceType == 'DATE'"> - <h3 edit-me="showEdit" ng-hide="showEdit || isOpen" ng-mouseenter="showEditHover = true" ng-mouseleave="showEditHover = false"> - <button class="btn btn-default" ng-if="!globalVariables.voted && globalVariables.editMode" ng-show="showEditHover" ng-click="editChoice(choice)">...</button> - {{choice.date | date:globalVariables.dateFormat}} - </h3> - <h3 ng-show="showEdit || isOpen"> - <input type="text" ng-model="choice.date" - datepicker-popup="{{globalVariables.dateFormat}}" - is-open="isOpen" - focus-me="showEdit" - ng-exit="showEdit = false" - ng-click="isOpen = true" - auto-save="saveChoice(choice)" required/> - </h3> - </div> - </div> - <p collapse="!globalVariables.editMode && !showChoiceDesc" edit-me="showEditChoiceDesc" ng-hide="showEditChoiceDesc">{{choice.description}}</p> - <p ng-show="globalVariables.editMode && showEditChoiceDesc"> - <textarea ng-model="choice.description" focus-me="showEditChoiceDesc" ng-blur="showEditChoiceDesc = false" auto-save="saveChoice(choice)" cols="80" rows="8"></textarea> - </p> - </div> - <div class="col-sm-2 pollChoiceInput"> - <input type="checkbox" ng-model="data.vote.choice[$index].voteValue" name="{{data.vote.choice[$index].choiceId}}"/> - </div> -</div> - -<div class="row pollBigChoice"> - <div class="col-sm-10"> - <button class="btn btn-info" ng-click="addChoice()" ng-if="globalVariables.editMode" tooltip="{{ 'action.choice.add' | translate }}"><span class="fa fa-plus"></span> Ajouter un choix</button> - </div> - <div class="col-sm-2"> - <button ng-click="inlineVersion()" class="btn btn-default">inline version</button> - </div> -</div> - -<div class="row" ng-show="!globalVariables.editMode" ng-if="!data.poll.isClosed"> - <div class="col-sm-6"> </div> - <div class="col-sm-4"> - <input-error error="data.vote.restError.voterName[0]" data="data.vote.voterName"> - <input type="text" class="form-control" placeholder="{{ 'user.name' | translate }}" ng-model="data.vote.voterName" input-error="data.vote.restError.voterName[0]" /> - </input-error> - </div> - <div class="col-sm-2"> - <button class="btn btn-primary" ng-click="voter()">{{ 'action.vote' | translate }}</button> - </div> -</div> diff --git a/pollen-ui-angular/src/main/webapp/partials/dateTimePicker.html b/pollen-ui-angular/src/main/webapp/partials/dateTimePicker.html deleted file mode 100644 index 4dae5de..0000000 --- a/pollen-ui-angular/src/main/webapp/partials/dateTimePicker.html +++ /dev/null @@ -1,30 +0,0 @@ -<!-- - #%L - Pollen :: UI (Angular) - %% - Copyright (C) 2009 - 2017 Code Lutin, Tony Chemit - %% - 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 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/>. - #L% - --> -<div class="input-group date datetimepicker"> - <input type="text" class="form-control" focus-me="focus" ng-exit="exit()" id="{{forId}}" /> - <span class="input-group-addon datepickerbutton"> - <span></span> - </span> - <span class="input-group-addon" ng-click="remove()"> - <span class="fa fa-remove"></span> - </span> -</div> - diff --git a/pollen-ui-angular/src/main/webapp/partials/favoriteList-edit.html b/pollen-ui-angular/src/main/webapp/partials/favoriteList-edit.html deleted file mode 100644 index f42733a..0000000 --- a/pollen-ui-angular/src/main/webapp/partials/favoriteList-edit.html +++ /dev/null @@ -1,82 +0,0 @@ -<!-- - #%L - Pollen :: UI (Angular) - %% - Copyright (C) 2009 - 2017 Code Lutin, Tony Chemit - %% - 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 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/>. - #L% - --> - -<h1> {{ 'user.favoriteList' | translate }} </h1> - -<div> - <table class="voterList"> - <tr> - <th colspan="2" ng-class="{'has-success':data.favoriteList.id && !data.favoriteList.restError, 'has-error':data.favoriteList.restError.name}"> - <input type="text" - name="group" - ng-model="data.favoriteList.name" - placeholder="name group" - class="form-control" - tooltip="{{data.favoriteList.restError.name[0]}}" - auto-save="saveFavoriteList()" /> - </th> - <th class="action"> </th> - </tr> - - <tr> - <th> {{ 'poll.restricted.name' | translate }} </th> - <th> {{ 'poll.restricted.mail' | translate }} </th> - <th class="action"> </th> - </tr> - - <tr ng-repeat="member in data.favoriteList.members" ng-class="{'has-success':member.id && !member.restError}"> - <td> - <input-error error="member.restError.name[0]"> - <input type="text" ng-model="member.name" class="form-control" auto-save="saveMember(member)" /> - </input-error> - </td> - <td> - <input-error error="member.restError.email[0]"> - <input type="text" ng-model="member.email" class="form-control" auto-save="saveMember(member)" /> - </input-error> - </td> - <td class="action"><button class="btn btn-danger" ng-click="deleteMember(member);" tooltip="{{ 'action.favoriteList.deleteMember' | translate }} "><span class="fa fa-trash"></span></button></td> - </tr> - - <tr> - <th colspan="3" ng-show="data.favoriteListMemberPagination.lastPage > 0"> - <make-pagination current-page="data.favoriteListMemberPagination.currentPage" - last-page="data.favoriteListMemberPagination.lastPage" - page-size="data.favoriteListMemberPagination.pageSize"></make-pagination> - </th> - </tr> - - <tr> - <th class="cell-lg" colspan="3"> - <div> - <button class="btn btn-info" ng-click="addMember();"><span class="fa fa-plus"></span> {{ 'action.favoriteList.addMember' | translate }} </button> - <button class="btn btn-danger" ng-click="deleteFavoriteList();"><span class="fa fa-trash"></span> {{ 'action.favoriteList.delete' | translate }} </button> - </div> - <div> - <import-csv fv-id="data.favoriteList.id" ng-if="data.favoriteList.id"></import-csv> - </div> - </th> - </tr> - </table> - - <div class="text-right"> - <a href="#/favoriteList" class="btn btn-default"><span class="fa fa-return"></span> {{ 'action.return' | translate }}</a> - <button class="btn btn-info" ng-click="newFavoriteList()"><span class="fa fa-plus"></span> {{ 'action.favoriteList.add' | translate }}</button> - </div> -</div> diff --git a/pollen-ui-angular/src/main/webapp/partials/favoriteList-list.html b/pollen-ui-angular/src/main/webapp/partials/favoriteList-list.html deleted file mode 100644 index f885e1e..0000000 --- a/pollen-ui-angular/src/main/webapp/partials/favoriteList-list.html +++ /dev/null @@ -1,32 +0,0 @@ -<!-- - #%L - Pollen :: UI (Angular) - %% - Copyright (C) 2009 - 2017 Code Lutin, Tony Chemit - %% - 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 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/>. - #L% - --> - -<h1> {{ 'user.favoriteList' | translate }} </h1> - -<div> - <a href="#/favoriteList/new"><button class="btn btn-info"><span class="fa fa-plus"></span> {{ 'action.favoriteList.add' | translate }}</button></a> - <div ng-repeat="favList in data.favoriteList"> - <h2> <a href="#/favoriteList/{{favList.id}}">{{ favList.name }}</a></h2> - <hr/> - </div> - - <make-pagination current-page="data.favoriteListPagination.currentPage" - last-page="data.favoriteListPagination.lastPage" - page-size="data.favoriteListPagination.pageSize"></make-pagination> -</div> diff --git a/pollen-ui-angular/src/main/webapp/partials/home.html b/pollen-ui-angular/src/main/webapp/partials/home.html deleted file mode 100644 index 7803fd6..0000000 --- a/pollen-ui-angular/src/main/webapp/partials/home.html +++ /dev/null @@ -1,36 +0,0 @@ -<!-- - #%L - Pollen :: UI (Angular) - %% - Copyright (C) 2009 - 2017 Code Lutin, Tony Chemit - %% - 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 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/>. - #L% - --> - -<div class="jumbotron"> - <div class="container"> - <h1> - {{ 'home.title' | translate }} - </h1> - <p> - {{ 'home.description' | translate }} - </p> - <p class=""> - <a href="#/poll/create" class="btn btn-primary btn-lg"><span class="fa fa-plus-circle"></span> {{ 'home.newPoll' | translate }}</a> - <a href="#/user/register" class="btn btn-default btn-lg" ng-if="!isConnected"><span class="fa fa-users"></span> {{ 'home.register' | translate }} </a> - </p> - </div> -</div> - diff --git a/pollen-ui-angular/src/main/webapp/partials/inline-poll.html b/pollen-ui-angular/src/main/webapp/partials/inline-poll.html deleted file mode 100644 index 0e07792..0000000 --- a/pollen-ui-angular/src/main/webapp/partials/inline-poll.html +++ /dev/null @@ -1,156 +0,0 @@ -<!-- - #%L - Pollen :: UI (Angular) - %% - Copyright (C) 2009 - 2017 Code Lutin, Tony Chemit - %% - 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 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/>. - #L% - --> - - <table id="poll-inline"> -<!-- begin print choices --> - <tr> - <td class="static"> - <!--<button ng-click="bigVersion()" class="btn btn-default" >Big version</button>--> - </td> - <td ng-repeat="choice in data.choices" class="pollChoice pollAnim" ng-mouseenter="showEditHover = true" ng-mouseleave="showEditHover = false"> - - <div ng-if="choice.choiceType == 'TEXT'" edit-me="showEdit" > - - <div ng-hide="showEdit && ((data.poll.addChoiceAllowed && (choice.permission || !choice.id)) || globalVariables.editMode)" class="fixe-input" title="{{choice.description}}"> - {{ choice.choiceValue || ('poll.edit.choice' | translate) }} - <info-error error="choice.restError.choiceValue[0]" data="choice.choiceValue" append-class="fa-lg"></info-error> - <input type="button" class="btn btn-default" ng-if="(data.poll.choiceAddAllowed && (choice.permission || !choice.id)) || globalVariables.editMode" ng-show="showEditHover" ng-click="editChoice(choice, $event);" value="..."/> - </div> - - <div ng-show="showEdit && ((data.poll.addChoiceAllowed && (choice.permission || !choice.id)) || globalVariables.editMode)"> - <input type="text" class="form-control" ng-model="choice.choiceValue" focus-me="showEdit" ng-exit="showEdit = false;" auto-save="saveChoice(choice)" required/> - <input type="button" class="btn btn-default" data-toggle="modal" data-target="#popupAddChoice" ng-click="editChoice(choice, $event);" value="..."/> - </div> - - </div> - - <div ng-if="choice.choiceType == 'DATE'" edit-me="showEdit" > - - <div ng-hide="showEdit && (data.poll.addChoiceAllowed && (choice.permission || !choice.id) || globalVariables.editMode)" class="fixe-input" title="{{choice.description}}"> - {{ (choice.choiceValue | date:globalVariables.dateTimeFormat) || ('poll.edit.choice' | translate) }} - <info-error error="choice.restError.choiceValue[0]" data="choice.choiceValue" append-class="fa-lg"></info-error> - <input type="button" class="btn btn-default" ng-if="(data.poll.choiceAddAllowed && (choice.permission || !choice.id)) || globalVariables.editMode" ng-show="showEditHover" ng-click="editChoice(choice, $event);" value="..."/> - </div> - - <div ng-show="showEdit && (data.poll.choiceAddAllowed && (choice.permission || !choice.id) || globalVariables.editMode)" > - <datetimepicker ng-model="choice.choiceValue" focus="showEdit" ng-exit="showEdit = false" ng-save="saveChoice(choice)"></datetimepicker> - <input type="button" class="btn btn-default" data-toggle="modal" data-target="#popupAddChoice" ng-click="editChoice(choice, $event);" value="..."/> - </div> - - </div> - - <div ng-if="choice.choiceType == 'RESOURCE'"> - - <div class="fixe-input" title="{{choice.description}}"> - {{choice.choiceValue.meta.name}} - <info-error error="choice.restError.choiceValue[0]" data="choice.choiceValue" append-class="fa-lg"></info-error> - <input type="button" class="btn btn-default" ng-if="data.poll.choiceAddAllowed && (choice.permission || !choice.id) || globalVariables.editMode" ng-show="showEditHover" ng-click="editChoice(choice, $event);" value="..."/> - <br/> - <print-resource image="choice.choiceValue.id" meta="choice.choiceValue.meta"></print-resource> - - </div> - - </div> - </td> - <td ng-if="data.poll.choiceAddAllowed || globalVariables.editMode"><button class="btn btn-default btn-large" ng-click="addChoice()" tooltip="{{ 'action.choice.add' | translate }}"> <span class="fa fa-plus"></span> </button></td> - </tr> -<!-- end print choice --> - -<!-- begin input vote --> - <tr ng-if="!globalVariables.editMode && data.poll.canVote"> - <td class="pollChoice vote-input"> - <input-error error="data.vote.restError.voterName[0]" data="data.vote.voterName"> - <input type="text" class="form-control" placeholder="{{ 'user.name' | translate }}" ng-model="data.vote.voterName" input-error="data.vote.restError.voterName[0]" focus-me="true" /> - </input-error> - </td> - <td ng-repeat="choice in data.vote.choice" class="pollChoice" ng-click="toggleValue(choice, $event);"> - <input-error error="choice.restError[0]" data="choice.voteValue"> - <input type="{{data.voteCountingType.renderType}}" ng-class="{'form-control':(data.voteCountingType.renderType != 'checkbox')}" name="{{choice.choiceId}}" ng-model="choice.voteValue" ng-click="toggleValue(choice, $event);" /> - </input-error> - </td> - <td> - <input class="btn btn-primary btn-large" type="button" value="{{ 'action.vote' | translate }}" ng-click="voter()" /> - </td> - </tr> -<!-- end input vote --> - -<!-- begin print vote --> - <tr ng-if="!globalVariables.editMode" ng-repeat="vote in data.votants track by $index" class="pollAnim"> - <td class="pollChoice"> - <div class="text-muted" ng-hide="vote.onEdit"> - {{vote.voterName}} - </div> - <div ng-show="vote.onEdit"> - <input-error error="vote.restError.voterName[0]" data="vote.voterName"> - <input type="text" - class="form-control" - placeholder="{{ 'user.name' | translate }}" - ng-model="vote.voterName" - input-error="vote.restError.voterName[0]" /> - </input-error> - </div> - </td> - <td ng-repeat="choice in vote.choice" - class="pollChoice" - ng-click="toggleVoteValue(choice, vote.onEdit, $event);" - ng-class="{ - voteTrue:choice.voteValue != null, - voteFalse:(choice.voteValue == null || (choice.voteValue == false && data.voteCountingType.renderType == 'checkbox'))}"> - - <div ng-hide="vote.onEdit"> - <div ng-show="choice.id"> - <div ng-show="data.voteCountingType.renderType == 'checkbox'" > - <span class="fa fa-check text-success" ng-show="choice.voteValue"></span> - </div> - <div ng-show="data.voteCountingType.renderType != 'checkbox'"> - {{choice.voteValue}} - </div> - </div> - <div ng-hide="choice.id"> - <span class="fa fa-eye-slash text-danger" tooltip="{{ 'poll.info.vote.noViewChoice' | translate }}"></span> - </div> - </div> - <div ng-show="vote.onEdit"> - <input-error error="choice.restError[0]" data="choice.voteValue"> - <input type="{{data.voteCountingType.renderType}}" - ng-model="choice.voteValue" - ng-disabled="!vote.onEdit" - ng-click="toggleVoteValue(choice, vote.onEdit, $event);" /> - </input-error> - </div> - </td> - <td class="vote-action"> - <div ng-if="!data.poll.isClosed"> - <button class="btn btn-primary" ng-if="vote.permission && !globalVariables.editMode && vote.onEdit" ng-click="saveVote(vote)"> - <span class="fa fa-check"></span> - </button> - <button class="btn btn-default" ng-if="vote.permission && !globalVariables.editMode && vote.onEdit" ng-click="cancelVote(vote)"> - <span class="fa fa-remove"></span> - </button> - <button class="btn btn-info" ng-if="vote.permission && !globalVariables.editMode && !vote.onEdit" ng-click="editVote(vote)"> - <span class="fa fa-edit"></span> - </button> - <button class="btn btn-danger" ng-if="vote.permission && !globalVariables.editMode && !vote.onEdit" ng-click="deleteVote(vote)"> - <span class="fa fa-trash"></span> - </button> - </div> - </td> - </tr> -<!-- end print vote --> - </table> diff --git a/pollen-ui-angular/src/main/webapp/partials/pagination.html b/pollen-ui-angular/src/main/webapp/partials/pagination.html deleted file mode 100644 index 0db8f8c..0000000 --- a/pollen-ui-angular/src/main/webapp/partials/pagination.html +++ /dev/null @@ -1,33 +0,0 @@ -<!-- - #%L - Pollen :: UI (Angular) - %% - Copyright (C) 2009 - 2017 Code Lutin, Tony Chemit - %% - 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 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/>. - #L% - --> -<ul class="pagination" ng-show="pageList.length > 1"> - <li ng-class="{disabled:currentPage == 0}" ng-click="goPage(previousPage)"> - <a class="fakeLink">«</a> - </li> - - <li ng-repeat="page in pageList" ng-class="{active:currentPage == page}" ng-click="goPage(page)"> - <a class="fakeLink">{{page+1}}</a> - </li> - - <li ng-class="{disabled:currentPage == lastPage}" ng-click="goPage(nextPage)"> - <a class="fakeLink">»</a> - </li> -</ul> diff --git a/pollen-ui-angular/src/main/webapp/partials/poll-comment.html b/pollen-ui-angular/src/main/webapp/partials/poll-comment.html deleted file mode 100644 index a1f907a..0000000 --- a/pollen-ui-angular/src/main/webapp/partials/poll-comment.html +++ /dev/null @@ -1,96 +0,0 @@ -<!-- - #%L - Pollen :: UI (Angular) - %% - Copyright (C) 2009 - 2017 Code Lutin, Tony Chemit - %% - 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 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/>. - #L% - --> -<div> - <h1>{{ data.poll.title }}</h1> - - <button ng-click="comment.hideForm = false" class="btn btn-info"> - <span class="fa fa-plus"></span> {{ 'title.poll.comment' | translate }} - </button> - - <div ng-hide="comment.hideForm" style="margin-top: 10px;"> - - <!-- begin for add comment --> - <form class="form-horizontal" ng-submit="postComment()" novalidate> - <div class="form-group"> - <label class="col-sm-2"> {{ 'user.name' | translate }} </label> - <div class="col-sm-1"> - <info-error error="restError['author.name'][0]" data="comment.authorName" append-class="fa-2x"></info-error> - </div> - <div class="col-sm-9"> - <input type="text" ng-model="comment.authorName" class="form-control" focus-me="comment.id != null || restError['author.name'] !== undefined" /> - </div> - </div> - - <div class="form-group"> - <label class="col-sm-2"> {{ 'comment' | translate }} </label> - <div class="col-sm-1"><info-error error="restError.text[0]" data="comment.text" append-class="fa-2x"></info-error></div> - <div class="col-sm-9"> - <textarea ck-editor ng-model="comment.text" focus-me="comment.id != null || restError.text[0] !== undefined"></textarea> - </div> - </div> - - <div class="form-group"> - <div class="col-sm-3"> - </div> - <div class="col-sm-9"> - <button type="submit" class="btn btn-primary" ng-hide="comment.id"><span class="fa fa-comment"></span> {{ 'action.comment' | translate }}</button> - <button type="submit" class="btn btn-primary" ng-show="comment.id"><span class="fa fa-pencil-square-o"></span> {{ 'action.edit' | translate }}</button> - <a class="btn btn-danger" ng-click="comment.hideForm = true; comment.text = ''"> - <span class="fa fa-times"></span> {{ 'action.cancel' | translate }} - </a> - </div> - </div> - </form> - <!-- end form comment --> - </div> - - <!-- begin print comments --> - <h2> - {{ 'title.poll.comments' | translate }} - <a class="fakeLink" - ng-click="toggleOrder()" - ng-show="data.comments" - tooltip="{{ desc ? ('comment.order.toAsc' | translate) : ('comment.order.toDesc' | translate) }}"> - <span ng-class="desc ? 'fa fa-sort-amount-asc' : 'fa fa-sort-amount-desc'"></span> - </a> - </h2> - <span ng-if="data.comments.length == 0">{{ 'poll.noComment' | translate }}</span> - <table id="comments"> - <tr ng-repeat="comment in data.comments"> - <td> - <span class="fa fa-user"></span> {{comment.authorName}}<br/> - <span class="fa fa-calendar-o"></span> {{comment.postDate | date:globalVariables.dateTimeFormat}}<br/> - <a class="fakeLink" ng-click="editPost(comment)" ng-if="comment.permission" title="{{ 'comment.edit' | translate }}"> - <span class="fa fa-pencil-square-o" ng-show="comment.id"></span> - </a> - <a class="fakeLink" ng-click="deletePost(comment)" ng-if="comment.permission" title="{{ 'comment.delete' | translate }}"> - <span class="fa fa-trash danger" ng-show="comment.id"></span> - </a> - </td> - <td> - <div ng-bind-html="toHTML(comment.text)"></div> - </td> - </tr> - </table> - <!-- end print comments --> - - <make-pagination current-page="data.commentsPagination.currentPage" - last-page="data.commentsPagination.lastPage" - page-size="pageSize"></make-pagination> -</div> diff --git a/pollen-ui-angular/src/main/webapp/partials/poll-info.html b/pollen-ui-angular/src/main/webapp/partials/poll-info.html deleted file mode 100644 index 65187a1..0000000 --- a/pollen-ui-angular/src/main/webapp/partials/poll-info.html +++ /dev/null @@ -1,70 +0,0 @@ -<!-- - #%L - Pollen :: UI (Angular) - %% - Copyright (C) 2009 - 2017 Code Lutin, Tony Chemit - %% - 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 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/>. - #L% - --> - -<div ng-if="data.poll.isClosed" class="anim"> - <h4 class="text-warning">{{ 'poll.info.closed' | translate }}</h4> -</div> - -<div ng-if="!data.poll.isClosed && data.poll.endDate && data.poll.endDate <= now" class="anim"> - <h4 class="text-warning">{{ 'poll.info.timeoutVote' | translate:{'time':timeOfEndVote} }}</h4> -</div> - -<div ng-if="!data.poll.isClosed && data.poll.beginDate >= now" class="anim"> - <h4>{{ 'poll.info.beginVote' | translate:{'time':timeToBeginVote} }}</h4> -</div> - -<div ng-if="!data.poll.isClosed && data.poll.endDate && data.poll.beginDate < data.poll.endDate && timeToEndVote.value < 100" class="anim"> - <h4>{{ 'poll.info.endVote' | translate:{'time':timeToEndVote.label} }}</h4> - <div ng-if="timeToEndVote.value > 0" class="anim"> - <progressbar max="100" value="timeToEndVote.value" type="{{timeToEndVote.type}}"></progressbar> - </div> -</div> - -<div ng-if="!data.poll.isClosed && !data.poll.endDate" class="anim"> - <h4>{{ 'poll.info.noEndDate' | translate }}</h4> -</div> - -<div ng-if="!data.poll.isClosed && data.poll.choiceAddAllowed && data.poll.beginChoiceDate >= now" class="anim"> - <h4>{{ 'poll.info.beginAddChoiceAllowed' | translate:{'time':timeToBeginAddChoice} }}</h4> -</div> - -<div ng-if="!data.poll.isClosed && data.poll.choiceAddAllowed && timeToAddChoice.value < 100" class="anim"> - <h4>{{ 'poll.info.endAddChoiceAllowed' | translate:{'time':timeToAddChoice.label} }}</h4> - <div ng-if="timeToAddChoice.value > 0" class="anim"> - <progressbar max="100" value="timeToAddChoice.value" type="{{timeToAddChoice.type}}"></progressbar> - </div> -</div> - -<div ng-if="!data.poll.isClosed && data.poll.choiceAddAllowed && (!data.poll.endChoiceDate || data.poll.endChoiceDate > data.poll.beginDate)" class="anim"> - <h4>{{ 'poll.info.addChoiceAllowed.waring' | translate }}</h4> - <p> - {{ 'poll.info.addChoiceAllowed.waring.help' | translate }} - </p> -</div> - -<div ng-if="!data.poll.isClosed && data.poll.limitedVote && data.poll.maxChoiceNumber > 0" class="anim"> - <h4>{{ 'poll.info.limitedChoice' | translate:{'nb':data.poll.maxChoiceNumber} }}</h4> -</div> - -<div ng-if="data.voteCountingType" class="anim"> - <h4>{{ 'poll.info.voteCountingType' | translate:{'name':data.voteCountingType.name} }}</h4> - <p ng-bind-html="toHTML(data.voteCountingType.helper)"></p> -</div> diff --git a/pollen-ui-angular/src/main/webapp/partials/poll-link.html b/pollen-ui-angular/src/main/webapp/partials/poll-link.html deleted file mode 100644 index d2a1ef1..0000000 --- a/pollen-ui-angular/src/main/webapp/partials/poll-link.html +++ /dev/null @@ -1,90 +0,0 @@ -<!-- - #%L - Pollen :: UI (Angular) - %% - Copyright (C) 2009 - 2017 Code Lutin, Tony Chemit - %% - 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 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/>. - #L% - --> - -<ul> - <li class="toMini" ng-click="toggleMinify()"> - <a class="fakeLink" ng-show="globalVariables.minify" title="{{ 'poll.link.toMaxify' | translate }}"><span class="fa fa-chevron-right"></span></a> - <a class="fakeLink" ng-hide="globalVariables.minify" title="{{ 'poll.link.toMinify' | translate }}"><span class="fa fa-chevron-left"></span></a> - </li> - - <li ng-if="! data.poll.isClosed"> - <a href="{{globalVariables.linkVote}}"> - <span class="fa fa-link" title="{{ 'poll.link.vote' | translate }}"></span> - <span class="text">{{ 'poll.link.vote' | translate }}</span> - </a> - <input type="text" select-on-click value="{{globalVariables.linkVote}}" readonly class="form-control input-mini"/> - </li> - - <li ng-if="data.poll.resultIsVisible"> - <a href="{{globalVariables.linkResult}}"> - <span class="fa fa-bar-chart-o" title="{{ 'poll.link.result' | translate }}"></span> - <span class="text">{{ 'poll.link.result' | translate }}</span> - </a> - <input type="text" select-on-click value="{{globalVariables.linkResult}}" readonly class="form-control input-mini"/> - </li> - - <li ng-if="data.poll.commentIsVisible"> - <a href="{{globalVariables.linkComment}}"> - <span class="fa fa-comments-o"></span> - <span class="text">{{ 'poll.link.comment' | translate }}</span> - </a> - </li> - -</ul> - -<ul ng-if="data.poll.permission"> - <li> - <a href="{{globalVariables.linkEdit}}"> - <span class="fa fa-pencil-square-o" title="{{ 'poll.link.edit' | translate }}"></span> - <span class="text">{{ 'poll.link.edit' | translate }}</span> - </a> - <input type="text" select-on-click value="{{globalVariables.linkEdit}}" readonly class="form-control input-mini"/> - </li> - - <li> - <a class="fakeLink" ng-click="clonePoll()" href=""> - <span class="fa fa-refresh" title="{{ 'poll.link.clone' | translate }}"></span> - <span class="text">{{ 'poll.link.clone' | translate }}</span> - </a> - </li> - - <li> - <a class="fakeLink"> - <span class="fa fa-share-square-o" title="{{ 'poll.link.export' | translate }}"></span> - <span class="text">{{ 'poll.link.export' | translate }} (disabled)</span> - </a> - </li> -</ul> - -<ul ng-if="data.poll.permission"> - <li ng-if="!data.poll.isClosed"> - <a class="fakeLink danger" href="" ng-click="closePoll()"> - <span class="fa fa-remove" title="{{ 'poll.link.close' | translate }}"></span> - <span class="text">{{ 'poll.link.close' | translate }}</span> - </a> - </li> - - <li> - <a class="fakeLink danger" href="" ng-click="deletePoll()"> - <span class="fa fa-trash" title="{{ 'poll.link.delete' | translate }}"></span> - <span class="text">{{ 'poll.link.delete' | translate }}</span> - </a> - </li> -</ul> - diff --git a/pollen-ui-angular/src/main/webapp/partials/poll-list.html b/pollen-ui-angular/src/main/webapp/partials/poll-list.html deleted file mode 100644 index 7dbbb6d..0000000 --- a/pollen-ui-angular/src/main/webapp/partials/poll-list.html +++ /dev/null @@ -1,46 +0,0 @@ -<!-- - #%L - Pollen :: UI (Angular) - %% - Copyright (C) 2009 - 2017 Code Lutin, Tony Chemit - %% - 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 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/>. - #L% - --> - -<div ng-if="!data.polls[0]"><h1>{{ 'poll.error.listEmpty' | translate }}</h1></div> - -<table class="table table-hover"> - <tr ng-repeat="poll in data.polls" ng-class="{'active':poll.selected}" ng-click="toggleSelect(poll, $event)"> - <td style="vertical-align:middle"> - <input type="checkbox" ng-model="poll.selected" ng-click="toggleSelect(poll, $event)"/> - </td> - <td> - <h2><a href="#/poll/vote/{{poll.id}}">{{poll.title}}</a></h2> - </td> - <td> - <div ng-bind-html="toHTML(poll.description)"></div> - </td> - </tr> - <tr ng-show="data.polls.length > 0"> - <td colspan="3"> - <button class="btn btn-default" ng-click="selectAll()"><span class="fa fa-check-square-o"></span> {{ 'action.selectAll' | translate }}</button> - <button class="btn btn-default" ng-click="unselectAll()"><span class="fa fa-square-o"></span> {{ 'action.unselectAll' | translate }}</button> - <button class="btn btn-default" ng-click="toggleSelectAll()"><span class="fa fa-check-square"></span> {{ 'action.toggleSelectAll' | translate }}</button> - <button class="btn btn-danger" ng-click="deleteSelected()" ng-if="globalVariables.hasAllRight"><span class="fa fa-trash"></span> {{ 'action.deleteSelected' | translate }}</button> - </td> - </tr> -</table> - -<make-pagination current-page="data.pollsPagination.currentPage" - last-page="data.pollsPagination.lastPage" - page-size="data.pollsPagination.pageSize"></make-pagination> diff --git a/pollen-ui-angular/src/main/webapp/partials/poll-listParticipant.html b/pollen-ui-angular/src/main/webapp/partials/poll-listParticipant.html deleted file mode 100644 index 61eaed8..0000000 --- a/pollen-ui-angular/src/main/webapp/partials/poll-listParticipant.html +++ /dev/null @@ -1,117 +0,0 @@ -<!-- - #%L - Pollen :: UI (Angular) - %% - Copyright (C) 2009 - 2017 Code Lutin, Tony Chemit - %% - 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 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/>. - #L% - --> -<h1>{{data.poll.title}}</h1> -<h2> - {{ 'poll.restricted.pollType' | translate }} - <info-error error="restError.pollType" data="data.poll.pollType" append-class="fa-lg"></info-error> -</h2> -<div> - <label for="formFree"> - <input type="radio" ng-model="data.poll.pollType" name="type" value="FREE" id="formFree" auto-save="autoSavePoll()"/> - {{ 'poll.restricted.free' | translate }} - </label> - <label for="formRestricted"> - <input type="radio" ng-model="data.poll.pollType" name="type" value="RESTRICTED" id="formRestricted" auto-save="autoSavePoll()"/> - {{ 'poll.restricted.restricted' | translate }} - </label> - <label for="formGroup"> - <input type="radio" ng-model="data.poll.pollType" name="type" value="GROUP" id="formGroup" auto-save="autoSavePoll()"/> - {{ 'poll.restricted.group' | translate }} - </label> - - - - <div class="container-fluid" ng-hide="data.poll.pollType == 'FREE'"> - <hr/> - - <div class="row"> - <button class="btn btn-info" ng-show="data.poll.pollType == 'GROUP'" ng-click="addGroup()"><span class="fa fa-plus"></span> {{ 'action.restricted.addGroup' | translate }}</button> - <button class="btn btn-warning" disabled><span class="fa fa-envelope"></span> {{ 'action.restricted.notify' | translate }}</button> - </div> - - <div class="row" ng-if="data.favoriteList"> - <hr/> - </div> - - <div class="row text-right" ng-if="data.favoriteList"> - <div class="col-sm-6"> - <h4>{{ 'user.favoriteList' | translate }}</h4> - </div> - <div class="col-sm-6"> - <select class="form-control" - ng-model="data.favoriteListImport" - ng-options="favList.id as favList.name for favList in data.favoriteList"> - </select> - </div> - </div> - - <hr/> - </div> - - - - <table ng-repeat="voterList in data.voterList" class="voterList" ng-hide="data.poll.pollType == 'FREE'"> - - <tr ng-show="data.poll.pollType == 'GROUP'" ng-class="{'has-success':voterList.group.id && !voterList.group.restError}"> - <th colspan="2"> - <input-error error="voterList.group.restError.name[0]"> - <input type="text" name="group" placeholder="name group" ng-model="voterList.group.name" class="form-control" auto-save="saveVoterList(voterList)" focus-me="!voterList.group.id"/> - </input-error> - </th> - <th class="weight" ng-class="{'has-error':voterList.group.restError.weight}"> <input type="number" step="0.1" min="0" ng-model="voterList.group.weight" select-on-click class="form-control" auto-save="saveVoterList(voterList)" /> </th> - <th class="action"> </th> - </tr> - - <tr> - <th> {{ 'poll.restricted.name' | translate }} </th> - <th> {{ 'poll.restricted.mail' | translate }} </th> - <th> {{ 'poll.restricted.weight' | translate }} </th> - <th class="action"> </th> - </tr> - - <tr ng-repeat="member in voterList.members" ng-class="{'has-success':member.id && !member.restError}"> - <td> - <input-error error="member.restError.name[0]"> - <input type="text" ng-model="member.name" class="form-control" auto-save="saveVoterListMember(member, voterList)"/> - </input-error> - </td> - <td> - <input-error error="member.restError.email[0]"> - <input type="text" ng-model="member.email" class="form-control" auto-save="saveVoterListMember(member, voterList)" /> - </input-error> - </td> - <td class="weight"> - <input-error error="member.restError.weight[0]"> - <input type="number" step="0.1" min="0" ng-model="member.weight" select-on-click class="form-control" auto-save="saveVoterListMember(member, voterList)"/> - </input-error> - </td> - <td class="action"> - <button class="btn btn-danger" ng-click="deleteVoterListMember(member, voterList);" tooltip="{{ 'action.restricted.deleteVoter' | translate }}"><span class="fa fa-trash"></span></button> - </td> - </tr> - - <tr> - <th colspan="4"> - <button class="btn btn-info" ng-click="addVoter($index);"> <span class="fa fa-plus"></span> {{ 'action.restricted.addVoter' | translate }} </button> - <button class="btn btn-danger" ng-click="deleteVoterList(voterList);"> <span class="fa fa-trash"></span> {{ 'action.restricted.deleteGroup' | translate }} </button> - <button class="btn btn-info" ng-click="importFavoriteList(voterList)" ng-if="data.favoriteList"><span class="fa fa-save"></span> {{ 'action.favoriteList.import.inGroup' | translate }}</button> - </th> - </tr> - </table> -</div> diff --git a/pollen-ui-angular/src/main/webapp/partials/poll-poll.html b/pollen-ui-angular/src/main/webapp/partials/poll-poll.html deleted file mode 100644 index 556ef74..0000000 --- a/pollen-ui-angular/src/main/webapp/partials/poll-poll.html +++ /dev/null @@ -1,45 +0,0 @@ -<!-- - #%L - Pollen :: UI (Angular) - %% - Copyright (C) 2009 - 2017 Code Lutin, Tony Chemit - %% - 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 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/>. - #L% - --> -<div class="pollTitle" edit-me="showEditTitle" novalidate> - <h1 ng-hide="globalVariables.editMode"> - <span>{{data.poll.title}}</span> - <info-error error="restError.title[0]" data="data.poll.title" append-class="fa-lg"></info-error> - </h1> - - <div ng-show="globalVariables.editMode"> - <label class="control-label">{{'poll.edit.title' | translate}}</label> - <input type="text" class="form-control" focus-me="showEditTitle" ng-model="data.poll.title" ng-exit="showEditTitle = false" auto-save="autoSavePoll()" required/> - </div> -</div> - -<div ng-include="'./partials/poll-info.html'" ng-controller="PollInfoCtrl" class="poll-info"></div> - -<div ng-hide="globalVariables.editMode" class="pollDesc"> - <div ng-bind-html="toHTML(data.poll.description)"></div> -</div> -<div ng-show="globalVariables.editMode" class="pollDesc"> - <label class="control-label">{{'poll.edit.description' | translate}}</label> - <textarea id="descEditor" data-ck-editor ng-model="data.poll.description"></textarea> -</div> - -<div id="poll"> - - <div ng-include="templateURL"></div> - -</div> diff --git a/pollen-ui-angular/src/main/webapp/partials/poll-popupChoice.html b/pollen-ui-angular/src/main/webapp/partials/poll-popupChoice.html deleted file mode 100644 index 3029fcc..0000000 --- a/pollen-ui-angular/src/main/webapp/partials/poll-popupChoice.html +++ /dev/null @@ -1,76 +0,0 @@ -<!-- - #%L - Pollen :: UI (Angular) - %% - Copyright (C) 2009 - 2017 Code Lutin, Tony Chemit - %% - 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 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/>. - #L% - --> - -<form class="form-horizontal"> - <div class="modal-header"> - <h4 class="modal-title">{{ title | translate }}</h4> - </div> - <div class="modal-body"> - - <div class="form-group"> - <label class="col-sm-4 control-label">{{ 'poll.popupChoice.choiceType.label' | translate }}</label> - - <div class="col-sm-8 btn-group"> - <button type="button" class="btn btn-default" ng-model="choice.choiceType" btn-radio="'TEXT'">{{ 'poll.popupChoice.text.label' | translate }}</button> - <button type="button" class="btn btn-default" ng-model="choice.choiceType" btn-radio="'DATE'">{{ 'poll.popupChoice.date.label' | translate }}</button> - <button type="button" class="btn btn-default" ng-model="choice.choiceType" btn-radio="'RESOURCE'">{{ 'poll.popupChoice.resource.label' | translate }}</button> - </div> - </div> - - <div class="form-group" ng-if="choice.choiceType == 'TEXT'"> - <label for="popChoiceText" class="col-sm-4 control-label">{{ 'poll.popupChoice.text.value' | translate }}</label> - - <div class="col-sm-6"> - <input id="popChoiceText" type="text" ng-model="choice.choiceValueText" class="form-control" focus-me="choice.choiceType == 'TEXT'"/> - </div> - </div> - - <div class="form-group" ng-if="choice.choiceType == 'DATE'"> - <label class="col-sm-4 control-label">{{ 'poll.popupChoice.date.value' | translate }}</label> - - <div class="col-sm-6"> - <datetimepicker ng-model="choice.choiceValueDate" focus="choice.choiceType == 'DATE'" ></datetimepicker> - </div> - </div> - - <div class="form-group" ng-if="choice.choiceType == 'RESOURCE'"> - <label class="col-sm-4 control-label">{{ 'poll.popupChoice.resource.value' | translate }}</label> - - <div class="col-sm-6"> - <upload-file ng-model="choice.choiceValueImage"></upload-file> - - </div> - </div> - - <div class="form-group"> - <label for="popDescChoice" class="col-sm-4 control-label">{{ 'poll.popupChoice.description.label' | translate }}</label> - - <div class="col-sm-6"> - <textarea id="popDescChoice" type="text" ng-model="choice.description" class="form-control"></textarea> - </div> - </div> - </div> - <div class="modal-footer"> - <button type="button" class="btn btn-danger" ng-if="choice.choiceIsDeletable" ng-click="deleteChoice(choice)"><span class="fa fa-trash"></span> {{ 'action.delete' | translate }}</button> - <button type="button" class="btn btn-default" ng-click="cancelChoice()"><span class="fa fa-remove"></span> {{ 'action.cancel' | translate }}</button> - <button type="button" class="btn btn-primary" ng-click="saveChoice()"><span class="fa fa-save"></span> {{ 'action.save' | translate }}</button> - <!--<button type="button" class="btn btn-success" ng-click="saveChoice()"><span class="fa fa-save"></span> Sauvegarder</button>--> - <!--<button type="button" class="btn btn-primary" ng-click="saveChoiceAndContinue()"><span class="fa fa-save"></span> Sauvegarder et nouveau</button>--> - </div> -</form> diff --git a/pollen-ui-angular/src/main/webapp/partials/poll-result.html b/pollen-ui-angular/src/main/webapp/partials/poll-result.html deleted file mode 100644 index daa13c9..0000000 --- a/pollen-ui-angular/src/main/webapp/partials/poll-result.html +++ /dev/null @@ -1,89 +0,0 @@ -<!-- - #%L - Pollen :: UI (Angular) - %% - Copyright (C) 2009 - 2017 Code Lutin, Tony Chemit - %% - 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 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/>. - #L% - --> - -<h1>{{data.poll.title}}</h1> - -<h2> <ng-pluralize count="data.result.nbVotants" when="translateTitle"></ng-pluralize> </h2> - -<div ng-if="data.result.nbVotants > 0"> - -<hr/> -<div> - <button class="btn btn-default" ng-click="plot = 'chart'"><img src="img/chart-icon.png" /></button> - <button class="btn btn-default" ng-click="plot = 'pie'"><img src="img/pie-icon.png" /></button> -</div> -<div class="plot"> - <div ng-if="plot == 'chart'"> - <chart data="data.result.scoresChart"></chart> - </div> - <div ng-if="plot == 'pie'"> - <pie data="data.result.scoresChart"></pie> - </div> -</div> -<hr/> -<table class="table-result"> - <tr> - <th>{{ 'poll.result.choice' | translate }}</th> - <th>{{ 'poll.result.score' | translate }}</th> - </tr> - <tr ng-repeat="score in data.result.scores"> - <th> {{ score.choice.choiceValue.meta.name || (score.choice.choiceValue | date:globalVariables.dateTimeFormat) || score.choice.choiceValue }} </th> - <td> - {{score.scoreValue}} - </td> - </tr> -</table> - -</div> - -<div ng-if="data.groupResult"> - <div ng-repeat="result in data.groupResult"> - <hr/> - <h3> - <ng-pluralize count="result.nbVotants" when="translateTitleGroup"></ng-pluralize> - </h3> - <div> - <button class="btn btn-default" ng-click="plot = 'chart'"><img src="img/chart-icon.png" /></button> - <button class="btn btn-default" ng-click="plot = 'pie'"><img src="img/pie-icon.png" /></button> - </div> - <div class="plot"> - <div ng-if="plot == 'chart'"> - <chart data="result.scoresChart"></chart> - </div> - <div ng-if="plot == 'pie'"> - <pie data="result.scoresChart"></pie> - </div> - </div> - <hr/> - - <table class="table-result"> - <tr> - <th>{{ 'poll.result.choice' | translate }}</th> - <th>{{ 'poll.result.score' | translate }}</th> - </tr> - <tr ng-repeat="score in result.scores"> - <th> {{ score.choice.choiceValue.meta.name || (score.choice.choiceValue | date:globalVariables.dateTimeFormat) || score.choice.choiceValue }} </th> - <td> - {{score.scoreValue}} - </td> - </tr> - </table> - - </div> -</div> diff --git a/pollen-ui-angular/src/main/webapp/partials/poll-settings.html b/pollen-ui-angular/src/main/webapp/partials/poll-settings.html deleted file mode 100644 index fbc3fb2..0000000 --- a/pollen-ui-angular/src/main/webapp/partials/poll-settings.html +++ /dev/null @@ -1,307 +0,0 @@ -<!-- - #%L - Pollen :: UI (Angular) - %% - Copyright (C) 2009 - 2017 Code Lutin, Tony Chemit - %% - 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 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/>. - #L% - --> -<h1>{{data.poll.title}}</h1> -<form class="form-horizontal" novalidate> - <h4>{{ 'poll.config.title.creator' | translate }}</h4> - - <div class="form-group row"> - <label class="col-sm-4 control-label" for="formCreatorName"> - {{ 'poll.config.label.creatorName' | translate }} - </label> - <div class="col-sm-6"> - <input-error error="restError['creator.name'][0]" data="data.poll.creatorName"> - <input type="text" class="form-control" id="formCreatorName" ng-model="data.poll.creatorName" auto-save="autoSavePoll()" /> - </input-error> - </div> - <div class="col-sm-2"> - <info-error error="restError['creator.name'][0]" append-class="fa-2x"></info-error> - </div> - </div> - - <div class="form-group row"> - <label class="col-sm-4 control-label" for="formCreatorEmail"> - {{ 'poll.config.label.creatorEmail' | translate }} - </label> - <div class="col-sm-6"> - <input-error error="restError['creator.email'][0]" data="data.poll.creatorEmail"> - <input type="text" class="form-control" id="formCreatorEmail" ng-model="data.poll.creatorEmail" auto-save="autoSavePoll()" /> - <span class="text-help">{{ 'poll.config.label.creatorEmail.help' | translate }}</span> - </input-error> - </div> - <div class="col-sm-2"> - <info-error error="restError['creator.email'][0]" append-class="fa-2x"></info-error> - </div> - </div> - - <h4>{{ 'poll.config.title.poll' | translate }}</h4> - - <div class="form-group row"> - <label class="col-sm-4 control-label" for="formBeginDate">{{ 'poll.config.label.beginDate' | translate }}</label> - <div class="col-sm-6"> - <input-error error="restError.beginDate[0]" data="data.poll.beginDate"> - <datetimepicker min-date="globalVariables.toDay" - max-date="data.poll.endDate" - ng-model="data.poll.beginDate" - auto-save="autoSavePoll()" - for-id="formBeginDate"></datetimepicker> - </input-error> - </div> - <div class="col-sm-2"> - <info-error error="restError.beginDate[0]" data="data.poll.beginDate" append-class="fa-2x"></info-error> - </div> - </div> - - <div class="form-group row"> - <label class="col-sm-4 control-label" for="formEndDate">{{ 'poll.config.label.endDate' | translate }}</label> - <div class="col-sm-6"> - <input-error error="restError.endDate[0]" data="data.poll.endDate"> - <datetimepicker min-date="data.poll.beginDate" - ng-model="data.poll.endDate" - auto-save="autoSavePoll()" - for-id="formEndDate"></datetimepicker> - </input-error> - </div> - <div class="col-sm-2"> - <info-error error="restError.endDate[0]" data="data.poll.endDate" append-class="fa-2x"></info-error> - </div> - </div> - - <div class="form-group row"> - <label class="col-sm-4 control-label"> - {{ 'poll.config.label.resultVisibility' | translate }} - </label> - <div class="col-sm-6"> - <label class="label-block"> - <input type="radio" - ng-model="data.poll.resultVisibility" - name="resultVisibility" - value="EVERYBODY" - auto-save="autoSavePoll()" /> - {{ 'poll.config.value.visibility.everybody' | translate }} - </label> - - <label class="label-block"> - <input type="radio" - ng-model="data.poll.resultVisibility" - name="resultVisibility" - value="VOTER" - auto-save="autoSavePoll()" /> - {{ 'poll.config.value.visibility.voter' | translate }} - </label> - - <label class="label-block"> - <input type="radio" - ng-model="data.poll.resultVisibility" - name="resultVisibility" - value="CREATOR" - auto-save="autoSavePoll()" /> - {{ 'poll.config.value.visibility.creator' | translate }} - </label> - </div> - <div class="col-sm-2"> - <info-error error="restError.resultVisibility[0]" data="data.poll.resultVisibility" append-class="fa-2x"></info-error> - </div> - </div> - - <div class="form-group row"> - <label class="col-sm-4 control-label" for="formContinuousResults"> - {{ 'poll.config.label.continuousResults' | translate }} - </label> - <div class="col-sm-6"> - <input type="checkbox" id="formContinuousResults" ng-model="data.poll.continuousResults" auto-save="autoSavePoll()" /> - </div> - <div class="col-sm-2"></div> - </div> - - <h4>{{ 'poll.config.title.choice' | translate }}</h4> - - <div class="form-group row"> - <label class="col-sm-4 control-label" for="formChoiceAddAllowed"> - {{ 'poll.config.label.choiceAddAllowed' | translate }} - </label> - <div class="col-sm-6 btn-group"> - <input type="checkbox" id="formChoiceAddAllowed" ng-model="data.poll.choiceAddAllowed" auto-save="autoSavePoll()" /> - </div> - <div class="col-sm-2"></div> - </div> - - <div class="form-group row" ng-show="data.poll.choiceAddAllowed"> - <label class="col-sm-4 control-label" for="beginChoiceDate"> - {{ 'poll.config.label.beginChoiceDate' | translate }} - </label> - <div class="col-sm-6"> - <input-error error="restError.beginChoiceDate[0]" data="data.poll.beginChoiceDate"> - <datetimepicker max-date="data.poll.endChoiceDate" - ng-model="data.poll.beginChoiceDate" - auto-save="autoSavePoll()" for-id="beginChoiceDate"></datetimepicker> - </input-error> - </div> - <div class="col-sm-2"> - <info-error error="restError.beginChoiceDate[0]" data="data.poll.beginChoiceDate" append-class="fa-2x"></info-error> - </div> - </div> - <div class="form-group row" ng-if="data.poll.choiceAddAllowed"> - <label class="col-sm-4 control-label" for="endChoiceDate"> - {{ 'poll.config.label.endChoiceDate' | translate }} - </label> - <div class="col-sm-6"> - <input-error error="restError.endChoiceDate[0]" data="data.poll.endChoiceDate"> - <datetimepicker min-date="data.poll.beginChoiceDate" - max-date="data.poll.endDate" - ng-model="data.poll.endChoiceDate" - auto-save="autoSavePoll()" - for-id="endChoiceDate"></datetimepicker> - </input-error> - </div> - <div class="col-sm-2"> - <info-error error="restError.endChoiceDate[0]" data="data.poll.endChoiceDate" append-class="fa-2x"></info-error> - </div> - </div> - - <div class="form-group row"> - <label class="col-sm-4 control-label" for="formLimitedVote"> - {{ 'poll.config.label.limitedVote' | translate }} - </label> - <div class="col-sm-6"> - <input type="checkbox" id="formLimitedVote" ng-model="data.poll.limitedVote" auto-save="autoSavePoll()" /> - </div> - <div class="col-sm-2"></div> - </div> - <div class="form-group row" ng-show="data.poll.limitedVote"> - <label class="col-sm-4 control-label" for="popMaxChoiceNumber">{{ 'poll.config.label.maxChoiceNumber' | translate }}</label> - <div class="col-sm-6"> - <input-error error="restError.maxChoiceNumber[0]" data="data.poll.maxChoiceNumber"> - <input type="number" min="1" step="1" class="form-control" id="popMaxChoiceNumber" ng-model="data.poll.maxChoiceNumber" auto-save="autoSavePoll()" /> - </input-error> - </div> - <div class="col-sm-2"> - <info-error error="restError.maxChoiceNumber[0]" data="data.poll.maxChoiceNumber" append-class="fa-2x"></info-error> - </div> - </div> - - <h4>{{ 'poll.config.title.vote' | translate }}</h4> - - <div class="form-group row"> - <label class="col-sm-4 control-label"> - {{ 'poll.config.label.voteCountingType' | translate }} - </label> - <div class="col-sm-6"> - <label class="label-block" ng-repeat="voteCountingType in data.allVoteCountingType"> - <input type="radio" - ng-model="data.poll.voteCountingType" - value="{{voteCountingType.id}}" - auto-save="autoSavePoll()" /> - {{voteCountingType.name}} - </label> - <hr/> - <p ng-bind-html="toHTML(data.voteCountingType.helper)"></p> - </div> - <div class="col-sm-2"> - <info-error error="restError.voteCountingType[0]" data="data.poll.voteCountingType" append-class="fa-2x"></info-error> - </div> - </div> - - <div class="form-group row"> - <label class="col-sm-4 control-label"> - {{ 'poll.config.label.voteVisibility' | translate }} - </label> - <div class="col-sm-6"> - <label class="label-block"> - <input type="radio" - ng-model="data.poll.voteVisibility" - auto-save="autoSavePoll()" - value="EVERYBODY" /> - {{ 'poll.config.value.visibility.everybody' | translate }} - </label> - - <label class="label-block"> - <input type="radio" - ng-model="data.poll.voteVisibility" - auto-save="autoSavePoll()" - value="VOTER" /> - {{ 'poll.config.value.visibility.voter' | translate }} - </label> - - <label class="label-block"> - <input type="radio" - ng-model="data.poll.voteVisibility" - auto-save="autoSavePoll()" - value="CREATOR" /> - {{ 'poll.config.value.visibility.creator' | translate }} - </label> - - <label class="label-block"> - <input type="radio" - ng-model="data.poll.voteVisibility" - auto-save="autoSavePoll()" - value="ANONYMOUS" /> - {{ 'poll.config.value.visibility.anonymous' | translate }} - </label> - </div> - <div class="col-sm-2"> - <info-error error="restError.voteVisibility[0]" data="data.poll.voteVisibility" append-class="fa-2x"></info-error> - </div> - </div> - - <div class="form-group row"> - <label class="col-sm-4 control-label" for="formAnonymousVoteAllowed"> - {{ 'poll.config.label.anonymousVoteAllowed' | translate }} - </label> - <div class="col-sm-6 btn-group"> - <input type="checkbox" id="formAnonymousVoteAllowed" ng-model="data.poll.anonymousVoteAllowed" auto-save="autoSavePoll()" /> - </div> - </div> - - <div class="form-group row"> - <label class="col-sm-4 control-label"> - {{ 'poll.config.label.commentVisibility' | translate }} - </label> - <div class="col-sm-6"> - <label class="label-block"> - <input type="radio" - ng-model="data.poll.commentVisibility" - name="commentVisibility" - value="EVERYBODY" - auto-save="autoSavePoll()" /> - {{ 'poll.config.value.visibility.everybody' | translate }} - </label> - - <label class="label-block"> - <input type="radio" - ng-model="data.poll.commentVisibility" - name="commentVisibility" - value="VOTER" - auto-save="autoSavePoll()" /> - {{ 'poll.config.value.visibility.voter' | translate }} - </label> - - <label class="label-block"> - <input type="radio" - ng-model="data.poll.commentVisibility" - name="commentVisibility" - value="NOBODY" - auto-save="autoSavePoll()" /> - {{ 'poll.config.value.visibility.nobody' | translate }} - </label> - </div> - <div class="col-sm-2"> - <info-error error="restError.commentVisibility[0]" data="data.poll.commentVisibility" append-class="fa-2x"></info-error> - </div> - </div> -</form> diff --git a/pollen-ui-angular/src/main/webapp/partials/poll.html b/pollen-ui-angular/src/main/webapp/partials/poll.html deleted file mode 100644 index edaae5a..0000000 --- a/pollen-ui-angular/src/main/webapp/partials/poll.html +++ /dev/null @@ -1,117 +0,0 @@ -<!-- - #%L - Pollen :: UI (Angular) - %% - Copyright (C) 2009 - 2017 Code Lutin, Tony Chemit - %% - 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 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/>. - #L% - --> - -<div id="poll-content" ng-class="{'maxi-content': globalVariables.minify}" ng-if="data.poll"> - <ul class="nav nav-tabs"> - <li ng-class="{active: tab == 'vote'}" ng-show="data.poll.id"> - <a href="{{globalVariables.linkVote}}"> - <span class="fa fa-thumbs-o-up fa-flip-horizontal"></span> {{ 'poll.tab.vote' | translate }} - </a> - </li> - <li ng-class="{active: tab == 'comment'}" ng-show="data.poll.commentIsVisible"> - <a href="{{globalVariables.linkComment}}"> - <span class="fa fa-comments-o"></span> {{ 'poll.tab.comment' | translate }} ({{ data.poll.commentCount }}) - </a> - </li> - <li ng-class="{active: tab == 'result'}" ng-show="data.poll.resultIsVisible"> - <a href="{{globalVariables.linkResult}}"> - <span class="fa fa-bar-chart-o"></span> {{ 'poll.tab.result' | translate }} - </a> - </li> - <li ng-class="{active: tab == 'edit'}" ng-show="data.poll.permission"> - <a href="{{globalVariables.linkEdit}}"> - <span class="fa fa-pencil-square-o"></span> {{ 'poll.tab.edit' | translate }} - <info-error error="globalVariables.pollError"></info-error> - </a> - </li> - <li ng-class="{active: tab == 'conf'}" ng-show="data.poll.permission"> - <a href="{{globalVariables.linkConf}}"> - <span class="fa fa-wrench"></span> {{ 'poll.tab.conf' | translate }} - <info-error error="globalVariables.configError"></info-error> - </a> - </li> - <li ng-class="{active: tab == 'participant'}" ng-show="data.poll.permission"> - <a href="{{globalVariables.linkParticipant}}"> - <span class="fa fa-users"></span> {{ 'poll.tab.participant' | translate }} - <info-error error="globalVariables.participantError"></info-error> - </a> - </li> - - <li ng-class="{active: tab == 'create'}" ng-show="globalVariables.create"> - <a href="#/poll/create"> - <span class="fa fa-pencil-square-o"></span> {{ 'poll.tab.create' | translate }} - <info-error error="globalVariables.pollError"></info-error> - </a> - </li> - <li ng-class="{active: tab == 'conf'}" ng-show="globalVariables.create"> - <a href="#/poll/create/conf"> - <span class="fa fa-wrench"></span> {{ 'poll.tab.conf' | translate }} - <info-error error="globalVariables.configError"></info-error> - </a> - </li> - <li ng-class="{active: tab == 'participant'}" ng-show="globalVariables.create"> - <a href="#/poll/create/participant"> - <span class="fa fa-users"></span> {{ 'poll.tab.participant' | translate }} - <info-error error="globalVariables.participantError"></info-error> - </a> - </li> - </ul> - - <!--<div ng-include="'./partials/poll-info.html'" ng-controller="PollInfoCtrl" class="poll-info"></div>--> - - <div ng-include="'./partials/poll-poll.html'" ng-if="tab == 'vote'" ng-controller="PollVoteCtrl" class="anim-fade"></div> - - <div ng-if="!globalVariables.create && (tab == 'edit' || tab == 'conf' || tab == 'participant')" ng-controller="PollEditCtrl"> - - <div ng-include="'./partials/poll-poll.html'" ng-if="tab == 'edit'" class="anim-fade"></div> - - <div ng-include="'./partials/poll-settings.html'" ng-if="tab == 'conf'" class="anim-fade poll-settings"></div> - - <div ng-include="'./partials/poll-listParticipant.html'" ng-if="tab == 'participant'" class="anim-fade"></div> - - <div> - <hr/> - <button class="btn btn-primary" ng-click="savePoll()"><span class="fa fa-save"></span> {{ 'action.save' | translate }}</button> - </div> - - </div> - - <div ng-if="globalVariables.create && (tab == 'create' || tab == 'conf' || tab == 'participant')"> - - <div ng-include="'./partials/poll-poll.html'" ng-if="tab == 'create'" class="anim-fade"></div> - - <div ng-include="'./partials/poll-settings.html'" ng-if="tab == 'conf'" class="anim-fade poll-settings"></div> - - <div ng-include="'./partials/poll-listParticipant.html'" ng-if="tab == 'participant'" class="anim-fade"></div> - - <div> - <hr/> - <button class="btn btn-primary" ng-click="savePoll()"><span class="fa fa-save"></span> {{ 'action.save' | translate }}</button> - </div> - - </div> - - - <div ng-include="'./partials/poll-comment.html'" ng-if="tab == 'comment'" ng-controller="PollCommentCtrl" class="anim-fade"></div> - - <div ng-include="'./partials/poll-result.html'" ng-if="tab == 'result'" ng-controller="PollResultCtrl" class="anim-fade"></div> - -</div> - -<div ng-include="'./partials/poll-link.html'" id="poll-link" ng-class="{'mini-link': globalVariables.minify}" ng-show="data.poll.id"></div> diff --git a/pollen-ui-angular/src/main/webapp/partials/printResource.html b/pollen-ui-angular/src/main/webapp/partials/printResource.html deleted file mode 100644 index cc8278f..0000000 --- a/pollen-ui-angular/src/main/webapp/partials/printResource.html +++ /dev/null @@ -1,40 +0,0 @@ -<!-- - #%L - Pollen :: UI (Angular) - %% - Copyright (C) 2009 - 2017 Code Lutin, Tony Chemit - %% - 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 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/>. - #L% - --> -<div class="preview" ng-if="isImage && resourceURL"> - <img ng-attr-src="{{previewURL}}" /> -</div> - -<div class="preview" ng-if="!isImage && resourceURL"> - <a ng-attr-href="{{resourceURL}}" target="_blank"> - <span ng-attr-class="fa {{meta.class}}"></span> - </a> -</div> - -<div class="preview" ng-if="!resourceURL"> - <span class="fa fa-spin fa-spinner"></span> -</div> - -<div ng-if="isImage && showImage" class="full"> - <div class="full-content"> - <span>{{meta.name}}</span> - <img ng-attr-src="{{resourceURL}}" /> - </div> -</div> diff --git a/pollen-ui-angular/src/main/webapp/partials/user-admin-list.html b/pollen-ui-angular/src/main/webapp/partials/user-admin-list.html deleted file mode 100644 index 171d00e..0000000 --- a/pollen-ui-angular/src/main/webapp/partials/user-admin-list.html +++ /dev/null @@ -1,58 +0,0 @@ -<!-- - #%L - Pollen :: UI (Angular) - %% - Copyright (C) 2009 - 2017 Code Lutin, Tony Chemit - %% - 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 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/>. - #L% - --> - -<div ng-if="!data.users[0]"> - <h1> - {{ 'user.error.listEmpty' | translate }} - </h1> -</div> - -<div class="control-group row form-search"> - <div class="col-sm-4"> - <input class="form-control" type="text" ng-model="search" placeholder="{{ 'action.search' | translate }}" /> - </div> -</div> - -<table class="table table-hover"> - <tr> - <th>{{ 'user.name' | translate }}</th> - <th>{{ 'user.isAdmin' | translate }}</th> - <th>{{ 'action' | translate }}</th> - </tr> - <tr ng-repeat="user in data.users | filter:search" ng-class="{ 'warning':user.isDisabled }"> - <td>{{user.name || user.email}}</td> - <td> - <input type="checkbox" ng-model="user.administrator" auto-save="saveUser(user)"/> - </td> - <td class="action"> - <button class="btn btn-warning" ng-click="generatePassword(user)" title="{{ 'user.generatePassword' | translate}}"> <span class="fa fa-refresh"></span> </button> - <button class="btn btn-warning" ng-click="banUser(user)" ng-disabled="user.isDisabled" title="{{ 'user.disableUser' | translate}}"> <span class="fa fa-ban"></span> </button> - <button class="btn btn-danger" ng-click="deleteUser(user)" title="{{ 'action.delete' | translate}}"> <span class="fa fa-trash"></span> </button> - </td> - </tr> - <tr> - <td colspan="3"> - <make-pagination current-page="data.usersPagination.currentPage" - last-page="data.usersPagination.lastPage" - page-size="data.usersPagination.pageSize"></make-pagination> - - </td> - </tr> - -</table> diff --git a/pollen-ui-angular/src/main/webapp/partials/user-edit-editProfile.html b/pollen-ui-angular/src/main/webapp/partials/user-edit-editProfile.html deleted file mode 100644 index 0ae41c9..0000000 --- a/pollen-ui-angular/src/main/webapp/partials/user-edit-editProfile.html +++ /dev/null @@ -1,65 +0,0 @@ -<!-- - #%L - Pollen :: UI (Angular) - %% - Copyright (C) 2009 - 2017 Code Lutin, Tony Chemit - %% - 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 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/>. - #L% - --> -<h2> {{ 'title.user.edit' | translate }} </h2> - -<form class="form-horizontal"> - <div class="control-group row"> - <label for="formName" class="col-sm-5 text-right control-label"> - {{ 'user.myName' | translate }} - </label> - <div class="col-sm-6"> - <input type="text" id="formName" class="form-control" ng-model="data.user.name" auto-save="editUser()" /> - </div> - <div class="col-sm-1"> - </div> - </div> - - <div class="control-group row"> - - <label for="formEmail" class="col-sm-5 text-right control-label"> - {{ 'user.myMail' | translate }} - </label> - - <div class="col-sm-6"> - <input type="email" id="formEmail" name="email" class="form-control" ng-model="data.user.email" auto-save="editUser()" /> - </div> - <div class="col-sm-1"> - <info-error error="restError.email[0]" data="data.user.email" append-class="fa-2x"></info-error> - </div> - </div> - - <div class="row"> - <div class="col-sm-2"></div> - <div class="col-sm-9"><hr/></div> - <div class="col-sm-1"></div> - </div> - - <div class="control-group row"> - <label for="formCurrentPassword" class="col-sm-5 text-right control-label"> - {{ 'user.passwordCurrent' | translate }} - </label> - <div class="col-sm-6"> - <input type="password" id="formCurrentPassword" class="form-control" ng-model="data.user.password" auto-save="editUser()" /> - </div> - <div class="col-sm-1"> - <info-error error="restError.password[0]" data="data.user.password" append-class="fa-2x"></info-error> - </div> - </div> - -</form> diff --git a/pollen-ui-angular/src/main/webapp/partials/user-edit-password.html b/pollen-ui-angular/src/main/webapp/partials/user-edit-password.html deleted file mode 100644 index 5ba7e2a..0000000 --- a/pollen-ui-angular/src/main/webapp/partials/user-edit-password.html +++ /dev/null @@ -1,64 +0,0 @@ -<!-- - #%L - Pollen :: UI (Angular) - %% - Copyright (C) 2009 - 2017 Code Lutin, Tony Chemit - %% - 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 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/>. - #L% - --> -<h2> {{ 'title.user.edit' | translate }} </h2> - -<form class="form-horizontal"> - <div class="control-group row"> - <label for="formNewPassword" class="col-sm-5 text-right control-label"> - {{ 'user.passwordNew' | translate }} - </label> - <div class="col-sm-6"> - <input type="password" id="formNewPassword" class="form-control" ng-model="data.user.newPassword" auto-save="editPassword()"/> - </div> - <div class="col-sm-1"> - <info-error error="restError.newPassword[0]" data="data.user.newPassword" append-class="fa-2x"></info-error> - </div> - </div> - - <div class="control-group row"> - <label for="formNewPassword2" class="col-sm-5 text-right control-label"> - {{ 'user.password2' | translate }} - </label> - <div class="col-sm-6"> - <input type="password" id="formNewPassword2" class="form-control" ng-model="data.user.newPassword2" auto-save="editPassword()"/> - </div> - <div class="col-sm-1"> - <span class="fa fa-info-error fa-2x danger" tooltip="{{ 'user.error.password.diff' | translate }}" ng-if="data.user.newPassword != data.user.newPassword2"></span> - </div> - </div> - - <div class="row"> - <div class="col-sm-2"></div> - <div class="col-sm-9"><hr/></div> - <div class="col-sm-1"></div> - </div> - - <div class="control-group row"> - <label for="formCurrentPassword" class="col-sm-5 text-right control-label"> - {{ 'user.passwordCurrent' | translate }} - </label> - <div class="col-sm-6"> - <input type="password" id="formCurrentPassword" class="form-control" ng-model="data.user.password" auto-save="editPassword()" /> - </div> - <div class="col-sm-1"> - <info-error error="restError.password[0]" data="data.user.password" append-class="fa-2x"></info-error> - </div> - </div> - -</form> diff --git a/pollen-ui-angular/src/main/webapp/partials/user-edit-viewProfile.html b/pollen-ui-angular/src/main/webapp/partials/user-edit-viewProfile.html deleted file mode 100644 index f10aa22..0000000 --- a/pollen-ui-angular/src/main/webapp/partials/user-edit-viewProfile.html +++ /dev/null @@ -1,46 +0,0 @@ -<!-- - #%L - Pollen :: UI (Angular) - %% - Copyright (C) 2009 - 2017 Code Lutin, Tony Chemit - %% - 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 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/>. - #L% - --> -<div class="row"> - <div class="col-sm-5 text-right">{{ 'user.myName' | translate }}</div> - <div class="col-sm-7"> - {{ data.user.name || data.user.email }} - </div> -</div> - -<div class="row"> - <div class="col-sm-5 text-right">{{ 'user.myMail' | translate }}</div> - <div class="col-sm-7"> - {{ data.user.email }} - </div> -</div> - -<div class="row"> - <div class="col-sm-2"></div> - <div class="col-sm-9"><hr/></div> - <div class="col-sm-1"></div> -</div> - -<div class="row"> - <div class="col-sm-5"></div> - <div class="col-sm-7"> - <button class="btn btn-warning" ng-click="disableUser()"><span class="fa fa-ban"></span> {{ 'user.disableMe' | translate }}</button> - </div> -</div> diff --git a/pollen-ui-angular/src/main/webapp/partials/user-edit.html b/pollen-ui-angular/src/main/webapp/partials/user-edit.html deleted file mode 100644 index d667233..0000000 --- a/pollen-ui-angular/src/main/webapp/partials/user-edit.html +++ /dev/null @@ -1,29 +0,0 @@ -<!-- - #%L - Pollen :: UI (Angular) - %% - Copyright (C) 2009 - 2017 Code Lutin, Tony Chemit - %% - 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 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/>. - #L% - --> - -<ul class="nav nav-tabs"> - <li ng-class="{active : tab == 'viewProfile'}"><a href="#/user/edit" ng-click="tab = 'viewProfile'">{{ 'user.tab.viewProfile' | translate }}</a></li> - <li ng-class="{active : tab == 'editProfile'}"><a href="#/user/edit" ng-click="tab = 'editProfile'">{{ 'user.tab.editProfile' | translate }}</a></li> - <li ng-class="{active : tab == 'editPassword'}"><a href="#/user/edit" ng-click="tab = 'editPassword'">{{ 'user.tab.editPassword' | translate }}</a></li> -</ul> - -<div ng-include="'partials/user-edit-viewProfile.html'" ng-if="tab == 'viewProfile'" class="anim-fade"></div> -<div ng-include="'partials/user-edit-editProfile.html'" ng-if="tab == 'editProfile'" class="anim-fade"></div> -<div ng-include="'partials/user-edit-password.html'" ng-if="tab == 'editPassword'" class="anim-fade"></div> - diff --git a/pollen-ui-angular/src/main/webapp/partials/user-login.html b/pollen-ui-angular/src/main/webapp/partials/user-login.html deleted file mode 100644 index 56716de..0000000 --- a/pollen-ui-angular/src/main/webapp/partials/user-login.html +++ /dev/null @@ -1,50 +0,0 @@ -<!-- - #%L - Pollen :: UI (Angular) - %% - Copyright (C) 2009 - 2017 Code Lutin, Tony Chemit - %% - 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 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/>. - #L% - --> - -<form class='loginForm' ng-submit="login()"> - - <div class="control-group"> - <label class="control-label"> - {{ 'user.mail' | translate }} - <info-error error="restError.connexion" data="data.user" append-class="fa-lg"></info-error> - </label> - <input id="login" type="text" name='login' ng-model="data.user.login" class="form-control"/> - </div> - - <div class="control-group"> - <label class="control-label" > - {{ 'user.password' | translate }} - </label> - <input id="password" type="password" name='password' ng-model="data.user.password" class="form-control"/> - </div> - - <div class="control-group"> - <label class="control-label checkbox" > - <input type="checkbox" name='rememberMe' ng-model="data.user.rememberMe" /> - {{ 'user.rememberMe' | translate }} - </label> - </div> - - <div class="form-actions"> - <button type="submit" class="btn btn-primary"><span class="fa fa-sign-in"></span> {{ 'action.login' | translate }}</button> - <hr/> - <a href="#/user/lostpassword"> {{ 'user.forgotPassword' | translate }}</a> - </div> - -</form> diff --git a/pollen-ui-angular/src/main/webapp/partials/user-lostPassword.html b/pollen-ui-angular/src/main/webapp/partials/user-lostPassword.html deleted file mode 100644 index 8449eaf..0000000 --- a/pollen-ui-angular/src/main/webapp/partials/user-lostPassword.html +++ /dev/null @@ -1,43 +0,0 @@ -<!-- - #%L - Pollen :: UI (Angular) - %% - Copyright (C) 2009 - 2017 Code Lutin, Tony Chemit - %% - 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 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/>. - #L% - --> -<h2>{{ 'title.user.forgotPassword' | translate }}</h2> -<form ng-submit="submit()" class="form-horizontal"> - - <div class="control-group row"> - - <label for="formEmail" class="col-sm-5 text-right control-label"> - {{ 'user.mail' | translate }} - </label> - - <div class="col-sm-6"> - <input type="email" id="formEmail" name="email" class="form-control" ng-model="email"/> - </div> - <div class="col-sm-1"> - <info-error error="restError.email[0]" data="email" append-class="fa-2x"></info-error> - </div> - </div> - - <div class="control-group row"> - <div class="col-sm-5"></div> - <div class="col-sm-6"> - <button class="btn btn-primary" type="submit"><span class="fa fa-envelope"></span> {{ 'action.recovered' | translate }}</button> - </div> - <div class="col-sm-1"></div> - </div> -</form> diff --git a/pollen-ui-angular/src/main/webapp/partials/user-register.html b/pollen-ui-angular/src/main/webapp/partials/user-register.html deleted file mode 100644 index 35683a9..0000000 --- a/pollen-ui-angular/src/main/webapp/partials/user-register.html +++ /dev/null @@ -1,85 +0,0 @@ -<!-- - #%L - Pollen :: UI (Angular) - %% - Copyright (C) 2009 - 2017 Code Lutin, Tony Chemit - %% - 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 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/>. - #L% - --> -<h2>{{ 'title.user.register' | translate }}</h2> -<form ng-submit="submit()" class="form-horizontal"> - - <div class="control-group row"> - - <label for="formEmail" class="col-sm-5 text-right control-label"> - {{ 'user.mail' | translate }} - </label> - - <div class="col-sm-6"> - <input type="email" id="formEmail" name="email" class="form-control" ng-model="data.user.email"/> - </div> - <div class="col-sm-1"> - <info-error error="restError.email[0]" data="data.user.email"></info-error> - </div> - </div> - - <div class="control-group row"> - <label for="formName" class="col-sm-5 text-right control-label"> - {{ 'user.name' | translate }} - </label> - <div class="col-sm-6"> - <input type="text" id="formName" name="email" class="form-control" ng-model="data.user.name"/> - </div> - <div class="col-sm-1"> - </div> - </div> - - - <div class="row"> - <div class="col-sm-3"></div> - <div class="col-sm-8"><hr/></div> - <div class="col-sm-1"></div> - </div> - - <div class="control-group row"> - <label for="formPassword" class="col-sm-5 text-right control-label"> - {{ 'user.password' | translate }} - </label> - <div class="col-sm-6"> - <input type="password" id="formPassword" name="password" class="form-control" ng-model="data.user.password"/> - </div> - <div class="col-sm-1"> - <info-error error="restError.password[0]" data="data.user.password"></info-error> - - </div> - </div> - <div class="control-group row"> - <label for="formPassword2" class="col-sm-5 text-right control-label"> - {{ 'user.password2' | translate }} - </label> - <div class="col-sm-6"> - <input type="password" id="formPassword2" name="password2" class="form-control" ng-model="data.user.password2"/> - </div> - <div class="col-sm-1"> - <span class="fa fa-info-error fa-2x danger" tooltip="{{ 'user.error.password.diff' | translate }}" ng-if="data.user.password != data.user.password2"></span> - </div> - </div> - - <div class="control-group row"> - <div class="col-sm-5"></div> - <div class="col-sm-6"> - <button class="btn btn-primary" type="submit"><span class="fa fa-sign-in"></span> {{ 'action.register' | translate }}</button> - </div> - <div class="col-sm-1"></div> - </div> -</form> diff --git a/pollen-ui-angular/src/test/karma.conf.ci.js b/pollen-ui-angular/src/test/karma.conf.ci.js deleted file mode 100644 index ae3d8d1..0000000 --- a/pollen-ui-angular/src/test/karma.conf.ci.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * #%L - * Pollen :: UI (Angular) - * %% - * Copyright (C) 2009 - 2017 Code Lutin, Tony Chemit - * %% - * 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 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/>. - * #L% - */ -// load the base config -var baseConfig = require('./karma.conf.js'); - -module.exports = function(config) { - // load base config - baseConfig(config); - - // override base config - config.set({ - - browsers: ['PhantomJS'], - - singleRun: true, - - autoWatch: false - }); -}; - diff --git a/pollen-ui-angular/src/test/karma.conf.js b/pollen-ui-angular/src/test/karma.conf.js deleted file mode 100644 index 305c36c..0000000 --- a/pollen-ui-angular/src/test/karma.conf.js +++ /dev/null @@ -1,112 +0,0 @@ -/* - * #%L - * Pollen :: UI (Angular) - * %% - * Copyright (C) 2009 - 2017 Code Lutin, Tony Chemit - * %% - * 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 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/>. - * #L% - */ -// Karma configuration -// Generated on Tue Jul 15 2014 10:21:18 GMT+0200 (CEST) - -module.exports = function(config) { - config.set({ - - // base path that will be used to resolve all patterns (eg. files, exclude) - basePath: '../../', - - - // frameworks to use - // available frameworks: https://npmjs.org/browse/keyword/karma-adapter - frameworks: ['jasmine'], - - - // list of files / patterns to load in the browser - files: [ - 'src/main/webapp/js/conf.js.example', // fix conf is not defined for controller - 'src/main/webapp/lib/jquery/dist/jquery.min.js', - 'src/main/webapp/lib/ckeditor/ckeditor.js', - 'src/main/webapp/lib/angular/angular.js', - 'src/main/webapp/lib/angular-mocks/angular-mocks.js', - 'src/main/webapp/lib/angular-bootstrap/ui-bootstrap-tpls.js', - 'src/main/webapp/lib/angular-resource/angular-resource.js', - 'src/main/webapp/lib/angular-route/angular-route.js', - 'src/main/webapp/lib/angular-translate/angular-translate.js', - 'src/main/webapp/lib/angular-animate/angular-animate.js', - 'src/main/webapp/js/*.js', - 'src/main/webapp/js/**/*.js', - 'src/main/webapp/i18n/*.js', - 'src/test/unit/**/*.js' - ], - - - // list of files to exclude - exclude: [ - ], - - - // preprocess matching files before serving them to the browser - // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor - preprocessors: { - - }, - - - // test results reporter to use - // possible values: 'dots', 'progress' - // available reporters: https://npmjs.org/browse/keyword/karma-reporter - reporters: ['progress'], - - - // web server port - port: 9876, - - - // enable / disable colors in the output (reporters and logs) - colors: true, - - - // level of logging - // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG - logLevel: config.LOG_INFO, - - - // enable / disable watching file and executing tests whenever any file changes - autoWatch: true, - - - // start these browsers - // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher - browsers: ['Chrome', 'Firefox', 'PhantomJS'], - - plugins : [ - 'karma-chrome-launcher', - 'karma-firefox-launcher', - 'karma-phantomjs-launcher', - 'karma-jasmine', - 'karma-junit-reporter' - ], - - junitReporter : { - outputFile: 'target/karma-reports/unit.xml', - suite: 'unit' - }, - - // Continuous Integration mode - // if true, Karma captures browsers, runs the tests and exits - singleRun: false - }); -}; - diff --git a/pollen-ui-angular/src/test/unit/alertControllersTest.js b/pollen-ui-angular/src/test/unit/alertControllersTest.js deleted file mode 100644 index 603f460..0000000 --- a/pollen-ui-angular/src/test/unit/alertControllersTest.js +++ /dev/null @@ -1,141 +0,0 @@ -/* - * #%L - * Pollen :: UI (Angular) - * %% - * Copyright (C) 2009 - 2017 Code Lutin, Tony Chemit - * %% - * 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 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/>. - * #L% - */ -'use strict'; - -/////////////////////////////// -//// TEST printAlertCtrl //// -/////////////////////////////// - -describe('Alert controller', function () { - var rootScope; - var $timeout; - var $scope = {}; - var ctrl = null; - - beforeEach(module('alertControllers')); - beforeEach(inject(function($rootScope, $controller) { - rootScope = $rootScope; - $scope = $rootScope.$new(); - ctrl = $controller('printAlertCtrl', {$scope: $scope}); - spyOn($rootScope, '$broadcast').andCallThrough(); - })); - - beforeEach(inject(function($injector) { - $timeout = $injector.get('$timeout'); - })); - - - it('should load printAlertCtrl', function () { - expect(ctrl).toBeDefined(); - expect(ctrl).not.toBeNull(); - }); - - it('should init alerts array', function () { - expect($scope.data.alerts.length).toBeGreaterThan(-1); - }); - - it('should can add an alert', function () { - var nbAlert = $scope.data.alerts.length; - var alert = {msg:'message alert', type:'type'}; - - $scope.addAlert(alert, 1000); - - expect($scope.data.alerts.length).toEqual(nbAlert + 1); - }); - - it('should can delete my alert', function () { - var nbAlert = $scope.data.alerts.length; - var alert = {msg:'message alert', type:'type'}; - - $scope.addAlert(alert, 1000); - $scope.hideAlert(alert); - - expect($scope.data.alerts.length).toEqual(nbAlert); - }); - - it('should can\'t duplicate alert ', function () { - var nbAlert = $scope.data.alerts.length; - var alert = {msg:'message alert', type:'type'}; - - $scope.addAlert(alert, 1000); - $scope.addAlert(alert, 1000); - - expect($scope.data.alerts.length).toEqual(nbAlert + 1); - }); - - it('should can hide an alert after timeout', function() { - var alert = {msg:'message alert', type:'type'}; - var nbAlert = $scope.data.alerts.length; - - $scope.addAlert(alert, 250); - - // check now is added - expect($scope.data.alerts.length).toEqual(nbAlert + 1); - - $timeout.flush(); - - // check now is hidden - expect($scope.data.alerts.length).toEqual(nbAlert); - }); - - it('should init alerts persistent array', function () { - expect($scope.data.persistentAlerts.length).toBeGreaterThan(-1); - }); - - it('should can\'t duplicate alert with different timeout', function () { - var nbAlert = $scope.data.alerts.length; - var alert = {msg:'message alert', type:'type'}; - - $scope.addAlert(alert, 1000); - $scope.addAlert(alert, 500); - - expect($scope.data.alerts.length).toEqual(nbAlert + 1); - }); - - it('should can add a persistent alert', function () { - var nbAlert = $scope.data.persistentAlerts.length; - var alert = {msg:'message alert', type:'type'}; - - $scope.addAlert(alert, -1); - - expect($scope.data.persistentAlerts.length).toEqual(nbAlert + 1); - }); - - it('should can delete a persistent alert', function () { - var nbAlert = $scope.data.persistentAlerts.length; - var alert = {msg:'message alert', type:'type'}; - - $scope.addAlert(alert, -1); - $scope.hideAlert(alert); - - expect($scope.data.persistentAlerts.length).toEqual(nbAlert); - }); - - it('should can\'t duplicate persistent alert ', function () { - var nbAlert = $scope.data.persistentAlerts.length; - var alert = {msg:'message alert', type:'type'}; - - $scope.addAlert(alert, -1); - $scope.addAlert(alert, -1); - - expect($scope.data.persistentAlerts.length).toEqual(nbAlert + 1); - }); -}); diff --git a/pollen-ui-angular/src/test/unit/pollControllersTest.js b/pollen-ui-angular/src/test/unit/pollControllersTest.js deleted file mode 100644 index 014bf38..0000000 --- a/pollen-ui-angular/src/test/unit/pollControllersTest.js +++ /dev/null @@ -1,522 +0,0 @@ -/* - * #%L - * Pollen :: UI (Angular) - * %% - * Copyright (C) 2009 - 2017 Code Lutin, Tony Chemit - * %% - * 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 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/>. - * #L% - */ -'use strict'; - -/////////////////////////////// -//// TEST PollCtrl //// -/////////////////////////////// - -describe('Global poll controller', function () { - beforeEach(module('pollControllers')); - beforeEach(inject(function($controller) { - ctrl = $controller('PollCtrl', {$scope: $scope}); - })); - - var $scope = {}; - var ctrl = null; - it('should load PollCtrl', function () { - expect(ctrl).toBeDefined(); - expect(ctrl).not.toBeNull(); - - }); - - - it('should set good default dateFormat', function() { - expect($scope.globalVariables.dateFormat).not.toBeNull(); - expect($scope.globalVariables.dateFormat).toBeDefined(); - - expect($scope.globalVariables.timeFormat).not.toBeNull(); - expect($scope.globalVariables.timeFormat).toBeDefined(); - - expect($scope.globalVariables.dateTimeFormat).not.toBeNull(); - expect($scope.globalVariables.dateTimeFormat).toBeDefined(); - }); - - it('should set good template url', function () { - expect($scope.templateURL).toBeDefined(); - expect($scope.templateURL).not.toBeNull(); - }); - - - it('should get good voteCounting', function () { - // voteCounting boolean - runs(function () { - $scope.data.voteCountingType = {renderType:'checkbox'}; - expect($scope.voteCountingIsBoolean()).toBeTruthy(); - }); - - // voteCounting not boolean - runs(function () { - $scope.data.voteCountingType = {renderType: 'text'}; - expect($scope.voteCountingIsBoolean()).toBeFalsy(); - }); - }); - - it('should get good voteValue', function () { - // voteCounting boolean - runs(function () { - $scope.data.voteCountingType = {renderType:'checkbox'}; - - var valueOf1 = $scope.getVoteValue(1.0); - expect(valueOf1).toBeTruthy(); - var valueOf2 = $scope.getVoteValue(2.0); - expect(valueOf2).toBeTruthy(); - - var valueOf0 = $scope.getVoteValue(0.0); - expect(valueOf0).toBeFalsy(); - - var valueOfTrue = $scope.getVoteValue(true); - expect(valueOfTrue).toBeTruthy(); - var valueOfFalse = $scope.getVoteValue(false); - expect(valueOfFalse).toBeFalsy(); - - }); - - // voteCounting not boolean - runs(function () { - $scope.data.voteCountingType = {renderType: 'text'}; - - var valueOf1 = $scope.getVoteValue(1.0); - expect(valueOf1).toEqual(1.0); - - var valueOf0 = $scope.getVoteValue(0.0); - expect(valueOf0).toEqual(0.0); - - var valueOfTrue = $scope.getVoteValue(true); - expect(valueOfTrue).toEqual(1.0); - - var valueOfFalse = $scope.getVoteValue(false); - expect(valueOfFalse).toEqual(0.0); - - }); - }); - - it('should prepare good choice before send', function () { - // choice type text - runs(function () { - var makeChoice = {choiceType:'TEXT', choiceValue:'value of this choice'}; - var sendChoice = $scope.preSendChoice(makeChoice); - - expect(sendChoice).toEqual(makeChoice); - }); - - // choice type date - runs(function () { - var date = new Date(); - var makeChoice, sendChoice; - - makeChoice = {choiceType:'DATE', choiceValue: 'not a date'}; - sendChoice = $scope.preSendChoice(makeChoice); - - expect(sendChoice.choiceValue).toBeNull(); - expect(sendChoice.choiceType).toEqual('DATE'); - - makeChoice.choiceValue = date; - sendChoice = $scope.preSendChoice(makeChoice); - - expect(sendChoice.choiceValue).toEqual(date.getTime()); - expect(sendChoice.choiceType).toEqual('DATE'); - - }); - - // choice type image - runs(function () { - var makeChoice, sendChoice; - - makeChoice = {choiceType:'RESOURCE', choiceValue:'not an image'}; - sendChoice = $scope.preSendChoice(makeChoice); - - expect(sendChoice.choiceValue).toBeNull(); - expect(sendChoice.choiceType).toEqual('RESOURCE'); - - makeChoice.choiceValue = {meta:{name:'image.png', id:'shortTopiaId'}, data:'urlpicture', id:'shortTopiaId'}; - sendChoice = $scope.preSendChoice(makeChoice); - - expect(sendChoice.choiceValue).toEqual('shortTopiaId'); - expect(sendChoice.choiceType).toEqual('RESOURCE'); - }); - }); - - it('should good receive choice', function () { - // choice type text - runs(function () { - var makeChoice = {choiceType:'TEXT', choiceValue:'value of this choice'}; - var receiveChoice = $scope.postReceiveChoice(makeChoice); - - expect(receiveChoice).toEqual(makeChoice); - }); - - // choice type date - runs(function () { - var date = new Date(1405461600000); - var makeChoice, receiveChoice; - - makeChoice = {choiceType:'DATE', choiceValue: "1405461600000"}; - receiveChoice = $scope.postReceiveChoice(makeChoice); - - expect(receiveChoice.choiceValue).toEqual(date); - expect(receiveChoice.choiceType).toEqual('DATE'); - - }); - - // choice type image - runs(function () { - var makeChoice, receiveChoice; - - makeChoice = {choiceType:'RESOURCE', choiceValue:'shortTopiaId'}; - receiveChoice = $scope.postReceiveChoice(makeChoice); - - expect(receiveChoice.choiceValue.id).toEqual('shortTopiaId'); - expect(receiveChoice.choiceValue.meta.id).toEqual('shortTopiaId'); - expect(receiveChoice.choiceValue.data).toEqual(conf.restURL+'/resources/shortTopiaId'); - expect(receiveChoice.choiceType).toEqual('RESOURCE'); - }); - }); -}); - -/////////////////////////////// -//// TEST PollAdminCtrl //// -/////////////////////////////// -describe('Admin poll controller', function () { - beforeEach(module('pollControllers')); - beforeEach(inject(function($controller) { - $controller('PollCtrl', {$scope: $scope}); - ctrl = $controller('PollAdminCtrl', {$scope: $scope}); - })); - - var $scope = {}; - var ctrl = null; - - it('should load PollAdminCtrl', function() { - expect(ctrl).toBeDefined(); - expect(ctrl).not.toBeNull(); - }); - - it('should be on edited mode', function () { - expect($scope.globalVariables.editMode).toBeTruthy(); - }); - - it('should init list of voterList group', function() { - expect($scope.data.voterList).toBeDefined(); - expect($scope.data.voterList.length).toBeGreaterThan(-1); - }); - - it('should add a new group of voterList', function () { - $scope.addGroup(); - - // check addGroup create is an array - expect($scope.data.voterList.length).toBeGreaterThan(0); - - // check addGroup add one group - var nbVoterList = $scope.data.voterList.length; - $scope.addGroup(); - expect($scope.data.voterList.length).toEqual(nbVoterList + 1); - }); - - it('should new group have name, weight', function () { - // create one voterList group and get one - $scope.addGroup(); - var voterList = $scope.data.voterList[0]; - - expect(voterList.group.name).toBeDefined(); - expect(voterList.group.weight).toEqual(1.0); - - }); - - it('should add a new voter in voterList', function () { - // create one voterList and get one - $scope.addGroup(); - - var voterList = $scope.data.voterList[0]; - - // check voterListMembers is an array - $scope.addVoter(0); - expect(voterList.members.length).toBeGreaterThan(0); - - //check add voterListMembers add one member - var nbMember = voterList.members.length; - $scope.addVoter(0); - expect(voterList.members.length).toEqual(nbMember + 1); - }); - - it('should new member have name, email and weight', function () { - $scope.addGroup(); - $scope.addVoter(0); - - // get the first member of the first group - var member = $scope.data.voterList[0].members[0]; - - expect(member.name).toBeDefined(); - expect(member.email).toBeDefined(); - expect(member.weight).toEqual(1.0); - - }); - -}); - -/////////////////////////////// -//// TEST PollCreateCtrl //// -/////////////////////////////// -describe('Create poll Controller', function () { - beforeEach(module('pollControllers')); - beforeEach(inject(function($controller) { - ctrl = $controller('PollCreateCtrl', {$scope:$scope}); - })); - - var $scope = {}; - var ctrl = null; - - it('should load PollCreateCtrl', function() { - expect(ctrl).toBeDefined(); - }); - - - it('should be on edited mode', function () { - expect($scope.globalVariables.editMode).toBeTruthy(); - }); - - it('should be on create mode', function () { - expect($scope.globalVariables.create).toBeTruthy(); - }); - - it('should load base of poll', function () { - expect($scope.data.choices).toBeDefined(); - expect($scope.data.vote).toBeDefined(); - expect($scope.data.vote.choices).toBeDefined(); - }); -}); - -/////////////////////////////// -//// TEST PollEditCtrl //// -/////////////////////////////// -describe('Edit poll controller', function () { - beforeEach(module('pollControllers')); - beforeEach(inject(function($controller) { - $controller('PollCtrl', {$scope: $scope}); - $scope.data = { poll: { title: "test" } }; - ctrl = $controller('PollEditCtrl', {$scope:$scope}); - })); - - var $scope = {}; - var ctrl = null; - - it('should load PollEditCtrl', function() { - expect(ctrl).toBeDefined(); - }); - - it('should be on edited mode', function () { - expect($scope.globalVariables.editMode).toBeTruthy(); - }); - - it('should detect if member is empty', function () { - var member, isEmpty; - - // is empty - - member = {}; - isEmpty = $scope.memberIsEmpty(member); - expect(isEmpty).toBeTruthy(); - - member = {name:''}; - isEmpty = $scope.memberIsEmpty(member); - expect(isEmpty).toBeTruthy(); - - member = {email:''}; - isEmpty = $scope.memberIsEmpty(member); - expect(isEmpty).toBeTruthy(); - - member = {name:'', email:''}; - isEmpty = $scope.memberIsEmpty(member); - expect(isEmpty).toBeTruthy(); - - // is not empty - - member = {name:'memberName'}; - isEmpty = $scope.memberIsEmpty(member); - expect(isEmpty).toBeFalsy(); - - member = {email:'member@pollen.org'}; - isEmpty = $scope.memberIsEmpty(member); - expect(isEmpty).toBeFalsy(); - - member = {name:'memberName', email:'member@pollen.org'}; - isEmpty = $scope.memberIsEmpty(member); - expect(isEmpty).toBeFalsy(); - }); -}); - -/////////////////////////////// -//// TEST PollVoteCtrl //// -/////////////////////////////// -describe('Vote poll controller', function () { - beforeEach(module('pollControllers')); - beforeEach(inject(function($controller) { - $controller('PollCtrl', {$scope: $scope}); - $scope.data = { poll: { title: "test" } }; - ctrl = $controller('PollVoteCtrl', {$scope:$scope}); - - // not limited number of choice (default) - $scope.data.poll = {maxChoiceNumber:0}; -})); - - var ctrl = null; - var $scope = {}; - - it('should load PollVoteCtrl', function() { - expect(ctrl).toBeDefined(); - }); - - it('should not be on edited mode', function () { - expect($scope.globalVariables.editMode).toBeFalsy(); - }); - - it('should be toggle choiceValue', function () { - // force vote counting on boolean - $scope.data.voteCountingType = {renderType:'checkbox'}; - - // choice.voteValue init to false - runs( function () { - var choice = {voteValue : false}; - $scope.toggleValue(choice); - expect(choice.voteValue).toBeTruthy(); - - $scope.toggleValue(choice); - expect(choice.voteValue).toBeFalsy(); - }); - - // choice.voteValue init to true - runs( function () { - var choice = {voteValue : true}; - $scope.toggleValue(choice); - expect(choice.voteValue).toBeFalsy(); - - $scope.toggleValue(choice); - expect(choice.voteValue).toBeTruthy(); - }); - - // choice.voteValue is not defined - runs(function () { - var choice = {}; - $scope.toggleValue(choice); - expect(choice.voteValue).toBeTruthy(); - - $scope.toggleValue(choice); - expect(choice.voteValue).toBeFalsy(); - }); - }); -}); - -/////////////////////////////// -//// TEST PollCommentCtrl //// -/////////////////////////////// -describe('Poll comment controller', function () { - beforeEach(module('pollControllers')); - beforeEach(inject(function($controller) { - $controller('PollCtrl', {$scope: $scope}); - $scope.data = { poll: { title: "test" } }; - ctrl = $controller('PollCommentCtrl', {$scope:$scope}); - })); - - var ctrl = null; - var $scope = {}; - - it('should load PollCommentCtrl', function() { - expect(ctrl).toBeDefined(); - }); - - it('should not be on edited mode', function () { - expect($scope.globalVariables.editMode).toBeFalsy(); - }); - - it('should initialize comment', function () { - expect($scope.comment.text).toBeDefined(); - expect($scope.comment.authorName).toBeDefined(); - }); - - it('should toggle order comments', function () { - // order desc - runs(function () { - $scope.desc = true; - - $scope.toggleOrder(); - - expect($scope.desc).toBeFalsy(); - }); - - // order asc - runs(function () { - $scope.desc = false; - - $scope.toggleOrder(); - - expect($scope.desc).toBeTruthy(); - }); - - // order not set - runs(function () { - delete $scope.desc; - - $scope.toggleOrder(); - - expect($scope.desc).toBeTruthy(); - }); - }); -}); - -/////////////////////////////// -//// TEST PollResultCtrl //// -/////////////////////////////// -describe('Poll result controller', function () { - beforeEach(module('pollControllers')); - beforeEach(inject(function($controller) { - $controller('PollCtrl', {$scope: $scope}); - $scope.data = { poll: { title: "test" } }; - ctrl = $controller('PollResultCtrl', {$scope:$scope}); - })); - - var ctrl = null; - var $scope = {}; - - it('should load PollResultCtrl', function() { - expect(ctrl).toBeDefined(); - }); - - it('should not be on edited mode', function () { - expect($scope.globalVariables.editMode).toBeFalsy(); - }); -}); - -/////////////////////////////// -//// TEST PollListCtrl //// -/////////////////////////////// -describe('List of poll controller', function () { - beforeEach(module('pollControllers')); - beforeEach(inject(function($controller) { - ctrl = $controller('PollListCtrl', {$scope:$scope}); - })); - - var ctrl = null; - var $scope = {}; - - it('should load PollListCtrl', function() { - expect(ctrl).toBeDefined(); - }); -}); diff --git a/pollen-ui-js/.gitignore b/pollen-ui-js/.gitignore deleted file mode 100644 index 74b4077..0000000 --- a/pollen-ui-js/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -src/main/webapp/pollen-ui-js.css -src/main/webapp/pollen-ui-js.js \ No newline at end of file diff --git a/pollen-ui-js/LICENSE.txt b/pollen-ui-js/LICENSE.txt deleted file mode 100644 index dba13ed..0000000 --- a/pollen-ui-js/LICENSE.txt +++ /dev/null @@ -1,661 +0,0 @@ - GNU AFFERO GENERAL PUBLIC LICENSE - Version 3, 19 November 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU Affero General Public License is a free, copyleft license for -software and other kinds of works, specifically designed to ensure -cooperation with the community in the case of network server software. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -our General Public Licenses are intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - Developers that use our General Public Licenses protect your rights -with two steps: (1) assert copyright on the software, and (2) offer -you this License which gives you legal permission to copy, distribute -and/or modify the software. - - A secondary benefit of defending all users' freedom is that -improvements made in alternate versions of the program, if they -receive widespread use, become available for other developers to -incorporate. Many developers of free software are heartened and -encouraged by the resulting cooperation. However, in the case of -software used on network servers, this result may fail to come about. -The GNU General Public License permits making a modified version and -letting the public access it on a server without ever releasing its -source code to the public. - - The GNU Affero General Public License is designed specifically to -ensure that, in such cases, the modified source code becomes available -to the community. It requires the operator of a network server to -provide the source code of the modified version running there to the -users of that server. Therefore, public use of a modified version, on -a publicly accessible server, gives the public access to the source -code of the modified version. - - An older license, called the Affero General Public License and -published by Affero, was designed to accomplish similar goals. This is -a different license, not a version of the Affero GPL, but Affero has -released a new version of the Affero GPL which permits relicensing under -this license. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU Affero General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Remote Network Interaction; Use with the GNU General Public License. - - Notwithstanding any other provision of this License, if you modify the -Program, your modified version must prominently offer all users -interacting with it remotely through a computer network (if your version -supports such interaction) an opportunity to receive the Corresponding -Source of your version by providing access to the Corresponding Source -from a network server at no charge, through some standard or customary -means of facilitating copying of software. This Corresponding Source -shall include the Corresponding Source for any work covered by version 3 -of the GNU General Public License that is incorporated pursuant to the -following paragraph. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the work with which it is combined will remain governed by version -3 of the GNU General Public License. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU Affero General Public License from time to time. Such new versions -will be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU Affero General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU Affero General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU Affero General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - <one line to give the program's name and a brief idea of what it does.> - Copyright (C) <year> <name of author> - - 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/>. - -Also add information on how to contact you by electronic and paper mail. - - If your software can interact with users remotely through a computer -network, you should also make sure that it provides a way for users to -get its source. For example, if your program is a web application, its -interface could display a "Source" link that leads users to an archive -of the code. There are many ways you could offer source, and different -solutions will be better for different programs; see section 13 for the -specific requirements. - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU AGPL, see -<http://www.gnu.org/licenses/>. diff --git a/pollen-ui-js/README.txt b/pollen-ui-js/README.txt deleted file mode 100644 index 4b24402..0000000 --- a/pollen-ui-js/README.txt +++ /dev/null @@ -1,58 +0,0 @@ -POLLEN ------- - -Pollen est une application Web de sondages en ligne qui permet de créer et de -gérer des sondages avec différents types de choix (texte, date, image). -Les votants peuvent participer au sondage en suivant un lien qui identifie le -sondage. - - -INSTALLATION ------------- - -Pour installer l'application il suffit de déployer l'archive war dans un -conteneur Web comme Tomcat. - -Par défaut une base de données H2 est créée dans le répertoire /tmp. -Pour modifier ce comportement par défaut il suffit de créer le fichier -/etc/pollen.properties et de le remplir avec les propriétés suivantes : - - # Configuration de la base de données - hibernate.show_sql=false - hibernate.dialect=org.hibernate.dialect.H2Dialect - hibernate.connection.username=username - hibernate.connection.password=password - hibernate.connection.driver_class=org.h2.Driver - hibernate.connection.url=jdbc:h2:file://tmp/pollen/pollen - - # Répertoire des images transférées - upImgDir=/tmp/pollen/uploadedImages - - # Taille maximal des images transférées (en octets) - upload.filesize-max=1048576 - upload.requestsize-max=10485760 - - # Configuration de l'envoi d'emails automatiques - email_host=smtp.free.fr - email_port=25 - email_from=bot@pollen.org - - # Répertoire des flux de syndication (Atom) - feedDir=/tmp/pollen/feeds - - # Adresse du site (utilisée pour les emails de rappel) - siteUrl=http://www.site.org/pollen/ - -Pour une base PostgreSQL on aura : - - hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect - hibernate.connection.driver_class=org.postgresql.Driver - hibernate.default_schema=public - -Il peut-être nécessaire de redéployer l'application après avoir modifié ce -fichier. - -Un utilisateur avec les droits d'administration est créé automatiquement -(identifiant "admin", mot de passe "pollen"). Par mesure de sécurité il est -important de supprimer cet utilisateur après avoir créer un autre compte -administrateur. diff --git a/pollen-ui-js/changelog.txt b/pollen-ui-js/changelog.txt deleted file mode 100644 index e1efb15..0000000 --- a/pollen-ui-js/changelog.txt +++ /dev/null @@ -1,40 +0,0 @@ -ChangeLog -========= -1.2.3 -- Anomalie #101: Sondage à type de dépouillement: Number - -1.2.2 -- Rename favicon to favicon.png -- Use war launcher from nuiton-utils project -- Evolution #96: Nouveau type de consultation: un nombre - -1.2.1 -- Erreur lors de la modification de son vote Issue: 87 - -1.2.0 -- Fixed a performance problem in the file upload with Winstone. -- Global dependencies update -- Use hudson version of winstone web server (original seam unmaintained) -- Fix slf4j dependency bug between api & impl -- Evol #54 -- Ano #49 - -1.1.0 -- liste de votants à partir d'un serveur ldap -- export de sondage -- flux de syndication atom -- création d'un sondage par copie d'un ancien -- sondages par groupes -- administration des sondages et des utilisateurs -- suppression de choix, de votes et de commentaires -- liste des sondages auxquels l'utilisateur a participé -- URL forgée pour les votes restreints - -1.0.1 -- refonte de la création de sondage -- sondages restreints -- listes de votants -- service de migration - -1.0.0 -- initiale release diff --git a/pollen-ui-js/pom.xml b/pollen-ui-js/pom.xml deleted file mode 100644 index 0176e43..0000000 --- a/pollen-ui-js/pom.xml +++ /dev/null @@ -1,95 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - - <modelVersion>4.0.0</modelVersion> - - <parent> - <groupId>org.chorem</groupId> - <artifactId>pollen</artifactId> - <version>2.0-SNAPSHOT</version> - </parent> - - <name>Pollen :: UI (CanJS) </name> - <description>Pollen UI</description> - - <groupId>org.chorem.pollen</groupId> - <artifactId>pollen-ui-js</artifactId> - <packaging>pom</packaging> - - <properties> - - <!-- Post Release configuration --> - <skipPostRelease>false</skipPostRelease> - </properties> - - <build> - - <plugins> - - <plugin> - <groupId>ro.isdc.wro4j</groupId> - <artifactId>wro4j-maven-plugin</artifactId> - <version>1.7.0</version> - <dependencies> - <dependency> - <groupId>org.nuiton.js</groupId> - <artifactId>nuiton-js-wro</artifactId> - <version>1.0</version> - </dependency> - - <dependency> - <groupId>org.nuiton.js</groupId> - <artifactId>nuiton-js-jquery</artifactId> - <version>1.9.1-2</version> - </dependency> - - <dependency> - <groupId>org.nuiton.js</groupId> - <artifactId>nuiton-js-bootstrap</artifactId> - <version>2.3.2-1</version> - </dependency> - - <dependency> - <groupId>org.nuiton.js</groupId> - <artifactId>nuiton-js-canjs</artifactId> - <version>1.1.6-1</version> - </dependency> - - <dependency> - <groupId>org.nuiton.js</groupId> - <artifactId>nuiton-js-jquery-i18n-properties</artifactId> - <version>1.0.9-1</version> - </dependency> - - <dependency> - <groupId>org.nuiton.js</groupId> - <artifactId>nuiton-js-moment</artifactId> - <version>2.0.0-1</version> - </dependency> - - </dependencies> - - <executions> - <execution> - <phase>compile</phase> - <goals> - <goal>run</goal> - </goals> - </execution> - </executions> - - <configuration> - <targetGroups>pollen-ui-js</targetGroups> - <minimize>true</minimize> - <wroFile>${basedir}/src/main/resources/nuiton-js/wro.xml</wroFile> - <extraConfigFile>${basedir}/src/main/resources/nuiton-js/wro.properties</extraConfigFile> - <contextFolder>${basedir}/src/main/webapp/</contextFolder> - <destinationFolder>${basedir}/src/main/webapp/</destinationFolder> - <wroManagerFactory>org.nuiton.js.wro.NuitonJsMavenWroManagerFactory</wroManagerFactory> - </configuration> - </plugin> - - </plugins> - </build> - -</project> diff --git a/pollen-ui-js/src/main/resources/nuiton-js/wro.properties b/pollen-ui-js/src/main/resources/nuiton-js/wro.properties deleted file mode 100644 index 085d205..0000000 --- a/pollen-ui-js/src/main/resources/nuiton-js/wro.properties +++ /dev/null @@ -1,26 +0,0 @@ -### -# #%L -# Pollen :: UI (JS) -# $Id$ -# $HeadURL$ -# %% -# Copyright (C) 2009 - 2013 CodeLutin -# %% -# 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 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/>. -# #L% -### -debug=false -preProcessors=forceCssDataUri,cssUrlRewriting,cssImport,semicolonAppender,cssMinJawr -postProcessors=cssVariables,jsMin -uriLocators=uri,classpath \ No newline at end of file diff --git a/pollen-ui-js/src/main/resources/nuiton-js/wro.xml b/pollen-ui-js/src/main/resources/nuiton-js/wro.xml deleted file mode 100644 index 71a4965..0000000 --- a/pollen-ui-js/src/main/resources/nuiton-js/wro.xml +++ /dev/null @@ -1,42 +0,0 @@ -<!-- - #%L - Pollen :: UI (JS) - $Id$ - $HeadURL$ - %% - Copyright (C) 2009 - 2013 CodeLutin - %% - 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 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/>. - #L% - --> -<groups xmlns="http://www.isdc.ro/wro"> - - <group name='pollen-ui-js'> - <group-ref>jquery</group-ref> - <group-ref>bootstrap-responsive</group-ref> - <group-ref>can.jquery</group-ref> - <group-ref>can.object</group-ref> - <group-ref>can.fixture</group-ref> - <group-ref>can.observe.attributes</group-ref> - <group-ref>can.observe.delegate</group-ref> - <group-ref>can.observe.validations</group-ref> - <group-ref>jquery.i18n.properties</group-ref> - <group-ref>moment</group-ref> - - <!-- scpecifique nuiton profiling --> - <!--<css>/nuiton-profiling.css</css>--> - <!--<js>/nuiton-profiling.js</js>--> - </group> - -</groups> diff --git a/pollen-ui-js/src/main/webapp/bundle/Messages.properties b/pollen-ui-js/src/main/webapp/bundle/Messages.properties deleted file mode 100644 index fe2b4bb..0000000 --- a/pollen-ui-js/src/main/webapp/bundle/Messages.properties +++ /dev/null @@ -1,196 +0,0 @@ -### -# #%L -# Pollen :: UI (JS) -# $Id$ -# $HeadURL$ -# %% -# Copyright (C) 2009 - 2013 CodeLutin -# %% -# 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 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/>. -# #L% -### -pollen.app.title=Pollen - -#common -pollen.common.cancel=Annuler -pollen.common.validate=Valider -pollen.common.format.date.moment=DD/MM/YYYY -pollen.common.format.dateTime.moment=DD/MM/YYYY HH:mm -pollen.common.format.date.input=dd/MM/yyyy -pollen.common.format.dateTime.input=dd/MM/yyyy hh:mm -pollen.common.format.time=HH:mm -pollen.common.date.from=à partir du {0} -pollen.common.date.fromTo=du {0} au {1} -pollen.common.date.to=jusqu'au {0} - -#poll attributes -pollen.poll.description.label=Description -pollen.poll.description.placeholder=Description -pollen.poll.title.label=Titre -pollen.poll.title.placeholder=Titre -pollen.poll.voteCountingType.label=Type de dépouillement -pollen.poll.creator.name.label=Votre nom -pollen.poll.creator.name.placeholder=Votre nom -pollen.poll.creator.email.label=Votre email -pollen.poll.creator.email.placeholder=Votre email -pollen.poll.choice.name.label=Nom -pollen.poll.choice.name.placeholder=Nom -pollen.poll.choice.description.label=Description -pollen.poll.choice.description.placeholder=Description -pollen.poll.beginDate.label=Date de début -pollen.poll.beginDate.placeholder=Date de début -pollen.poll.endDate.label=Date de fin -pollen.poll.endDate.placeholder=Date de fin -pollen.poll.choiceAddAllowed.label=Autoriser l'ajout de choix -pollen.poll.addChoiceBeginDate.label=Date de début d'ajout de choix -pollen.poll.addChoiceBeginDate.placeholder=Date de début d'ajout de choix -pollen.poll.addChoiceEndDate.label=Date de fin d'ajout de choix -pollen.poll.addChoiceEndDate.placeholder=Date de fin d'ajout de choix -pollen.poll.maxChoiceNumber.label=Nombre limite de choix par vote -pollen.poll.maxChoiceNumber.placeholder=Nombre limite de choix par vote -pollen.poll.maxChoiceNumber.help=Laisser vide ou 0 pour ne pas fixer de limite -pollen.poll.commentVisibility.label=Visibilité des commentaires -pollen.poll.commentVisibility.everybody.label=Publique -pollen.poll.commentVisibility.voter.label=Seulement les votants -pollen.poll.commentVisibility.nobody.label=Aucun commentaires -pollen.poll.voteVisibility.label=Visibilité des votes -pollen.poll.voteVisibility.everybody.label=Publique -pollen.poll.voteVisibility.voter.label=Votants -pollen.poll.voteVisibility.creator.label=Créateur -pollen.poll.voteVisibility.anonymous.label=Anonyme -pollen.poll.anonymousVoteAllowed.label=Vote anonyme -pollen.poll.pollType.label=Qui peut voter ? -pollen.poll.pollType.free.label=Libre -pollen.poll.pollType.restricted.label=Restreint -pollen.poll.pollType.group.label=Groupe -pollen.poll.voter.name.label=Nom -pollen.poll.voter.name.placeholder=Nom -pollen.poll.voter.email.label=Email -pollen.poll.voter.email.placeholder=Email -pollen.poll.voter.weight.label=Poids -pollen.poll.voter.weight.placeholder=Poids -pollen.poll.resultVisibility.label=Visibilité des résultats -pollen.poll.resultVisibility.everybody.label=Publique -pollen.poll.resultVisibility.voter.label=Seulement les votants -pollen.poll.resultVisibility.creator.label=Créateur -pollen.poll.continuousResults.label=Résultats continus - -#choice attributes -pollen.choice.description.label=Description -pollen.choice.description.placeholder=Description -pollen.choice.noDescription=Aucune description -pollen.choice.name.label=Titre -pollen.choice.name.placeholder=Titre -pollen.choice.voteType.normal.label=Normal -pollen.choice.voteType.normal.description=Voter pour le ou les choix préférés. -pollen.choice.voteType.percentage.label=Pourcentage -pollen.choice.voteType.percentage.description=Répartir les choix de manière à obtenir 100% au total. -pollen.choice.voteType.condorcet.label=Condorcet -pollen.choice.voteType.condorcet.description=Classer les choix par ordre de préférence de 1 à N (1=préféré).<br/>Seul l'ordre des choix compte, peu importe les valeurs. Deux choix peuvent avoir la même valeur.<br/><a href='http://fr.wikipedia.org/wiki/Méthode_Condorcet'>Pour en savoir plus</a> -pollen.choice.voteType.number.label=Nombre -pollen.choice.voteType.number.description=La réponse est libre, laissez vide ou entrez un nombre entier -pollen.choice.voteType.borda.label=Borda -pollen.choice.voteType.borda.description=Classer les choix par ordre de préférence de 1 à N (1=préféré).<br/>Seul l'ordre des choix compte, peu importe les valeurs. Deux choix peuvent avoir la même valeur.<br/><a href='http://fr.wikipedia.org/wiki/Méthode_Borda'>Pour en savoir plus</a> -pollen.choice.voteType.alternative.label=Vote alternatif -pollen.choice.voteType.alternative.description=Classer les choix par ordre de préférence de 1 à N (1=préféré).<br/>Seul l'ordre des choix compte, peu importe les valeurs. Deux choix peuvent avoir la même valeur.<br/><a href='http://fr.wikipedia.org/wiki/Vote_alternatif'>Pour en savoir plus</a> -pollen.choice.voteType.coombs.label=Coombs -pollen.choice.voteType.coombs.description=Classer les choix par ordre de préférence de 1 à N (1=préféré).<br/>Seul l'ordre des choix compte, peu importe les valeurs. Deux choix peuvent avoir la même valeur.<br/><a href='http://fr.wikipedia.org/wiki/Méthode_de_Coombs'>Pour en savoir plus</a> - -#user attributes -pollen.user.email.label=Email -pollen.user.email.placeholder=Email -pollen.user.login.label=Login -pollen.user.login.placeholder=Login -pollen.user.name.label=Nom -pollen.user.name.placeholder=Nom -pollen.user.password.label=Mot de passe -pollen.user.password.placeholder=Mot de passe -pollen.user.repeatPassword.label=Répétez le mot de passe -pollen.user.repeatPassword.placeholder=Répétez le mot de passe - -#menu -pollen.menu.home=Accueil -pollen.menu.polls.label=Sondages -pollen.menu.polls.create=Créer un sondage -pollen.menu.polls.list=Mes sondages -pollen.menu.register=Créer un compte -pollen.menu.login.label=S'identifier -pollen.menu.login.form.login.label=Identifiant -pollen.menu.login.form.login.placeholder=Votre identifiant -pollen.menu.login.form.password.label=Mot de passe -pollen.menu.login.form.password.placeholder=Votre mot de passe -pollen.menu.login.form.rememberMe.label=Rester connecté -pollen.menu.login.form.button=M'identifier -pollen.menu.user.profile=Mon profile -pollen.menu.logout=Déconnexion - -#poll creation form -pollen.poll.form.create.button.save=Créer le sondage -pollen.poll.form.create.button.previous=Précedent -pollen.poll.form.create.button.next=Suivant -pollen.poll.form.create.button.addChoice=Ajouter un choix -pollen.poll.form.create.title=Création de sondage -pollen.poll.form.create.step1=Informations générales -pollen.poll.form.create.step2=Définition des choix -pollen.poll.form.create.step3=Options -pollen.poll.form.create.legend.validityDates=Plage de validité -pollen.poll.form.create.legend.choices=Choix -pollen.poll.form.create.legend.votes=Votes -pollen.poll.form.create.legend.results=Resultats - -#poll lists -pollen.polls.created.title=Sondages créés -pollen.polls.created.empty=Vous n'avez créé aucun sondage - -#poll summary -pollen.poll.summary.title=Sondage \'{0}\' -pollen.poll.summary.linkToVote=Lien pour participer : -pollen.poll.summary.part.export.title=Export -pollen.poll.summary.part.export.item.export=Exporter -pollen.poll.summary.part.poll.title=Sondage -pollen.poll.summary.part.poll.item.close=Clore -pollen.poll.summary.part.poll.item.delete=Supprimer -pollen.poll.summary.part.poll.item.duplicate=Dupliquer -pollen.poll.summary.part.poll.item.edit=Modifier -pollen.poll.summary.part.poll.item.history=Historique -pollen.poll.summary.part.poll.item.notification=Notification -pollen.poll.summary.part.voters.title=Participants -pollen.poll.summary.part.voters.item.invite=Inviter des participants -pollen.poll.summary.part.voters.item.contact=Contacter les invités - -#vote -pollen.vote.poll.author=Sondage lancé par {0} -pollen.vote.poll.closed.alert=<strong>Ce sondage est clos.</strong> Vous ne pouvez plus voter. -pollen.vote.choices.list.title=Propositions -pollen.vote.choices.list.button.addChoice=Ajouter un choix -pollen.vote.votes.list.title=Votes -pollen.vote.votes.list.header.voter=Votant -pollen.vote.form.add.field.userName.placeholder=Votre nom -pollen.vote.form.add.button.vote=Voter -pollen.vote.comments.list.title=Commentaires -pollen.vote.comments.list.button.addComment=Ajouter un commentaire -pollen.vote.comments.add.field.userName.placeholder=Votre nom -pollen.vote.comments.add.field.message.placeholder=Votre commentaire - -#user form -pollen.user.form.edit.title.creation=Enregistrement -pollen.user.form.edit.title.update=Compte utilisateur -pollen.user.form.edit.button.create=Créer le compte -pollen.user.form.edit.button.update=Sauvegarder - -#validation -pollen.validation.required=Le champ est obligatoire -pollen.validation.email.format.error=L''email n''est pas valide -pollen.validation.password.length.error=Le mot de passe doit faire au moins 6 caractères -pollen.validation.passwords.different.error=Les deux mots de passes ne correspondent pas \ No newline at end of file diff --git a/pollen-ui-js/src/main/webapp/css/bootstrap-datetimepicker.min.css b/pollen-ui-js/src/main/webapp/css/bootstrap-datetimepicker.min.css deleted file mode 100644 index 36394e2..0000000 --- a/pollen-ui-js/src/main/webapp/css/bootstrap-datetimepicker.min.css +++ /dev/null @@ -1,8 +0,0 @@ -/*! - * Datepicker for Bootstrap - * - * Copyright 2012 Stefan Petre - * Licensed under the Apache License v2.0 - * http://www.apache.org/licenses/LICENSE-2.0 - * - */.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;content:"";line-height:0}.clearfix:after{clear:both}.hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.input-block-level{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.bootstrap-datetimepicker-widget{top:0;left:0;width:250px;padding:4px;margin-top:1px;z-index:3000;-webkit-border-radius:4px;-moz-border-ra [...] \ No newline at end of file diff --git a/pollen-ui-js/src/main/webapp/css/style.css b/pollen-ui-js/src/main/webapp/css/style.css deleted file mode 100644 index 1d5e017..0000000 --- a/pollen-ui-js/src/main/webapp/css/style.css +++ /dev/null @@ -1,104 +0,0 @@ -/* - * #%L - * Pollen :: UI (JS) - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2009 - 2013 CodeLutin - * %% - * 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 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/>. - * #L% - */ -.dropdown-menu.form { - padding: 0; - padding-top: 15px; -} - -.dropdown-menu.form > form { - margin: 0; -} - -.dropdown-menu.form .form-actions { - padding: 15px 20px 20px; - margin-bottom: 0; - border-radius: 0 0 6px 6px; -} - -.dropdown-menu.form .control-group { - padding: 0 15px; - margin-bottom: 5px; -} - -.noListStyle { - list-style-type: none; -} - -.noListStyle i { - margin-right: 5px; -} - -.link { - cursor: pointer; -} - -.icon-link { - background-image: url(../img/glyphicons_050_link.png); - background-position: center; - background-repeat: no-repeat; - background-size: 12px 14px; -} - -i.bigger { - width: 24px; - height: 24px; - background-size: 21px 23px; -} - -i.icon-collapse { - background-position: -288px -120px; -} - -.collapsed i.icon-collapse { - background-position: -313px -119px; -} - -.list.alternate-colors > div { - padding: 10px 20px; -} - -.list.alternate-colors > .even { - background-color: rgb(245, 245, 245); -} - -.list.alternate-colors .footer { - color: rgb(150, 150, 150); -} - -#voteForm .choice { - background-position: center; - background-repeat: no-repeat; - text-align: center; -} - -#voteForm .selected { - background-color: #6f6; -} - -#voteForm .notSelected { - background-color: #f66; -} - -#voteForm .voteBeforeChoice { - background-color: #ff6; -} \ No newline at end of file diff --git a/pollen-ui-js/src/main/webapp/img/glyphicons_050_link.png b/pollen-ui-js/src/main/webapp/img/glyphicons_050_link.png deleted file mode 100644 index a68cbfc..0000000 Binary files a/pollen-ui-js/src/main/webapp/img/glyphicons_050_link.png and /dev/null differ diff --git a/pollen-ui-js/src/main/webapp/img/pollen.png b/pollen-ui-js/src/main/webapp/img/pollen.png deleted file mode 100644 index fb656f6..0000000 Binary files a/pollen-ui-js/src/main/webapp/img/pollen.png and /dev/null differ diff --git a/pollen-ui-js/src/main/webapp/index.html b/pollen-ui-js/src/main/webapp/index.html deleted file mode 100644 index 40eec91..0000000 --- a/pollen-ui-js/src/main/webapp/index.html +++ /dev/null @@ -1,102 +0,0 @@ -<!-- - #%L - Pollen :: UI (JS) - $Id$ - $HeadURL$ - %% - Copyright (C) 2009 - 2013 CodeLutin - %% - 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 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/>. - #L% - --> -<!DOCTYPE html> -<html lang="fr" xmlns="http://www.w3.org/1999/xhtml"> -<head> - <meta charset="utf-8"/> - <title>Pollen</title> - <link rel="stylesheet" href="pollen-ui-js.css"></link> - <link rel="stylesheet" href="css/bootstrap-datetimepicker.min.css"></link> - <link rel="stylesheet" href="css/style.css"></link> -</head> - -<body> - - <div class="navbar navbar-inverse navbar-static-top"> - <div class="navbar-inner"> - <div class='container' id="menu"> - </div> - </div> - </div> - - <div class='container' id="content"> - - <!--Body content--> - <div id="pollForm"></div> - <div id="pollList"></div> - <div id="pollSummary"></div> - <div id="vote"></div> - <div id="userForm"></div> - - </div> - - <script src="pollen-ui-js.js"></script> - <script src="js/libs/jquery.scrollto.js"></script> - <script src="js/libs/bootstrap-datetimepicker.min.js"></script> - <script src="js/pollen-utils.js"></script> - - <script src="js/models/polls.js"></script> - <script src="js/models/choices.js"></script> - <script src="js/models/comments.js"></script> - <script src="js/models/votes.js"></script> - <script src="js/models/users.js"></script> - - <script type="text/javascript"> - var currentUser = new User(JSON.parse(window.localStorage.getItem('currentUser'))); - </script> - - <script src="js/controls/menu.js"></script> - <script src="js/controls/poll_form.js"></script> - <script src="js/controls/poll_list.js"></script> - <script src="js/controls/poll_summary.js"></script> - <script src="js/controls/vote.js"></script> - <script src="js/controls/user_form.js"></script> - - <script type="text/javascript"> - - // This will initialize the plugin - $.i18n.properties({ - name:'Messages', - path:'bundle/', - mode:'both', - language:'fr_FR', - callback: function() { - - var menu = new Menu('#menu'); - - var pollForm = new PollForm('#pollForm'); - var pollList = new PollList('#pollList'); - var summary = new PollSummary('#pollSummary'); - var vote = new PollVote('#vote'); - var userForm = new UserForm('#userForm'); - - can.route(':type/:action'); - can.route(':type/:id/:action'); - - } - }); - - </script> - -</body> -</html> \ No newline at end of file diff --git a/pollen-ui-js/src/main/webapp/js/controls/menu.js b/pollen-ui-js/src/main/webapp/js/controls/menu.js deleted file mode 100644 index 6e5d94c..0000000 --- a/pollen-ui-js/src/main/webapp/js/controls/menu.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * #%L - * Pollen :: UI (JS) - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2009 - 2013 CodeLutin - * %% - * 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 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/>. - * #L% - */ -var Menu = can.Control({ - init: function() { - this.element.html(can.view('views/menu.ejs', {currentUser: currentUser})); - }, - - '#loginForm submit': function(form) { - can.ajax(backendUrl + '/login', { - type: 'PUT', - data: { - login: form.find('[name="login"]').val(), - password: form.find('[name="password"]').val() - }, - success: function(user) { - form[0].reset(); - form.parents(".dropdown.open").removeClass("open"); - currentUser.attr(user.pollenUser, true); - currentUser.attr("token", user.id); - window.localStorage.setItem('currentUser', JSON.stringify(currentUser._data)); - } - }); - return false; - }, - - '#menuItemLogout click': function() { - can.ajax(backendUrl + '/logout', { - type: 'GET', - data: { - login: currentUser.login, - token: currentUser.token - }, - success: function(user) { - currentUser.attr({}, true); - window.localStorage.setItem('currentUser', '{}'); - } - }); - } -}); \ No newline at end of file diff --git a/pollen-ui-js/src/main/webapp/js/controls/poll_form.js b/pollen-ui-js/src/main/webapp/js/controls/poll_form.js deleted file mode 100644 index 1e9300a..0000000 --- a/pollen-ui-js/src/main/webapp/js/controls/poll_form.js +++ /dev/null @@ -1,176 +0,0 @@ -/* - * #%L - * Pollen :: UI (JS) - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2009 - 2013 CodeLutin - * %% - * 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 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/>. - * #L% - */ -var PollForm = can.Control({ - - defaults: { - poll: new Poll({ - choiceAddAllowed: true, - choice: [] - }), - process: new can.Observe({ - step: 1 - }) - }, - - pollDefaultValues: { - continuousResults: true, - choice: [{},{}], - voterList: [[{}, {}]] - } - -}, { - - init: function() { - var self = this; - - this.element.html(can.view('views/poll_form.ejs', { - poll: this.options.poll, - process: this.options.process - })); - - this.options.process.delegate('step', 'change', function(ev, prop, how, newVal, oldVal) { - var breadcrumbs = self.element.find('.breadcrumb li'); - breadcrumbs.each(function() { - var li = $(this); - if (li.data('step') == newVal) { - li.addClass("active"); - li.find('.step').removeClass("btn-link"); - } else { - li.removeClass("active"); - if (li.data('step') < newVal) { - li.find('.step').addClass("btn-link"); - } - } - }); - - var div = self.element.find(".step" + newVal); - div.siblings().hide(); - div.show(); - }); - - this.options.poll.delegate('voteCountingType', 'change', function(ev, prop, how, newVal, oldVal) { - var toSelectOption = self.element.find('[name="voteCountingType"] [value=' + newVal + ']'); - toSelectOption.attr('selected', 'selected'); - $('#pollCreationFormVoteCountingTypeHelp').html(pollen.choice.voteType[toSelectOption.data('description')].description); - }); - - this.options.poll.delegate('choiceAddAllowed', 'change', function(ev, prop, how, newVal, oldVal) { - $('.dateTimePicker.addChoiceDate').each(function() { - if (newVal) { - $(this).data('datetimepicker').enable(); - } else { - $(this).data('datetimepicker').disable(); - } - }); - }); - }, - - ':type/:action route': function(data) { - if (data.type === "poll" && data.action === "create") { - if (data.step) { - this.options.process.attr('step', data.step); - this.element.show(); - - } else { - var self = this; - $.when(can.ajax(backendUrl + "/polls/new", { - data: { - choiceType: "TEXT", - userId: currentUser.id - } - })).then(function(pollData) { - var poll = new Poll(pollData); - self.editPoll(poll); - }); - } - } - }, - - ':type/:id/:action route': function(data) { - if (data.type === "poll" && data.action === "edit") { - $.when(Poll.findOne({id: data.id})).then( - function(poll) { - self.editPoll(poll); - }); - } - }, - - '.breadcrumb .step click': function(el) { - var step = el.parent().data('step'); - if (step < this.options.process.step) { - this.options.process.attr('step', step); - } - }, - - 'button.prevStep click': function() { - var process = this.options.process; - process.attr('step', process.step - 1); - }, - - 'button.nextStep click': function() { - var process = this.options.process; - process.attr('step', process.step + 1); - }, - - '.dateTimePicker changeDate': function(el, e) { - var input = el.find('input'); - var owner = input.data('owner'); - owner.attr(input.attr('name'), e.localDate.getTime()); - }, - - ':input:not(:checkbox):not(:checkbox) change': function(el) { - var owner = el.data('owner'); - owner.attr(el.attr('name'), el.val()); - }, - - ':checkbox change': function(el) { - var owner = el.data('owner'); - owner.attr(el.attr('name'), el.prop('checked')); - }, - - '.addChoice click': function() { - this.options.poll.choice.push({}); - }, - - '#pollCreationForm submit': function(form) { - var self = this; - - this.options.poll.save(function(data) { - if (data.id) { - self.options.poll.id = data.id; - } - can.route.attr({ type: "poll", action: "summary", id: data.id }); - }); - - return false; - }, - - editPoll: function(poll) { - this.options.poll.attr(this.constructor.pollDefaultValues, true); - this.options.poll.attr(poll._data); - this.element.siblings().hide(); - this.options.process.attr('step', 1); - this.element.show(); - } - -}); \ No newline at end of file diff --git a/pollen-ui-js/src/main/webapp/js/controls/poll_list.js b/pollen-ui-js/src/main/webapp/js/controls/poll_list.js deleted file mode 100644 index 3dcadce..0000000 --- a/pollen-ui-js/src/main/webapp/js/controls/poll_list.js +++ /dev/null @@ -1,53 +0,0 @@ -/* - * #%L - * Pollen :: UI (JS) - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2009 - 2013 CodeLutin - * %% - * 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 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/>. - * #L% - */ -var PollList = can.Control({ - - defaults: { - polls: new Poll.List() - } - -}, { - - init: function() { - this.element.html(can.view('views/poll_list.ejs', { - polls: this.options.polls - })); - }, - - ':type/:action route': function(data) { - if (data.type === "polls") { - var self = this; - $.when(Poll.findAll({ category: 'created', userId: currentUser.id })).then( - function(polls) { - self.updatePolls(polls); - }); - } - }, - - updatePolls: function(polls) { - this.options.polls.replace(polls); - this.element.siblings().hide(); - this.element.show(); - } - -}); \ No newline at end of file diff --git a/pollen-ui-js/src/main/webapp/js/controls/poll_summary.js b/pollen-ui-js/src/main/webapp/js/controls/poll_summary.js deleted file mode 100644 index 050746e..0000000 --- a/pollen-ui-js/src/main/webapp/js/controls/poll_summary.js +++ /dev/null @@ -1,55 +0,0 @@ -/* - * #%L - * Pollen :: UI (JS) - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2009 - 2013 CodeLutin - * %% - * 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 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/>. - * #L% - */ -var PollSummary = can.Control({ - - defaults: { - poll: new Poll() - } - -}, { - - init: function() { - - this.element.html(can.view('views/summary.ejs', { - poll: this.options.poll - })); - - }, - - ':type/:id/:action route': function(data) { - if (data.type === "poll" && data.action === "summary") { - var self = this; - $.when(Poll.findOne({id: data.id, auth: currentUser.token})).then( - function(poll) { - self.updateSummary(poll); - }); - } - }, - - updateSummary: function(poll) { - this.options.poll.attr(poll._data, true); - this.element.siblings().hide(); - this.element.show(); - } - -}); \ No newline at end of file diff --git a/pollen-ui-js/src/main/webapp/js/controls/user_form.js b/pollen-ui-js/src/main/webapp/js/controls/user_form.js deleted file mode 100644 index 8ae3ab3..0000000 --- a/pollen-ui-js/src/main/webapp/js/controls/user_form.js +++ /dev/null @@ -1,122 +0,0 @@ -/* - * #%L - * Pollen :: UI (JS) - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2009 - 2013 CodeLutin - * %% - * 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 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/>. - * #L% - */ -var UserForm = can.Control({ - - defaults: { - user: new User() - } - -}, { - init: function() { - - this.element.html(can.view('views/user_form.ejs', { - user: this.options.user - })); - - }, - - ':type/:action route': function(data) { - if (data.type === "user" && data.action === "registration") { - this.editUser(new User()); - } - }, - - ':type/:id/:action route': function(data) { - if (data.type === "user" && data.action === "edit") { - var self = this; - $.when(User.findOne({id: data.id})).then( - function(user) { - self.editUser(user); - }); - } - }, - - ':input change': function(el) { - this.options.user.attr(el.attr('name'), el.val()); - }, - - ':input keyup': function(el) { - this.options.user.attr(el.attr('name'), el.val()); - }, - - '#userEditionForm submit': function(form) { - var self = this, - user = this.options.user, - password = user.password, - errors = user.errors(); - - if (errors == null) { - user.repeatPassword = null; - user.save(function(data) { - form[0].reset(); - can.ajax(backendUrl + '/login', { - type: 'PUT', - data: { - login: user.login, - password: password - }, - success: function(user) { - currentUser.attr(user.pollenUser, true); - currentUser.attr("token", user.id); - window.localStorage.setItem('currentUser', JSON.stringify(currentUser._data)); - can.route.attr({ type: 'polls', action: 'created' }); - } - }); - }); - - } else { - for (var error in errors) { - this.hideOrShowError(error, errors); - } - } - - return false; - }, - - '{user} change': function(user, ev, attr, type, newValue, oldValue) { - var errors = user.errors(); - this.hideOrShowError(attr, errors, type == "remove"); - }, - - hideOrShowError: function(attr, errors, forceHide) { - var error = errors && errors[attr]; - var el = this.element.find(':input[name="' + attr + '"]'); - - if (error && !forceHide) { - el.parents('.control-group').addClass('error'); - el.siblings('.help-inline').text($.i18n.prop(error, this.options.user[attr])); - el.siblings('.help-inline').show(); - - } else { - el.parents('.control-group').removeClass('error'); - el.siblings('.help-inline').hide(); - } - }, - - editUser: function(user) { - this.options.user.attr(user._data, true); - this.element.siblings().hide(); - this.element.show(); - } - -}); \ No newline at end of file diff --git a/pollen-ui-js/src/main/webapp/js/controls/vote.js b/pollen-ui-js/src/main/webapp/js/controls/vote.js deleted file mode 100644 index aa629d4..0000000 --- a/pollen-ui-js/src/main/webapp/js/controls/vote.js +++ /dev/null @@ -1,183 +0,0 @@ -/* - * #%L - * Pollen :: UI (JS) - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2009 - 2013 CodeLutin - * %% - * 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 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/>. - * #L% - */ -var PollVote = can.Control({ - - // route - - ':type/:id/:action route': function(data) { - if (data.type === "poll" && data.action === "vote") { - var self = this; - $.when(Poll.findOne({id: data.id}), - Choice.findAll({pollId: data.id}), - Comment.findAll({pollId: data.id}), - Vote.findAll({pollId: data.id})).then( - function(poll, choices, comments, votes) { - self.showPoll(poll, choices, comments, votes); - }); - } - }, - - // click events - - '#voteSummary click': function() { - this.scrollToComponent($("#voteForm")); - }, - - '#commentSummary click': function() { - this.scrollToComponent($("#comments")); - }, - - '#voteForm submit': function(form) { - var voteToChoices = {}; - var choices = this.options.poll.choices; - for (var i = 0 ; i < choices.length ; i++) { - var choice = choices[i]; - var voteValue = form.find("[name='" + i + "']").is(':checked'); - voteToChoices[choice.id] = { voteValue: voteValue, choice: choice.id }; - } - - var nameInput = form.find("[name='userName']"); - var voteAttributes = { - voterListMember: { - name: nameInput.val() - }, - voteToChoices: voteToChoices - }; - - var vote = new Vote(voteAttributes); - var errors = vote.errors(); - if (errors != null) { - if (errors.voterListMember != null) { - nameInput.parents('.control-group').addClass('error'); - } - - } else { - var self = this; - var poll = this.options.poll; - vote.save({ pollId: poll.id }, function(saved) { - self.options.votes.push(vote); - for (var choiceId in vote.voteToChoices) { - if (vote.voteToChoices[choiceId].voteValue) { - var result = poll.results[choiceId]; - poll.results.attr(choiceId, result + 1); - } - } - }); - - form[0].reset(); - } - - return false; - }, - - '#addChoiceForm submit': function(form) { - var choices = this.options.poll.choices; - var name = form.find("[name='name']").val(); - var desc = form.find("[name='description']").val(); - var choiceId = moment().valueOf(); - choices.push({ id: choiceId, name: name, description: desc }); - this.options.poll.results.attr(choiceId, 0); - - form[0].reset(); - - return false; - }, - - '#addCommentForm submit': function(form) { - var comments = this.options.poll.comments; - var author = form.find("[name='author']").val(); - var message = form.find("[name='message']").val(); - - var comment = new Comment({ - author: author, - text: message, - postDate: new Date().getTime() - }); - var self = this; - comment.save({ pollId: this.options.poll.id }, - function(data) { - if (data.id) { - comment.attr('id', data.id); - } - self.options.comments.push(comment); - self.scrollToComponent(form); - }); - - form[0].reset(); - - return false; - }, - - 'th mouseover': function(element) { - element.popover('show'); - }, - - 'th mouseout': function(element) { - element.popover('hide'); - }, - - // other functions - - showPoll: function(poll, choices, comments, votes) { - var results = new can.Observe.List(); - // init results - for (var i = 0 ; i < choices.length ; i++) { - results[choices[i].id] = 0; - } - // fill the results - for (i = 0 ; i < votes.length ; i++) { - var vote = votes[i]; - var voteToChoices = {}; - // create a map of the choices by id - for (var j = 0 ; j < vote.voteToChoices.length ; j++) { - var voteChoice = vote.voteToChoices[j]; - voteToChoices[voteChoice.choice] = voteChoice; - if (voteChoice.voteValue) { - results.attr(voteChoice.choice, results[voteChoice.choice] + 1); - } - } - vote.voteToChoices = voteToChoices; - } - poll.results = results; - - this.options.poll = poll; - this.options.choices = choices; - this.options.votes = votes; - this.options.comments = comments; - - this.element.html(can.view('views/vote.ejs', { - poll: poll, - choices: choices, - comments: comments, - votes: votes, - currentUser: currentUser - })); - this.element.siblings().hide(); - this.element.show(); - }, - - scrollToComponent: function(component) { - $('html, body').scrollTo(null, component); - } - -}); \ No newline at end of file diff --git a/pollen-ui-js/src/main/webapp/js/libs/bootstrap-datetimepicker.min.js b/pollen-ui-js/src/main/webapp/js/libs/bootstrap-datetimepicker.min.js deleted file mode 100644 index a30f776..0000000 --- a/pollen-ui-js/src/main/webapp/js/libs/bootstrap-datetimepicker.min.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * ========================================================= - * bootstrap-datetimepicker.js - * http://www.eyecon.ro/bootstrap-datepicker - * ========================================================= - * Copyright 2012 Stefan Petre - * - * Contributions: - * - Andrew Rowls - * - Thiago de Arruda - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ========================================================= - */ -(function($){var smartPhone=window.orientation!=undefined;var DateTimePicker=function(element,options){this.id=dpgId++;this.init(element,options)};var dateToDate=function(dt){if(typeof dt==="string"){return new Date(dt)}return dt};DateTimePicker.prototype={constructor:DateTimePicker,init:function(element,options){var icon;if(!(options.pickTime||options.pickDate))throw new Error("Must choose at least one picker");this.options=options;this.$element=$(element);this.language=options.language [...] \ No newline at end of file diff --git a/pollen-ui-js/src/main/webapp/js/libs/jquery.scrollto.js b/pollen-ui-js/src/main/webapp/js/libs/jquery.scrollto.js deleted file mode 100644 index adc2d59..0000000 --- a/pollen-ui-js/src/main/webapp/js/libs/jquery.scrollto.js +++ /dev/null @@ -1,54 +0,0 @@ -/* - * #%L - * Pollen :: UI (JS) - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2009 - 2013 CodeLutin - * %% - * 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 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/>. - * #L% - */ -/*! - * jquery.scrollto.js 0.0.1 - https://github.com/yckart/jquery.scrollto.js - * Scroll smooth to any element in your DOM. - * - * Copyright (c) 2012 Yannick Albert (http://yckart.com) - * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php). - * 2013/02/17 - **/ -$.scrollTo = $.fn.scrollTo = function(x, y, options){ - if (!(this instanceof $)) return $.fn.scrollTo.apply($('html, body'), arguments); - - options = $.extend({}, { - gap: { - x: 0, - y: 0 - }, - animation: { - easing: 'swing', - duration: 600, - complete: $.noop, - step: $.noop - } - }, options); - - return this.each(function(){ - var elem = $(this); - elem.stop().animate({ - scrollLeft: !isNaN(Number(x)) ? x : $(y).offset().left + options.gap.x, - scrollTop: !isNaN(Number(y)) ? y : $(y).offset().top + options.gap.y - }, options.animation); - }); -}; diff --git a/pollen-ui-js/src/main/webapp/js/models/choices.js b/pollen-ui-js/src/main/webapp/js/models/choices.js deleted file mode 100644 index 2099158..0000000 --- a/pollen-ui-js/src/main/webapp/js/models/choices.js +++ /dev/null @@ -1,27 +0,0 @@ -/* - * #%L - * Pollen :: UI (CanJS) - * %% - * Copyright (C) 2009 - 2014 CodeLutin - * %% - * 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 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/>. - * #L% - */ -var Choice = can.Model({ - findAll : "GET " + backendUrl + "/polls/{pollId}/choices", - findOne : "GET " + backendUrl + "/polls/{pollId}/choices/{id}", - create : "POST " + backendUrl + "/polls/{pollId}/choices", - update : "PUT " + backendUrl + "/polls/{pollId}/choices/{id}", - destroy : "DELETE " + backendUrl + "/polls/{pollId}/choices/{id}" -},{}); \ No newline at end of file diff --git a/pollen-ui-js/src/main/webapp/js/models/comments.js b/pollen-ui-js/src/main/webapp/js/models/comments.js deleted file mode 100644 index 8bc7dce..0000000 --- a/pollen-ui-js/src/main/webapp/js/models/comments.js +++ /dev/null @@ -1,70 +0,0 @@ -/* - * #%L - * Pollen :: UI (JS) - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2009 - 2013 CodeLutin - * %% - * 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 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/>. - * #L% - */ -var Comment = can.Model({ - findAll : "GET " + backendUrl + "/polls/{pollId}/comments", - findOne : "GET " + backendUrl + "/polls/{pollId}/comments/{id}", - create : "POST " + backendUrl + "/polls/{pollId}/comments", - update : "PUT " + backendUrl + "/polls/{pollId}/comments/{id}", - destroy : "DELETE " + backendUrl + "/polls/{pollId}/comments/{id}" -},{}); - -var COMMENTS = [ - [{ - text: "This is the end of the world", - author: "Mayan guy", - postDate: moment().subtract('d', 5).valueOf() - },{ - text: "Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praese [...] - author: "Sacha", - postDate: moment().subtract('d', 7).valueOf() - }], - [{ - text: "azztyuiopfghj", - author: "yyy", - postDate: moment().subtract('d', 2).valueOf() - },{ - text: "aqwxszedv", - author: "sdsqdqsdqsdqdqsd", - postDate: moment().subtract('d', 6).valueOf() - }] -]; - -can.fixture("GET " + backendUrl + "/polls/{pollId}/comments", function(orig) { - return []; -}); - -var idToInc= 3; -can.fixture("POST " + backendUrl + "/polls/{pollId}/comments", function() { - console.log("create comment " + idToInc); - return {id: (idToInc++)} -}); - -can.fixture("PUT " + backendUrl + "/polls/{pollId}/comments/{id}", function(orig) { - console.log("update comment " + orig.data.id); - return {}; -}); - -can.fixture("DELETE " + backendUrl + "/polls/{pollId}/comments/{id}", function(orig){ - console.log("delete comment " + orig.data.commentId); - return {}; -}); \ No newline at end of file diff --git a/pollen-ui-js/src/main/webapp/js/models/polls.js b/pollen-ui-js/src/main/webapp/js/models/polls.js deleted file mode 100644 index 9d9fc62..0000000 --- a/pollen-ui-js/src/main/webapp/js/models/polls.js +++ /dev/null @@ -1,104 +0,0 @@ -/* - * #%L - * Pollen :: UI (JS) - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2009 - 2013 CodeLutin - * %% - * 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 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/>. - * #L% - */ -var Poll = can.Model({ - findAll : "GET " + backendUrl + "/polls/{category}", - findOne : "GET " + backendUrl + "/polls/{id}", - create : function(attrs) { - var t = paramForWM(attrs, 'poll') + 'userId=' + currentUser.id; - return can.ajax(backendUrl + "/polls", { - type: "POST", - data: t - }); - }, - update : "PUT " + backendUrl + "/polls/{id}", - destroy : "DELETE " + backendUrl + "/polls/{id}" -}, {}); - -var POLLS = [ - { - id: 1, - title: 'Titre 1', - description: "Desc 1", - creatorName: "Kevin", - closed: true, - choices: [ - { - id: 1, - name: "Choix 1", - description: "desc du choix 1" - }, - { - id: 2, - name: "Choix 2", - description: "desc du choix 2" - } - ] - }, - { - id: 2, - title: 'Lorem Ipsum', - description: "description très longue, mais vraiment très longue pour qu'elle passe en dessous. Enfin j'espère que ce sera assez long", - creatorName: "moi", - choiceAddAllowed: true, - beginChoiceDate: moment().valueOf(), - endChoiceDate: moment().add('m', 1).valueOf(), - beginDate: moment().subtract('d', 5).valueOf(), - endDate: moment().add('d', 5).valueOf(), - choices: [ - { - id: 3, - name: "Choix 1", - description: "desc du choix 1" - }, - { - id: 4, - name: "Choix 2", - description: "desc du choix 2" - } - ] - }, -]; - -//can.fixture("GET " + backendUrl + "/polls", function(){ -// return POLLS; -//}); - -//can.fixture("GET " + backendUrl + "/polls/{id}", function(orig) { -// return POLLS[orig.data.id - 1]; -//}); - -var idToInc= 3; -//can.fixture("POST " + backendUrl + "/polls", function() { -// console.log("create poll " + idToInc); -// return {id: (idToInc++)} -//}); - -can.fixture("PUT " + backendUrl + "/polls/{id}", function(orig) { - console.log("update poll " + orig.data.id); - return {}; -}); - -can.fixture("DELETE " + backendUrl + "/polls/{id}", function(orig){ - console.log("delete poll " + orig.data.id); - return {}; -}); diff --git a/pollen-ui-js/src/main/webapp/js/models/users.js b/pollen-ui-js/src/main/webapp/js/models/users.js deleted file mode 100644 index 2637d6f..0000000 --- a/pollen-ui-js/src/main/webapp/js/models/users.js +++ /dev/null @@ -1,102 +0,0 @@ -/* - * #%L - * Pollen :: UI (JS) - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2009 - 2013 CodeLutin - * %% - * 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 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/>. - * #L% - */ -var User = can.Model({ - findAll : "GET " + backendUrl + "/users", - findOne : "GET " + backendUrl + "/users/{id}", - create : function(attrs) { - return can.ajax(backendUrl + "/users",{ - type: "POST", - data: paramForWM(attrs, 'user') + 'generatePassword=false' - }); - }, - update : "PUT " + backendUrl + "/users/{id}", - - init: function() { - this.validatePresenceOf(["login", "name", "email", "password", "repeatPassword"], - { - message : "pollen.validation.required" - }); - - this.validateFormatOf( - ["email"], - /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/, - { - message : "pollen.validation.email.format.error" - }); - - this.validateLengthOf(["password"], 6, 1000, { - message : "pollen.validation.password.length.error" - }); - - this.validate(["repeatPassword"], function(val) { - if (val != this.password) { - return "pollen.validation.passwords.different.error"; - } - }); - } - -}, {}); - -var USERS = [ - { - id: 1, - login: 'kmorin', - name: "Kevin Morin", - email: "kmorin@codelutin.com" - }, - { - id: 2, - login: 'tchemit', - name: "Tony Chemit", - email: "chemit@codelutin.com" - }, -]; - -//can.fixture("GET " + backendUrl + "/users", function(){ -// return USERS; -//}); -// -//can.fixture("GET " + backendUrl + "/users/{id}", function(orig) { -// return USERS[orig.data.id - 1]; -//}); -// -//var idToInc= 3; -//can.fixture("POST " + backendUrl + "/users", function() { -// console.log("create user " + idToInc); -// return {id: (idToInc++)} -//}); -// -//can.fixture("PUT " + backendUrl + "/users/{id}", function(orig) { -// console.log("update user " + orig.data.id); -// return {}; -//}); -// -//can.fixture("PUT " + backendUrl + "/login", function(orig) { -// console.log("login user " + orig.data.login); -// for (var i = 0 ; i < USERS.length ; i++) { -// if (USERS[i].login == orig.data.login) { -// return USERS[i]; -// } -// } -// return {}; -//}); \ No newline at end of file diff --git a/pollen-ui-js/src/main/webapp/js/models/votes.js b/pollen-ui-js/src/main/webapp/js/models/votes.js deleted file mode 100644 index 0a75630..0000000 --- a/pollen-ui-js/src/main/webapp/js/models/votes.js +++ /dev/null @@ -1,168 +0,0 @@ -/* - * #%L - * Pollen :: UI (JS) - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2009 - 2013 CodeLutin - * %% - * 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 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/>. - * #L% - */ -var Vote = can.Model({ - findAll : "GET " + backendUrl + "/polls/{pollId}/votes", - findOne : "GET " + backendUrl + "/polls/{pollId}/votes/{id}", - create : "POST " + backendUrl + "/polls/{pollId}/votes", - update : "PUT " + backendUrl + "/polls/{pollId}/votes/{id}", - destroy : "DELETE " + backendUrl + "/polls/{pollId}/votes/{id}", - - init: function() { - this.validate(["voterListMember"], function(val) { - if (!val || !val.name) { - return "pollen.validation.required"; - } - }); - } -},{}); - -var VOTES = [ - [{ - id: 1, - voterListMember: { - name: "Joe", - email: "joe@dalt.on" - }, - voteToChoices: [{ - voteValue: 0, - choice: 1 - },{ - voteValue: 0, - choice: 2 - }] - - }, { - id: 2, - voterListMember: { - name: "Jack", - email: "jack@dalt.on" - }, - voteToChoices: [{ - voteValue: 1, - choice: 1 - },{ - voteValue: 1, - choice: 2 - }] - },{ - id: 3, - voterListMember: { - name: "William", - email: "william@dalt.on" - }, - voteToChoices: [{ - voteValue: 0, - choice: 2 - }, { - voteValue: 1, - choice: 1 - }] - }, { - id: 4, - voterListMember: { - name: "Avrel", - email: "avrel@dalt.on" - }, - voteToChoices: [{ - voteValue: 0, - choice: 1 - },{ - voteValue: 1, - choice: 2 - }] - }], - [{ - id: 5, - voterListMember: { - name: "Joe", - email: "joe@dalt.on" - }, - voteToChoices: [{ - voteValue: 0, - choice: 3 - },{ - voteValue: 0, - choice: 4 - }] - - }, { - id: 6, - voterListMember: { - name: "Jack", - email: "jack@dalt.on" - }, - voteToChoices: [{ - voteValue: 1, - choice: 3 - },{ - voteValue: 1, - choice: 4 - }] - },{ - id: 7, - voterListMember: { - name: "William", - email: "william@dalt.on" - }, - voteToChoices: [{ - voteValue: 1, - choice: 3 - },{ - voteValue: 0, - choice: 4 - }] - }, { - id: 8, - voterListMember: { - name: "Avrel", - email: "avrel@dalt.on" - }, - voteToChoices: [{ - voteValue: 0, - choice: 3 - },{ - voteValue: 1, - choice: 4 - }] - }] -]; - -can.fixture("GET " + backendUrl + "/polls/{pollId}/votes", function(orig) { - return []; -}); - -var idToInc= 3; -can.fixture("POST " + backendUrl + "/polls/{pollId}/votes", function() { - console.log("create vote " + idToInc); - return {id: (idToInc++)} -}); - -can.fixture("PUT " + backendUrl + "/polls/{pollId}/votes/{id}", function(orig) { - console.log("update vote " + orig.data.id); - return {}; -}); - -can.fixture("DELETE " + backendUrl + "/polls/{pollId}/votes/{id}", function(orig){ - console.log("delete vote " + orig.data.vote); - return {}; -}); \ No newline at end of file diff --git a/pollen-ui-js/src/main/webapp/js/pollen-utils.js b/pollen-ui-js/src/main/webapp/js/pollen-utils.js deleted file mode 100644 index ed4964d..0000000 --- a/pollen-ui-js/src/main/webapp/js/pollen-utils.js +++ /dev/null @@ -1,33 +0,0 @@ -/* - * #%L - * Pollen :: UI (CanJS) - * %% - * Copyright (C) 2009 - 2014 CodeLutin - * %% - * 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 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/>. - * #L% - */ -var backendUrl = 'http://localhost:8080/pollen/v1'; - -var paramForWM = function(obj, objName) { - var result = ""; - for (var k in obj) { - if (typeof obj[k] === "object") { - result += paramForWM(obj[k], objName + '.' + k); - } else { - result += objName + '.' + k + '=' + obj[k] + '&'; - } - } - return result; -};;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; [...] \ No newline at end of file diff --git a/pollen-ui-js/src/main/webapp/js/route.js b/pollen-ui-js/src/main/webapp/js/route.js deleted file mode 100644 index 1b394bf..0000000 --- a/pollen-ui-js/src/main/webapp/js/route.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * #%L - * Pollen :: UI (JS) - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2009 - 2013 CodeLutin - * %% - * 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 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/>. - * #L% - */ -var Routing = can.Control({ - 'route': function() { - // Matches every routing change, but gets passed no data. - console.log("route") - }, - - ':type route': function(data) { - console.log(":type route " + data) - }, - - ':type/:id route': function(data) { - console.log(":type/:id route" + data) - } -}); \ No newline at end of file diff --git a/pollen-ui-js/src/main/webapp/views/menu.ejs b/pollen-ui-js/src/main/webapp/views/menu.ejs deleted file mode 100644 index f9b6144..0000000 --- a/pollen-ui-js/src/main/webapp/views/menu.ejs +++ /dev/null @@ -1,69 +0,0 @@ -<a class="brand" href="#"><%= pollen.app.title %></a> -<ul class="nav"> - <li><%== can.route.link(pollen.menu.home, {}) %></li> - <li class="dropdown"> - <a href="#" role="button" class="dropdown-toggle" data-toggle="dropdown"> - <%= pollen.menu.polls.label %> <strong class="caret"></strong> - </a> - <ul class="dropdown-menu" role="menu"> - <li role="presentation"> - <%== can.route.link(pollen.menu.polls.create, { type: 'poll', action: 'create' }, { role: 'menuitem', tabIndex: "-1" }, false) %> - </li> - <% if (currentUser.attr('login')) { %> - <li class="divider" role="presentation"></li> - <li role="presentation"> - <%== can.route.link(pollen.menu.polls.list, { type: 'polls', action: 'created' }, { role: 'menuitem', tabIndex: "-1" }, false) %> - </li> - <% } %> - </ul> - </li> -</ul> - -<ul class="nav pull-right"> - <% if (!currentUser.attr('login')) { %> - <li><%== can.route.link(pollen.menu.register, { type: 'user', action: 'registration' }) %></li> - <li class="divider-vertical"></li> - <li class="dropdown"> - <a href="#" role="button" class="dropdown-toggle" data-toggle="dropdown"> - <%= pollen.menu.login.label %> <strong class="caret"></strong> - </a> - <div class="dropdown-menu form" role="menu"> - <form id='loginForm'> - <div class="control-group"> - <label class="control-label"><%= pollen.menu.login.form.login.label %></label> - <input type="text" name='login' placeholder="<%= pollen.menu.login.form.login.placeholder %>"/> - <span class="help-block hide"></span> - </div> - <div class="control-group"> - <label class="control-label" ><%= pollen.menu.login.form.password.label %></label> - <input type="password" name='password' placeholder="<%= pollen.menu.login.form.password.placeholder %>"/> - <span class="help-block hide"></span> - </div> - <div class="control-group"> - <label class="control-label checkbox" > - <input type="checkbox" name='rememberMe'> <%= pollen.menu.login.form.rememberMe.label %> - </label> - </div> - <div class="form-actions"> - <button type="submit" class="btn btn-primary"><%= pollen.menu.login.form.button %></button> - </div> - </form> - </div> - </li> - <% } else { %> - <li class="dropdown"> - <a href="#" role="button" class="dropdown-toggle" data-toggle="dropdown"> - <%= currentUser.attr('name') %> <strong class="caret"></strong> - </a> - <ul class="dropdown-menu" role="menu"> - <li role="presentation"> - <%== can.route.link(pollen.menu.user.profile, { type: 'user', action: 'edit', id: currentUser.attr('id') }) %> - </li> - <li class="divider" role="presentation"></li> - <li role="presentation"> - <a id='menuItemLogout'><%= pollen.menu.logout %></a> - </li> - </ul> - </li> - <% } %> -</ul> \ No newline at end of file diff --git a/pollen-ui-js/src/main/webapp/views/poll_form.ejs b/pollen-ui-js/src/main/webapp/views/poll_form.ejs deleted file mode 100644 index 24378d4..0000000 --- a/pollen-ui-js/src/main/webapp/views/poll_form.ejs +++ /dev/null @@ -1,339 +0,0 @@ -<h1><%= pollen.poll.form.create.title %></h1> - -<ul class="breadcrumb"> - <li class='active' <%= (el) -> el.data('step', 1) %>><span class='step'><%= pollen.poll.form.create.step1 %></span> <span class="divider">/</span></li> - <li <%= (el) -> el.data('step', 2) %>><span class='step'><%= pollen.poll.form.create.step2 %></span> <span class="divider">/</span></li> -<li <%= (el) -> el.data('step', 3) %>><span class='step'><%= pollen.poll.form.create.step3 %></span> <span class="divider">/</span></li> -</ul> - -<form id='pollCreationForm' class="form-horizontal"> - - <!-- Basic info step --> - <div class='step1'> - <h3><%= pollen.poll.form.create.step1 %></h3> - - <div class="control-group"> - <label class="control-label" for="pollCreationFormTitle"><%= pollen.poll.title.label %></label> - <div class="controls"> - <input type='text' name='title' id='pollCreationFormTitle' class="input-xxlarge" - placeholder='<%= pollen.poll.title.placeholder %>' - value='<%= poll.attr("title")%>' - <%= (el) -> el.data('owner', poll) %>/> - </div> - </div> - - <div class="control-group"> - <label class="control-label" for='pollCreationFormDescription'><%= pollen.poll.description.label %></label> - <div class="controls"> - <textarea id='pollCreationFormDescription' class="input-xxlarge" - name='description' - placeholder="<%= pollen.poll.description.placeholder %>" - <%= (el) -> el.data('owner', poll) %>><%= poll.attr('description') %></textarea> - </div> - </div> - - <div class="control-group"> - <label class="control-label" for='pollCreationFormCreatorName'><%= pollen.poll.creator.name.label %></label> - <div class="controls"> - <input type='text' name='creator.name' id='pollCreationFormCreatorName' class="input-xxlarge" - placeholder='<%= pollen.poll.creator.name.placeholder %>' - value='<%= poll.attr("creator.name")%>' - <%= (el) -> el.data('owner', poll) %>/> - </div> - </div> - - <div class="control-group"> - <label class="control-label" for='pollCreationFormCreatorEmail'><%= pollen.poll.creator.email.label %></label> - <div class="controls"> - <input type='text' name='creator.email' id='pollCreationFormCreatorEmail' class="input-xxlarge" - placeholder='<%= pollen.poll.creator.email.placeholder %>' - value='<%= poll.attr("creator.email")%>' - <%= (el) -> el.data('owner', poll) %>/> - </div> - </div> - - <div class="form-actions"> - <button type="button" class="btn nextStep"><%= pollen.poll.form.create.button.next %></button> - </div> - </div> - - <!-- choices step --> - <div class='step2 hide'> - <h3><%= pollen.poll.form.create.step2 %></h3> - - <% poll.choice.each(function(choice) { %> - <div class="control-group row-fluid"> - <label class="control-label span1" for='pollCreationFormCreatorName'><%= pollen.poll.choice.name.label %></label> - <div class="controls span3"> - <input type='text' name='name' class="input-block-level" - placeholder='<%= pollen.poll.choice.name.placeholder %>' - value="<%= choice.attr('name') %>" - <%= (el) -> el.data('owner', choice) %>/> - </div> - - <label class="control-label span1" for='pollCreationFormCreatorName'><%= pollen.poll.choice.description.label %></label> - <div class="controls span7"> - <textarea name='description' class="input-block-level" - placeholder="<%= pollen.poll.choice.description.placeholder %>" - <%= (el) -> el.data('owner', choice) %>><%= choice.attr('description') %></textarea> - </div> - </div> - <% }) %> - - <div class="form-actions"> - <button type="button" class="btn prevStep"><%= pollen.poll.form.create.button.previous %></button> - <button type='button' class='btn addChoice'><%= pollen.poll.form.create.button.addChoice %></button> - <button type='submit' class="btn btn-primary"><%= pollen.poll.form.create.button.save %></button> - <button type="button" class="btn nextStep"><%= pollen.poll.form.create.button.next %></button> - </div> - - </div> - - <!-- Options step --> - <div class='step3 hide'> - - <h3><%= pollen.poll.form.create.step3 %></h3> - - <!-- dates --> - <fieldset> - <legend><%= pollen.poll.form.create.legend.validityDates %></legend> - - <div class="control-group"> - <label class="control-label" for='pollCreationFormBeginDate'><%= pollen.poll.beginDate.label %></label> - <div class="controls"> - <div class="input-append dateTimePicker"> - <input type="text" name='beginDate' id='pollCreationFormBeginDate' - placeholder='<%= pollen.poll.beginDate.placeholder %>' - value='<%= poll.attr("beginDate") ? moment(poll.attr("beginDate")).format(pollen.common.format.dateTime.moment) : "" %>' - <%= (el) -> el.data('owner', poll) %>/> - <span class="add-on"> - <i data-time-icon="icon-time" data-date-icon="icon-calendar"></i> - </span> - </div> - </div> - </div> - - <div class="control-group"> - <label class="control-label" for='pollCreationFormEndDate'><%= pollen.poll.endDate.label %></label> - <div class="controls"> - <div class="input-append dateTimePicker"> - <input type="text" name='endDate' id='pollCreationFormEndDate' - placeholder='<%= pollen.poll.endDate.placeholder %>' - value='<%= poll.attr("endDate") ? moment(poll.attr("endDate")).format(pollen.common.format.dateTime.moment) : "" %>' - <%= (el) -> el.data('owner', poll) %>/> - <span class="add-on"> - <i data-time-icon="icon-time" data-date-icon="icon-calendar"></i> - </span> - </div> - </div> - </div> - - </fieldset> - - <!-- choices --> - <fieldset> - <legend><%= pollen.poll.form.create.legend.choices %></legend> - - <div class="control-group"> - <div class="controls"> - <label class="checkbox"> - <input type="checkbox" id='pollCreationFormChoiceAddAllowed' name="choiceAddAllowed" - <%= poll.attr('choiceAddAllowed') ? "checked": "" %> - <%= (el) -> el.data('owner', poll) %>/> - <%= pollen.poll.choiceAddAllowed.label %> - </label> - </div> - </div> - - <div class="control-group"> - <label class="control-label" for='pollCreationFormAddChoiceBeginDate'><%= pollen.poll.addChoiceBeginDate.label %></label> - <div class="controls"> - <div class="input-append dateTimePicker addChoiceDate"> - <input type="text" name='addChoiceBeginDate' id='pollCreationFormAddChoiceBeginDate' - placeholder='<%= pollen.poll.addChoiceBeginDate.placeholder %>' - value='<%= poll.attr("addChoiceBeginDate") ? moment(poll.attr("addChoiceBeginDate")).format(pollen.common.format.dateTime.moment) : "" %>' - <%= (el) -> el.data('owner', poll) %>/> - <span class="add-on"> - <i data-time-icon="icon-time" data-date-icon="icon-calendar"></i> - </span> - </div> - </div> - </div> - - <div class="control-group"> - <label class="control-label" for='pollCreationFormAddChoiceEndDate'><%= pollen.poll.addChoiceEndDate.label %></label> - <div class="controls"> - <div class="input-append dateTimePicker addChoiceDate"> - <input type="text" name='addChoiceEndDate' id='pollCreationFormAddChoiceEndDate' - placeholder='<%= pollen.poll.addChoiceEndDate.placeholder %>' - value='<%= poll.attr("addChoiceEndDate") ? moment(poll.attr("addChoiceEndDate")).format(pollen.common.format.dateTime.moment) : "" %>' - <%= (el) -> el.data('owner', poll) %>/> - <span class="add-on"> - <i data-time-icon="icon-time" data-date-icon="icon-calendar"></i> - </span> - </div> - </div> - </div> - - <div class="control-group"> - <label class="control-label" for='pollCreationFormMaxChoiceNumber'><%= pollen.poll.maxChoiceNumber.label %></label> - <div class="controls"> - <input type='number' name='maxChoiceNumber' id='pollCreationFormMaxChoiceNumber' class="input-mini" - placeholder='<%= pollen.poll.maxChoiceNumber.placeholder %>' - value='<%= poll.attr("maxChoiceNumber")%>' - <%= (el) -> el.data('owner', poll) %>/> - <span class="help-inline"><%= pollen.poll.maxChoiceNumber.help %></span> - </div> - </div> - - </fieldset> - - <!-- votes --> - <fieldset> - <legend><%= pollen.poll.form.create.legend.votes %></legend> - - <div class="control-group"> - <label class="control-label" for="pollCreationFormCommentVisibility"><%= pollen.poll.commentVisibility.label %></label> - <div class="controls"> - <select name='commentVisibility' id='pollCreationFormCommentVisibility' <%= (el) -> el.data('owner', poll) %>> - <option value="EVERYBODY"><%= pollen.poll.commentVisibility.everybody.label %></option> - <option value="VOTER"><%= pollen.poll.commentVisibility.voter.label %></option> - <option value="NOBODY"><%= pollen.poll.commentVisibility.nobody.label %></option> - </select> - </div> - </div> - - <div class="control-group"> - <label class="control-label" for="pollCreationFormVoteVisibility"><%= pollen.poll.voteVisibility.label %></label> - <div class="controls"> - <select name='voteVisibility' id='pollCreationFormVoteVisibility' <%= (el) -> el.data('owner', poll) %>> - <option value="EVERYBODY"><%= pollen.poll.voteVisibility.everybody.label %></option> - <option value="VOTER"><%= pollen.poll.voteVisibility.voter.label %></option> - <option value="CREATOR"><%= pollen.poll.voteVisibility.creator.label %></option> - <option value="ANONYMOUS"><%= pollen.poll.voteVisibility.anonymous.label %></option> - </select> - </div> - </div> - - <div class="control-group"> - <div class="controls"> - <label class="checkbox"> - <input type="checkbox" id='pollCreationFormAnonymousVoteAllowed' name="anonymousVoteAllowed" - <%= poll.attr('anonymousVoteAllowed') ? "checked": "" %> - <%= (el) -> el.data('owner', poll) %>/> - <%= pollen.poll.anonymousVoteAllowed.label %> - </label> - </div> - </div> - - <div class="control-group"> - <label class="control-label" for="pollCreationFormPollType"><%= pollen.poll.pollType.label %></label> - <div class="controls"> - <select name='pollType' id='pollCreationFormPollType' <%= (el) -> el.data('owner', poll) %>> - <option value="FREE"><%= pollen.poll.pollType.free.label %></option> - <option value="RESTRICTED"><%= pollen.poll.pollType.restricted.label %></option> - <option value="GROUP"><%= pollen.poll.pollType.group.label %></option> - </select> - </div> - </div> - - <% - if (poll.attr("pollType") == "RESTRICTED") { - poll.voterList[0].each(function(voter) { - %> - <div class="control-group row-fluid"> - <label class="control-label span1"><%= pollen.poll.voter.name.label %></label> - <div class="controls span3"> - <input type='text' name='name' class="input-block-level" - placeholder='<%= pollen.poll.voter.name.placeholder %>' - value="<%= voter.attr('name') %>" - <%= (el) -> el.data('owner', voter) %>/> - </div> - - <label class="control-label span1"><%= pollen.poll.voter.email.label %></label> - <div class="controls span4"> - <input type='text' name='email' class="input-block-level" - placeholder='<%= pollen.poll.voter.email.placeholder %>' - value="<%= voter.attr('email') %>" - <%= (el) -> el.data('owner', voter) %>/> - </div> - - <label class="control-label span1"><%= pollen.poll.voter.weight.label %></label> - <div class="controls span1"> - <input type='text' name='weight' class="input-block-level" - placeholder='<%= pollen.poll.voter.weight.placeholder %>' - value="<%= voter.attr('weight') %>" - <%= (el) -> el.data('owner', voter) %>/> - </div> - - <button type="button" class='btn btn-danger span1'><i class="icon-minus icon-white"></i></button> - </div> - <% }) %> - <button type="button" class='btn btn-success span1'><i class="icon-plus icon-white"></i></button> - <% } %> - - - </fieldset> - - <!-- results --> - <fieldset> - <legend><%= pollen.poll.form.create.legend.results %></legend> - - <div class="control-group"> - <label class="control-label" for="pollCreationFormVoteCountingType"><%= pollen.poll.voteCountingType.label %></label> - <div class="controls"> - <select name='voteCountingType' id='pollCreationFormVoteCountingType' <%= (el) -> el.data('owner', poll) %>> - <option value="1" <%= (el) -> el.data('description', 'normal') %>><%= pollen.choice.voteType.normal.label %></option> - <option value="2" <%= (el) -> el.data('description', 'percentage') %>><%= pollen.choice.voteType.percentage.label %></option> - <option value="3" <%= (el) -> el.data('description', 'condorcet') %>><%= pollen.choice.voteType.condorcet.label %></option> - <option value="4" <%= (el) -> el.data('description', 'number') %>><%= pollen.choice.voteType.number.label %></option> - <option value="5" <%= (el) -> el.data('description', 'borda') %>><%= pollen.choice.voteType.borda.label %></option> - <option value="6" <%= (el) -> el.data('description', 'alternative') %>><%= pollen.choice.voteType.alternative.label %></option> - <option value="7" <%= (el) -> el.data('description', 'coombs') %>><%= pollen.choice.voteType.coombs.label %></option> - </select> - <span id='pollCreationFormVoteCountingTypeHelp' class="help-block"><%= pollen.choice.voteType.normal.description %></span> - </div> - </div> - - <div class="control-group"> - <label class="control-label" for="pollCreationFormResultVisibility"><%= pollen.poll.resultVisibility.label %></label> - <div class="controls"> - <select name='resultVisibility' id='pollCreationFormResultVisibility' <%= (el) -> el.data('owner', poll) %>> - <option value="EVERYBODY"><%= pollen.poll.resultVisibility.everybody.label %></option> - <option value="VOTER"><%= pollen.poll.resultVisibility.voter.label %></option> - <option value="CREATOR"><%= pollen.poll.resultVisibility.creator.label %></option> - </select> - </div> - </div> - - <div class="control-group"> - <div class="controls"> - <label class="checkbox"> - <input type="checkbox" id='pollCreationFormContinuousResults' name="continuousResults" - <%= poll.attr('continuousResults') ? "checked": "" %> - <%= (el) -> el.data('owner', poll) %>/> - <%= pollen.poll.continuousResults.label %> - </label> - </div> - </div> - - </fieldset> - - - <div class="form-actions"> - <button type="button" class="btn prevStep"><%= pollen.poll.form.create.button.previous %></button> - <button type='submit' class="btn btn-primary"><%= pollen.poll.form.create.button.save %></button> - </div> - </div> - -</form> - -<% - $(function() { - $('.dateTimePicker').datetimepicker({ - language: 'fr_FR', - pickSeconds: false, - format: pollen.common.format.dateTime.input - }); - }); -%> \ No newline at end of file diff --git a/pollen-ui-js/src/main/webapp/views/poll_list.ejs b/pollen-ui-js/src/main/webapp/views/poll_list.ejs deleted file mode 100644 index 9b60091..0000000 --- a/pollen-ui-js/src/main/webapp/views/poll_list.ejs +++ /dev/null @@ -1,11 +0,0 @@ -<h1><%= $.i18n.prop("pollen.polls." + can.route.attr('action') + ".title") %></h1> - -<% if (polls.length == 0) { %> -<p><%= pollen.polls.created.empty %></p> -<% } else { - polls.each(function(poll) { %> -<div> - <%== can.route.link(poll.attr('title'), {type: 'poll', action: 'summary', id: poll.attr('id')}) %> -</div> -<% }); - } %> \ No newline at end of file diff --git a/pollen-ui-js/src/main/webapp/views/summary.ejs b/pollen-ui-js/src/main/webapp/views/summary.ejs deleted file mode 100644 index 5fb3d0a..0000000 --- a/pollen-ui-js/src/main/webapp/views/summary.ejs +++ /dev/null @@ -1,36 +0,0 @@ -<h1><%= pollen.poll.summary.title(poll.attr('title')) %></h1> - -<div class="control-group"> - <label class="control-label" for='pollSummaryLink'><%= pollen.poll.summary.linkToVote %></label> - <input type='url' id='pollSummaryLink' value="<%== window.location.href.split('#')[0] + can.route.url({ type: 'poll', action: 'vote', id: poll.attr('id') }) %>"/> - <%== can.route.link('<i class="icon-link bigger link"></i>', {type: 'poll', action: 'vote', id: poll.attr('id')}) %> -</div> - -<div class='row-fluid'> - <div class='span4'> - <h2><%= pollen.poll.summary.part.poll.title %></h2> - <ul class='noListStyle'> - <li><%== can.route.link('<i class="icon-ok"></i>' + pollen.poll.summary.part.poll.item.close, {}) %></li> - <li><%== can.route.link('<i class="icon-pencil"></i>' + pollen.poll.summary.part.poll.item.edit, {type: 'poll', action: 'edit', id: poll.id}) %></li> - <li><%== can.route.link('<i class="icon-envelope"></i>' + pollen.poll.summary.part.poll.item.notification, {}) %></li> - <li><%== can.route.link('<i class="icon-time"></i>' + pollen.poll.summary.part.poll.item.history, {}) %></li> - <li><%== can.route.link('<i class="icon-clone"></i>' + pollen.poll.summary.part.poll.item.duplicate, {}) %></li> - <li><%== can.route.link('<i class="icon-trash"></i>' + pollen.poll.summary.part.poll.item.delete, {}) %></li> - </ul> - </div> - - <div class='span4'> - <h2><%= pollen.poll.summary.part.voters.title %></h2> - <ul class='noListStyle'> - <li><%== can.route.link('<i class="icon-user"></i>' + pollen.poll.summary.part.voters.item.invite, {}) %></li> - <li><%== can.route.link('<i class="icon-envelope"></i>' + pollen.poll.summary.part.voters.item.contact, {}) %></li> - </ul> - </div> - - <div class='span4'> - <h2><%= pollen.poll.summary.part.export.title %></h2> - <ul class='noListStyle'> - <li><%== can.route.link('<i class="icon-upload"></i>'+ pollen.poll.summary.part.export.item.export, {}) %></li> - </ul> - </div> -</div> \ No newline at end of file diff --git a/pollen-ui-js/src/main/webapp/views/user_form.ejs b/pollen-ui-js/src/main/webapp/views/user_form.ejs deleted file mode 100644 index 7201dad..0000000 --- a/pollen-ui-js/src/main/webapp/views/user_form.ejs +++ /dev/null @@ -1,75 +0,0 @@ -<h1><%= user.attr('id') ? pollen.user.form.edit.title.update : pollen.user.form.edit.title.creation %></h1> - -<form method="post" id='userEditionForm' class="form-horizontal"> - - <div class="control-group"> - <label class="control-label" for="userEditionFormLogin"><%= pollen.user.login.label %></label> - <div class="controls"> - <input type='text' name='login' - id='userEditionFormLogin' - placeholder='<%= pollen.user.login.placeholder %>' - value='<%= user.attr("login")%>' - /> - <span class="help-inline"></span> - </div> - </div> - - <div class="control-group"> - <label class="control-label" for="userEditionFormPassword"><%= pollen.user.password.label %></label> - <div class="controls"> - <input type='password' - name='password' - id='userEditionFormPassword' - placeholder='<%= pollen.user.password.placeholder %>' - value='<%= user.attr("password")%>' - /> - <span class="help-inline"></span> - </div> - </div> - - <div class="control-group"> - <label class="control-label" for="userEditionFormRepeatPassword"><%= pollen.user.repeatPassword.label %></label> - <div class="controls"> - <input type='password' - name='repeatPassword' - id='userEditionFormRepeatPassword' - placeholder='<%= pollen.user.repeatPassword.placeholder %>' - value='<%= user.attr("repeatPassword")%>' - /> - <span class="help-inline"></span> - </div> - </div> - - <div class="control-group"> - <label class="control-label" for="userEditionFormName"><%= pollen.user.name.label %></label> - <div class="controls"> - <input type='text' - name='name' - id='userEditionFormName' - placeholder='<%= pollen.user.name.placeholder %>' - value='<%= user.attr("name")%>' - /> - <span class="help-inline"></span> - </div> - </div> - - <div class="control-group"> - <label class="control-label" for="userEditionFormEmail"><%= pollen.user.email.label %></label> - <div class="controls"> - <input type='email' - name='email' - id='userEditionFormEmail' - placeholder='<%= pollen.user.email.placeholder %>' - value='<%= user.attr("email")%>' - /> - <span class="help-inline"></span> - </div> - </div> - - <div class="form-actions"> - <button type='submit' class="btn btn-primary save"> - <%= user.attr('id') ? pollen.user.form.edit.button.update : pollen.user.form.edit.button.create %> - </button> - </div> - -</form> \ No newline at end of file diff --git a/pollen-ui-js/src/main/webapp/views/vote.ejs b/pollen-ui-js/src/main/webapp/views/vote.ejs deleted file mode 100644 index 681d3b9..0000000 --- a/pollen-ui-js/src/main/webapp/views/vote.ejs +++ /dev/null @@ -1,192 +0,0 @@ -<div class="page-header"> - - <h1><%= poll.attr('title') %></h1> - - <p> - <%= pollen.vote.poll.author(poll.attr('creator.name')) %> - <!-- number of votes --> - | <a id="voteSummary" class='link'><i class='icon-user'></i> <%= votes.attr('length') %></a> - <!-- number of comments--> - | <a id="commentSummary" class='link'><i class='icon-comment'></i> <%= comments.attr('length') %></a> - <!-- poll dates --> - <% if (poll.attr('beginDate') && poll.attr('endDate')) { %> - | <i class='icon-time'></i> <%= pollen.common.date.fromTo(moment(poll.attr('beginDate')).format(pollen.common.format.dateTime.moment), moment(poll.attr('endDate')).format(pollen.common.format.dateTime.moment)) %> - <% } else if (poll.attr('beginDate')) { %> - | <i class='icon-time'></i> <%= pollen.common.date.from(moment(poll.attr('beginDate')).format(pollen.common.format.dateTime.moment)) %> - <% } else if (poll.attr('endDate')) { %> - | <i class='icon-time'></i> <%= pollen.common.date.to(moment(poll.attr('endDate')).format(pollen.common.format.dateTime.moment)) %> - <% } %> - </p> - - <p><%= poll.attr('description') %></p> - -</div> - -<!-- alert if the poll is closed --> -<% if (poll.attr('closed')) { %> -<div class="alert fade in"> - <button type="button" class="close" data-dismiss="alert">×</button> - <%== pollen.vote.poll.closed.alert %> -</div> -<% } %> - -<!-- list of the choices --> -<div class='well'> - - <h3><%= pollen.vote.choices.list.title %></h3> - - <ol> - <% choices.each(function(choice) { %> - <li><strong><%= choice.attr('name') %></strong> : - <%== choice.attr('description') ? choice.attr('description') : "<em>" + pollen.choice.noDescription + "</em>" %></li> - <% }); %> - </ol> - <% var now = moment().valueOf(); - if (poll.attr('choiceAddAllowed') && poll.attr('beginChoiceDate') <= now && poll.attr('endChoiceDate') > now) {%> - - <!-- link to show/hide the new choice form --> - <button class="collapsed btn btn-link" data-toggle="collapse" data-target="#addChoiceForm"> - <%= pollen.vote.choices.list.button.addChoice %> <i class="icon-collapse"></i> - </button> - - <!-- form to add a new choice to the poll --> - <form id="addChoiceForm" class="collapse form-horizontal"> - <div class="control-group"> - <label class="control-label" ><%= pollen.choice.name.placeholder %></label> - <div class="controls"> - <input type="text" name="name" placeholder="<%= pollen.choice.name.placeholder %>"/> - </div> - </div> - <div class="control-group"> - <label class="control-label" ><%= pollen.choice.description.placeholder %></label> - <div class="controls"> - <textarea name="description" placeholder="<%= pollen.choice.description.placeholder %>"></textarea> - </div> - </div> - <div class="control-group"> - <div class="controls"> - <button type="submit" class="btn btn-primary"><%= pollen.common.validate %></button> - </div> - </div> - </form> -<% } %> -</div> - -<!-- table of the votes --> -<form id="voteForm"> - - <h2><%= pollen.vote.votes.list.title %></h2> - - <table id="voteTable" class="table table-bordered table-striped"> - <thead> - <tr> - <th><%= pollen.vote.votes.list.header.voter %></th> - <% choices.each(function(choice, i) { %> - <th data-container='body' data-placement='top' title='<%= choice.attr("description") %>'> - <%= choice.attr('name') %> - </th> - <% }); %> - </tr> - </thead> - <tbody> - <% votes.each(function(vote) { %> - <tr> - <td><%= vote.attr('voterListMember.name') %></td> - <% - choices.each(function(choice) { - var voteChoice = vote.voteToChoices[choice.id]; - if (voteChoice == null) { - %> - <td class='choice voteBeforeChoice'></td> - <% } else { %> - <td class='choice <%= voteChoice.attr("voteValue") ? "selected" : "notSelected" %>'> - <%= voteChoice.attr("voteValue") ? "OK" : "" %> - </td> - <% - } - }); - %> - </tr> - <% }); %> - - <tr> - <td>Resultats</td> - <% choices.each(function(choice) { %> - <td class='result'> - <%= poll.results.attr(choice.id) %> - </td> - <% }); %> - </tr> - - <% if (!poll.attr('closed')) { %> - <tr> - <td> - <div class="control-group"> - <div class="controls"> - <input name="userName" - type='text' - value='<%= currentUser.attr("name") %>' - placeholder='<%= pollen.vote.form.add.field.userName.placeholder %>' - required/> - </div> - </div> - </td> - <% choices.each(function(choice, i) { %> - <td><input name="<%= i %>" type='checkbox'/></td> - <% }); %> - </tr> - <% } %> - </tbody> - </table> - - <% if (!poll.attr('closed')) { %> - <div class="form-actions"> - <button type="submit" id="voteButton" class="btn btn-primary"><%= pollen.vote.form.add.button.vote %></button> - </div> - <% } %> - -</form> - -<!-- Comments --> -<div id="comments"> - <h2><%= pollen.vote.comments.list.title %></h2> - - <button class="collapsed btn btn-link" data-toggle="collapse" data-target="#addCommentForm"> - <%= pollen.vote.comments.list.button.addComment %> <i class="icon-collapse"></i> - </button> - - <form id="addCommentForm" class="collapse form-horizontal"> - <div class="control-group"> - <label class="control-label" ><%= pollen.vote.comments.add.field.userName.placeholder %></label> - <div class="controls"> - <input type="text" name="author" placeholder="<%= pollen.vote.comments.add.field.userName.placeholder %>"/> - </div> - </div> - <div class="control-group"> - <label class="control-label" ><%= pollen.vote.comments.add.field.message.placeholder %></label> - <div class="controls"> - <textarea name="message" placeholder="<%= pollen.vote.comments.add.field.message.placeholder %>"></textarea> - </div> - </div> - <div class="control-group"> - <div class="controls"> - <button type="submit" class="btn btn-primary"><%= pollen.common.validate %></button> - </div> - </div> - </form> - - <div class='list alternate-colors'> - <% comments.each(function(comment, i) { %> - - <div class="<%= i % 2 ? 'odd' : 'even' %>"> - <p> - <%= comment.attr('text') %> - </p> - <div class='footer'> - <small><%= comment.attr('author') %> | <%= moment(comment.attr('postDate')).format(pollen.common.format.dateTime.moment) %></small> - </div> - </div> - - <% }); %> - </div> -</div> \ No newline at end of file diff --git a/pollen-ui-riot-js/pom.xml b/pollen-ui-riot-js/pom.xml index 91b2b84..4c7c3c1 100644 --- a/pollen-ui-riot-js/pom.xml +++ b/pollen-ui-riot-js/pom.xml @@ -27,7 +27,7 @@ <parent> <groupId>org.chorem</groupId> <artifactId>pollen</artifactId> - <version>2.0-SNAPSHOT</version> + <version>3.0-SNAPSHOT</version> </parent> <groupId>org.chorem.pollen</groupId> diff --git a/pollen-votecounting-aggregator/pom.xml b/pollen-votecounting-aggregator/pom.xml index 01a6bc3..4e248d5 100644 --- a/pollen-votecounting-aggregator/pom.xml +++ b/pollen-votecounting-aggregator/pom.xml @@ -27,7 +27,7 @@ <parent> <groupId>org.chorem</groupId> <artifactId>pollen</artifactId> - <version>2.0-SNAPSHOT</version> + <version>3.0-SNAPSHOT</version> </parent> <groupId>org.chorem.pollen</groupId> diff --git a/pollen-votecounting-api/pom.xml b/pollen-votecounting-api/pom.xml index 225b755..9f2e3e4 100644 --- a/pollen-votecounting-api/pom.xml +++ b/pollen-votecounting-api/pom.xml @@ -27,7 +27,7 @@ <parent> <groupId>org.chorem</groupId> <artifactId>pollen</artifactId> - <version>2.0-SNAPSHOT</version> + <version>3.0-SNAPSHOT</version> </parent> <groupId>org.chorem.pollen</groupId> diff --git a/pollen-votecounting-borda/pom.xml b/pollen-votecounting-borda/pom.xml index 28533bf..38ed44e 100644 --- a/pollen-votecounting-borda/pom.xml +++ b/pollen-votecounting-borda/pom.xml @@ -27,7 +27,7 @@ <parent> <groupId>org.chorem</groupId> <artifactId>pollen</artifactId> - <version>2.0-SNAPSHOT</version> + <version>3.0-SNAPSHOT</version> </parent> <groupId>org.chorem.pollen</groupId> diff --git a/pollen-votecounting-condorcet/pom.xml b/pollen-votecounting-condorcet/pom.xml index 1bdae20..15f6d71 100644 --- a/pollen-votecounting-condorcet/pom.xml +++ b/pollen-votecounting-condorcet/pom.xml @@ -27,7 +27,7 @@ <parent> <groupId>org.chorem</groupId> <artifactId>pollen</artifactId> - <version>2.0-SNAPSHOT</version> + <version>3.0-SNAPSHOT</version> </parent> <groupId>org.chorem.pollen</groupId> diff --git a/pollen-votecounting-coombs/pom.xml b/pollen-votecounting-coombs/pom.xml index 184f7af..68cfde5 100644 --- a/pollen-votecounting-coombs/pom.xml +++ b/pollen-votecounting-coombs/pom.xml @@ -27,7 +27,7 @@ <parent> <groupId>org.chorem</groupId> <artifactId>pollen</artifactId> - <version>2.0-SNAPSHOT</version> + <version>3.0-SNAPSHOT</version> </parent> <groupId>org.chorem.pollen</groupId> diff --git a/pollen-votecounting-instant-runoff/pom.xml b/pollen-votecounting-instant-runoff/pom.xml index 65f91e8..10e24b8 100644 --- a/pollen-votecounting-instant-runoff/pom.xml +++ b/pollen-votecounting-instant-runoff/pom.xml @@ -27,7 +27,7 @@ <parent> <groupId>org.chorem</groupId> <artifactId>pollen</artifactId> - <version>2.0-SNAPSHOT</version> + <version>3.0-SNAPSHOT</version> </parent> <groupId>org.chorem.pollen</groupId> diff --git a/pollen-votecounting-normal/pom.xml b/pollen-votecounting-normal/pom.xml index 8411a38..16d0ccf 100644 --- a/pollen-votecounting-normal/pom.xml +++ b/pollen-votecounting-normal/pom.xml @@ -27,7 +27,7 @@ <parent> <groupId>org.chorem</groupId> <artifactId>pollen</artifactId> - <version>2.0-SNAPSHOT</version> + <version>3.0-SNAPSHOT</version> </parent> <groupId>org.chorem.pollen</groupId> diff --git a/pollen-votecounting-number/pom.xml b/pollen-votecounting-number/pom.xml index 2b33623..0f301a9 100644 --- a/pollen-votecounting-number/pom.xml +++ b/pollen-votecounting-number/pom.xml @@ -27,7 +27,7 @@ <parent> <groupId>org.chorem</groupId> <artifactId>pollen</artifactId> - <version>2.0-SNAPSHOT</version> + <version>3.0-SNAPSHOT</version> </parent> <groupId>org.chorem.pollen</groupId> diff --git a/pollen-votecounting-percentage/pom.xml b/pollen-votecounting-percentage/pom.xml index 0d8fd60..79c8dd8 100644 --- a/pollen-votecounting-percentage/pom.xml +++ b/pollen-votecounting-percentage/pom.xml @@ -27,7 +27,7 @@ <parent> <groupId>org.chorem</groupId> <artifactId>pollen</artifactId> - <version>2.0-SNAPSHOT</version> + <version>3.0-SNAPSHOT</version> </parent> <groupId>org.chorem.pollen</groupId> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm