]> source.dussan.org Git - archiva.git/commitdiff
[MRM-429] correct problems when ui is modified - the actionerrors were not shown...
authorBrett Porter <brett@apache.org>
Fri, 3 Aug 2007 08:24:29 +0000 (08:24 +0000)
committerBrett Porter <brett@apache.org>
Fri, 3 Aug 2007 08:24:29 +0000 (08:24 +0000)
git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@562384 13f79535-47bb-0310-9956-ffa450edef68

archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/findArtifact.jsp

index 1647c9a566cde4b70cef239b29ba64af85630129..1302a20c222059797c0d6ca50544781dbae14dde 100644 (file)
 
 <div id="contentArea">
   <div id="searchBox">
-    <script type="text/javascript">
-      function generateMd5( file, defVal )
-      {
-        if ( file )
+    <ww:if test="${sessionScope.uiOptions.appletFindEnabled}">
+      <script type="text/javascript">
+        function generateMd5( file, defVal )
         {
-          var s = document.ChecksumApplet.generateMd5(file);
-          // If there is a space, it's an error message, not a checksum
-          if ( s.indexOf(" ") >= 0 )
+          if ( file )
           {
-            alert(s);
-            return "";
+            var s = document.ChecksumApplet.generateMd5(file);
+            // If there is a space, it's an error message, not a checksum
+            if ( s.indexOf(" ") >= 0 )
+            {
+              alert(s);
+              return "";
+            }
+            else
+              return s;
           }
-          else
-            return s;
+          return defVal;
         }
-        return defVal;
-      }
-    </script>
+      </script>
 
-    <noscript>
-      <span class="errorMessage">JavaScript is disabled: using the file browser will not work.</span>
-    </noscript>
+      <noscript>
+        <span class="errorMessage">JavaScript is disabled: using the file browser will not work.</span>
+      </noscript>
 
-    <ww:form method="POST" action="checksumSearch" namespace="/"
-             onsubmit="this.q.value = generateMd5(this.file.value,this.md5.value); this.file.disabled = true;">
-      <ww:hidden name="q"/>
-      <ww:if test="${sessionScope.uiOptions.appletFindEnabled}">     
-      <tr>
-        <td class="tdLabel"><label for="checksumSearch_file" class="label">Search for:</label></td>
-        <td>
-          <input type="file" name="file" size="50" value="" id="checksumSearch_file"/>
-        </td>
-      </tr>
-      </ww:if>
-      <ww:textfield label="Checksum" size="50" name="md5"/>
-      <ww:submit value="Go!"/>
-    </ww:form>
+      <ww:form method="POST" action="checksumSearch" namespace="/"
+               onsubmit="this.q.value = generateMd5(this.file.value,this.md5.value); this.file.disabled = true;">
+        <ww:hidden name="q"/>
+        <tr>
+          <td class="tdLabel"><label for="checksumSearch_file" class="label">Search for:</label></td>
+          <td>
+            <input type="file" name="file" size="50" value="" id="checksumSearch_file"/>
+          </td>
+        </tr>
+        <ww:textfield label="Checksum" size="50" name="md5"/>
+        <ww:submit value="Go!"/>
+      </ww:form>
 
-    <ww:if test="${sessionScope.uiOptions.appletFindEnabled}">
-    <p>
-      Select the file you would like to locate in the remote repository.
-      The entire file will
-      <b>not</b>
-      be uploaded to the server. See the progress bar below for progress of
-      locally creating a checksum that is uploaded to the server after you hit "Go!".
-      <ww:actionerror/>
-    </p>
+      <p>
+        Select the file you would like to locate in the remote repository.
+        The entire file will
+        <b>not</b>
+        be uploaded to the server. See the progress bar below for progress of
+        locally creating a checksum that is uploaded to the server after you hit "Go!".
+        <ww:actionerror/>
+      </p>
 
-    <p>
-      <applet code="org/apache/maven/archiva/applet/ChecksumApplet.class"
-              archive="archiva-applet.jar"
-              width="400" height="20" name="ChecksumApplet">
-      </applet>
-    </p>
+      <p>
+        <applet code="org/apache/maven/archiva/applet/ChecksumApplet.class"
+                archive="archiva-applet.jar"
+                width="400" height="20" name="ChecksumApplet">
+        </applet>
+      </p>
     </ww:if>
+    <ww:else>
+      <ww:form method="POST" action="checksumSearch" namespace="/">
+        <ww:textfield label="Checksum" size="50" name="q"/>
+        <ww:submit value="Go!"/>
+      </ww:form>
+
+      <p>
+        <ww:actionerror/>
+      </p>
+    </ww:else>
   </div>
 </div>