]> source.dussan.org Git - sonarqube.git/commitdiff
improve rendering of login form with many oauth providers
authorStas Vilchik <vilchiks@gmail.com>
Tue, 2 Feb 2016 15:52:25 +0000 (16:52 +0100)
committerStas Vilchik <vilchiks@gmail.com>
Tue, 2 Feb 2016 15:52:31 +0000 (16:52 +0100)
server/sonar-web/src/main/less/pages/login.less
server/sonar-web/src/main/webapp/WEB-INF/app/views/sessions/_form.html.erb

index 3af71a8b5ef5cb1fecef4c1b09bd143a5701cf66..15f37875df4da0950cf8e6a966fbae9fc6efdb22 100644 (file)
@@ -70,7 +70,6 @@
 }
 
 .oauth-providers {
-  margin-bottom: 30px;
   padding-bottom: 30px;
   border-bottom: 1px solid @barBorderColor;
 
@@ -80,6 +79,8 @@
     flex-wrap: wrap;
 
     & > li {
+      margin-bottom: 30px;
+
       & > a {
         display: block;
         width: 180px;
index 556822c9e877bc4c60a88f6d77508ce6dc440fdd..d0b72146d0422d1f5ba7ad51ca6422b0039a5d8f 100644 (file)
@@ -1,20 +1,22 @@
 <h1 class="maintenance-title text-center">Log In to SonarQube</h1>
 
-<section class="oauth-providers">
-  <% auth_providers = Api::Utils.java_facade.getIdentityProviders().to_a %>
-  <ul>
-    <% auth_providers.each do |provider| %>
-      <li>
-        <a href="<%= ApplicationController.root_context -%>/sessions/init/<%= provider.getKey().to_s %>"
-           title="Log in with <%= provider.getName().to_s -%>">
-          <img alt="<%= provider.getName().to_s -%>" width="20" height="20"
-               src="<%= ApplicationController.root_context + provider.getIconPath().to_s -%>">
-          <span>Log in with <%= provider.getName().to_s -%></span>
-        </a>
-      </li>
-    <% end %>
-  </ul>
-</section>
+<% auth_providers = Api::Utils.java_facade.getIdentityProviders().to_a %>
+<% if auth_providers.size > 0 %>
+  <section class="oauth-providers">
+    <ul>
+      <% auth_providers.each do |provider| %>
+        <li>
+          <a href="<%= ApplicationController.root_context -%>/sessions/init/<%= provider.getKey().to_s %>"
+             title="Log in with <%= provider.getName().to_s -%>">
+            <img alt="<%= provider.getName().to_s -%>" width="20" height="20"
+                 src="<%= ApplicationController.root_context + provider.getIconPath().to_s -%>">
+            <span>Log in with <%= provider.getName().to_s -%></span>
+          </a>
+        </li>
+      <% end %>
+    </ul>
+  </section>
+<% end %>
 
 <form id="login_form" action="<%= url_for :controller => 'sessions', :action => 'login' -%>" method="post">
   <input type="hidden" name="return_to_anchor" value="<%= h @return_to_anchor %>">