diff --git a/app/modules/components/tribe-button/tribe-button.directive.coffee b/app/modules/components/tribe-button/tribe-button.directive.coffee index 4f961f06..03925461 100644 --- a/app/modules/components/tribe-button/tribe-button.directive.coffee +++ b/app/modules/components/tribe-button/tribe-button.directive.coffee @@ -17,11 +17,16 @@ # File: tribe-button.directive.coffee ### -TribeButtonDirective = (configService) -> +TribeButtonDirective = (configService, locationService) -> link = (scope, el, attrs) -> scope.vm = {} scope.vm.tribeHost = configService.config.tribeHost + scope.vm.url = "#{locationService.protocol()}://#{locationService.host()}" + if (locationService.protocol() == "http" and locationService.port() != 80) + scope.vm.url = "#{scope.vm.url}:#{locationService.port()}" + else if (locationService.protocol() == "https" and locationService.port() != 443) + scope.vm.url = "#{scope.vm.url}:#{locationService.port()}" return { scope: {usId: "=", projectSlug: "="} @@ -31,7 +36,7 @@ TribeButtonDirective = (configService) -> } TribeButtonDirective.$inject = [ - "$tgConfig" + "$tgConfig", "$tgLocation" ] angular.module("taigaComponents").directive("tgTribeButton", TribeButtonDirective) diff --git a/app/modules/components/tribe-button/tribe-button.jade b/app/modules/components/tribe-button/tribe-button.jade index 06ace0c7..7d2b09e2 100644 --- a/app/modules/components/tribe-button/tribe-button.jade +++ b/app/modules/components/tribe-button/tribe-button.jade @@ -1,5 +1,5 @@ a.button-tribe( - ng-href="{{::vm.tribeHost}}/taiga-integration/receive?project={{projectSlug}}&us={{usId}}", + ng-href="{{::vm.tribeHost}}/taiga-integration/receive?url={{::vm.url}}&project={{projectSlug}}&us={{usId}}", title="{{ 'US.TRIBE.PUBLISH' | translate }}" target="_blank" )