commit
9e698e40c5
|
@ -8,4 +8,6 @@ app/coffee/modules/locales/locale*.coffee
|
|||
*.swp
|
||||
*.swo
|
||||
tags
|
||||
tmp/
|
||||
conf/
|
||||
app/config/main.coffee
|
||||
|
|
|
@ -193,14 +193,10 @@ init = ($log, $i18n, $config, $rootscope, $auth, $events) ->
|
|||
if $auth.isAuthenticated()
|
||||
$events.setupConnection()
|
||||
|
||||
# Default Value for taiga local config module.
|
||||
angular.module("taigaLocalConfig", []).value("localconfig", {})
|
||||
|
||||
modules = [
|
||||
# Main Global Modules
|
||||
"taigaBase",
|
||||
"taigaCommon",
|
||||
"taigaConfig",
|
||||
"taigaResources",
|
||||
"taigaLocales",
|
||||
"taigaAuth",
|
||||
|
|
|
@ -16,35 +16,20 @@
|
|||
# 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: config.coffee
|
||||
# File: modules/base/conf.coffee
|
||||
###
|
||||
|
||||
taiga = @.taiga
|
||||
defaults = {
|
||||
api: "http://localhost:8000/api/v1/"
|
||||
debug: true
|
||||
lang: "en"
|
||||
}
|
||||
|
||||
class ConfigService extends taiga.Service
|
||||
defaults: {
|
||||
host: "localhost:8000"
|
||||
scheme: "http"
|
||||
class ConfigurationService
|
||||
@.$inject = ["localconf"]
|
||||
|
||||
debug: false
|
||||
|
||||
defaultLanguage: "en"
|
||||
languageOptions: {
|
||||
"es": "Spanish"
|
||||
"en": "English"
|
||||
}
|
||||
|
||||
publicRegisterEnabled: false
|
||||
|
||||
termsOfServiceUrl: null
|
||||
privacyPolicyUrl: null
|
||||
|
||||
feedbackEnabled: true
|
||||
}
|
||||
|
||||
initialize: (localconfig) ->
|
||||
defaults = _.clone(@.defaults, true)
|
||||
@.config = _.merge(defaults, localconfig)
|
||||
constructor: (localconf) ->
|
||||
@.config = _.merge(_.clone(defaults, true), localconf)
|
||||
|
||||
get: (key, defaultValue=null) ->
|
||||
if _.has(@.config, key)
|
||||
|
@ -52,12 +37,7 @@ class ConfigService extends taiga.Service
|
|||
return defaultValue
|
||||
|
||||
|
||||
# Initialize config loading local configuration.
|
||||
init = ($log, localconfig, config) ->
|
||||
$log.debug("Initializing configuration", localconfig)
|
||||
config.initialize(localconfig)
|
||||
module = angular.module("taigaBase")
|
||||
module.service("$tgConfig", ConfigurationService)
|
||||
module.value("localconf", null)
|
||||
|
||||
|
||||
module = angular.module("taigaConfig", ["taigaLocalConfig"])
|
||||
module.service("$tgConfig", ConfigService)
|
||||
module.run(["$log", "localconfig", "$tgConfig", init])
|
|
@ -26,51 +26,50 @@ defaults = {
|
|||
ns: "app"
|
||||
fallbackLng: "en"
|
||||
async: false
|
||||
lng: "en"
|
||||
}
|
||||
|
||||
|
||||
class I18nService extends taiga.Service
|
||||
constructor: (@rootscope, @localeEn) ->
|
||||
constructor: (@rootscope, localesEn) ->
|
||||
@.options = _.clone(defaults, true)
|
||||
@.options.resStore = {
|
||||
en: { app: localesEn }
|
||||
}
|
||||
|
||||
setLanguage: (language) ->
|
||||
options = _.clone(defaults, true)
|
||||
i18n.setLng(language, options)
|
||||
|
||||
i18n.setLng(language)
|
||||
@rootscope.currentLang = language
|
||||
@rootscope.$broadcast("i18n:changeLang", language)
|
||||
|
||||
initialize: (defaultLang="en") ->
|
||||
options = _.clone(defaults, true)
|
||||
options.lng = defaultLang
|
||||
options.resStore = {
|
||||
en: { app: @localeEn }
|
||||
}
|
||||
|
||||
i18n.init(options)
|
||||
initialize: ->
|
||||
i18n.init(@.options)
|
||||
@rootscope.t = i18n.t
|
||||
|
||||
|
||||
I18nDirective = ($rootscope, $i18n) ->
|
||||
link = ($scope, $el, $attrs) ->
|
||||
values = $attrs.tgI18n.split(",")
|
||||
options = $attrs.tgI18nOptions or '{}'
|
||||
values = $attrs.tr.split(",")
|
||||
options = $attrs.trOpts or '{}'
|
||||
|
||||
applyTranslation = ->
|
||||
opts = $scope.$eval(options)
|
||||
|
||||
for v in values
|
||||
if v.indexOf(":") == -1
|
||||
$el.html($scope.t(v, opts))
|
||||
$el.html(_.escape($scope.t(v, opts)))
|
||||
else
|
||||
[ns, v] = v.split(":")
|
||||
$el.attr(ns, $scope.t(v, opts))
|
||||
$el.attr(ns, _.escape($scope.t(v, opts)))
|
||||
|
||||
bindOnce($scope, "t", applyTranslation)
|
||||
$scope.$on("i18n:changeLang", applyTranslation)
|
||||
|
||||
return {link: link}
|
||||
return {
|
||||
link: link
|
||||
restrict: "A"
|
||||
scope: false
|
||||
}
|
||||
|
||||
|
||||
module = angular.module("taigaBase")
|
||||
module.service("$tgI18n", ["$rootScope", "localesEnglish", I18nService])
|
||||
module.directive("tgI18n", ["$rootScope", "$tgI18n", I18nDirective])
|
||||
module.service("$tgI18n", ["$rootScope", "localesEn", I18nService])
|
||||
module.directive("tr", ["$rootScope", "$tgI18n", I18nDirective])
|
||||
|
|
|
@ -30,8 +30,7 @@ class UrlsService extends taiga.Service
|
|||
|
||||
constructor: (@config) ->
|
||||
@.urls = {}
|
||||
@.host = config.get("host")
|
||||
@.scheme = config.get("scheme")
|
||||
@.mainUrl = config.get("api")
|
||||
|
||||
update: (urls) ->
|
||||
@.urls = _.merge(@.urls, urls)
|
||||
|
@ -44,7 +43,11 @@ class UrlsService extends taiga.Service
|
|||
|
||||
name = args.slice(0, 1)[0]
|
||||
url = format(@.urls[name], args.slice(1))
|
||||
return format("%s://%s%s", [@.scheme, @.host, url])
|
||||
|
||||
return format("%s/%s", [
|
||||
_.str.rtrim(@.mainUrl, "/"),
|
||||
_.str.ltrim(url, "/")
|
||||
])
|
||||
|
||||
|
||||
module = angular.module("taigaBase")
|
||||
|
|
|
@ -24,79 +24,79 @@ taiga = @.taiga
|
|||
class ResourcesService extends taiga.Service
|
||||
|
||||
urls = {
|
||||
"auth": "/api/v1/auth"
|
||||
"auth-register": "/api/v1/auth/register"
|
||||
"invitations": "/api/v1/invitations"
|
||||
"permissions": "/api/v1/permissions"
|
||||
"roles": "/api/v1/roles"
|
||||
"projects": "/api/v1/projects"
|
||||
"memberships": "/api/v1/memberships"
|
||||
"notify-policies": "/api/v1/notify-policies"
|
||||
"bulk-create-memberships": "/api/v1/memberships/bulk_create"
|
||||
"milestones": "/api/v1/milestones"
|
||||
"userstories": "/api/v1/userstories"
|
||||
"bulk-create-us": "/api/v1/userstories/bulk_create"
|
||||
"bulk-update-us-backlog-order": "/api/v1/userstories/bulk_update_backlog_order"
|
||||
"bulk-update-us-sprint-order": "/api/v1/userstories/bulk_update_sprint_order"
|
||||
"bulk-update-us-kanban-order": "/api/v1/userstories/bulk_update_kanban_order"
|
||||
"userstories-restore": "/api/v1/userstories/%s/restore"
|
||||
"tasks": "/api/v1/tasks"
|
||||
"bulk-create-tasks": "/api/v1/tasks/bulk_create"
|
||||
"tasks-restore": "/api/v1/tasks/%s/restore"
|
||||
"issues": "/api/v1/issues"
|
||||
"bulk-create-issues": "/api/v1/issues/bulk_create"
|
||||
"issues-restore": "/api/v1/issues/%s/restore"
|
||||
"wiki": "/api/v1/wiki"
|
||||
"wiki-restore": "/api/v1/wiki/%s/restore"
|
||||
"wiki-links": "/api/v1/wiki-links"
|
||||
"choices/userstory-statuses": "/api/v1/userstory-statuses"
|
||||
"choices/userstory-statuses/bulk-update-order": "/api/v1/userstory-statuses/bulk_update_order"
|
||||
"choices/points": "/api/v1/points"
|
||||
"choices/points/bulk-update-order": "/api/v1/points/bulk_update_order"
|
||||
"choices/task-statuses": "/api/v1/task-statuses"
|
||||
"choices/task-statuses/bulk-update-order": "/api/v1/task-statuses/bulk_update_order"
|
||||
"choices/issue-statuses": "/api/v1/issue-statuses"
|
||||
"choices/issue-statuses/bulk-update-order": "/api/v1/issue-statuses/bulk_update_order"
|
||||
"choices/issue-types": "/api/v1/issue-types"
|
||||
"choices/issue-types/bulk-update-order": "/api/v1/issue-types/bulk_update_order"
|
||||
"choices/priorities": "/api/v1/priorities"
|
||||
"choices/priorities/bulk-update-order": "/api/v1/priorities/bulk_update_order"
|
||||
"choices/severities": "/api/v1/severities"
|
||||
"choices/severities/bulk-update-order": "/api/v1/severities/bulk_update_order"
|
||||
"search": "/api/v1/search"
|
||||
"sites": "/api/v1/sites"
|
||||
"project-templates": "/api/v1/project-templates"
|
||||
"site-members": "/api/v1/site-members"
|
||||
"site-projects": "/api/v1/site-projects"
|
||||
"users": "/api/v1/users"
|
||||
"users-password-recovery": "/api/v1/users/password_recovery"
|
||||
"users-change-password-from-recovery": "/api/v1/users/change_password_from_recovery"
|
||||
"users-change-password": "/api/v1/users/change_password"
|
||||
"users-change-email": "/api/v1/users/change_email"
|
||||
"user-storage": "/api/v1/user-storage"
|
||||
"resolver": "/api/v1/resolver"
|
||||
"userstory-statuses": "/api/v1/userstory-statuses"
|
||||
"points": "/api/v1/points"
|
||||
"task-statuses": "/api/v1/task-statuses"
|
||||
"issue-statuses": "/api/v1/issue-statuses"
|
||||
"issue-types": "/api/v1/issue-types"
|
||||
"priorities": "/api/v1/priorities"
|
||||
"severities": "/api/v1/severities"
|
||||
"auth": "/auth"
|
||||
"auth-register": "/auth/register"
|
||||
"invitations": "/invitations"
|
||||
"permissions": "/permissions"
|
||||
"roles": "/roles"
|
||||
"projects": "/projects"
|
||||
"memberships": "/memberships"
|
||||
"notify-policies": "/notify-policies"
|
||||
"bulk-create-memberships": "/memberships/bulk_create"
|
||||
"milestones": "/milestones"
|
||||
"userstories": "/userstories"
|
||||
"bulk-create-us": "/userstories/bulk_create"
|
||||
"bulk-update-us-backlog-order": "/userstories/bulk_update_backlog_order"
|
||||
"bulk-update-us-sprint-order": "/userstories/bulk_update_sprint_order"
|
||||
"bulk-update-us-kanban-order": "/userstories/bulk_update_kanban_order"
|
||||
"userstories-restore": "/userstories/%s/restore"
|
||||
"tasks": "/tasks"
|
||||
"bulk-create-tasks": "/tasks/bulk_create"
|
||||
"tasks-restore": "/tasks/%s/restore"
|
||||
"issues": "/issues"
|
||||
"bulk-create-issues": "/issues/bulk_create"
|
||||
"issues-restore": "/issues/%s/restore"
|
||||
"wiki": "/wiki"
|
||||
"wiki-restore": "/wiki/%s/restore"
|
||||
"wiki-links": "/wiki-links"
|
||||
"choices/userstory-statuses": "/userstory-statuses"
|
||||
"choices/userstory-statuses/bulk-update-order": "/userstory-statuses/bulk_update_order"
|
||||
"choices/points": "/points"
|
||||
"choices/points/bulk-update-order": "/points/bulk_update_order"
|
||||
"choices/task-statuses": "/task-statuses"
|
||||
"choices/task-statuses/bulk-update-order": "/task-statuses/bulk_update_order"
|
||||
"choices/issue-statuses": "/issue-statuses"
|
||||
"choices/issue-statuses/bulk-update-order": "/issue-statuses/bulk_update_order"
|
||||
"choices/issue-types": "/issue-types"
|
||||
"choices/issue-types/bulk-update-order": "/issue-types/bulk_update_order"
|
||||
"choices/priorities": "/priorities"
|
||||
"choices/priorities/bulk-update-order": "/priorities/bulk_update_order"
|
||||
"choices/severities": "/severities"
|
||||
"choices/severities/bulk-update-order": "/severities/bulk_update_order"
|
||||
"search": "/search"
|
||||
"sites": "/sites"
|
||||
"project-templates": "/project-templates"
|
||||
"site-members": "/site-members"
|
||||
"site-projects": "/site-projects"
|
||||
"users": "/users"
|
||||
"users-password-recovery": "/users/password_recovery"
|
||||
"users-change-password-from-recovery": "/users/change_password_from_recovery"
|
||||
"users-change-password": "/users/change_password"
|
||||
"users-change-email": "/users/change_email"
|
||||
"user-storage": "/user-storage"
|
||||
"resolver": "/resolver"
|
||||
"userstory-statuses": "/userstory-statuses"
|
||||
"points": "/points"
|
||||
"task-statuses": "/task-statuses"
|
||||
"issue-statuses": "/issue-statuses"
|
||||
"issue-types": "/issue-types"
|
||||
"priorities": "/priorities"
|
||||
"severities": "/severities"
|
||||
|
||||
# History
|
||||
"history/us": "/api/v1/history/userstory"
|
||||
"history/issue": "/api/v1/history/issue"
|
||||
"history/task": "/api/v1/history/task"
|
||||
"history/wiki": "/api/v1/history/wiki"
|
||||
"history/us": "/history/userstory"
|
||||
"history/issue": "/history/issue"
|
||||
"history/task": "/history/task"
|
||||
"history/wiki": "/history/wiki"
|
||||
|
||||
# Attachments
|
||||
"attachments/us": "/api/v1/userstories/attachments"
|
||||
"attachments/issue": "/api/v1/issues/attachments"
|
||||
"attachments/task": "/api/v1/tasks/attachments"
|
||||
"attachments/wiki_page": "/api/v1/wiki/attachments"
|
||||
"attachments/us": "/userstories/attachments"
|
||||
"attachments/issue": "/issues/attachments"
|
||||
"attachments/task": "/tasks/attachments"
|
||||
"attachments/wiki_page": "/wiki/attachments"
|
||||
|
||||
# Feedback
|
||||
"feedback": "/api/v1/feedback"
|
||||
"feedback": "/feedback"
|
||||
}
|
||||
|
||||
# Initialize api urls service
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
config = {
|
||||
host: "localhost:8000"
|
||||
scheme: "http"
|
||||
|
||||
debug: true
|
||||
|
||||
defaultLanguage: "en"
|
||||
languageOptions: {
|
||||
"en": "English"
|
||||
}
|
||||
|
||||
publicRegisterEnabled: true
|
||||
privacyPolicyUrl: null
|
||||
termsOfServiceUrl: null
|
||||
|
||||
feedbackEnabled: true
|
||||
}
|
||||
|
||||
angular.module("taigaLocalConfig", []).value("localconfig", config)
|
|
@ -1,8 +1,8 @@
|
|||
a.close(href="", title="close")
|
||||
span.icon.icon-delete
|
||||
form
|
||||
h2.title(tg-i18n="common.new-bulk")
|
||||
h2.title(tr="common.new-bulk")
|
||||
fieldset
|
||||
textarea(cols="200", wrap="off", tg-limit-line-length, tg-i18n="placeholder:common.one-item-line", ng-model="new.bulk", data-required="true", data-linewidth="200")
|
||||
a.button.button-green(href="", tg-i18n="title:common.save")
|
||||
span(tg-i18n="common.save")
|
||||
textarea(cols="200", wrap="off", tg-limit-line-length, tr="placeholder:common.one-item-line", ng-model="new.bulk", data-required="true", data-linewidth="200")
|
||||
a.button.button-green(href="", tr="title:common.save")
|
||||
span(tr="common.save")
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
a.close(href="", title="close")
|
||||
span.icon.icon-delete
|
||||
form
|
||||
h2.title(tg-i18n="common.new-bulk")
|
||||
h2.title(tr="common.new-bulk")
|
||||
fieldset
|
||||
textarea(cols="200", wrap="off", tg-limit-line-length, tg-i18n="placeholder:common.one-item-line", ng-model="form.data", data-required="true")
|
||||
a.button.button-green(href="", tg-i18n="title:common.save")
|
||||
span(tg-i18n="common.save")
|
||||
textarea(cols="200", wrap="off", tg-limit-line-length, tr="placeholder:common.one-item-line", ng-model="form.data", data-required="true")
|
||||
a.button.button-green(href="", tr="title:common.save")
|
||||
span(tr="common.save")
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
a.close(href="", title="close")
|
||||
span.icon.icon-delete
|
||||
form
|
||||
h2.title(tg-i18n="task.title-new")
|
||||
h2.title(tr="task.title-new")
|
||||
fieldset
|
||||
input(type="text", ng-model="task.subject", placeholder="A task subject",
|
||||
data-required="true", data-maxlength="500")
|
||||
|
@ -30,7 +30,7 @@ form
|
|||
|
||||
fieldset.blocking-flag
|
||||
input(type="checkbox", ng-model="task.is_blocked", name="blocked-task", id="blocked-task", ng-value="true")
|
||||
label.blocked(for="blocked-task", tg-i18n="common.blocked")
|
||||
label.blocked(for="blocked-task", tr="common.blocked")
|
||||
|
||||
tg-blocking-message-input(watch="task.is_blocked", ng-model="task.blocked_note")
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
a.close(href="", title="close")
|
||||
span.icon.icon-delete
|
||||
form
|
||||
h2.title(tg-i18n="common.new-bulk")
|
||||
h2.title(tr="common.new-bulk")
|
||||
fieldset
|
||||
textarea(cols="200", wrap="off", tg-limit-line-length, tg-i18n="placeholder:common.one-item-line", ng-model="new.bulk", data-required="true", data-linewidth="200")
|
||||
a.button.button-green(href="", tg-i18n="title:common.save")
|
||||
span(tg-i18n="common.save")
|
||||
textarea(cols="200", wrap="off", tg-limit-line-length, tr="placeholder:common.one-item-line", ng-model="new.bulk", data-required="true", data-linewidth="200")
|
||||
a.button.button-green(href="", tr="title:common.save")
|
||||
span(tr="common.save")
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
a.close(href="", title="close")
|
||||
span.icon.icon-delete
|
||||
form
|
||||
h2.title(tg-i18n="us.title-new")
|
||||
h2.title(tr="us.title-new")
|
||||
fieldset
|
||||
input(type="text", name="subject", ng-model="us.subject", tg-i18n="placeholder:common.subject",
|
||||
input(type="text", name="subject", ng-model="us.subject", tr="placeholder:common.subject",
|
||||
data-required="true", data-maxlength="500")
|
||||
|
||||
fieldset.estimation
|
||||
|
@ -12,7 +12,7 @@ form
|
|||
|
||||
fieldset
|
||||
select(name="status", ng-model="us.status", ng-options="s.id as s.name for s in usStatusList",
|
||||
tg-i18n="placeholder:common.status")
|
||||
tr="placeholder:common.status")
|
||||
|
||||
fieldset
|
||||
div(tg-tag-line, editable="true", ng-model="us.tags")
|
||||
|
@ -24,16 +24,16 @@ form
|
|||
fieldset.team-requirement
|
||||
input(type="checkbox", name="team_requirement", ng-model="us.team_requirement",
|
||||
id="team-requirement", ng-value="true")
|
||||
label.requirement(for="team-requirement", tg-i18n="us.team-requirement")
|
||||
label.requirement(for="team-requirement", tr="us.team-requirement")
|
||||
|
||||
fieldset.client-requirement
|
||||
input(type="checkbox", name="client_requirement", ng-model="us.client_requirement",
|
||||
id="client-requirement", ng-value="true")
|
||||
label.requirement(for="client-requirement", tg-i18n="us.client-requirement")
|
||||
label.requirement(for="client-requirement", tr="us.client-requirement")
|
||||
|
||||
fieldset.blocking-flag
|
||||
input(type="checkbox", name="is_blocked", ng-model="us.is_blocked", id="blocked-us" ng-value="true")
|
||||
label.blocked(for="blocked-us", tg-i18n="common.blocked")
|
||||
label.blocked(for="blocked-us", tr="common.blocked")
|
||||
|
||||
tg-blocking-message-input(watch="us.is_blocked", ng-model="us.blocked_note")
|
||||
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"api": "http://localhost:8000/api/v1/",
|
||||
"eventsUrl": "ws://localhost:8888/events",
|
||||
"debug": "true",
|
||||
"publicRegisterEnabled": true,
|
||||
"privacyPolicyUrl": null,
|
||||
"termsOfServiceUrl": null
|
||||
}
|
265
gulpfile.coffee
265
gulpfile.coffee
|
@ -19,66 +19,72 @@ newer = require("gulp-newer")
|
|||
cache = require("gulp-cached")
|
||||
jadeInheritance = require('gulp-jade-inheritance')
|
||||
|
||||
paths = {
|
||||
app: "app"
|
||||
dist: "dist"
|
||||
html: "app/*.html"
|
||||
jade: ["app/index.jade", "app/partials/**/*.jade"]
|
||||
scssStyles: "app/styles/**/*.scss"
|
||||
distStylesPath: "dist/styles"
|
||||
distStyles: ["dist/styles/vendor.css",
|
||||
"dist/styles/app.css"]
|
||||
sassStylesMain: "app/styles/main.scss"
|
||||
css: "app/styles/vendor/*.css"
|
||||
images: "app/images/**/*"
|
||||
svg: "app/svg/**/*"
|
||||
locales: "app/locales/**/*.json"
|
||||
coffee: ["app/coffee/app.coffee",
|
||||
"app/config/*.coffee",
|
||||
"app/coffee/*.coffee",
|
||||
"app/coffee/modules/controllerMixins.coffee",
|
||||
"app/coffee/modules/*.coffee",
|
||||
"app/coffee/modules/common/*.coffee",
|
||||
"app/coffee/modules/backlog/*.coffee",
|
||||
"app/coffee/modules/taskboard/*.coffee",
|
||||
"app/coffee/modules/kanban/*.coffee",
|
||||
"app/coffee/modules/issues/*.coffee",
|
||||
"app/coffee/modules/userstories/*.coffee",
|
||||
"app/coffee/modules/tasks/*.coffee",
|
||||
"app/coffee/modules/wiki/*.coffee",
|
||||
"app/coffee/modules/admin/*.coffee",
|
||||
"app/coffee/modules/projects/*.coffee",
|
||||
"app/coffee/modules/locales/*.coffee",
|
||||
"app/coffee/modules/base/*.coffee",
|
||||
"app/coffee/modules/resources/*.coffee",
|
||||
"app/coffee/modules/user-settings/*.coffee"
|
||||
"app/plugins/**/*.coffee"]
|
||||
vendorJsLibs: [
|
||||
"app/vendor/jquery/dist/jquery.js",
|
||||
"app/vendor/lodash/dist/lodash.js",
|
||||
"app/vendor/emoticons/lib/emoticons.js",
|
||||
"app/vendor/underscore.string/lib/underscore.string.js",
|
||||
"app/vendor/angular/angular.js",
|
||||
"app/vendor/angular-route/angular-route.js",
|
||||
"app/vendor/angular-sanitize/angular-sanitize.js",
|
||||
"app/vendor/angular-animate/angular-animate.js",
|
||||
"app/vendor/i18next/i18next.js",
|
||||
"app/vendor/moment/min/moment-with-langs.js",
|
||||
"app/vendor/checksley/checksley.js",
|
||||
"app/vendor/pikaday/pikaday.js",
|
||||
"app/vendor/jquery-flot/jquery.flot.js",
|
||||
"app/vendor/jquery-flot/jquery.flot.pie.js",
|
||||
"app/vendor/jquery-flot/jquery.flot.time.js",
|
||||
"app/vendor/jquery-flot/jquery.flot.time.js",
|
||||
"app/vendor/flot-axislabels/jquery.flot.axislabels.js",
|
||||
"app/vendor/jquery-textcomplete/jquery.textcomplete.js",
|
||||
"app/vendor/markitup/markitup/jquery.markitup.js",
|
||||
"app/vendor/malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.concat.min.js",
|
||||
"app/js/jquery.ui.git.js",
|
||||
"app/js/sha1.js",
|
||||
"app/plugins/**/*.js"
|
||||
]
|
||||
}
|
||||
paths = {}
|
||||
paths.app = "app/"
|
||||
paths.dist = "dist/"
|
||||
paths.tmp = "tmp/"
|
||||
|
||||
paths.jade = [
|
||||
paths.app + "index.jade",
|
||||
paths.app + "partials/**/*.jade"
|
||||
]
|
||||
|
||||
paths.images = paths.app + "images/**/*"
|
||||
paths.svg = paths.app + "svg/**/*"
|
||||
paths.css = paths.app + "app/styles/vendor/*.css"
|
||||
paths.locales = paths.app + "locales/**/*.json"
|
||||
paths.sass = [
|
||||
paths.app + "styles/**/*.scss"
|
||||
"!#{paths.app}/styles/bourbon/**/*.scss"
|
||||
]
|
||||
|
||||
paths.coffee = [
|
||||
paths.app + "coffee/app.coffee",
|
||||
paths.app + "coffee/*.coffee",
|
||||
paths.app + "coffee/modules/controllerMixins.coffee",
|
||||
paths.app + "coffee/modules/*.coffee",
|
||||
paths.app + "coffee/modules/common/*.coffee",
|
||||
paths.app + "coffee/modules/backlog/*.coffee",
|
||||
paths.app + "coffee/modules/taskboard/*.coffee",
|
||||
paths.app + "coffee/modules/kanban/*.coffee",
|
||||
paths.app + "coffee/modules/issues/*.coffee",
|
||||
paths.app + "coffee/modules/userstories/*.coffee",
|
||||
paths.app + "coffee/modules/tasks/*.coffee",
|
||||
paths.app + "coffee/modules/wiki/*.coffee",
|
||||
paths.app + "coffee/modules/admin/*.coffee",
|
||||
paths.app + "coffee/modules/projects/*.coffee",
|
||||
paths.app + "coffee/modules/locales/*.coffee",
|
||||
paths.app + "coffee/modules/base/*.coffee",
|
||||
paths.app + "coffee/modules/resources/*.coffee",
|
||||
paths.app + "coffee/modules/user-settings/*.coffee"
|
||||
paths.app + "plugins/**/*.coffee"
|
||||
]
|
||||
|
||||
paths.js = [
|
||||
paths.app + "vendor/jquery/dist/jquery.js",
|
||||
paths.app + "vendor/lodash/dist/lodash.js",
|
||||
paths.app + "vendor/emoticons/lib/emoticons.js",
|
||||
paths.app + "vendor/underscore.string/lib/underscore.string.js",
|
||||
paths.app + "vendor/angular/angular.js",
|
||||
paths.app + "vendor/angular-route/angular-route.js",
|
||||
paths.app + "vendor/angular-sanitize/angular-sanitize.js",
|
||||
paths.app + "vendor/angular-animate/angular-animate.js",
|
||||
paths.app + "vendor/i18next/i18next.js",
|
||||
paths.app + "vendor/moment/min/moment-with-langs.js",
|
||||
paths.app + "vendor/checksley/checksley.js",
|
||||
paths.app + "vendor/pikaday/pikaday.js",
|
||||
paths.app + "vendor/jquery-flot/jquery.flot.js",
|
||||
paths.app + "vendor/jquery-flot/jquery.flot.pie.js",
|
||||
paths.app + "vendor/jquery-flot/jquery.flot.time.js",
|
||||
paths.app + "vendor/jquery-flot/jquery.flot.time.js",
|
||||
paths.app + "vendor/flot-axislabels/jquery.flot.axislabels.js",
|
||||
paths.app + "vendor/jquery-textcomplete/jquery.textcomplete.js",
|
||||
paths.app + "vendor/markitup/markitup/jquery.markitup.js",
|
||||
paths.app + "vendor/malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.concat.min.js",
|
||||
paths.app + "js/jquery.ui.git.js",
|
||||
paths.app + "js/sha1.js",
|
||||
paths.app + "plugins/**/*.js"
|
||||
]
|
||||
|
||||
############################################################################
|
||||
# Layout/CSS Related tasks
|
||||
|
@ -89,125 +95,153 @@ gulp.task "jade-deploy", ->
|
|||
.pipe(plumber())
|
||||
.pipe(cache("jade"))
|
||||
.pipe(jade({pretty: false}))
|
||||
.pipe(gulp.dest("#{paths.dist}/partials"))
|
||||
.pipe(gulp.dest(paths.dist + "partials/"))
|
||||
|
||||
gulp.task "jade-watch", ->
|
||||
gulp.src(paths.jade)
|
||||
.pipe(plumber())
|
||||
.pipe(cache("jade"))
|
||||
.pipe(jadeInheritance({basedir: './app'}))
|
||||
.pipe(jadeInheritance({basedir: "./app"}))
|
||||
.pipe(jade({pretty: true}))
|
||||
.pipe(gulp.dest("#{paths.dist}"))
|
||||
.pipe(gulp.dest(paths.dist))
|
||||
|
||||
gulp.task "template", ->
|
||||
gulp.src("#{paths.app}/index.jade")
|
||||
gulp.task "templates", ->
|
||||
gulp.src(paths.app + "index.jade")
|
||||
.pipe(plumber())
|
||||
.pipe(jade({pretty: true, locals:{v:(new Date()).getTime()}}))
|
||||
.pipe(gulp.dest("#{paths.dist}"))
|
||||
.pipe(gulp.dest(paths.dist))
|
||||
|
||||
gulp.task "sass-lint", ->
|
||||
gulp.src([paths.scssStyles, '!app/styles/bourbon/**/*.scss'])
|
||||
gulp.src(paths.sass)
|
||||
.pipe(cache("sasslint"))
|
||||
.pipe(scsslint({config: "scsslint.yml"}))
|
||||
|
||||
gulp.task "sass-watch", ["sass-lint"], ->
|
||||
gulp.src(paths.sassStylesMain)
|
||||
gulp.src(paths.app + "styles/main.scss")
|
||||
.pipe(plumber())
|
||||
.pipe(sass())
|
||||
.pipe(rename("app.css"))
|
||||
.pipe(gulp.dest(paths.distStylesPath))
|
||||
.pipe(gulp.dest(paths.tmp))
|
||||
|
||||
gulp.task "sass-deploy", ->
|
||||
gulp.src(paths.sassStylesMain)
|
||||
gulp.src(paths.app + "styles/main.scss")
|
||||
.pipe(plumber())
|
||||
.pipe(sass())
|
||||
.pipe(rename("app.css"))
|
||||
.pipe(gulp.dest(paths.distStylesPath))
|
||||
.pipe(gulp.dest(paths.tmp))
|
||||
|
||||
gulp.task "css-vendor", ->
|
||||
gulp.src(paths.css)
|
||||
.pipe(concat("vendor.css"))
|
||||
.pipe(gulp.dest(paths.distStylesPath))
|
||||
.pipe(gulp.dest(paths.tmp))
|
||||
|
||||
gulp.task "css-lint-app", ["sass-watch"], ->
|
||||
gulp.src(paths.distStylesPath + "/app.css")
|
||||
gulp.src(paths.tmp + "app.css")
|
||||
.pipe(csslint("csslintrc.json"))
|
||||
.pipe(csslint.reporter())
|
||||
|
||||
gulp.task "styles-watch", ["sass-watch", "css-vendor", "css-lint-app"], ->
|
||||
gulp.src(paths.distStyles)
|
||||
_paths = [
|
||||
paths.tmp + "vendor.css",
|
||||
paths.tmp + "app.css"
|
||||
]
|
||||
|
||||
gulp.src(_paths)
|
||||
.pipe(concat("main.css"))
|
||||
.pipe(gulp.dest(paths.distStylesPath))
|
||||
.pipe(gulp.dest(paths.dist + "styles/"))
|
||||
|
||||
gulp.task "styles-deploy", ["sass-deploy", "css-vendor"], ->
|
||||
gulp.src(paths.distStyles)
|
||||
_paths = [
|
||||
paths.tmp + "vendor.css",
|
||||
paths.tmp + "app.css"
|
||||
]
|
||||
|
||||
gulp.src(_paths)
|
||||
.pipe(concat("main.css"))
|
||||
.pipe(minifyCSS())
|
||||
.pipe(gulp.dest(paths.distStylesPath))
|
||||
.pipe(gulp.dest(paths.dist + "styles/"))
|
||||
|
||||
##############################################################################
|
||||
# JS Related tasks
|
||||
##############################################################################
|
||||
|
||||
gulp.task "conf", ->
|
||||
gulp.src("conf/main.json")
|
||||
.pipe(wrap("angular.module('taigaBase').value('localconf', <%= contents %>);"))
|
||||
.pipe(concat("conf.js"))
|
||||
.pipe(gulp.dest(paths.tmp));
|
||||
|
||||
gulp.task "locales", ->
|
||||
gulp.src("app/locales/en/app.json")
|
||||
.pipe(wrap("angular.module('taigaLocales').constant('localesEnglish', <%= contents %>);"))
|
||||
.pipe(rename("localeEnglish.coffee"))
|
||||
.pipe(gulp.dest("app/coffee/modules/locales"))
|
||||
.pipe(wrap("angular.module('taigaBase').value('localesEn', <%= contents %>);"))
|
||||
.pipe(rename("locales.en.js"))
|
||||
.pipe(gulp.dest(paths.tmp))
|
||||
|
||||
# gulp.src("app/locales/es/app.json")
|
||||
# .pipe(wrap("angular.module('locales.es', []).constant('locales.es', <%= contents %>);"))
|
||||
# .pipe(rename("locale.es.coffee"))
|
||||
# .pipe(gulp.dest("app/coffee/"))
|
||||
|
||||
gulp.task "coffee-watch", ["locales"], ->
|
||||
gulp.task "coffee", ->
|
||||
gulp.src(paths.coffee)
|
||||
.pipe(plumber())
|
||||
.pipe(coffee())
|
||||
.pipe(concat("app.js"))
|
||||
.pipe(gulp.dest("dist/js/"))
|
||||
|
||||
gulp.task "coffee-deploy", ["locales"], ->
|
||||
gulp.src(paths.coffee)
|
||||
.pipe(plumber())
|
||||
.pipe(coffee())
|
||||
.pipe(concat("app.js"))
|
||||
.pipe(uglify({mangle:false, preserveComments: false}))
|
||||
.pipe(gulp.dest("dist/js/"))
|
||||
.pipe(gulp.dest(paths.tmp))
|
||||
|
||||
gulp.task "jslibs-watch", ->
|
||||
gulp.src(paths.vendorJsLibs)
|
||||
gulp.src(paths.js)
|
||||
.pipe(plumber())
|
||||
.pipe(concat("libs.js"))
|
||||
.pipe(gulp.dest("dist/js/"))
|
||||
|
||||
gulp.task "jslibs-deploy", ->
|
||||
gulp.src(paths.vendorJsLibs)
|
||||
gulp.src(paths.js)
|
||||
.pipe(plumber())
|
||||
.pipe(concat("libs.js"))
|
||||
.pipe(uglify({mangle:false, preserveComments: false}))
|
||||
.pipe(gulp.dest("dist/js/"))
|
||||
|
||||
gulp.task "app-watch", ["coffee", "conf", "locales"], ->
|
||||
_paths = [
|
||||
paths.tmp + "app.js",
|
||||
paths.tmp + "conf.js",
|
||||
paths.tmp + "locales.en.js"
|
||||
]
|
||||
|
||||
gulp.src(_paths)
|
||||
.pipe(concat("app.js"))
|
||||
.pipe(gulp.dest(paths.dist + "js/"));
|
||||
|
||||
gulp.task "app-deploy", ["coffee", "conf", "locales"], ->
|
||||
_paths = [
|
||||
paths.tmp + "app.js",
|
||||
paths.tmp + "conf.js",
|
||||
paths.tmp + "locales.en.js"
|
||||
]
|
||||
|
||||
gulp.src(_paths)
|
||||
.pipe(concat("app.js"))
|
||||
.pipe(uglify({mangle:false, preserveComments: false}))
|
||||
.pipe(gulp.dest(paths.dist + "js/"));
|
||||
|
||||
##############################################################################
|
||||
# Common tasks
|
||||
##############################################################################
|
||||
|
||||
# SVG
|
||||
gulp.task "svg", ->
|
||||
gulp.task "copy-svg", ->
|
||||
gulp.src("#{paths.app}/svg/**/*")
|
||||
.pipe(gulp.dest("#{paths.dist}/svg/"))
|
||||
|
||||
# Copy Files
|
||||
gulp.task "copy", ->
|
||||
gulp.task "copy-fonts", ->
|
||||
gulp.src("#{paths.app}/fonts/*")
|
||||
.pipe(gulp.dest("#{paths.dist}/fonts/"))
|
||||
|
||||
gulp.task "copy-images", ->
|
||||
gulp.src("#{paths.app}/images/**/*")
|
||||
.pipe(gulp.dest("#{paths.dist}/images/"))
|
||||
|
||||
gulp.task "copy-plugin-templates", ->
|
||||
gulp.src("#{paths.app}/plugins/**/templates/*")
|
||||
.pipe(gulp.dest("#{paths.dist}/plugins/"))
|
||||
|
||||
gulp.task "copy", ["copy-fonts", "copy-images", "copy-plugin-templates", "copy-svg"]
|
||||
|
||||
gulp.task "express", ->
|
||||
express = require("express")
|
||||
|
@ -230,32 +264,33 @@ gulp.task "express", ->
|
|||
# Rerun the task when a file changes
|
||||
gulp.task "watch", ->
|
||||
gulp.watch(paths.jade, ["jade-watch"])
|
||||
gulp.watch("#{paths.app}/index.jade", ["template"])
|
||||
gulp.watch(paths.scssStyles, ["styles-watch"])
|
||||
gulp.watch(paths.svg, ["svg"])
|
||||
gulp.watch(paths.coffee, ["coffee-watch"])
|
||||
gulp.watch(paths.vendorJsLibs, ["jslibs-watch"])
|
||||
gulp.watch(paths.locales, ["coffee-watch"])
|
||||
gulp.watch(paths.app + "index.jade", ["templates"])
|
||||
gulp.watch(paths.sass, ["styles-watch"])
|
||||
gulp.watch(paths.svg, ["copy-svg"])
|
||||
gulp.watch(paths.coffee, ["app-watch"])
|
||||
gulp.watch(paths.js, ["jslibs-watch"])
|
||||
gulp.watch(paths.locales, ["app-watch"])
|
||||
gulp.watch(paths.images, ["copy-images"])
|
||||
gulp.watch(paths.fonts, ["copy-fonts"])
|
||||
|
||||
|
||||
gulp.task "deploy", [
|
||||
"jade-deploy",
|
||||
"template",
|
||||
"templates",
|
||||
"copy",
|
||||
"svg",
|
||||
"coffee-deploy",
|
||||
"jade-deploy",
|
||||
"app-deploy",
|
||||
"jslibs-deploy",
|
||||
"styles-deploy"
|
||||
]
|
||||
|
||||
# The default task (called when you run gulp from cli)
|
||||
gulp.task "default", [
|
||||
"jade-deploy",
|
||||
"template",
|
||||
"styles-watch",
|
||||
"svg",
|
||||
"copy",
|
||||
"coffee-watch",
|
||||
"templates",
|
||||
"styles-watch",
|
||||
"app-watch",
|
||||
"jslibs-watch",
|
||||
"jade-deploy",
|
||||
"express",
|
||||
"watch"
|
||||
]
|
||||
|
|
Loading…
Reference in New Issue