You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2021/09/21 15:53:50 UTC

[ofbiz-framework] branch trunk updated: Improved: Adds the HTML accept Attribute in form widgets and Freemaker templates (OFBIZ-12049)

This is an automated email from the ASF dual-hosted git repository.

jleroux pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 6c42384  Improved: Adds the HTML <input> accept Attribute in form widgets and Freemaker templates (OFBIZ-12049)
6c42384 is described below

commit 6c4238418efc4593c50cedeb2ae5f3835da362ca
Author: Jacques Le Roux <ja...@les7arts.com>
AuthorDate: Tue Sep 21 17:53:01 2021 +0200

    Improved: Adds the HTML <input> accept Attribute in form widgets and Freemaker templates (OFBIZ-12049)
    
    Adds HTML accept where it fits, let the more general cases as they are
---
 .../order/template/order/AddOrderAttachments.ftl     |  2 +-
 .../party/template/party/AddressMatchMap.ftl         | 12 ++++++------
 .../product/template/category/EditCategory.ftl       |  2 +-
 .../template/config/EditProductConfigItemContent.ftl |  2 +-
 .../template/imagemanagement/AddMultipleImages.ftl   | 20 ++++++++++----------
 .../product/template/product/AddAdditionalImages.ftl |  6 +++---
 .../product/template/product/EditProductContent.ftl  |  2 +-
 7 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/applications/order/template/order/AddOrderAttachments.ftl b/applications/order/template/order/AddOrderAttachments.ftl
index 153742e..17033d8 100644
--- a/applications/order/template/order/AddOrderAttachments.ftl
+++ b/applications/order/template/order/AddOrderAttachments.ftl
@@ -49,7 +49,7 @@ under the License.
         </select>
       </div>
       <div>
-        <input type="file" name="uploadedFile" class="required" size="25">
+        <input type="file" name="uploadedFile" class="required" size="25" accept=".png,.gif,.jpg,.jpeg,.tiff,.tif"/>
       </div>
       <div>
         <button type="submit">
diff --git a/applications/party/template/party/AddressMatchMap.ftl b/applications/party/template/party/AddressMatchMap.ftl
index bafff48..a857c89 100644
--- a/applications/party/template/party/AddressMatchMap.ftl
+++ b/applications/party/template/party/AddressMatchMap.ftl
@@ -52,7 +52,7 @@ under the License.
           <td></td>
           <td>
             <form name="importaddrmap" method="post" enctype="multipart/form-data" action="<@o...@ofbizUrl>">
-            <input type="file" name="uploadedFile" size="14"/>
+            <input type="file" name="uploadedFile" size="14" accept=".csv"/>
             <input type="submit" value="${uiLabelMap.CommonUpload} CSV"/>
             <p>${uiLabelMap.PartyAddressMatchMessage1}</p>
             </form>
@@ -87,11 +87,11 @@ under the License.
               <td>${map.sequenceNum!}</td>
               <td class="button-col">
                 <form name="removeAddressMatchMap_${map_index}" method="post" action="<@o...@ofbizUrl>">
-	              <input type="hidden" name="mapKey" value="${map.mapKey}" />
-	              <input type="hidden" name="mapValue" value="${map.mapValue}" />
-	              <input type="submit" value="${uiLabelMap.CommonDelete}" />
-	            </form>
-	          </td>
+                <input type="hidden" name="mapKey" value="${map.mapKey}" />
+                <input type="hidden" name="mapValue" value="${map.mapValue}" />
+                <input type="submit" value="${uiLabelMap.CommonDelete}" />
+              </form>
+            </td>
             </tr>
             <#-- toggle the row color -->
 
diff --git a/applications/product/template/category/EditCategory.ftl b/applications/product/template/category/EditCategory.ftl
index 50c0b8b..fd4174e 100644
--- a/applications/product/template/category/EditCategory.ftl
+++ b/applications/product/template/category/EditCategory.ftl
@@ -216,7 +216,7 @@ function insertImageName(type,nameValue) {
             <form method="post" enctype="multipart/form-data" action="<@o...@ofbizUrl>" name="imageUploadForm">
                 <table cellspacing="0" class="basic-table">
                     <tr><td>
-                        <input type="file" size="50" name="fname"/>
+                        <input type="file" size="50" name="fname" accept=".png,.gif,.jpg,.jpeg,.tiff,.tif"/>
                         <br />
                         <span>
                             <label><input type="radio" name="upload_file_type_bogus" value="category" checked="checked" onclick='setUploadUrl("<@o...@ofbizUrl>");'/>${uiLabelMap.ProductCategoryImageUrl}</label>
diff --git a/applications/product/template/config/EditProductConfigItemContent.ftl b/applications/product/template/config/EditProductConfigItemContent.ftl
index c2f6a30..9567438 100644
--- a/applications/product/template/config/EditProductConfigItemContent.ftl
+++ b/applications/product/template/config/EditProductConfigItemContent.ftl
@@ -153,7 +153,7 @@ function insertImageName(size,nameValue) {
         </div>
         <div class="screenlet-body">
             <form method="post" enctype="multipart/form-data" action="<@o...@ofbizUrl>" name="imageUploadForm">
-                <input type="file" size="50" name="fname" />
+                <input type="file" size="50" name="fname" accept=".png,.gif,.jpg,.jpeg,.tiff,.tif"/>
                 <input type="submit" class="smallSubmit" value="${uiLabelMap.ProductUploadImage}" />
             </form>
         </div>
diff --git a/applications/product/template/imagemanagement/AddMultipleImages.ftl b/applications/product/template/imagemanagement/AddMultipleImages.ftl
index bad3acb..cfe9f65 100644
--- a/applications/product/template/imagemanagement/AddMultipleImages.ftl
+++ b/applications/product/template/imagemanagement/AddMultipleImages.ftl
@@ -37,43 +37,43 @@ under the License.
       </tr>
       <tr>
         <td class="label"/>
-        <td><input type="file" size="20" name="additionalImageOne"/></td>
+        <td><input type="file" size="20" name="additionalImageOne"accept=".png,.gif,.jpg,.jpeg,.tiff,.tif"/></td>
       </tr>
       <tr>
         <td class="label"/>
-        <td><input type="file" size="20" name="additionalImageTwo"/></td>
+        <td><input type="file" size="20" name="additionalImageTwo"accept=".png,.gif,.jpg,.jpeg,.tiff,.tif"/></td>
       </tr>
       <tr>
         <td class="label"/>
-        <td><input type="file" size="20" name="additionalImageThree"/></td>
+        <td><input type="file" size="20" name="additionalImageThree"accept=".png,.gif,.jpg,.jpeg,.tiff,.tif"/></td>
       </tr>
       <tr>
         <td class="label"/>
-        <td><input type="file" size="20" name="additionalImageFour"/></td>
+        <td><input type="file" size="20" name="additionalImageFour"accept=".png,.gif,.jpg,.jpeg,.tiff,.tif"/></td>
       </tr>
       <tr>
         <td class="label"/>
-        <td><input type="file" size="20" name="additionalImageFive"/></td>
+        <td><input type="file" size="20" name="additionalImageFive"accept=".png,.gif,.jpg,.jpeg,.tiff,.tif"/></td>
       </tr>
       <tr>
         <td class="label"/>
-        <td><input type="file" size="20" name="additionalImageSix"/></td>
+        <td><input type="file" size="20" name="additionalImageSix"accept=".png,.gif,.jpg,.jpeg,.tiff,.tif"/></td>
       </tr>
       <tr>
         <td class="label"/>
-        <td><input type="file" size="20" name="additionalImageSeven"/></td>
+        <td><input type="file" size="20" name="additionalImageSeven"accept=".png,.gif,.jpg,.jpeg,.tiff,.tif"/></td>
       </tr>
       <tr>
         <td class="label"/>
-        <td><input type="file" size="20" name="additionalImageEight"/></td>
+        <td><input type="file" size="20" name="additionalImageEight"accept=".png,.gif,.jpg,.jpeg,.tiff,.tif"/></td>
       </tr>
       <tr>
         <td class="label"/>
-        <td><input type="file" size="20" name="additionalImageNine"/></td>
+        <td><input type="file" size="20" name="additionalImageNine"accept=".png,.gif,.jpg,.jpeg,.tiff,.tif"/></td>
       </tr>
       <tr>
         <td class="label"/>
-        <td><input type="file" size="20" name="additionalImageTen"/></td>
+        <td><input type="file" size="20" name="additionalImageTen"accept=".png,.gif,.jpg,.jpeg,.tiff,.tif"/></td>
       </tr>
       <tr>
         <td class="label"/>
diff --git a/applications/product/template/product/AddAdditionalImages.ftl b/applications/product/template/product/AddAdditionalImages.ftl
index 6944ed0..79aa505 100644
--- a/applications/product/template/product/AddAdditionalImages.ftl
+++ b/applications/product/template/product/AddAdditionalImages.ftl
@@ -32,15 +32,15 @@ under the License.
       </tr>
       <tr>
         <td><#if productAdditionalImage2?has_content><a href="javascript:void(0);" swapDetail="<@o...@ofbizContentUrl>" ><img src="<@o...@ofbizContentUrl>" class="cssImgSmall" alt="" /></a></#if></td>
-        <td><input type="file" size="20" name="additionalImageTwo" /></td>
+        <td><input type="file" size="20" name="additionalImageTwo" accept=".png,.gif,.jpg,.jpeg,.tiff,.tif"/></td>
       </tr>
       <tr>
         <td><#if productAdditionalImage3?has_content><a href="javascript:void(0);" swapDetail="<@o...@ofbizContentUrl>"><img src="<@o...@ofbizContentUrl>" class="cssImgSmall" alt="" /></a></#if></td>
-        <td><input type="file" size="20" name="additionalImageThree" /></td>
+        <td><input type="file" size="20" name="additionalImageThree" accept=".png,.gif,.jpg,.jpeg,.tiff,.tif"/></td>
       </tr>
       <tr>
         <td><#if productAdditionalImage4?has_content><a href="javascript:void(0);" swapDetail="<@o...@ofbizContentUrl>"><img src="<@o...@ofbizContentUrl>" class="cssImgSmall" alt="" /></a></#if></td>
-        <td><input type="file" size="20" name="additionalImageFour" /></td>
+        <td><input type="file" size="20" name="additionalImageFour" accept=".png,.gif,.jpg,.jpeg,.tiff,.tif"/></td>
       </tr>
       <tr>
         <td></td>
diff --git a/applications/product/template/product/EditProductContent.ftl b/applications/product/template/product/EditProductContent.ftl
index 5d05b7c..a851999 100644
--- a/applications/product/template/product/EditProductContent.ftl
+++ b/applications/product/template/product/EditProductContent.ftl
@@ -188,7 +188,7 @@ under the License.
         <table cellspacing="0" class="basic-table">
             <tr>
                 <td width="20%" align="right" valign="top">
-                    <input type="file" size="50" name="fname"/>
+                    <input type="file" size="50" name="fname" accept=".png,.gif,.jpg,.jpeg,.tiff,.tif"/>
                 </td>
                 <td>&nbsp;</td>
                 <td width="80%" colspan="4" valign="top">