Преглед на файлове

Support app deployment under a path prefix

Fixes #133
Maxime Quandalle преди 9 години
родител
ревизия
a78debc461

+ 1 - 1
.meteor/versions

@@ -61,7 +61,7 @@ id-map@1.0.4
 idmontie:migrations@1.0.0
 idmontie:migrations@1.0.0
 jquery@1.11.4
 jquery@1.11.4
 kadira:blaze-layout@2.1.0
 kadira:blaze-layout@2.1.0
-kadira:flow-router@2.6.1
+kadira:flow-router@2.7.0
 kenton:accounts-sandstorm@0.1.4
 kenton:accounts-sandstorm@0.1.4
 launch-screen@1.0.4
 launch-screen@1.0.4
 less@2.5.0_3
 less@2.5.0_3

+ 2 - 2
client/components/activities/activities.js

@@ -55,7 +55,7 @@ BlazeComponent.extendComponent({
   cardLink() {
   cardLink() {
     const card = this.currentData().card();
     const card = this.currentData().card();
     return card && Blaze.toHTML(HTML.A({
     return card && Blaze.toHTML(HTML.A({
-      href: card.absoluteUrl(),
+      href: FlowRouter.path(card.absoluteUrl()),
       'class': 'action-card',
       'class': 'action-card',
     }, card.title));
     }, card.title));
   },
   },
@@ -69,7 +69,7 @@ BlazeComponent.extendComponent({
   attachmentLink() {
   attachmentLink() {
     const attachment = this.currentData().attachment();
     const attachment = this.currentData().attachment();
     return attachment && Blaze.toHTML(HTML.A({
     return attachment && Blaze.toHTML(HTML.A({
-      href: attachment.url({ download: true }),
+      href: FlowRouter.path(attachment.url({ download: true })),
       target: '_blank',
       target: '_blank',
     }, attachment.name()));
     }, attachment.name()));
   },
   },

+ 1 - 1
client/components/cards/attachments.jade

@@ -15,7 +15,7 @@ template(name="attachmentsGalery")
         .attachment-thumbnail
         .attachment-thumbnail
           if isUploaded
           if isUploaded
             if isImage
             if isImage
-              img.attachment-thumbnail-img(src=url)
+              img.attachment-thumbnail-img(src="{{pathfor url}}")
             else
             else
               span.attachment-thumbnail-ext= extension
               span.attachment-thumbnail-ext= extension
           else
           else

+ 1 - 1
client/components/cards/minicard.jade

@@ -2,7 +2,7 @@ template(name="minicard")
   .minicard
   .minicard
     if cover
     if cover
       .minicard-cover
       .minicard-cover
-        img(src=cover.url)
+        img(src="{{pathFor cover.url}}")
     if labels
     if labels
       .minicard-labels
       .minicard-labels
         each labels
         each labels

+ 2 - 2
client/components/main/header.jade

@@ -43,10 +43,10 @@ template(name="header")
         the list of all boards.
         the list of all boards.
       if isSandstorm
       if isSandstorm
         .wekan-logo
         .wekan-logo
-          img(src="/wekan-logo-header.png" alt="Wekan")
+          img(src="{{pathFor '/wekan-logo-header.png'}}" alt="Wekan")
       else
       else
         a.wekan-logo(href="{{pathFor 'home'}}" title="{{_ 'header-logo-title'}}")
         a.wekan-logo(href="{{pathFor 'home'}}" title="{{_ 'header-logo-title'}}")
-          img(src="/wekan-logo-header.png" alt="Wekan")
+          img(src="{{pathFor '/wekan-logo-header.png'}}" alt="Wekan")
 
 
 template(name="headerTitle")
 template(name="headerTitle")
   h1 {{_ 'my-boards'}}
   h1 {{_ 'my-boards'}}

+ 5 - 1
client/components/main/layouts.jade

@@ -2,12 +2,16 @@ head
   title Wekan
   title Wekan
   meta(name="viewport"
   meta(name="viewport"
    content="maximum-scale=1.0,width=device-width,initial-scale=1.0,user-scalable=0")
    content="maximum-scale=1.0,width=device-width,initial-scale=1.0,user-scalable=0")
+  //- XXX We should use pathFor in the following `href` to support the case
+    where the application is deployed with a path prefix, but it seems to be
+    difficult to do that cleanly with Blaze -- at least without adding extra
+    packages.
   link(rel="shortcut icon" href="/wekan-favicon.png")
   link(rel="shortcut icon" href="/wekan-favicon.png")
 
 
 template(name="userFormsLayout")
 template(name="userFormsLayout")
   section.auth-layout
   section.auth-layout
     h1.at-form-landing-logo
     h1.at-form-landing-logo
-      img(src="/wekan-logo.png" alt="Wekan")
+      img(src="{{pathFor '/wekan-logo.png'}}" alt="Wekan")
     +Template.dynamic(template=content)
     +Template.dynamic(template=content)
 
 
 template(name="defaultLayout")
 template(name="defaultLayout")