20862: Merge branch 'main' into 20862-google-api-client
[arvados.git] / apps / workbench / app / views / layouts / body.html.erb
index ed19d51d2574a0b7bc044e923e4d3c66d5ca4e0b..8b114478ba089e538e4e8b60a60f09b317370287 100644 (file)
@@ -85,12 +85,13 @@ SPDX-License-Identifier: AGPL-3.0 %>
                 <% if Rails.configuration.Services.Workbench2.ExternalURL != URI("") %>
                 <li role="menuitem">
                   <%
-                    wb2_url = Rails.configuration.Services.Workbench2.ExternalURL.to_s
-                    wb2_url += '/' if wb2_url[-1] != '/'
-                    wb2_url += 'token'
+                  wb2_url = Rails.configuration.Services.Workbench2.ExternalURL.to_s
+                  if wb2_url[-1] == '/'
+                    wb2_url  = wb2_url.chop
+                  end
+                  wb2_url += request.fullpath
                   %>
                   <form action="<%= wb2_url %>" method="GET">
-                    <input type="hidden" name="api_token" value="<%= Thread.current[:arvados_api_token] %>">
                     <button role="menuitem" type="submit">
                       <i class="fa fa-lg fa-share-square fa-fw"></i> Go to Workbench 2
                     </button>
@@ -244,6 +245,23 @@ SPDX-License-Identifier: AGPL-3.0 %>
       <% end %>
     <% end %>
 
+    <% if current_user.andand.is_active %>
+    <div id="deprecation-notice" class="row">
+      <div class="col-md-12">
+       <div class="alert alert-block alert-warning">
+         <span>You are using the <a href="https://doc.arvados.org/user/topics/workbench-migration.html">deprecated Workbench application</a>
+           to access Arvados. A newer Workbench application is available.
+            <form action="<%= wb2_url %>" method="GET">
+              <button type="submit">
+                <i class="fa fa-lg fa-share-square fa-fw"></i> Go to Workbench 2
+              </button>
+            </form>
+         </span>
+    </div>
+  </div>
+    </div>
+    <% end %>
+
     <%= render partial: 'browser_unsupported' %><%# requires JS support below %>
     <%= render partial: 'getting_started/getting_started_popup' %>