Remove plugins and create modules/components/terms-of-service-and-privacy-policy-notice/

stable
David Barragán Merino 2015-10-28 16:23:06 +01:00
parent b8173d129f
commit 2ee79aa983
11 changed files with 113 additions and 143 deletions

View File

@ -648,7 +648,6 @@ modules = [
"taigaProject", "taigaProject",
"taigaUserSettings", "taigaUserSettings",
"taigaFeedback", "taigaFeedback",
"taigaPlugins",
"taigaIntegrations", "taigaIntegrations",
"taigaComponents", "taigaComponents",
# new modules # new modules

View File

@ -1343,6 +1343,9 @@
"UNBLOCKED": "{{username}} has unblocked {{obj_name}}", "UNBLOCKED": "{{username}} has unblocked {{obj_name}}",
"NEW_USER": "{{username}} has joined Taiga" "NEW_USER": "{{username}} has joined Taiga"
}, },
"LEGAL": {
"TERMS_OF_SERVICE_AND_PRIVACY_POLICY_AD": "<span>By clicking \"Sign up\"', you agree to our <br /></span><a href=\"{{ termsOfServiceUrl }}\" title=\"See terms of service\" target=\"_blank\">terms of service</a><span> and </span><a href=\"{{ privacyPolicyUrl }}\" title=\"See privacy policy\" target=\"_blank\">privacy policy</a>."
},
"EXTERNAL_APP": { "EXTERNAL_APP": {
"PAGE_TITLE": "An external app requires authentication", "PAGE_TITLE": "An external app requires authentication",
"PAGE_DESCRIPTION": "An external app requires authentication", "PAGE_DESCRIPTION": "An external app requires authentication",

View File

@ -16,16 +16,24 @@
# You should have received a copy of the GNU Affero General Public License # 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/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
# #
# 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 TermsOfServiceAndPrivacyPolicyNoticeDirective = ($config) ->
module = angular.module("taigaPlugins") link = (scope, el, attrs) ->
scope.privacyPolicyUrl = $config.get("privacyPolicyUrl")
scope.termsOfServiceUrl = $config.get("termsOfServiceUrl")
configure = ($routeProvider) -> return {
$routeProvider.when("/humans.html", {"templateUrl": "/plugins/humanshtml/templates/humans.html"}) 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
])

View File

@ -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}"
)

View File

@ -1,25 +1,52 @@
form.register-form form.register-form
p.form-header(translate="REGISTER_FORM.TITLE") p.form-header(translate="REGISTER_FORM.TITLE")
fieldset fieldset
input(type="text", tg-capslock, name="username", ng-model="dataRegister.username", input(
data-required="true", data-maxlength="255", data-regexp="^[\\w.-]+$", type="text"
placeholder="{{'REGISTER_FORM.PLACEHOLDER_NAME' | translate}}") name="username"
ng-model="dataRegister.username"
data-required="true"
data-maxlength="255"
data-regexp="^[\\w.-]+$"
placeholder="{{'REGISTER_FORM.PLACEHOLDER_NAME' | translate}}"
)
fieldset fieldset
input(type="text", name="full_name", ng-model="dataRegister.full_name", input(
data-required="true", data-maxlength="256", type="text"
placeholder="{{'REGISTER_FORM.PLACEHOLDER_FULL_NAME' | translate}}") name="full_name"
ng-model="dataRegister.full_name"
data-required="true"
data-maxlength="256"
placeholder="{{'REGISTER_FORM.PLACEHOLDER_FULL_NAME' | translate}}"
)
fieldset fieldset
input(type="text", tg-capslock, name="email", ng-model="dataRegister.email", input(
data-required="true", data-maxlength="255", type="text"
placeholder="{{'REGISTER_FORM.PLACEHOLDER_EMAIL' | translate}}") name="email"
ng-model="dataRegister.email"
data-required="true"
data-maxlength="255"
placeholder="{{'REGISTER_FORM.PLACEHOLDER_EMAIL' | translate}}"
)
fieldset fieldset
input(type="password", tg-capslock, name="password", ng-model="dataRegister.password", data-required="true", input(
placeholder="{{'REGISTER_FORM.PLACEHOLDER_PASSWORD' | translate}}") type="password"
name="password"
tg-capslock
ng-model="dataRegister.password"
data-required="true"
placeholder="{{'REGISTER_FORM.PLACEHOLDER_PASSWORD' | translate}}"
)
fieldset 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

View File

@ -1,31 +1,63 @@
div.register-form-container(tg-register) div.register-form-container(tg-register)
form.register-form form.register-form
fieldset fieldset
input(type="text", name="username", ng-model="data.username", tg-capslock, input(
data-required="true", data-maxlength="255", data-regexp="^[\\w.-]+$", type="text"
placeholder="{{'REGISTER_FORM.PLACEHOLDER_NAME' | translate}}") name="username"
ng-model="data.username"
data-required="true"
data-maxlength="255"
data-regexp="^[\\w.-]+$"
placeholder="{{'REGISTER_FORM.PLACEHOLDER_NAME' | translate}}"
)
fieldset fieldset
input(type="text", name="full_name", ng-model="data.full_name", input(
data-required="true", data-maxlength="256", type="text"
placeholder="{{'REGISTER_FORM.PLACEHOLDER_FULL_NAME' | translate}}") name="full_name"
ng-model="data.full_name"
data-required="true"
data-maxlength="256"
placeholder="{{'REGISTER_FORM.PLACEHOLDER_FULL_NAME' | translate}}"
)
fieldset fieldset
input(type="text", name="email", ng-model="data.email", tg-capslock, input(
data-required="true", data-maxlength="255", type="text"
placeholder="{{'REGISTER_FORM.PLACEHOLDER_EMAIL' | translate}}") name="email"
ng-model="data.email"
data-required="true"
data-maxlength="255"
placeholder="{{'REGISTER_FORM.PLACEHOLDER_EMAIL' | translate}}"
)
fieldset fieldset
input(type="password", name="password", ng-model="data.password", tg-capslock, input(
data-required="true", data-minlength="4", type="password"
placeholder="{{'REGISTER_FORM.PLACEHOLDER_PASSWORD' | translate}}") name="password"
tg-capslock
ng-model="data.password"
data-required="true"
data-minlength="4"
placeholder="{{'REGISTER_FORM.PLACEHOLDER_PASSWORD' | translate}}"
)
fieldset 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) fieldset(tg-github-login-button)
// Only displays terms notice when terms plugin is loaded. //- Only displays terms notice when terms plugin is loaded.
tg-terms-notice 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"
)

View File

View File

@ -1,10 +0,0 @@
<h2>Team</h2>
<ul>
<li>Andrey Antukh «niwi@niwi.be»</li>
<li>Jesus Espino Garcia «jespinog@gmail.com»</li>
<li>David Barragán Merino «bameda@dbarragan.com»</li>
<li>Xavi Julian «xavier.julian@kaleidos.net»</li>
<li>Alejandro Alonso «alejandro.alonso@kaleidos.net»</li>
</ul>

View File

@ -1,22 +0,0 @@
###
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014 David Barragán Merino <bameda@dbarragan.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# File: pluggins/main.coffee
###
module = angular.module("taigaPlugins", ["ngRoute"])

View File

@ -1,53 +0,0 @@
###
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014 Jesús Espino Garcia <jespinog@gmail.com>
# Copyright (C) 2014 David Barragán Merino <bameda@dbarragan.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# File: plugins/terms/terms.coffee
###
taiga = @.taiga
module = angular.module("taigaPlugins")
template = _.template("""
<p class="register-text">
<span>By clicking "Sign up", you agree to our <br /></span>
<a href="<%= termsUrl %>" title="See terms of service" target="_blank"> terms of service</a>
<span> and</span>
<a href="<%= privacyUrl %>" title="See privacy policy" target="_blank"> privacy policy.</a>
</p>""")
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])

View File

@ -50,7 +50,6 @@ paths.jade = [
paths.htmlPartials = [ paths.htmlPartials = [
paths.tmp + "partials/**/*.html", paths.tmp + "partials/**/*.html",
paths.tmp + "plugins/**/*.html",
paths.tmp + "modules/**/*.html", paths.tmp + "modules/**/*.html",
"!" + paths.tmp + "partials/includes/**/*.html", "!" + paths.tmp + "partials/includes/**/*.html",
"!" + paths.tmp + "/modules/**/includes/**/*.html" "!" + paths.tmp + "/modules/**/includes/**/*.html"
@ -82,7 +81,6 @@ paths.styles_dependencies = [
paths.css = [ paths.css = [
paths.tmp + "styles/**/*.css", paths.tmp + "styles/**/*.css",
paths.tmp + "modules/**/*.css", paths.tmp + "modules/**/*.css",
paths.tmp + "plugins/**/*.css"
]; ];
paths.css_order = [ paths.css_order = [
@ -98,7 +96,6 @@ paths.css_order = [
paths.tmp + "styles/modules/**/*.css", paths.tmp + "styles/modules/**/*.css",
paths.tmp + "modules/**/*.css", paths.tmp + "modules/**/*.css",
paths.tmp + "styles/shame/*.css", paths.tmp + "styles/shame/*.css",
paths.tmp + "plugins/**/*.css",
paths.tmp + "themes/**/*.css" paths.tmp + "themes/**/*.css"
]; ];
@ -130,9 +127,7 @@ paths.coffee_order = [
paths.app + "coffee/modules/user-settings/*.coffee", paths.app + "coffee/modules/user-settings/*.coffee",
paths.app + "coffee/modules/integrations/*.coffee", paths.app + "coffee/modules/integrations/*.coffee",
paths.app + "modules/**/*.module.coffee", paths.app + "modules/**/*.module.coffee",
paths.app + "modules/**/*.coffee", paths.app + "modules/**/*.coffee"
paths.app + "plugins/*.coffee",
paths.app + "plugins/**/*.coffee"
]; ];
paths.libs = [ paths.libs = [
@ -485,17 +480,6 @@ gulp.task("copy-theme-images", function() {
.pipe(gulp.dest(paths.dist + "/images/" + themes.current.name)); .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() { gulp.task("copy-extras", function() {
return gulp.src(paths.extras + "/*") return gulp.src(paths.extras + "/*")
.pipe(gulp.dest(paths.dist + "/")); .pipe(gulp.dest(paths.dist + "/"));
@ -506,8 +490,6 @@ gulp.task("copy", [
"copy-theme-fonts", "copy-theme-fonts",
"copy-images", "copy-images",
"copy-theme-images", "copy-theme-images",
"copy-images-plugins",
"copy-plugin-templates",
"copy-svg", "copy-svg",
"copy-theme-svg", "copy-theme-svg",
"copy-extras" "copy-extras"
@ -527,7 +509,6 @@ gulp.task("express", function() {
app.use("/svg", express.static(__dirname + "/dist/svg")); app.use("/svg", express.static(__dirname + "/dist/svg"));
app.use("/partials", express.static(__dirname + "/dist/partials")); app.use("/partials", express.static(__dirname + "/dist/partials"));
app.use("/fonts", express.static(__dirname + "/dist/fonts")); 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("/locales", express.static(__dirname + "/dist/locales"));
app.use("/maps", express.static(__dirname + "/dist/maps")); app.use("/maps", express.static(__dirname + "/dist/maps"));