]> source.dussan.org Git - archiva.git/commitdiff
do not display login and register links when creating admin is needed
authorOlivier Lamy <olamy@apache.org>
Mon, 23 Jan 2012 08:33:54 +0000 (08:33 +0000)
committerOlivier Lamy <olamy@apache.org>
Mon, 23 Jan 2012 08:33:54 +0000 (08:33 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1234698 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/topbar.html

index bde8281edf81badc3bddbc03392478a3476afb5d..e5647cc0ca2b7aea607075d5cb03d38a581aa509 100644 (file)
@@ -115,23 +115,6 @@ $(function() {
   }
 
 
-
-
-  checkCreateAdminLink=function(){
-    $.ajax("restServices/redbackServices/userService/isAdminUserExists", {
-      type: "GET",
-      dataType: 'json',
-      success: function(data) {
-        var adminExists = JSON.parse(data);
-        if (adminExists == false) {
-          $("#create-admin-link").show();
-        } else {
-          $("#create-admin-link").hide();
-        }
-      }
-    });
-  }
-
   checkSecurityLinks=function(){
     var user = userLogged();
     $.log("checkSecurityLinks, user:"+user);
@@ -149,7 +132,22 @@ $(function() {
     }
   }
 
-
+  checkCreateAdminLink=function(){
+    $.ajax("restServices/redbackServices/userService/isAdminUserExists", {
+      type: "GET",
+      dataType: 'json',
+      success: function(data) {
+        var adminExists = JSON.parse(data);
+        if (adminExists == false) {
+          $("#create-admin-link").show();
+          $("#login-link").hide();
+          $("#register-link").hide();
+        } else {
+          $("#create-admin-link").hide();
+        }
+      }
+    });
+  }
 
   // handle url with registration link
   $(document).ready(function() {
index b9af0133d5879f70f364373e7f1517cb39ad911f..a0701f32d7c4c9479ba2b94629476595699c87ff 100644 (file)
@@ -40,7 +40,7 @@
           </a>
         </li>
         <li id="register-link" style="display: none">
-          <a href="#" onclick="registerBox();">
+          <a href="#" onclick="registerBox();" id="register-link-a">
             <span class="label notice">${register}</span>
           </a>
         </li>