save statics inside a non-cacheable folder

stable
Juanfran 2015-11-12 10:57:08 +01:00
parent f34d01f249
commit d0d25dfd4c
36 changed files with 102 additions and 95 deletions

View File

@ -1,5 +1,7 @@
# Changelog # # Changelog #
## 1.10.0 ??? (unreleased)
- Statics folder hash
## 1.9.0 Abies Siberica (2015-11-XX) ## 1.9.0 Abies Siberica (2015-11-XX)

View File

@ -1,4 +1,4 @@
version = ___VERSION___ window._version = "___VERSION___"
window.taigaConfig = { window.taigaConfig = {
"api": "http://localhost:8000/api/v1/", "api": "http://localhost:8000/api/v1/",
"eventsUrl": null, "eventsUrl": null,
@ -16,16 +16,16 @@ window.taigaConfig = {
"contribPlugins": [] "contribPlugins": []
} }
promise = $.getJSON "/js/conf.json" promise = $.getJSON "/conf.json"
promise.done (data) -> promise.done (data) ->
window.taigaConfig = _.extend({}, window.taigaConfig, data) window.taigaConfig = _.extend({}, window.taigaConfig, data)
promise.always -> promise.always ->
if window.taigaConfig.contribPlugins.length > 0 if window.taigaConfig.contribPlugins.length > 0
plugins = _.map(window.taigaConfig.contribPlugins, (plugin) -> "#{plugin}?v=#{version}") plugins = _.map(window.taigaConfig.contribPlugins, (plugin) -> "#{plugin}")
ljs.load plugins, -> ljs.load plugins, ->
ljs.load "/js/app.js?v=#{version}", -> ljs.load "/#{window._version}/js/app.js", ->
angular.bootstrap(document, ['taiga']) angular.bootstrap(document, ['taiga'])
else else
ljs.load "/js/app.js?v=#{version}", -> ljs.load "/#{window._version}/js/app.js", ->
angular.bootstrap(document, ['taiga']) angular.bootstrap(document, ['taiga'])

View File

@ -508,7 +508,7 @@ configure = ($routeProvider, $locationProvider, $httpProvider, $provide, $tgEven
$translatePartialLoaderProvider.addPart('taiga') $translatePartialLoaderProvider.addPart('taiga')
$translateProvider $translateProvider
.useLoader('$translatePartialLoader', { .useLoader('$translatePartialLoader', {
urlTemplate: '/locales/{part}/locale-{lang}.json' urlTemplate: '/' + window._version + '/locales/{part}/locale-{lang}.json'
}) })
.useSanitizeValueStrategy('escapeParameters') .useSanitizeValueStrategy('escapeParameters')
.addInterpolation('$translateMessageFormatInterpolation') .addInterpolation('$translateMessageFormatInterpolation')

View File

@ -219,7 +219,7 @@ MembershipsRowAvatarDirective = ($log, $template, $translate) ->
ctx = { ctx = {
full_name: if member.full_name then member.full_name else "" full_name: if member.full_name then member.full_name else ""
email: if member.user_email then member.user_email else member.email email: if member.user_email then member.user_email else member.email
imgurl: if member.photo then member.photo else "/images/unnamed.png" imgurl: if member.photo then member.photo else "/" + window._version + "/images/unnamed.png"
pending: if !member.is_user_active then pending else "" pending: if !member.is_user_active then pending else ""
} }

View File

@ -140,7 +140,7 @@ CreatedByDisplayDirective = ($template, $compile, $translate, $navUrls)->
if model? if model?
$scope.owner = model.owner_extra_info or { $scope.owner = model.owner_extra_info or {
full_name_display: $translate.instant("COMMON.EXTERNAL_USER") full_name_display: $translate.instant("COMMON.EXTERNAL_USER")
photo: "/images/user-noimage.png" photo: "/" + window._version + "/images/user-noimage.png"
} }
$scope.url = if $scope.owner?.is_active then $navUrls.resolve("user-profile", {username: $scope.owner.username}) else "" $scope.url = if $scope.owner?.is_active then $navUrls.resolve("user-profile", {username: $scope.owner.username}) else ""
@ -643,7 +643,7 @@ ListItemAssignedtoDirective = ($template) ->
link = ($scope, $el, $attrs) -> link = ($scope, $el, $attrs) ->
bindOnce $scope, "usersById", (usersById) -> bindOnce $scope, "usersById", (usersById) ->
item = $scope.$eval($attrs.tgListitemAssignedto) item = $scope.$eval($attrs.tgListitemAssignedto)
ctx = {name: "Unassigned", imgurl: "/images/unnamed.png"} ctx = {name: "Unassigned", imgurl: "/" + window._version + "/images/unnamed.png"}
member = usersById[item.assigned_to] member = usersById[item.assigned_to]
if member if member

View File

@ -22,7 +22,7 @@
module = angular.module("taigaCommon") module = angular.module("taigaCommon")
TgLoadingService = ($compile) -> TgLoadingService = ($compile) ->
spinner = "<img class='loading-spinner' src='/svg/spinner-circle.svg' alt='loading...' />" spinner = "<img class='loading-spinner' src='/" + window._version + "/svg/spinner-circle.svg' alt='loading...' />"
return () -> return () ->
service = { service = {

View File

@ -780,7 +780,7 @@ IssueAssignedToInlineEditionDirective = ($repo, $rootscope, popoverService) ->
link = ($scope, $el, $attrs) -> link = ($scope, $el, $attrs) ->
updateIssue = (issue) -> updateIssue = (issue) ->
ctx = {name: "Unassigned", imgurl: "/images/unnamed.png"} ctx = {name: "Unassigned", imgurl: "/" + window._version + "/images/unnamed.png"}
member = $scope.usersById[issue.assigned_to] member = $scope.usersById[issue.assigned_to]
if member if member
ctx.imgurl = member.photo ctx.imgurl = member.photo

View File

@ -547,7 +547,7 @@ KanbanUserDirective = ($log, $compile) ->
render = (user) -> render = (user) ->
if user is undefined if user is undefined
ctx = {name: "Unassigned", imgurl: "/images/unnamed.png", clickable: clickable} ctx = {name: "Unassigned", imgurl: "/" + window._version + "/images/unnamed.png", clickable: clickable}
else else
ctx = {name: user.full_name_display, imgurl: user.photo, clickable: clickable} ctx = {name: user.full_name_display, imgurl: user.photo, clickable: clickable}

View File

@ -248,7 +248,7 @@ RelatedTaskAssignedToInlineEditionDirective = ($repo, $rootscope, popoverService
link = ($scope, $el, $attrs) -> link = ($scope, $el, $attrs) ->
updateRelatedTask = (task) -> updateRelatedTask = (task) ->
ctx = {name: "Unassigned", imgurl: "/images/unnamed.png"} ctx = {name: "Unassigned", imgurl: "/" + window._version + "/images/unnamed.png"}
member = $scope.usersById[task.assigned_to] member = $scope.usersById[task.assigned_to]
if member if member
ctx.imgurl = member.photo ctx.imgurl = member.photo

View File

@ -185,7 +185,7 @@ class TaskboardController extends mixOf(taiga.Controller, taiga.PageMixin)
@scope.usTasks[task.user_story][task.status].push(task) @scope.usTasks[task.user_story][task.status].push(task)
if tasks.length == 0 if tasks.length == 0
if @scope.userstories.length > 0 if @scope.userstories.length > 0
usId = @scope.userstories[0].id usId = @scope.userstories[0].id
else else
@ -442,7 +442,7 @@ TaskboardUserDirective = ($log) ->
user = $scope.usersById[assigned_to] user = $scope.usersById[assigned_to]
if user is undefined if user is undefined
_.assign($scope, {name: "Unassigned", imgurl: "/images/unnamed.png", clickable: clickable}) _.assign($scope, {name: "Unassigned", imgurl: "/" + window._version + "/images/unnamed.png", clickable: clickable})
else else
_.assign($scope, {name: user.full_name_display, imgurl: user.photo, clickable: clickable}) _.assign($scope, {name: user.full_name_display, imgurl: user.photo, clickable: clickable})

View File

@ -157,7 +157,7 @@ WikiSummaryDirective = ($log, $template, $compile, $translate) ->
user = $scope.usersById[wiki.last_modifier] user = $scope.usersById[wiki.last_modifier]
if user is undefined if user is undefined
user = {name: "unknown", imgUrl: "/images/user-noimage.png"} user = {name: "unknown", imgUrl: "/" + window._version + "/images/user-noimage.png"}
else else
user = {name: user.full_name_display, imgUrl: user.photo} user = {name: user.full_name_display, imgUrl: user.photo}

View File

@ -10,8 +10,8 @@ html(lang="en")
meta(name="description", content="Taiga is a project management platform for startups and agile developers & designers who want a simple, beautiful tool that makes work truly enjoyable.") meta(name="description", content="Taiga is a project management platform for startups and agile developers & designers who want a simple, beautiful tool that makes work truly enjoyable.")
meta(name="keywords", content="agile, scrum, taiga, management, project, developer, designer, user experience") meta(name="keywords", content="agile, scrum, taiga, management, project, developer, designer, user experience")
//-meta(name="viewport", content="width=device-width, user-scalable=no") //-meta(name="viewport", content="width=device-width, user-scalable=no")
link(rel="stylesheet", href="/styles/theme-taiga.css") link(rel="stylesheet", href="/#{v}/styles/theme-taiga.css")
link(rel="icon", type="image/png", href="/images/favicon.png") link(rel="icon", type="image/png", href="/#{v}/images/favicon.png")
//- PRERENDER SERVICE: This is to know when the page is completely loaded. //- PRERENDER SERVICE: This is to know when the page is completely loaded.
script(type='text/javascript'). script(type='text/javascript').
@ -39,6 +39,6 @@ html(lang="en")
div(tg-joy-ride) div(tg-joy-ride)
script(src="/js/libs.js?v=#{v}") script(src="/#{v}/js/libs.js")
script(src="/js/templates.js?v=#{v}") script(src="/#{v}/js/templates.js")
script(src="/js/app-loader.js?v=#{v}") script(src="/#{v}/js/app-loader.js")

View File

@ -1,7 +1,7 @@
a.list-itemtype-ticket( a.list-itemtype-ticket(
href="{{ ::vm.duty.get('url') }}" href="{{ ::vm.duty.get('url') }}"
title="{{ ::duty.get('subject') }}" title="{{ ::duty.get('subject') }}"
) )
div.list-itemtype-avatar(ng-if="::vm.duty.get('assigned_to_extra_info')") div.list-itemtype-avatar(ng-if="::vm.duty.get('assigned_to_extra_info')")
img( img(
ng-src="{{ ::vm.duty.get('assigned_to_extra_info').get('photo') }}" ng-src="{{ ::vm.duty.get('assigned_to_extra_info').get('photo') }}"
@ -9,7 +9,7 @@ a.list-itemtype-ticket(
) )
div.list-itemtype-avatar(ng-if="::!vm.duty.get('assigned_to_extra_info')") div.list-itemtype-avatar(ng-if="::!vm.duty.get('assigned_to_extra_info')")
img( img(
src="/images/unnamed.png" src="/#{v}/images/unnamed.png"
title="{{'ACTIVITY.VALUES.UNASSIGNED' | translate}}" title="{{'ACTIVITY.VALUES.UNASSIGNED' | translate}}"
) )
div.list-itemtype-ticket-data div.list-itemtype-ticket-data
@ -17,7 +17,7 @@ a.list-itemtype-ticket(
span.ticket-project {{ ::vm.duty.get('projectName')}} span.ticket-project {{ ::vm.duty.get('projectName')}}
span.ticket-type {{ ::vm.getDutyType() }} span.ticket-type {{ ::vm.getDutyType() }}
span.ticket-status(ng-style="{'color': vm.duty.get('status_extra_info').get('color')}") {{ ::vm.duty.get('status_extra_info').get('name') }} span.ticket-status(ng-style="{'color': vm.duty.get('status_extra_info').get('color')}") {{ ::vm.duty.get('status_extra_info').get('name') }}
h2 h2
span.ticket-id(tg-bo-ref="duty.get('ref')") span.ticket-id(tg-bo-ref="duty.get('ref')")
span.ticket-title {{ ::duty.get('subject') }} span.ticket-title {{ ::duty.get('subject') }}

View File

@ -1,7 +1,7 @@
section.profile-contacts section.profile-contacts
div(ng-if="vm.contacts === undefined") div(ng-if="vm.contacts === undefined")
div.spin div.spin
img(src="/svg/spinner-circle.svg", alt="Loading...") img(src="/#{v}/svg/spinner-circle.svg", alt="Loading...")
div.empty-tab(ng-if="vm.contacts && !vm.contacts.size") div.empty-tab(ng-if="vm.contacts && !vm.contacts.size")
include ../../../svg/hide.svg include ../../../svg/hide.svg

View File

@ -16,7 +16,7 @@ div.list-itemtype-ticket
title="{{ 'COMMON.ASSIGNED_TO.NOT_ASSIGNED'|translate }}" title="{{ 'COMMON.ASSIGNED_TO.NOT_ASSIGNED'|translate }}"
) )
img( img(
src="/images/unnamed.png", src="/#{v}/images/unnamed.png",
alt="{{ 'COMMON.ASSIGNED_TO.NOT_ASSIGNED'|translate }}" alt="{{ 'COMMON.ASSIGNED_TO.NOT_ASSIGNED'|translate }}"
) )

View File

@ -68,13 +68,13 @@ section.profile-favs
div(ng-if="vm.isLoading") div(ng-if="vm.isLoading")
div.spin div.spin
img( img(
src="/svg/spinner-circle.svg" src="/#{v}/svg/spinner-circle.svg"
alt="{{ 'COMMON.LOADING'|translate }}" alt="{{ 'COMMON.LOADING'|translate }}"
) )
.empty-search-results(ng-if="vm.hasNoResults && !vm.isLoading") .empty-search-results(ng-if="vm.hasNoResults && !vm.isLoading")
img( img(
src="../../images/search-empty.png" src="/#{v}/images/search-empty.png"
alt="{{ 'USER.PROFILE_FAVS.EMPTY_TITLE' | translate }}" alt="{{ 'USER.PROFILE_FAVS.EMPTY_TITLE' | translate }}"
) )
p.title {{ 'USER.PROFILE_FAVS.EMPTY_TITLE' | translate }} p.title {{ 'USER.PROFILE_FAVS.EMPTY_TITLE' | translate }}

View File

@ -1,7 +1,7 @@
section.profile-projects section.profile-projects
div(ng-if="vm.projects === undefined") div(ng-if="vm.projects === undefined")
div.spin div.spin
img(src="/svg/spinner-circle.svg", alt="Loading...") img(src="/#{v}/svg/spinner-circle.svg", alt="Loading...")
.empty-tab(ng-if="vm.projects && !vm.projects.size") .empty-tab(ng-if="vm.projects && !vm.projects.size")
include ../../../svg/hide.svg include ../../../svg/hide.svg

View File

@ -149,7 +149,7 @@
.profile-quote { .profile-quote {
@extend %light; @extend %light;
@extend %large; @extend %large;
background: url('/images/quote.png') no-repeat top left; background: url('../images/quote.png') no-repeat top left;
line-height: 1.4; line-height: 1.4;
padding: .5rem; padding: .5rem;
} }

View File

@ -68,14 +68,14 @@ class AppMetaService
@._set("twitter:site", "@taigaio") @._set("twitter:site", "@taigaio")
@._set("twitter:title", title) @._set("twitter:title", title)
@._set("twitter:description", truncate(description, 300)) @._set("twitter:description", truncate(description, 300))
@._set("twitter:image", "#{window.location.origin}/images/logo-color.png") @._set("twitter:image", "#{window.location.origin}/#{window._version}/images/logo-color.png")
setOpenGraphMetas: (title, description) -> setOpenGraphMetas: (title, description) ->
@._set("og:type", "object") @._set("og:type", "object")
@._set("og:site_name", "Taiga - Love your projects") @._set("og:site_name", "Taiga - Love your projects")
@._set("og:title", title) @._set("og:title", title)
@._set("og:description", truncate(description, 300)) @._set("og:description", truncate(description, 300))
@._set("og:image", "#{window.location.origin}/images/logo-color.png") @._set("og:image", "#{window.location.origin}/#{window._version}/images/logo-color.png")
@._set("og:url", window.location.href) @._set("og:url", window.location.href)
setAll: (title, description) -> setAll: (title, description) ->

View File

@ -30,6 +30,9 @@ describe "AppMetaService", ->
appMetaService = _tgAppMetaService_ appMetaService = _tgAppMetaService_
$rootScope = _$rootScope_ $rootScope = _$rootScope_
before ->
window._version = 1
beforeEach -> beforeEach ->
module "taigaCommon" module "taigaCommon"
_inject() _inject()
@ -48,7 +51,7 @@ describe "AppMetaService", ->
expect($("meta[name='twitter:site']")).to.have.attr("content", "@taigaio") expect($("meta[name='twitter:site']")).to.have.attr("content", "@taigaio")
expect($("meta[name='twitter:title']")).to.have.attr("content", data.title) expect($("meta[name='twitter:title']")).to.have.attr("content", data.title)
expect($("meta[name='twitter:description']")).to.have.attr("content", data.description) expect($("meta[name='twitter:description']")).to.have.attr("content", data.description)
expect($("meta[name='twitter:image']")).to.have.attr("content", "#{window.location.origin}/images/logo-color.png") expect($("meta[name='twitter:image']")).to.have.attr("content", "#{window.location.origin}/#{window._version}/images/logo-color.png")
it "set meta for open graph", () -> it "set meta for open graph", () ->
appMetaService.setOpenGraphMetas(data.title, data.description) appMetaService.setOpenGraphMetas(data.title, data.description)
@ -56,7 +59,7 @@ describe "AppMetaService", ->
expect($("meta[property='og:site_name']")).to.have.attr("content", "Taiga - Love your projects") expect($("meta[property='og:site_name']")).to.have.attr("content", "Taiga - Love your projects")
expect($("meta[property='og:title']")).to.have.attr("content", data.title) expect($("meta[property='og:title']")).to.have.attr("content", data.title)
expect($("meta[property='og:description']")).to.have.attr("content", data.description) expect($("meta[property='og:description']")).to.have.attr("content", data.description)
expect($("meta[property='og:image']")).to.have.attr("content", "#{window.location.origin}/images/logo-color.png") expect($("meta[property='og:image']")).to.have.attr("content", "#{window.location.origin}/#{window._version}/images/logo-color.png")
expect($("meta[property='og:url']")).to.have.attr("content", window.location.href) expect($("meta[property='og:url']")).to.have.attr("content", window.location.href)
it "set all meta", () -> it "set all meta", () ->
@ -67,12 +70,12 @@ describe "AppMetaService", ->
expect($("meta[name='twitter:site']")).to.have.attr("content", "@taigaio") expect($("meta[name='twitter:site']")).to.have.attr("content", "@taigaio")
expect($("meta[name='twitter:title']")).to.have.attr("content", data.title) expect($("meta[name='twitter:title']")).to.have.attr("content", data.title)
expect($("meta[name='twitter:description']")).to.have.attr("content", data.description) expect($("meta[name='twitter:description']")).to.have.attr("content", data.description)
expect($("meta[name='twitter:image']")).to.have.attr("content", "#{window.location.origin}/images/logo-color.png") expect($("meta[name='twitter:image']")).to.have.attr("content", "#{window.location.origin}/#{window._version}/images/logo-color.png")
expect($("meta[property='og:type']")).to.have.attr("content", "object") expect($("meta[property='og:type']")).to.have.attr("content", "object")
expect($("meta[property='og:site_name']")).to.have.attr("content", "Taiga - Love your projects") expect($("meta[property='og:site_name']")).to.have.attr("content", "Taiga - Love your projects")
expect($("meta[property='og:title']")).to.have.attr("content", data.title) expect($("meta[property='og:title']")).to.have.attr("content", data.title)
expect($("meta[property='og:description']")).to.have.attr("content", data.description) expect($("meta[property='og:description']")).to.have.attr("content", data.description)
expect($("meta[property='og:image']")).to.have.attr("content", "#{window.location.origin}/images/logo-color.png") expect($("meta[property='og:image']")).to.have.attr("content", "#{window.location.origin}/#{window._version}/images/logo-color.png")
expect($("meta[property='og:url']")).to.have.attr("content", window.location.href) expect($("meta[property='og:url']")).to.have.attr("content", window.location.href)
it "set function to set the metas", () -> it "set function to set the metas", () ->

View File

@ -7,10 +7,10 @@ div.activity-item
// profile image with url // profile image with url
div.profile-contact-picture(ng-if="timeline.getIn(['data', 'user', 'is_profile_visible'])") div.profile-contact-picture(ng-if="timeline.getIn(['data', 'user', 'is_profile_visible'])")
a(tg-nav="user-profile:username=timeline.getIn(['data', 'user', 'username'])", title="{{::timeline.getIn(['data', 'user', 'name']) }}") a(tg-nav="user-profile:username=timeline.getIn(['data', 'user', 'username'])", title="{{::timeline.getIn(['data', 'user', 'name']) }}")
img(ng-src="{{::timeline.getIn(['data', 'user', 'photo']) || '/images/user-noimage.png'}}", alt="{{::timeline.getIn(['data', 'user', 'name'])}}") img(ng-src="{{::timeline.getIn(['data', 'user', 'photo']) || '/#{v}/images/user-noimage.png'}}", alt="{{::timeline.getIn(['data', 'user', 'name'])}}")
// profile image without url // profile image without url
div.profile-contact-picture(ng-if="!timeline.getIn(['data', 'user', 'is_profile_visible'])") div.profile-contact-picture(ng-if="!timeline.getIn(['data', 'user', 'is_profile_visible'])")
img(ng-src="{{::timeline.getIn(['data', 'user', 'photo']) || '/images/user-noimage.png'}}", alt="{{::timeline.getIn(['data', 'user', 'name'])}}") img(ng-src="{{::timeline.getIn(['data', 'user', 'photo']) || '/#{v}/images/user-noimage.png'}}", alt="{{::timeline.getIn(['data', 'user', 'name'])}}")
p(tg-compile-html="timeline.get('title_html')") p(tg-compile-html="timeline.get('title_html')")

View File

@ -1,7 +1,7 @@
section.profile-timeline section.profile-timeline
div(ng-if="!vm.timelineList.size") div(ng-if="!vm.timelineList.size")
div.spin div.spin
img(src="/svg/spinner-circle.svg", alt="Loading...") img(src="/#{v}/svg/spinner-circle.svg", alt="Loading...")
div(infinite-scroll="vm.loadTimeline()", infinite-scroll-distance="3", infinite-scroll-disabled="vm.scrollDisabled") div(infinite-scroll="vm.loadTimeline()", infinite-scroll-distance="3", infinite-scroll-disabled="vm.scrollDisabled")
div(tg-repeat="timeline in vm.timelineList", tg-user-timeline-item="timeline") div(tg-repeat="timeline in vm.timelineList", tg-user-timeline-item="timeline")

View File

@ -21,7 +21,7 @@ div.wrapper(ng-controller="ProjectProfileController as ctrl",
div.admin-project-export-result.hidden div.admin-project-export-result.hidden
div.spin.hidden div.spin.hidden
img(src="/svg/spinner-circle.svg", alt="{{ 'COMMON.LOADING' | translate }}") img(src="/#{v}/svg/spinner-circle.svg", alt="{{ 'COMMON.LOADING' | translate }}")
h3.result-title h3.result-title
p.result-message p.result-message

View File

@ -55,7 +55,7 @@ div.wrapper(tg-backlog, ng-controller="BacklogController as ctrl",
tg-backlog-empty-sortable tg-backlog-empty-sortable
) )
img( img(
src="/images/backlog-empty.png" src="/#{v}/images/backlog-empty.png"
alt="{{'BACKLOG.EMPTY' | translate}}" alt="{{'BACKLOG.EMPTY' | translate}}"
) )
p.title(translate="BACKLOG.EMPTY") p.title(translate="BACKLOG.EMPTY")

View File

@ -3,7 +3,7 @@ doctype html
div.error-main div.error-main
div.error-container div.error-container
object.logo-svg(type="image/svg+xml", data="/svg/logo.svg") object.logo-svg(type="image/svg+xml", data="/svg/logo.svg")
img(src="/images/logo.png", alt="TAIGA") img(src="/#{v}/images/logo.png", alt="TAIGA")
h1.logo Taiga h1.logo Taiga
p.error-text(translate="ERROR.TEXT1") p.error-text(translate="ERROR.TEXT1")
a(href="/", title="", translate="COMMON.GO_HOME") a(href="/", title="", translate="COMMON.GO_HOME")

View File

@ -2,8 +2,8 @@ doctype html
div.error-main div.error-main
div.error-container div.error-container
object.logo-svg(type="image/svg+xml", data="/svg/logo.svg") object.logo-svg(type="image/svg+xml", data="/#{v}/svg/logo.svg")
img(src="/images/logo.png", alt="TAIGA") img(src="/#{v}/images/logo.png", alt="TAIGA")
h1.logo(translate="ERROR.NOT_FOUND") h1.logo(translate="ERROR.NOT_FOUND")
p.error-text(translate="ERROR.NOT_FOUND_TEXT") p.error-text(translate="ERROR.NOT_FOUND_TEXT")
a(href="/", title="", translate="COMMON.GO_HOME") a(href="/", title="", translate="COMMON.GO_HOME")

View File

@ -3,7 +3,7 @@ doctype html
div.error-main div.error-main
div.error-container div.error-container
object.logo-svg(type="image/svg+xml", data="/svg/logo.svg") object.logo-svg(type="image/svg+xml", data="/svg/logo.svg")
img(src="/images/logo.png", alt="TAIGA") img(src="/#{v}/images/logo.png", alt="TAIGA")
h1.logo(translate="ERROR.PERMISSION_DENIED") h1.logo(translate="ERROR.PERMISSION_DENIED")
p.error-text(translate="ERROR.PERMISSION_DENIED_TEXT") p.error-text(translate="ERROR.PERMISSION_DENIED_TEXT")
a(href="/", title="", translate="COMMON.GO_HOME") a(href="/", title="", translate="COMMON.GO_HOME")

View File

@ -1 +1 @@
img.beta(src="/images/beta.png", title="{{'COMMON.BETA' | translate}}") img.beta(src="/#{v}/images/beta.png", title="{{'COMMON.BETA' | translate}}")

View File

@ -1,5 +1,5 @@
img( img(
src="../../images/search-empty.png" src="/#{v}/images/search-empty.png"
alt="{{ 'SEARCH.EMPTY_TITLE' | translate }}" alt="{{ 'SEARCH.EMPTY_TITLE' | translate }}"
) )
p.title {{ 'SEARCH.EMPTY_TITLE' | translate }} p.title {{ 'SEARCH.EMPTY_TITLE' | translate }}

View File

@ -53,7 +53,7 @@ section.issues-table.basic-table(ng-class="{empty: !issues.length}")
section.empty-issues(ng-if="issues != undefined && issues.length == 0") section.empty-issues(ng-if="issues != undefined && issues.length == 0")
img( img(
src="../../images/issues-empty.png", src="/#{v}/images/issues-empty.png",
alt="{{ISSUES.TABLE.EMPTY.TITLE | translate }}" alt="{{ISSUES.TABLE.EMPTY.TITLE | translate }}"
) )
p.title(translate="ISSUES.TABLE.EMPTY.TITLE") p.title(translate="ISSUES.TABLE.EMPTY.TITLE")

View File

@ -2,7 +2,7 @@
section section
div.spin.hidden div.spin.hidden
img(src="/svg/spinner-circle.svg", alt="{{'COMMON.LOADING' | translate}}") img(src="/#{v}/svg/spinner-circle.svg", alt="{{'COMMON.LOADING' | translate}}")
div.progress-bar-wrapper.hidden div.progress-bar-wrapper.hidden
div.bar div.bar

View File

@ -17,7 +17,7 @@ section.sprints
div.sprints-empty(ng-if="totalMilestones === 0") div.sprints-empty(ng-if="totalMilestones === 0")
img( img(
src="/images/sprint-empty.png" src="/#{v}/images/sprint-empty.png"
alt="{{'BACKLOG.SPRINTS.EMPTY' | translate}}" alt="{{'BACKLOG.SPRINTS.EMPTY' | translate}}"
) )
p.title(translate="BACKLOG.SPRINTS.EMPTY") p.title(translate="BACKLOG.SPRINTS.EMPTY")

View File

@ -19,7 +19,7 @@ div.wrapper(tg-user-profile, ng-controller="UserSettingsController as ctrl",
img.avatar(ng-src="{{user.big_photo}}" alt="avatar") img.avatar(ng-src="{{user.big_photo}}" alt="avatar")
.overlay.hidden .overlay.hidden
img.loading-spinner( img.loading-spinner(
src="/svg/spinner-circle.svg", src="/#{v}/svg/spinner-circle.svg",
alt="{{'COMMON.LOADING' | translate}}" alt="{{'COMMON.LOADING' | translate}}"
) )

View File

@ -63,11 +63,11 @@ $dropdown-color: rgba(darken($grayer, 20%), 1);
// Background images // Background images
%triangled-bg { %triangled-bg {
background: url('/images/bg.png') no-repeat center center; background: url('../images/bg.png') no-repeat center center;
background-size: cover; background-size: cover;
} }
%background-taiga { %background-taiga {
background: url('/images/invitation_bg.jpg') no-repeat center center; background: url('../images/invitation_bg.jpg') no-repeat center center;
background-size: cover; background-size: cover;
} }

View File

@ -37,9 +37,12 @@ if (argv.theme) {
themes.set(argv.theme); themes.set(argv.theme);
} }
var version = "v-" + Date.now();
var paths = {}; var paths = {};
paths.app = "app/"; paths.app = "app/";
paths.dist = "dist/"; paths.dist = "dist/";
paths.distVersion = paths.dist + version + "/";
paths.tmp = "tmp/"; paths.tmp = "tmp/";
paths.extras = "extras/"; paths.extras = "extras/";
paths.vendor = "vendor/"; paths.vendor = "vendor/";
@ -190,7 +193,7 @@ gulp.task("jade", function() {
return gulp.src(paths.jade) return gulp.src(paths.jade)
.pipe(plumber()) .pipe(plumber())
.pipe(cached("jade")) .pipe(cached("jade"))
.pipe(jade({pretty: true, locals:{v:(new Date()).getTime()}})) .pipe(jade({pretty: true, locals:{v:version}}))
.pipe(gulp.dest(paths.tmp)); .pipe(gulp.dest(paths.tmp));
}); });
@ -199,7 +202,7 @@ gulp.task("jade-inheritance", function() {
.pipe(plumber()) .pipe(plumber())
.pipe(cached("jade")) .pipe(cached("jade"))
.pipe(jadeInheritance({basedir: "./app/"})) .pipe(jadeInheritance({basedir: "./app/"}))
.pipe(jade({pretty: true, locals:{v:(new Date()).getTime()}})) .pipe(jade({pretty: true, locals:{v: version}}))
.pipe(gulp.dest(paths.tmp)); .pipe(gulp.dest(paths.tmp));
}); });
@ -211,7 +214,7 @@ gulp.task("copy-index", function() {
gulp.task("template-cache", function() { gulp.task("template-cache", function() {
return gulp.src(paths.htmlPartials) return gulp.src(paths.htmlPartials)
.pipe(templateCache({standalone: true})) .pipe(templateCache({standalone: true}))
.pipe(gulp.dest(paths.dist + "js/")); .pipe(gulp.dest(paths.distVersion + "js/"));
}); });
gulp.task("jade-deploy", function(cb) { gulp.task("jade-deploy", function(cb) {
@ -316,7 +319,7 @@ gulp.task("main-css", function() {
return gulp.src(_paths) return gulp.src(_paths)
.pipe(concat("theme-" + themes.current.name + ".css")) .pipe(concat("theme-" + themes.current.name + ".css"))
.pipe(gulpif(isDeploy, minifyCSS({noAdvanced: true}))) .pipe(gulpif(isDeploy, minifyCSS({noAdvanced: true})))
.pipe(gulp.dest(paths.dist + "styles/")); .pipe(gulp.dest(paths.distVersion + "styles/"));
}); });
var compileThemes = function (cb) { var compileThemes = function (cb) {
@ -365,19 +368,19 @@ gulp.task("styles-dependencies", function(cb) {
*/ */
gulp.task("conf", function() { gulp.task("conf", function() {
return gulp.src(["conf/conf.example.json"]) return gulp.src(["conf/conf.example.json"])
.pipe(gulp.dest(paths.dist + "js/")); .pipe(gulp.dest(paths.dist));
}); });
gulp.task("app-loader", function() { gulp.task("app-loader", function() {
return gulp.src("app-loader/app-loader.coffee") return gulp.src("app-loader/app-loader.coffee")
.pipe(replace("___VERSION___", (new Date()).getTime())) .pipe(replace("___VERSION___", version))
.pipe(coffee()) .pipe(coffee())
.pipe(gulp.dest(paths.dist + "js/")); .pipe(gulp.dest(paths.distVersion + "js/"));
}); });
gulp.task("locales", function() { gulp.task("locales", function() {
return gulp.src(paths.locales) return gulp.src(paths.locales)
.pipe(gulp.dest(paths.dist + "locales")); .pipe(gulp.dest(paths.distVersion + "locales"));
}); });
gulp.task("coffee-lint", function () { gulp.task("coffee-lint", function () {
@ -412,14 +415,14 @@ gulp.task("coffee", function() {
}) })
.pipe(concat("app.js")) .pipe(concat("app.js"))
.pipe(sourcemaps.write('./maps')) .pipe(sourcemaps.write('./maps'))
.pipe(gulp.dest(paths.dist + "js/")); .pipe(gulp.dest(paths.distVersion + "js/"));
}); });
gulp.task("jslibs-watch", function() { gulp.task("jslibs-watch", function() {
return gulp.src(paths.libs) return gulp.src(paths.libs)
.pipe(plumber()) .pipe(plumber())
.pipe(concat("libs.js")) .pipe(concat("libs.js"))
.pipe(gulp.dest(paths.dist + "js/")); .pipe(gulp.dest(paths.distVersion + "js/"));
}); });
gulp.task("jslibs-deploy", function() { gulp.task("jslibs-deploy", function() {
@ -429,19 +432,17 @@ gulp.task("jslibs-deploy", function() {
.pipe(concat("libs.js")) .pipe(concat("libs.js"))
.pipe(uglify({mangle:false, preserveComments: false})) .pipe(uglify({mangle:false, preserveComments: false}))
.pipe(sourcemaps.write("./maps")) .pipe(sourcemaps.write("./maps"))
.pipe(gulp.dest(paths.dist + "js/")); .pipe(gulp.dest(paths.distVersion + "js/"));
}); });
gulp.task("app-watch", ["coffee-lint", "coffee", "conf", "locales", "app-loader"]); gulp.task("app-watch", ["coffee-lint", "coffee", "conf", "locales", "app-loader"]);
gulp.task("app-deploy", ["coffee", "conf", "locales", "app-loader"], function() { gulp.task("app-deploy", ["coffee", "conf", "locales", "app-loader"], function() {
return gulp.src(paths.dist) return gulp.src(paths.distVersion + "js/app.js")
.pipe(order(paths.coffee_order, {base: '.'}))
.pipe(sourcemaps.init()) .pipe(sourcemaps.init())
.pipe(concat("app.js"))
.pipe(uglify({mangle:false, preserveComments: false})) .pipe(uglify({mangle:false, preserveComments: false}))
.pipe(sourcemaps.write("./maps")) .pipe(sourcemaps.write("./maps"))
.pipe(gulp.dest(paths.dist + "js/")); .pipe(gulp.dest(paths.distVersion + "js/"));
}); });
/* /*
@ -456,45 +457,45 @@ gulp.task("clear", ["clear-sass-cache"], function(done) {
//SVG //SVG
gulp.task("copy-svg", function() { gulp.task("copy-svg", function() {
return gulp.src(paths.app + "/svg/**/*") return gulp.src(paths.app + "/svg/**/*")
.pipe(gulp.dest(paths.dist + "/svg/")); .pipe(gulp.dest(paths.distVersion + "/svg/"));
}); });
gulp.task("copy-theme-svg", function() { gulp.task("copy-theme-svg", function() {
return gulp.src(themes.current.path + "/svg/**/*") return gulp.src(themes.current.path + "/svg/**/*")
.pipe(gulp.dest(paths.dist + "/svg/" + themes.current.name)); .pipe(gulp.dest(paths.distVersion + "/svg/" + themes.current.name));
}); });
gulp.task("copy-fonts", function() { gulp.task("copy-fonts", function() {
return gulp.src(paths.app + "/fonts/*") return gulp.src(paths.app + "/fonts/*")
.pipe(gulp.dest(paths.dist + "/fonts/")); .pipe(gulp.dest(paths.distVersion + "/fonts/"));
}); });
gulp.task("copy-theme-fonts", function() { gulp.task("copy-theme-fonts", function() {
return gulp.src(themes.current.path + "/fonts/*") return gulp.src(themes.current.path + "/fonts/*")
.pipe(gulp.dest(paths.dist + "/fonts/" + themes.current.name)); .pipe(gulp.dest(paths.distVersion + "/fonts/" + themes.current.name));
}); });
gulp.task("copy-images", function() { gulp.task("copy-images", function() {
return gulp.src(paths.app + "/images/**/*") return gulp.src(paths.app + "/images/**/*")
.pipe(gulpif(isDeploy, imagemin({progressive: true}))) .pipe(gulpif(isDeploy, imagemin({progressive: true})))
.pipe(gulp.dest(paths.dist + "/images/")); .pipe(gulp.dest(paths.distVersion + "/images/"));
}); });
gulp.task("copy-theme-images", function() { gulp.task("copy-theme-images", function() {
return gulp.src(themes.current.path + "/images/**/*") return gulp.src(themes.current.path + "/images/**/*")
.pipe(gulpif(isDeploy, imagemin({progressive: true}))) .pipe(gulpif(isDeploy, imagemin({progressive: true})))
.pipe(gulp.dest(paths.dist + "/images/" + themes.current.name)); .pipe(gulp.dest(paths.distVersion + "/images/" + themes.current.name));
}); });
gulp.task("copy-images-plugins", function() { gulp.task("copy-images-plugins", function() {
return gulp.src(paths.app + "/plugins/**/images/*") return gulp.src(paths.app + "/plugins/**/images/*")
.pipe(flatten()) .pipe(flatten())
.pipe(gulp.dest(paths.dist + "/images/")); .pipe(gulp.dest(paths.distVersion + "/images/"));
}); });
gulp.task("copy-plugin-templates", function() { gulp.task("copy-plugin-templates", function() {
return gulp.src(paths.app + "/plugins/**/templates/**/*.html") return gulp.src(paths.app + "/plugins/**/templates/**/*.html")
.pipe(gulp.dest(paths.dist + "/plugins/")); .pipe(gulp.dest(paths.distVersion + "/plugins/"));
}); });
gulp.task("copy-extras", function() { gulp.task("copy-extras", function() {
@ -514,6 +515,10 @@ gulp.task("copy", [
"copy-extras" "copy-extras"
]); ]);
gulp.task("delete-old-version", function() {
del.sync(paths.dist + "v-*");
});
gulp.task("delete-tmp", function() { gulp.task("delete-tmp", function() {
del.sync(paths.tmp); del.sync(paths.tmp);
}); });
@ -522,15 +527,16 @@ gulp.task("express", function() {
var express = require("express"); var express = require("express");
var app = express(); var app = express();
app.use("/js", express.static(__dirname + "/dist/js")); app.use("/" + version + "/js", express.static(__dirname + "/dist/" + version + "/js"));
app.use("/styles", express.static(__dirname + "/dist/styles")); app.use("/" + version + "/styles", express.static(__dirname + "/dist/" + version + "/styles"));
app.use("/images", express.static(__dirname + "/dist/images")); app.use("/" + version + "/images", express.static(__dirname + "/dist/" + version + "/images"));
app.use("/svg", express.static(__dirname + "/dist/svg")); app.use("/" + version + "/svg", express.static(__dirname + "/dist/" + version + "/svg"));
app.use("/partials", express.static(__dirname + "/dist/partials")); app.use("/" + version + "/partials", express.static(__dirname + "/dist/" + version + "/partials"));
app.use("/fonts", express.static(__dirname + "/dist/fonts")); app.use("/" + version + "/fonts", express.static(__dirname + "/dist/" + version + "/fonts"));
app.use("/plugins", express.static(__dirname + "/dist/plugins")); app.use("/" + version + "/plugins", express.static(__dirname + "/dist/" + version + "/plugins"));
app.use("/locales", express.static(__dirname + "/dist/locales")); app.use("/" + version + "/locales", express.static(__dirname + "/dist/" + version + "/locales"));
app.use("/maps", express.static(__dirname + "/dist/maps")); app.use("/" + version + "/maps", express.static(__dirname + "/dist/" + version + "/maps"));
app.use("/conf.json", express.static(__dirname + "/dist/conf.json"));
app.all("/*", function(req, res, next) { app.all("/*", function(req, res, next) {
//Just send the index.html for other files to support HTML5Mode //Just send the index.html for other files to support HTML5Mode
@ -554,7 +560,7 @@ gulp.task("watch", function() {
}); });
gulp.task("deploy", function(cb) { gulp.task("deploy", function(cb) {
runSequence("clear", "delete-tmp", [ runSequence("clear", "delete-old-version", "delete-tmp", [
"copy", "copy",
"jade-deploy", "jade-deploy",
"app-deploy", "app-deploy",
@ -564,7 +570,7 @@ gulp.task("deploy", function(cb) {
}); });
//The default task (called when you run gulp from cli) //The default task (called when you run gulp from cli)
gulp.task("default", function(cb) { gulp.task("default", function(cb) {
runSequence("delete-tmp", [ runSequence("delete-old-version", "delete-tmp", [
"copy", "copy",
"styles", "styles",
"app-watch", "app-watch",

View File

@ -2,9 +2,6 @@
// Generated on Wed Apr 15 2015 09:44:14 GMT+0200 (CEST) // Generated on Wed Apr 15 2015 09:44:14 GMT+0200 (CEST)
// this is needed by theme.service.spec // this is needed by theme.service.spec
var fs = require('fs');
fs.writeFileSync('dist/styles/empty.css', '');
module.exports = function(config) { module.exports = function(config) {
var configuration = { var configuration = {
@ -20,7 +17,7 @@ module.exports = function(config) {
// list of files / patterns to load in the browser // list of files / patterns to load in the browser
files: [ files: [
'karma.app.conf.js', 'karma.app.conf.js',
'dist/js/libs.js', 'dist/**/js/libs.js',
'node_modules/angular-mocks/angular-mocks.js', 'node_modules/angular-mocks/angular-mocks.js',
'vendor/bluebird/js/browser/bluebird.js', 'vendor/bluebird/js/browser/bluebird.js',
'node_modules/chai-jquery/chai-jquery.js', 'node_modules/chai-jquery/chai-jquery.js',
@ -28,8 +25,8 @@ module.exports = function(config) {
'vendor/lodash/dist/lodash.js', 'vendor/lodash/dist/lodash.js',
'vendor/underscore.string/lib/underscore.string.js', 'vendor/underscore.string/lib/underscore.string.js',
'test-utils.js', 'test-utils.js',
'dist/js/app.js', 'dist/**/js/app.js',
'dist/js/templates.js', 'dist/**/js/templates.js',
'app/**/*spec.coffee' 'app/**/*spec.coffee'
], ],
@ -96,8 +93,7 @@ module.exports = function(config) {
proxies: { proxies: {
'/images/': 'http://localhost:9001/images/', '/images/': 'http://localhost:9001/images/',
'/base/dist/js/maps/': 'http://localhost:9001/js/maps/', '/base/dist/js/maps/': 'http://localhost:9001/js/maps/',
'/base/dist/js/maps/': 'http://localhost:9001/js/maps/', '/base/dist/js/maps/': 'http://localhost:9001/js/maps/'
'/styles/theme-testTheme.css': 'http://localhost:9001/styles/empty.css'
}, },
// Continuous Integration mode // Continuous Integration mode