[ARVADOS] created: 5aff810336162ec6bfa6b38b914b5f7df4d0fc7a

git at public.curoverse.com git at public.curoverse.com
Thu Mar 12 11:07:54 EDT 2015


        at  5aff810336162ec6bfa6b38b914b5f7df4d0fc7a (commit)


commit 5aff810336162ec6bfa6b38b914b5f7df4d0fc7a
Author: Radhika Chippada <radhika at curoverse.com>
Date:   Thu Mar 12 11:06:51 2015 -0400

    5418: topnav brand name is clickable only when user is logged in.

diff --git a/apps/workbench/app/views/layouts/body.html.erb b/apps/workbench/app/views/layouts/body.html.erb
index 67eba94..fbbd0fa 100644
--- a/apps/workbench/app/views/layouts/body.html.erb
+++ b/apps/workbench/app/views/layouts/body.html.erb
@@ -7,7 +7,12 @@
           <span class="icon-bar"></span>
           <span class="icon-bar"></span>
         </button>
-        <a class="navbar-brand" href="/" data-push=true><%= Rails.configuration.site_name.downcase rescue Rails.application.class.parent_name %></a>
+        <% site_name = Rails.configuration.site_name.downcase rescue Rails.application.class.parent_name %>
+        <% if current_user %>
+          <a class="navbar-brand" href="/" data-push=true><%= site_name %></a>
+        <% else %>
+          <span class="navbar-brand"><%= site_name %></span>
+        <% end %>
       </div>
 
       <div class="collapse navbar-collapse">
diff --git a/apps/workbench/test/integration/anonymous_access_test.rb b/apps/workbench/test/integration/anonymous_access_test.rb
index b51730b..0eaae47 100644
--- a/apps/workbench/test/integration/anonymous_access_test.rb
+++ b/apps/workbench/test/integration/anonymous_access_test.rb
@@ -22,6 +22,7 @@ class AnonymousAccessTest < ActionDispatch::IntegrationTest
         assert_text 'indicate that you have read and accepted the user agreement'
       end
       within('.navbar-fixed-top') do
+        assert_selector 'a', text:Rails.configuration.site_name.downcase
         assert_selector 'a', text: "#{user['email']}"
         find('a', text: "#{user['email']}").click
         within('.dropdown-menu') do
@@ -31,6 +32,8 @@ class AnonymousAccessTest < ActionDispatch::IntegrationTest
     else  # anonymous
       assert_text 'Unrestricted public data'
       within('.navbar-fixed-top') do
+        assert_text Rails.configuration.site_name.downcase
+        assert_no_selector 'a', text:Rails.configuration.site_name.downcase
         assert_selector 'a', text: 'Log in'
       end
     end
diff --git a/apps/workbench/test/integration/application_layout_test.rb b/apps/workbench/test/integration/application_layout_test.rb
index 8a2906a..2357d30 100644
--- a/apps/workbench/test/integration/application_layout_test.rb
+++ b/apps/workbench/test/integration/application_layout_test.rb
@@ -34,9 +34,12 @@ class ApplicationLayoutTest < ActionDispatch::IntegrationTest
 
     within('.navbar-fixed-top') do
       if !user
+        assert_text Rails.configuration.site_name.downcase
+        assert_no_selector 'a', text:Rails.configuration.site_name.downcase
         assert page.has_link?('Log in'), 'Not found link - Log in'
       else
         # my account menu
+        assert_selector 'a', text:Rails.configuration.site_name.downcase
         assert page.has_link?("#{user['email']}"), 'Not found link - email'
         find('a', text: "#{user['email']}").click
         within('.dropdown-menu') do

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list