Update of 
/var/cvs/contributions/CMSContainer/cmsc/contentrepository/src/webapp/editors/resources
In directory james.mmbase.org:/tmp/cvs-serv5549

Modified Files:
        attachmentsearch.jsp imagesearch.jsp 
Log Message:
CMSC-933 image, attachment improvment, add search result column, editwizard add 
fields


See also: 
http://cvs.mmbase.org/viewcvs/contributions/CMSContainer/cmsc/contentrepository/src/webapp/editors/resources
See also: http://www.mmbase.org/jira/browse/CMSC-933


Index: attachmentsearch.jsp
===================================================================
RCS file: 
/var/cvs/contributions/CMSContainer/cmsc/contentrepository/src/webapp/editors/resources/attachmentsearch.jsp,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- attachmentsearch.jsp        7 Oct 2008 09:57:27 -0000       1.13
+++ attachmentsearch.jsp        7 Oct 2008 13:01:44 -0000       1.14
@@ -23,8 +23,7 @@
 </cmscedit:head>
 <body>
   <mm:cloud jspvar="cloud" loginpage="../../editors/login.jsp">
-
-<mm:import externid="action">search</mm:import><%-- either: search of select 
--%>
+   <mm:import externid="action">search</mm:import><%-- either: search of 
select --%>
 
       <div class="tabs">
          <div class="tab_active">
@@ -51,27 +50,26 @@
             <html:hidden property="offset"/>
             <html:hidden property="order"/>
             <html:hidden property="direction"/>
-<mm:import id="contenttypes" jspvar="contenttypes">attachments</mm:import>
-<[EMAIL PROTECTED] file="attachmentform.jsp" %>
+               <mm:import id="contenttypes" 
jspvar="contenttypes">attachments</mm:import>
+               <[EMAIL PROTECTED] file="attachmentform.jsp" %>
          </html:form>
      </div>
 
-<div class="ruler_green"><div><fmt:message key="attachments.results" 
/></div></div>
-
-<div class="body">
-<mm:import externid="results" jspvar="nodeList" vartype="List" />
-<mm:import externid="resultCount" jspvar="resultCount" 
vartype="Integer">0</mm:import>
-<mm:import externid="offset" jspvar="offset" vartype="Integer">0</mm:import>
-<c:if test="${resultCount > 0}">
-<[EMAIL PROTECTED] file="../repository/searchpages.jsp" %>
+         <div class="ruler_green"><div><fmt:message key="attachments.results" 
/></div></div>
 
+         <div class="body">
+            <mm:import externid="results" jspvar="nodeList" vartype="List" />
+            <mm:import externid="resultCount" jspvar="resultCount" 
vartype="Integer">0</mm:import>
+            <mm:import externid="offset" jspvar="offset" 
vartype="Integer">0</mm:import>
+            <c:if test="${resultCount > 0}">
+               <[EMAIL PROTECTED] file="../repository/searchpages.jsp" %>
          <table>
             <tr class="listheader">
                <th> </th>
                <th nowrap="true"><a href="javascript:orderBy('title')" 
class="headerlink" ><fmt:message key="attachmentsearch.titlecolumn" /></a></th>
                <th nowrap="true"><a href="javascript:orderBy('filename')" 
class="headerlink" ><fmt:message key="attachmentsearch.filenamecolumn" 
/></a></th>
+                     <th><fmt:message key="attachmentsearch.filesizecolumn" 
/></th>
                <th nowrap="true"><a href="javascript:orderBy('mimetype')" 
class="headerlink" ><fmt:message key="attachmentsearch.mimetypecolumn" 
/></a></th>
-               <th><fmt:message key="attachmentsearch.mimetypecolumn" /></th>
             </tr>
             <tbody class="hover">
                 <c:set var="useSwapStyle">true</c:set>
@@ -83,38 +81,48 @@
                              <a href="<mm:url page="../WizardInitAction.do">
                                          <mm:param 
name="objectnumber"><mm:field name="number" /></mm:param>
                                          <mm:param name="returnurl" 
value="<%="../editors/resources/AttachmentAction.do" + 
request.getAttribute("geturl")%>" />
-                                      </mm:url>">
-                              <img src="../gfx/icons/page_edit.png" 
alt="<fmt:message key="attachmentsearch.icon.edit" />" title="<fmt:message 
key="attachmentsearch.icon.edit" />" /></a>
-                             <a href="javascript:showInfo(<mm:field 
name="number" />)">
-                                 <img src="../gfx/icons/info.png" 
alt="<fmt:message key="attachmentsearch.icon.info" />" title="<fmt:message 
key="attachmentsearch.icon.info" />" /></a>
+                                    </mm:url>"><img 
src="../gfx/icons/page_edit.png" alt="<fmt:message 
key="attachmentsearch.icon.edit" />" title="<fmt:message 
key="attachmentsearch.icon.edit" />"/></a>
+                                 <a href="javascript:showInfo(<mm:field 
name="number" />)"><img src="../gfx/icons/info.png" alt="<fmt:message 
key="attachmentsearch.icon.info" />" title="<fmt:message 
key="attachmentsearch.icon.info" />" /></a>
                              <mm:hasrank minvalue="administrator">
                              <a href="<mm:url 
page="DeleteSecondaryContentAction.do" >
                                             <mm:param 
name="objectnumber"><mm:field name="number" /></mm:param>
                                             <mm:param name="returnurl" 
value="<%="/editors/resources/AttachmentAction.do" + 
request.getAttribute("geturl")%>" />
-                                         </mm:url>">
-                               <img src="../gfx/icons/delete.png" 
alt="<fmt:message key="attachmentsearch.icon.delete" />" title="<fmt:message 
key="attachmentsearch.icon.delete" />"/></a>
+                                    </mm:url>"><img 
src="../gfx/icons/delete.png" alt="<fmt:message 
key="attachmentsearch.icon.delete" />" title="<fmt:message 
key="attachmentsearch.icon.delete" />"/></a>
                              </mm:hasrank>
                           </c:if>
                          </td>
                         <td onMouseDown="objClick(this);"><mm:field 
name="title"/></td>
                         <td onMouseDown="objClick(this);"><mm:field 
name="filename"/></td>
-                        <td onMouseDown="objClick(this);"><mm:field 
name="size" jspvar="size" write="false"/><fmt:formatNumber value="${size div 
1000}" pattern=".0"/> K </td>
+                           <td onMouseDown="objClick(this);">
+                              <mm:field name="size" jspvar="filesize" 
write="false"/>
+                              <c:choose>
+                                 <c:when test="${filesize lt 2048}">
+                                    <fmt:formatNumber value="${filesize}" 
pattern=""/> byte 
+                                 </c:when>
+                                 <c:when test="${filesize ge 2048 && filesize 
le(2*1024*1024)}">
+                                    <fmt:formatNumber value="${filesize div 
1024}" pattern=".0"/> K 
+                                 </c:when>
+                                 <c:otherwise>
+                                    <fmt:formatNumber value="${filesize div 
(1024 * 1024)}" pattern=".0"/> M 
+                                 </c:otherwise>
+                              </c:choose>
+                           </td>
                         <td onMouseDown="objClick(this);"><mm:field 
name="mimetype"/></td>
                      </tr>
                   <c:set var="useSwapStyle">${!useSwapStyle}</c:set>
                </mm:listnodes>
             </tbody>
          </table>
-</c:if>
-<c:if test="${resultCount == 0 && param.title != null}">
+            </c:if>
+            <c:if test="${resultCount == 0 && param.title != null}">
    <fmt:message key="attachmentsearch.noresult" />
-</c:if>
-<c:if test="${resultCount > 0}">
+            </c:if>
+            <c:if test="${resultCount > 0}">
    <[EMAIL PROTECTED] file="../repository/searchpages.jsp" %>
-</c:if>
-</div>
-</div>   
-</mm:cloud>
+            </c:if>
+         </div>
+      </div>
+   </mm:cloud>
 </body>
 </html:html>
 </mm:content>
\ No newline at end of file


Index: imagesearch.jsp
===================================================================
RCS file: 
/var/cvs/contributions/CMSContainer/cmsc/contentrepository/src/webapp/editors/resources/imagesearch.jsp,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- imagesearch.jsp     7 Oct 2008 09:57:27 -0000       1.13
+++ imagesearch.jsp     7 Oct 2008 13:01:44 -0000       1.14
@@ -26,7 +26,6 @@
 <body>
 <mm:cloud jspvar="cloud" loginpage="../../editors/login.jsp">
 <mm:import externid="action">search</mm:import><%-- either: search of select 
--%>
-
       <div class="tabs">
          <div class="tab_active">
             <div class="body">
@@ -43,70 +42,73 @@
             </div>
          </div>
       </div>
-      
      <div class="editor" style="height:500px">
      <div class="body">
-
          <mm:import id="searchinit"><c:url 
value='/editors/resources/ImageInitAction.do'/></mm:import>
           <html:form action="/editors/resources/ImageAction" method="post">
          <html:hidden property="action" value="${action}"/>
             <html:hidden property="offset"/>
             <html:hidden property="order"/>
             <html:hidden property="direction"/>
-
          <mm:import id="contenttypes" jspvar="contenttypes">images</mm:import>
          <[EMAIL PROTECTED] file="imageform.jsp" %>
-
          </html:form>
      </div>
-     
-<div class="ruler_green"><div><fmt:message key="images.results" /></div></div>
-<div class="body"> 
-<mm:import externid="results" jspvar="nodeList" vartype="List" />
-<mm:import externid="resultCount" jspvar="resultCount" 
vartype="Integer">0</mm:import>
-<mm:import externid="offset" jspvar="offset" vartype="Integer">0</mm:import>
-<c:if test="${resultCount > 0}">
-<[EMAIL PROTECTED] file="../repository/searchpages.jsp" %>
+      <div class="ruler_green"><div><fmt:message key="images.results" 
/></div></div>
+      <div class="body"> 
+         <mm:import externid="results" jspvar="nodeList" vartype="List"/>
+         <mm:import externid="resultCount" jspvar="resultCount" 
vartype="Integer">0</mm:import>
+         <mm:import externid="offset" jspvar="offset" 
vartype="Integer">0</mm:import>
+         <c:if test="${resultCount > 0}">
+            <[EMAIL PROTECTED] file="../repository/searchpages.jsp" %>
          <table>
             <tr class="listheader">
                <th width="55"> </th>
                <th nowrap="true"><a href="javascript:orderBy('title')" 
class="headerlink"><fmt:message key="imagesearch.titlecolumn" /></a></th>
                <th nowrap="true"><a href="javascript:orderBy('filename')" 
class="headerlink"><fmt:message key="imagesearch.filenamecolumn" /></a></th>
+                  <th><fmt:message key="imagesearch.sizecolumn" /></th>
                <th nowrap="true"><a href="javascript:orderBy('itype')" 
class="headerlink" ><fmt:message key="imagesearch.mimetypecolumn" /></a></th>
-               <th><fmt:message key="imagesearch.mimetypecolumn" /></th>
                <th></th>
             </tr>
             <tbody class="hover">
                 <c:set var="useSwapStyle">true</c:set>
                 <mm:listnodes referid="results">
-
                <mm:field name="description" escape="js-single-quotes" 
jspvar="description">
                   <%description = 
((String)description).replaceAll("[\\n\\r\\t]+"," "); %>
                        <mm:import id="url">javascript:selectElement('<mm:field 
name="number"/>', '<mm:field name="title" 
escape="js-single-quotes"/>','<mm:image />','<mm:field 
name="width"/>','<mm:field name="height"/>', '<%=description%>');</mm:import>
                </mm:field>
-
                     <tr <c:if test="${useSwapStyle}">class="swap"</c:if> 
href="<mm:write referid="url"/>">
                        <td style="white-space:nowrap;">
                         <c:if test="${action != 'select'}">
                              <a href="<mm:url page="../WizardInitAction.do">
                                                      <mm:param 
name="objectnumber"><mm:field name="number" /></mm:param>
                                                      <mm:param 
name="returnurl" value="<%="../editors/resources/ImageAction.do" + 
request.getAttribute("geturl")%>" />
-                                                  </mm:url>">
-                                 <img src="../gfx/icons/page_edit.png" 
alt="<fmt:message key="imagesearch.icon.edit" />" title="<fmt:message 
key="imagesearch.icon.edit" />" /></a>
+                                 </mm:url>"><img 
src="../gfx/icons/page_edit.png" alt="<fmt:message key="imagesearch.icon.edit" 
/>" title="<fmt:message key="imagesearch.icon.edit" />" /></a>
                        <a href="javascript:showInfo(<mm:field name="number" 
/>)">
                               <img src="../gfx/icons/info.png" 
alt="<fmt:message key="imagesearch.icon.info" />" title="<fmt:message 
key="imagesearch.icon.info" />" /></a>
                        <mm:hasrank minvalue="administrator">
                          <a href="<mm:url 
page="DeleteSecondaryContentAction.do" >
                                                         <mm:param 
name="objectnumber"><mm:field name="number" /></mm:param>
                                                         <mm:param 
name="returnurl" value="<%="/editors/resources/ImageAction.do" + 
request.getAttribute("geturl")%>" />
-                                                     </mm:url>">
-                                 <img src="../gfx/icons/delete.png" 
alt="<fmt:message key="imagesearch.icon.delete" />" title="<fmt:message 
key="imagesearch.icon.delete" />"/></a>
+                                 </mm:url>"><img src="../gfx/icons/delete.png" 
alt="<fmt:message key="imagesearch.icon.delete" />" title="<fmt:message 
key="imagesearch.icon.delete" />"/></a>
                         </mm:hasrank>
                         </c:if>
                        </td>
                        <td onMouseDown="objClick(this);"><mm:field 
name="title"/></td>
                        <td onMouseDown="objClick(this);"><mm:field 
name="filename"/></td>
-                       <td onMouseDown="objClick(this);"><mm:field 
name="filesize" jspvar="filesize" write="false"/><fmt:formatNumber 
value="${filesize div 1000}" pattern=".0"/> K </td>
+                       <td onMouseDown="objClick(this);"><mm:field 
name="filesize" jspvar="filesize" write="false"/>
+                           <c:choose>
+                              <c:when test="${filesize lt 2048}">
+                                 <fmt:formatNumber value="${filesize}" 
pattern=""/> byte </td>
+                              </c:when>
+                              <c:when test="${filesize ge 2048 && filesize 
le(2*1024*1024)}">
+                                 <fmt:formatNumber value="${filesize div 
1024}" pattern=".0"/> K </td>
+                              </c:when>
+                              <c:otherwise>
+                                 <fmt:formatNumber value="${filesize div (1024 
* 1024)}" pattern=".0"/> M </td>
+                              </c:otherwise>
+                           </c:choose>
+                        </td>
                        <td onMouseDown="objClick(this);"><mm:field 
name="itype"/></td>
                        <td onMouseDown="objClick(this);"><a 
href="javascript:showInfo(<mm:field name="number" />)"><img src="<mm:image 
template="s(100x100)"/>" alt="" /></a></td>
                     </tr>
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to