diff --git a/app/coffee/app.coffee b/app/coffee/app.coffee index f1e17b00..44e6b72c 100644 --- a/app/coffee/app.coffee +++ b/app/coffee/app.coffee @@ -648,7 +648,6 @@ modules = [ "taigaProject", "taigaUserSettings", "taigaFeedback", - "taigaPlugins", "taigaIntegrations", "taigaComponents", # new modules diff --git a/app/locales/locale-en.json b/app/locales/locale-en.json index 6da49cc2..7ce47389 100644 --- a/app/locales/locale-en.json +++ b/app/locales/locale-en.json @@ -1343,6 +1343,9 @@ "UNBLOCKED": "{{username}} has unblocked {{obj_name}}", "NEW_USER": "{{username}} has joined Taiga" }, + "LEGAL": { + "TERMS_OF_SERVICE_AND_PRIVACY_POLICY_AD": "By clicking \"Sign up\"', you agree to our
terms of service and privacy policy." + }, "EXTERNAL_APP": { "PAGE_TITLE": "An external app requires authentication", "PAGE_DESCRIPTION": "An external app requires authentication", diff --git a/app/plugins/humanshtml/humanshtml.coffee b/app/modules/components/terms-of-service-and-privacy-policy-notice/terms-of-service-and-privacy-policy-notice.directive.coffee similarity index 53% rename from app/plugins/humanshtml/humanshtml.coffee rename to app/modules/components/terms-of-service-and-privacy-policy-notice/terms-of-service-and-privacy-policy-notice.directive.coffee index 59130f8a..b893129f 100644 --- a/app/plugins/humanshtml/humanshtml.coffee +++ b/app/modules/components/terms-of-service-and-privacy-policy-notice/terms-of-service-and-privacy-policy-notice.directive.coffee @@ -16,16 +16,24 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . # -# File: plugins/humanshtml/humanshtml.coffee +# File: modules/components/terms-of-service-and-privacy-policy-notice/terms-of-service-and-privacy-policy-notice.directive.coffee ### -# Simple plugin example that extends the urlmappings -# and add additional template. -taiga = @.taiga -module = angular.module("taigaPlugins") +TermsOfServiceAndPrivacyPolicyNoticeDirective = ($config) -> + link = (scope, el, attrs) -> + scope.privacyPolicyUrl = $config.get("privacyPolicyUrl") + scope.termsOfServiceUrl = $config.get("termsOfServiceUrl") -configure = ($routeProvider) -> - $routeProvider.when("/humans.html", {"templateUrl": "/plugins/humanshtml/templates/humans.html"}) + return { + restrict: "AE", + scope: {}, + link: link, + templateUrl: "components/terms-of-service-and-privacy-policy-notice/terms-of-service-and-privacy-policy-notice.html" + } -module.config(["$routeProvider", configure]) +angular.module("taigaComponents") + .directive("tgTermsOfServiceAndPrivacyPolicyNotice", [ + "$tgConfig", + TermsOfServiceAndPrivacyPolicyNoticeDirective + ]) diff --git a/app/modules/components/terms-of-service-and-privacy-policy-notice/terms-of-service-and-privacy-policy-notice.jade b/app/modules/components/terms-of-service-and-privacy-policy-notice/terms-of-service-and-privacy-policy-notice.jade new file mode 100644 index 00000000..c609f5dd --- /dev/null +++ b/app/modules/components/terms-of-service-and-privacy-policy-notice/terms-of-service-and-privacy-policy-notice.jade @@ -0,0 +1,5 @@ +p.register-text( + ng-if="privacyPolicyUrl && termsOfServiceUrl" + translate="LEGAL.TERMS_OF_SERVICE_AND_PRIVACY_POLICY_AD" + translate-values="{termsOfServiceUrl: termsOfServiceUrl, privacyPolicyUrl: privacyPolicyUrl}" +) diff --git a/app/partials/includes/modules/invitation-register-form.jade b/app/partials/includes/modules/invitation-register-form.jade index 6db3e055..8ac3e284 100644 --- a/app/partials/includes/modules/invitation-register-form.jade +++ b/app/partials/includes/modules/invitation-register-form.jade @@ -1,25 +1,52 @@ form.register-form p.form-header(translate="REGISTER_FORM.TITLE") fieldset - input(type="text", tg-capslock, name="username", ng-model="dataRegister.username", - data-required="true", data-maxlength="255", data-regexp="^[\\w.-]+$", - placeholder="{{'REGISTER_FORM.PLACEHOLDER_NAME' | translate}}") + input( + type="text" + name="username" + ng-model="dataRegister.username" + data-required="true" + data-maxlength="255" + data-regexp="^[\\w.-]+$" + placeholder="{{'REGISTER_FORM.PLACEHOLDER_NAME' | translate}}" + ) fieldset - input(type="text", name="full_name", ng-model="dataRegister.full_name", - data-required="true", data-maxlength="256", - placeholder="{{'REGISTER_FORM.PLACEHOLDER_FULL_NAME' | translate}}") + input( + type="text" + name="full_name" + ng-model="dataRegister.full_name" + data-required="true" + data-maxlength="256" + placeholder="{{'REGISTER_FORM.PLACEHOLDER_FULL_NAME' | translate}}" + ) fieldset - input(type="text", tg-capslock, name="email", ng-model="dataRegister.email", - data-required="true", data-maxlength="255", - placeholder="{{'REGISTER_FORM.PLACEHOLDER_EMAIL' | translate}}") + input( + type="text" + name="email" + ng-model="dataRegister.email" + data-required="true" + data-maxlength="255" + placeholder="{{'REGISTER_FORM.PLACEHOLDER_EMAIL' | translate}}" + ) fieldset - input(type="password", tg-capslock, name="password", ng-model="dataRegister.password", data-required="true", - placeholder="{{'REGISTER_FORM.PLACEHOLDER_PASSWORD' | translate}}") + input( + type="password" + name="password" + tg-capslock + ng-model="dataRegister.password" + data-required="true" + placeholder="{{'REGISTER_FORM.PLACEHOLDER_PASSWORD' | translate}}" + ) fieldset - a.button-register.button-blackish.submit-button(type="submit", title="{{'REGISTER_FORM.ACTION_SIGN_UP' | translate}}", translate="REGISTER_FORM.ACTION_SIGN_UP") + a.button-register.button-blackish.submit-button( + type="submit" + title="{{'REGISTER_FORM.ACTION_SIGN_UP' | translate}}" + translate="REGISTER_FORM.ACTION_SIGN_UP" + ) - tg-terms-notice + //- Only displays terms notice when terms plugin is loaded. + tg-terms-of-service-and-privacy-policy-notice diff --git a/app/partials/includes/modules/register-form.jade b/app/partials/includes/modules/register-form.jade index 62b89c9c..b9335b17 100644 --- a/app/partials/includes/modules/register-form.jade +++ b/app/partials/includes/modules/register-form.jade @@ -1,31 +1,63 @@ div.register-form-container(tg-register) + form.register-form fieldset - input(type="text", name="username", ng-model="data.username", tg-capslock, - data-required="true", data-maxlength="255", data-regexp="^[\\w.-]+$", - placeholder="{{'REGISTER_FORM.PLACEHOLDER_NAME' | translate}}") + input( + type="text" + name="username" + ng-model="data.username" + data-required="true" + data-maxlength="255" + data-regexp="^[\\w.-]+$" + placeholder="{{'REGISTER_FORM.PLACEHOLDER_NAME' | translate}}" + ) fieldset - input(type="text", name="full_name", ng-model="data.full_name", - data-required="true", data-maxlength="256", - placeholder="{{'REGISTER_FORM.PLACEHOLDER_FULL_NAME' | translate}}") + input( + type="text" + name="full_name" + ng-model="data.full_name" + data-required="true" + data-maxlength="256" + placeholder="{{'REGISTER_FORM.PLACEHOLDER_FULL_NAME' | translate}}" + ) fieldset - input(type="text", name="email", ng-model="data.email", tg-capslock, - data-required="true", data-maxlength="255", - placeholder="{{'REGISTER_FORM.PLACEHOLDER_EMAIL' | translate}}") + input( + type="text" + name="email" + ng-model="data.email" + data-required="true" + data-maxlength="255" + placeholder="{{'REGISTER_FORM.PLACEHOLDER_EMAIL' | translate}}" + ) fieldset - input(type="password", name="password", ng-model="data.password", tg-capslock, - data-required="true", data-minlength="4", - placeholder="{{'REGISTER_FORM.PLACEHOLDER_PASSWORD' | translate}}") + input( + type="password" + name="password" + tg-capslock + ng-model="data.password" + data-required="true" + data-minlength="4" + placeholder="{{'REGISTER_FORM.PLACEHOLDER_PASSWORD' | translate}}" + ) fieldset - button.button-register.button-gray.submit-button(type="submit", title="{{'REGISTER_FORM.ACTION_SIGN_UP' | translate}}", translate="REGISTER_FORM.ACTION_SIGN_UP") + button.button-register.button-gray.submit-button( + type="submit" + title="{{'REGISTER_FORM.ACTION_SIGN_UP' | translate}}" + translate="REGISTER_FORM.ACTION_SIGN_UP" + ) fieldset(tg-github-login-button) - // Only displays terms notice when terms plugin is loaded. - tg-terms-notice + //- Only displays terms notice when terms plugin is loaded. + tg-terms-of-service-and-privacy-policy-notice - a.register-text-top(href="", title="{{'REGISTER_FORM.TITLE_LINK_LOGIN' | translate}}", tg-nav="login", translate="REGISTER_FORM.LINK_LOGIN") + a.register-text-top(i + href="" + title="{{'REGISTER_FORM.TITLE_LINK_LOGIN' | translate}}" + tg-nav="login" + translate="REGISTER_FORM.LINK_LOGIN" + ) diff --git a/app/plugins/.hidden b/app/plugins/.hidden deleted file mode 100644 index e69de29b..00000000 diff --git a/app/plugins/humanshtml/templates/humans.html b/app/plugins/humanshtml/templates/humans.html deleted file mode 100644 index 63ee509c..00000000 --- a/app/plugins/humanshtml/templates/humans.html +++ /dev/null @@ -1,10 +0,0 @@ -

Team

- - - diff --git a/app/plugins/main.coffee b/app/plugins/main.coffee deleted file mode 100644 index 3f7d3e9d..00000000 --- a/app/plugins/main.coffee +++ /dev/null @@ -1,22 +0,0 @@ -### -# Copyright (C) 2014 Andrey Antukh -# Copyright (C) 2014 Jesús Espino Garcia -# Copyright (C) 2014 David Barragán Merino -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -# File: pluggins/main.coffee -### - -module = angular.module("taigaPlugins", ["ngRoute"]) diff --git a/app/plugins/terms/terms.coffee b/app/plugins/terms/terms.coffee deleted file mode 100644 index ef4fa4d2..00000000 --- a/app/plugins/terms/terms.coffee +++ /dev/null @@ -1,53 +0,0 @@ -### -# Copyright (C) 2014 Andrey Antukh -# Copyright (C) 2014 Jesús Espino Garcia -# Copyright (C) 2014 David Barragán Merino -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -# File: plugins/terms/terms.coffee -### - -taiga = @.taiga - -module = angular.module("taigaPlugins") - -template = _.template(""" -

- By clicking "Sign up", you agree to our
- terms of service - and - privacy policy. -

""") - - -TermsNoticeDirective = ($config) -> - privacyPolicyUrl = $config.get("privacyPolicyUrl") - termsOfServiceUrl = $config.get("termsOfServiceUrl") - - templateFn = -> - if not (privacyPolicyUrl and termsOfServiceUrl) - return "" - - ctx = {termsUrl: termsOfServiceUrl, privacyUrl: privacyPolicyUrl} - return template(ctx) - - return { - scope: {} - restrict: "AE" - template: templateFn - } - - -module.directive("tgTermsNotice", ["$tgConfig", TermsNoticeDirective]) diff --git a/gulpfile.js b/gulpfile.js index dbd0e4d3..ab19bc08 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -50,7 +50,6 @@ paths.jade = [ paths.htmlPartials = [ paths.tmp + "partials/**/*.html", - paths.tmp + "plugins/**/*.html", paths.tmp + "modules/**/*.html", "!" + paths.tmp + "partials/includes/**/*.html", "!" + paths.tmp + "/modules/**/includes/**/*.html" @@ -82,7 +81,6 @@ paths.styles_dependencies = [ paths.css = [ paths.tmp + "styles/**/*.css", paths.tmp + "modules/**/*.css", - paths.tmp + "plugins/**/*.css" ]; paths.css_order = [ @@ -98,7 +96,6 @@ paths.css_order = [ paths.tmp + "styles/modules/**/*.css", paths.tmp + "modules/**/*.css", paths.tmp + "styles/shame/*.css", - paths.tmp + "plugins/**/*.css", paths.tmp + "themes/**/*.css" ]; @@ -130,9 +127,7 @@ paths.coffee_order = [ paths.app + "coffee/modules/user-settings/*.coffee", paths.app + "coffee/modules/integrations/*.coffee", paths.app + "modules/**/*.module.coffee", - paths.app + "modules/**/*.coffee", - paths.app + "plugins/*.coffee", - paths.app + "plugins/**/*.coffee" + paths.app + "modules/**/*.coffee" ]; paths.libs = [ @@ -485,17 +480,6 @@ gulp.task("copy-theme-images", function() { .pipe(gulp.dest(paths.dist + "/images/" + themes.current.name)); }); -gulp.task("copy-images-plugins", function() { - return gulp.src(paths.app + "/plugins/**/images/*") - .pipe(flatten()) - .pipe(gulp.dest(paths.dist + "/images/")); -}); - -gulp.task("copy-plugin-templates", function() { - return gulp.src(paths.app + "/plugins/**/templates/**/*.html") - .pipe(gulp.dest(paths.dist + "/plugins/")); -}); - gulp.task("copy-extras", function() { return gulp.src(paths.extras + "/*") .pipe(gulp.dest(paths.dist + "/")); @@ -506,8 +490,6 @@ gulp.task("copy", [ "copy-theme-fonts", "copy-images", "copy-theme-images", - "copy-images-plugins", - "copy-plugin-templates", "copy-svg", "copy-theme-svg", "copy-extras" @@ -527,7 +509,6 @@ gulp.task("express", function() { app.use("/svg", express.static(__dirname + "/dist/svg")); app.use("/partials", express.static(__dirname + "/dist/partials")); app.use("/fonts", express.static(__dirname + "/dist/fonts")); - app.use("/plugins", express.static(__dirname + "/dist/plugins")); app.use("/locales", express.static(__dirname + "/dist/locales")); app.use("/maps", express.static(__dirname + "/dist/maps"));