From ad5bd3d3f1d4a59a9ea5755c591e76746afdb035 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Thu, 4 Sep 2014 14:57:26 +0200 Subject: [PATCH 1/5] Add sample humanstxt plugin. That plugin shows an simple example how add additional urlmappings and additional templates to the project. --- app/plugins/humanstxt/humanstxt.coffee | 31 +++++++++++++++++++ .../humanstxt/templates/humanstxt.html | 10 ++++++ 2 files changed, 41 insertions(+) create mode 100644 app/plugins/humanstxt/humanstxt.coffee create mode 100644 app/plugins/humanstxt/templates/humanstxt.html diff --git a/app/plugins/humanstxt/humanstxt.coffee b/app/plugins/humanstxt/humanstxt.coffee new file mode 100644 index 00000000..2b42b38a --- /dev/null +++ b/app/plugins/humanstxt/humanstxt.coffee @@ -0,0 +1,31 @@ +### +# 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/humanstxt/humanstxt.coffee +### + +# Simple plugin example that extends the urlmappings +# and add additional template. + +taiga = @.taiga +module = angular.module("taigaPlugins") + +configure = ($routeProvider) -> + $routeProvider.when("/humans.txt", {"templateUrl": "/plugins/humanstxt/templates/humanstxt.html"}) + +module.config(["$routeProvider", configure]) diff --git a/app/plugins/humanstxt/templates/humanstxt.html b/app/plugins/humanstxt/templates/humanstxt.html new file mode 100644 index 00000000..63ee509c --- /dev/null +++ b/app/plugins/humanstxt/templates/humanstxt.html @@ -0,0 +1,10 @@ +

Team

+ +
    +
  • Andrey Antukh «niwi@niwi.be»
  • +
  • Jesus Espino Garcia «jespinog@gmail.com»
  • +
  • David Barragán Merino «bameda@dbarragan.com»
  • +
  • Xavi Julian «xavier.julian@kaleidos.net»
  • +
  • Alejandro Alonso «alejandro.alonso@kaleidos.net»
  • +
+ From 7b279bb00fbcb2cf1698d406c7bfea8bc8ecc47a Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Thu, 4 Sep 2014 14:58:05 +0200 Subject: [PATCH 2/5] Add ngRoute dependency to taigaPlugins module. --- app/plugins/main.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/plugins/main.coffee b/app/plugins/main.coffee index e43cd966..3f7d3e9d 100644 --- a/app/plugins/main.coffee +++ b/app/plugins/main.coffee @@ -19,4 +19,4 @@ # File: pluggins/main.coffee ### -module = angular.module("taigaPlugins", []) +module = angular.module("taigaPlugins", ["ngRoute"]) From e789d49244a954ee667ff1086811352f6147a41b Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Thu, 4 Sep 2014 14:58:47 +0200 Subject: [PATCH 3/5] Add gulp task for copy plugins templates. --- gulpfile.coffee | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gulpfile.coffee b/gulpfile.coffee index b4e791ba..379f386a 100644 --- a/gulpfile.coffee +++ b/gulpfile.coffee @@ -170,7 +170,6 @@ gulp.task "jslibs", -> .pipe(concat("libs.js")) .pipe(gulp.dest("dist/js/")) - gulp.task "locales", -> gulp.src("app/locales/en/app.json") .pipe(wrap("angular.module('taigaLocales').constant('localesEnglish', <%= contents %>);")) @@ -195,6 +194,9 @@ gulp.task "copy", -> gulp.src("#{paths.app}/images/**/*") .pipe(gulp.dest("#{paths.dist}/images/")) + gulp.src("#{paths.app}/plugins/**/templates/*") + .pipe(gulp.dest("#{paths.dist}/plugins/")) + gulp.task "connect", -> connect.server({ From 46e088d0fbff35c0459b8ac35cb61ced66df2d28 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Thu, 4 Sep 2014 14:58:56 +0200 Subject: [PATCH 4/5] Add express/gulp url for serve plugins directory in development server. --- gulpfile.coffee | 1 + 1 file changed, 1 insertion(+) diff --git a/gulpfile.coffee b/gulpfile.coffee index 379f386a..f8364b04 100644 --- a/gulpfile.coffee +++ b/gulpfile.coffee @@ -215,6 +215,7 @@ gulp.task "express", -> app.use("/images", express.static("#{__dirname}/dist/images")) app.use("/partials", express.static("#{__dirname}/dist/partials")) app.use("/fonts", express.static("#{__dirname}/dist/fonts")) + app.use("/plugins", express.static("#{__dirname}/dist/plugins")) app.all "/*", (req, res, next) -> # Just send the index.html for other files to support HTML5Mode From 7b9773df5fabf72ca4904ce92293a81816ba3938 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Thu, 4 Sep 2014 16:25:53 +0200 Subject: [PATCH 5/5] Rename humanstxt to humanshtml --- .../humanstxt.coffee => humanshtml/humanshtml.coffee} | 4 ++-- .../humanstxt.html => humanshtml/templates/humans.html} | 0 2 files changed, 2 insertions(+), 2 deletions(-) rename app/plugins/{humanstxt/humanstxt.coffee => humanshtml/humanshtml.coffee} (87%) rename app/plugins/{humanstxt/templates/humanstxt.html => humanshtml/templates/humans.html} (100%) diff --git a/app/plugins/humanstxt/humanstxt.coffee b/app/plugins/humanshtml/humanshtml.coffee similarity index 87% rename from app/plugins/humanstxt/humanstxt.coffee rename to app/plugins/humanshtml/humanshtml.coffee index 2b42b38a..59130f8a 100644 --- a/app/plugins/humanstxt/humanstxt.coffee +++ b/app/plugins/humanshtml/humanshtml.coffee @@ -16,7 +16,7 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . # -# File: plugins/humanstxt/humanstxt.coffee +# File: plugins/humanshtml/humanshtml.coffee ### # Simple plugin example that extends the urlmappings @@ -26,6 +26,6 @@ taiga = @.taiga module = angular.module("taigaPlugins") configure = ($routeProvider) -> - $routeProvider.when("/humans.txt", {"templateUrl": "/plugins/humanstxt/templates/humanstxt.html"}) + $routeProvider.when("/humans.html", {"templateUrl": "/plugins/humanshtml/templates/humans.html"}) module.config(["$routeProvider", configure]) diff --git a/app/plugins/humanstxt/templates/humanstxt.html b/app/plugins/humanshtml/templates/humans.html similarity index 100% rename from app/plugins/humanstxt/templates/humanstxt.html rename to app/plugins/humanshtml/templates/humans.html