whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject [whimsy] branch master updated: Ensure app JS is reloaded when it changes
Date Thu, 25 Jan 2018 15:08:17 GMT
This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new 2fb4410  Ensure app JS is reloaded when it changes
2fb4410 is described below

commit 2fb44108d85df47f39718b107526b143d9f4c857
Author: Sebb <sebb@apache.org>
AuthorDate: Thu Jan 25 15:08:15 2018 +0000

    Ensure app JS is reloaded when it changes
---
 www/roster/main.rb                  | 4 ++++
 www/roster/views/committee.html.rb  | 2 +-
 www/roster/views/committer.html.rb  | 2 +-
 www/roster/views/committers.html.rb | 2 +-
 www/roster/views/group.html.rb      | 2 +-
 www/roster/views/ppmc.html.rb       | 2 +-
 www/roster/views/ppmc_new.html.rb   | 2 +-
 7 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/www/roster/main.rb b/www/roster/main.rb
index 83c99cd..0ecac4d 100755
--- a/www/roster/main.rb
+++ b/www/roster/main.rb
@@ -31,6 +31,10 @@ helpers do
   def cssmtime
     File.mtime('public/stylesheets/app.css').to_i
   end
+  def appmtime
+    # TODO can this/should this be cached?
+    Wunderbar::Asset.convert("#{settings.views}/app.js.rb").mtime.to_i
+  end
 end
 
 get '/' do
diff --git a/www/roster/views/committee.html.rb b/www/roster/views/committee.html.rb
index 968e8c1..7719e05 100644
--- a/www/roster/views/committee.html.rb
+++ b/www/roster/views/committee.html.rb
@@ -18,7 +18,7 @@ _html do
       _div_.main!
     end
 
-    _script src: 'app.js'
+    _script src: "app.js?#{appmtime}"
     _.render '#main' do
       _PMC committee: @committee, auth: @auth
     end
diff --git a/www/roster/views/committer.html.rb b/www/roster/views/committer.html.rb
index bf7c0cb..22dd36f 100644
--- a/www/roster/views/committer.html.rb
+++ b/www/roster/views/committer.html.rb
@@ -17,7 +17,7 @@ _html do
       _div_.main!
     end
 
-    _script src: 'app.js'
+    _script src: "app.js?#{appmtime}"
     _.render '#main' do
       _Person committer: @committer, auth: @auth
     end
diff --git a/www/roster/views/committers.html.rb b/www/roster/views/committers.html.rb
index 0e41713..75b4bbd 100644
--- a/www/roster/views/committers.html.rb
+++ b/www/roster/views/committers.html.rb
@@ -13,7 +13,7 @@ _html do
     }
   ) do
     _div_.main!
-    _script src: 'app.js'
+    _script src: "app.js?#{appmtime}"
     _.render '#main' do
       _CommitterSearch
     end
diff --git a/www/roster/views/group.html.rb b/www/roster/views/group.html.rb
index c8c3055..85555f1 100644
--- a/www/roster/views/group.html.rb
+++ b/www/roster/views/group.html.rb
@@ -18,7 +18,7 @@ _html do
       _div_.main!
     end
 
-    _script src: 'app.js'
+    _script src: "app.js?#{appmtime}"
     _.render '#main' do
       _Group group: @group, auth: @auth
     end
diff --git a/www/roster/views/ppmc.html.rb b/www/roster/views/ppmc.html.rb
index df3fe32..5cae494 100644
--- a/www/roster/views/ppmc.html.rb
+++ b/www/roster/views/ppmc.html.rb
@@ -16,7 +16,7 @@ _html do
       }
     ) do
       _div_.main!
-      _script src: 'app.js'
+      _script src: "app.js?#{appmtime}"
       _.render '#main' do
         _PPMC ppmc: @ppmc, auth: @auth
       end
diff --git a/www/roster/views/ppmc_new.html.rb b/www/roster/views/ppmc_new.html.rb
index 992e592..e7050f3 100644
--- a/www/roster/views/ppmc_new.html.rb
+++ b/www/roster/views/ppmc_new.html.rb
@@ -18,7 +18,7 @@ _html do
       _div_.main!
     end
 
-    _script src: 'app.js'
+    _script src: "app.js?#{appmtime}"
     _.render '#main' do
       _PPMCNew auth: @auth, pmcsAndBoard: @pmcsAndBoard,
         officersAndMemers: @officersAndMembers, ipmc: @ipmc

-- 
To stop receiving notification emails like this one, please contact
sebb@apache.org.

Mime
View raw message