Author: andre
Date: 2010-06-29 14:49:16 +0200 (Tue, 29 Jun 2010)
New Revision: 42736

Modified:
   openimages/trunk/src/main/webapp/editors/edit.jspx
   openimages/trunk/src/main/webapp/editors/plays.jspx
Log:
monthly stats of media items

Modified: openimages/trunk/src/main/webapp/editors/edit.jspx
===================================================================
--- openimages/trunk/src/main/webapp/editors/edit.jspx  2010-06-29 12:48:48 UTC 
(rev 42735)
+++ openimages/trunk/src/main/webapp/editors/edit.jspx  2010-06-29 12:49:16 UTC 
(rev 42736)
@@ -177,31 +177,37 @@
                 <mm:hasrelationmanager sourcemanager="$type" 
destinationmanager="stats" role="related">
                   <mm:relatednodescontainer type="stats" role="related" 
searchdirs="destination">
                     <mm:sortorder field="created" direction="DOWN" />
-                    <table summary="Statistics for this node" border="0" 
cellspacing="0" cellpadding="3" class="stats">
+                    
+                    <table class="stats shorten" summary="Statistics for this 
node" border="0" cellspacing="0" cellpadding="3">
                       <thead>
                         <tr>
                           <th>date</th>
                           <th># of plays</th>
                         </tr>
                       </thead>
+                      <tfoot>
+                        <tr>
+                          <th colspan="2">
+                            <mm:size write="false">
+                              <c:if test="${_ gt 10}">
+                                <a class="showrest" 
href="#show-rest">Show/hide more</a>
+                              </c:if>
+                            </mm:size>
+                          </th>
+                        </tr>
+                      </tfoot>
                       <tbody>
+                      
                         <mm:relatednodes>
-                        
-                          <mm:import id="jaar" reset="true"><mm:field 
name="created"><mm:time format="yyyy" /></mm:field></mm:import>
-                          <mm:import id="maand" reset="true"><mm:field 
name="created"><mm:time format="M" /></mm:field></mm:import>
-                          <mm:import id="week" reset="true"><mm:field 
name="created"><mm:time format="w" /></mm:field></mm:import>
-                          <mm:import id="day" reset="true"><mm:field 
name="created"><mm:time format="D" /></mm:field></mm:import>
-                          <mm:import id="hour" reset="true"><mm:field 
name="created"><mm:time format="k" /></mm:field></mm:import>
-                          
                           <mm:index write="false">
                             <c:choose>
-                              <c:when test="${(_ mod 2) eq 0}"><c:set 
var="tdclass" value="even" /></c:when>
-                              <c:otherwise><c:set var="tdclass" value="odd" 
/></c:otherwise>
+                              <c:when test="${(_ mod 2) eq 0}"><c:set 
var="oddeven" value="even" /></c:when>
+                              <c:otherwise><c:set var="oddeven" value="odd" 
/></c:otherwise>
                             </c:choose>
                           </mm:index>
-                          <tr class="${tdclass}">
+                          <tr class="${oddeven}">
                             <td class="date">
-                              <mm:field name="created"><mm:time 
format="dd-MM-yyyy k" />:00</mm:field>
+                              <mm:field name="created"><mm:time 
format="dd-MM-yyyy kk:mm" /></mm:field>
                             </td>
                             <td class="total">
                               <mm:field name="total" />

Modified: openimages/trunk/src/main/webapp/editors/plays.jspx
===================================================================
--- openimages/trunk/src/main/webapp/editors/plays.jspx 2010-06-29 12:48:48 UTC 
(rev 42735)
+++ openimages/trunk/src/main/webapp/editors/plays.jspx 2010-06-29 12:49:16 UTC 
(rev 42736)
@@ -3,7 +3,7 @@
     xmlns:c="http://java.sun.com/jsp/jstl/core";
     xmlns:fn="http://java.sun.com/jsp/jstl/functions";
     xmlns:mm="http://www.mmbase.org/mmbase-taglib-2.0";
-    xmlns:sr="http://www.mmbase.org/tags/mm/searchrelate";
+    xmlns:oip="urn:jsptagdir:/WEB-INF/tags/oip"
     expires="0" type="text/html" language="client" postprocessor="none">
 <jsp:output doctype-root-element="html"
       doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
@@ -22,11 +22,282 @@
   <div id="content">
     <h2># of plays</h2>
     
+<mm:import externid="offset">0</mm:import>
+<mm:import id="max">50</mm:import>
+
+<mm:time time="now this month"    write="false" id="from" />
+<mm:time time="${from} + 1 month" write="false" id="to" />
+
+<mm:import externid="w" />
+<mm:import externid="m" />
+<mm:import externid="y" />
+
+<mm:present referid="w">
+  <mm:import id="from" reset="true"><mm:time inputformat="yyyy-w" 
time="${y}-${w}" /></mm:import>
+  <mm:import id="to"   reset="true"><mm:time time="${from} + 1 week" 
/></mm:import>
+</mm:present>
+
+<mm:present referid="m">
+  <mm:import id="from" reset="true"><mm:time time="${y}-${m}-1" /></mm:import>
+  <mm:import id="to"   reset="true"><mm:time time="${from} + 1 month" 
/></mm:import>
+</mm:present>
+
+<!-- sortorder and field to sort on -->
+<mm:import externid="sf">total</mm:import>
+<mm:import externid="so">down</mm:import>
+<c:choose>
+  <c:when test="${so eq 'up'}"><c:set var="sortorder" value="UP" /></c:when>
+  <c:otherwise><c:set var="sortorder" value="DOWN" /></c:otherwise>
+</c:choose>
+
+
+<!-- the table -->
+<mm:url id="baseurl" absolute="true" escapeamps="false" 
referids="w?,m?,y?,sf?,so?" write="false" />
+
+<mm:listnodescontainer type="stats">
+  <mm:sortorder field="$sf" direction="$so" />
+  <mm:constraint field="created" value="$from" operator="BETWEEN" value2="$to" 
/>
+  
+  <mm:size id="total" write="false" />
+  
+  <mm:offset value="$offset" />
+  <mm:maxnumber value="$max" />
+
+  <table summary="Play statistics" border="0" cellspacing="0" cellpadding="3" 
class="stats">
+    <thead>
+      <tr>
+        <th>#</th>
+        <th>node</th>
+        <th>
+          <mm:link referids="w?,m?,y?">
+            <mm:param name="so">${so eq 'up' ? 'down' : 'up'}</mm:param>
+            <mm:param name="sf">created</mm:param>
+            <a href="${_}">date</a>
+          </mm:link>
+        </th>
+        <th>
+          <mm:link referids="w?,m?,y?">
+            <mm:param name="sf">total</mm:param>
+            <mm:param name="so">${so eq 'down' ? 'up' : 'down'}</mm:param>
+            <a href="${_}"># of plays</a>
+          </mm:link>
+        </th>
+      </tr>
+    </thead>
+    <tfoot>
+      <tr>
+        <th colspan="4">
+          <oip:pager total="${total}" offset="${offset}" max="${max}" 
baseurl="${baseurl}" />
+        </th>
+      </tr>
+    </tfoot>
+
+    <mm:listnodes>
+      
+      <mm:index write="false">
+        <c:choose>
+          <c:when test="${(_ mod 2) eq 0}"><c:set var="oddeven" value="even" 
/></c:when>
+          <c:otherwise><c:set var="oddeven" value="odd" /></c:otherwise>
+        </c:choose>
+      </mm:index>
+      
+      <tr class="${oddeven}">
+        <td><mm:index offset="${offset + 1}" /></td>
+        <td> 
+          <mm:import id="node_nr" reset="true"><mm:field name="node" 
/></mm:import>
+          <mm:hasnode number="$node_nr">
+            <mm:node element="node" notfound="skip">
+              <mm:link page="edit.jspx" referids="node...@nr">
+                <a href="${_}">
+                  <mm:hasfield name="title"><mm:field name="title" 
/></mm:hasfield>
+                  <mm:hasfield name="title" inverse="true"><mm:field 
name="number" /></mm:hasfield>
+                </a>
+              </mm:link>
+            </mm:node>
+          </mm:hasnode>
+          <mm:hasnode number="$node_nr" inverse="true">
+            ${node_nr} (deleted)
+          </mm:hasnode>
+        </td>
+        <td>
+          <mm:field name="created">
+            <mm:time format="dd-MM-yyyy kk:mm" />
+          </mm:field>
+        </td>
+        <td>
+          <mm:field name="total" />
+        </td>
+      </tr>
+      
+    </mm:listnodes>
+  </table>
+</mm:listnodescontainer>
     
   
   
   </div><!-- /#content -->
-  <div id="sidebar"> <jsp:text>  </jsp:text> </div><!-- /#sidebar -->
+  <div id="sidebar">
+
+<!-- navigation with months -->
+<mm:listnodescontainer type="stats">
+  <mm:sortorder field="created" direction="UP" />
+  <p>
+    <mm:listnodes>
+      
+      <mm:import id="year" reset="true"><mm:field name="created"><mm:time 
format="yyyy" /></mm:field></mm:import>
+      <mm:import id="month" reset="true"><mm:field name="created"><mm:time 
format="M" /></mm:field></mm:import>
+      <mm:import id="week" reset="true"><mm:field name="created"><mm:time 
format="w" /></mm:field></mm:import>
+
+      <c:choose>
+        <c:when test="${(year eq '2014') and (yearisset ne '2014')}">
+          <c:if test="${(!empty yearisset)}"><br /></c:if>
+          2014 :
+          <c:set var="yearisset">2014</c:set>
+        </c:when>
+        <c:when test="${(year eq '2013') and (yearisset ne '2013')}">
+          <c:if test="${(!empty yearisset)}"><br /></c:if>
+          2013 :
+          <c:set var="yearisset">2013</c:set>
+        </c:when>
+        <c:when test="${(year eq '2012') and (yearisset ne '2012')}">
+          <c:if test="${(!empty yearisset)}"><br /></c:if>
+          2012 :
+          <c:set var="yearisset">2012</c:set>
+        </c:when>
+        <c:when test="${(year eq '2011') and (yearisset ne '2011')}">
+          <c:if test="${(!empty yearisset)}"><br /></c:if>
+          2011 :
+          <c:set var="yearisset">2011</c:set>
+        </c:when>
+        <c:when test="${(year eq '2010') and (yearisset ne '2010')}">
+          <c:if test="${(!empty yearisset)}"><br /></c:if>
+          2010 :
+          <c:set var="yearisset">2010</c:set>
+        </c:when>
+      </c:choose>
+
+<!--
+      <c:choose>
+        <c:when test="${(week eq '24') and (weekisset ne '24')}">
+          <c:if test="${(!empty weekisset)}"> - </c:if>
+          <mm:link referids="w...@w,y...@y">
+            <a href="${_}">24</a>
+          </mm:link> 
+          <c:set var="weekisset">24</c:set>
+        </c:when>
+        <c:when test="${(week eq '25') and (weekisset ne '25')}">
+          <c:if test="${(!empty weekisset)}"> - </c:if>
+          <mm:link referids="w...@w,y...@y">
+            <a href="${_}">25</a>
+          </mm:link> 
+          <c:set var="weekisset">25</c:set>
+        </c:when>
+        <c:when test="${(week eq '26') and (weekisset ne '26')}">
+          <c:if test="${(!empty weekisset)}"> - </c:if>
+          <mm:link referids="w...@w,y...@y">
+            <a href="${_}">26</a>
+          </mm:link> 
+          <c:set var="weekisset">26</c:set>
+        </c:when>
+        <c:when test="${(week eq '27') and (weekisset ne '27')}">
+          <c:if test="${(!empty weekisset)}"> - </c:if>
+          <mm:link referids="w...@w,y...@y">
+            <a href="${_}">27</a>
+          </mm:link> 
+          <c:set var="weekisset">27</c:set>
+        </c:when>
+      </c:choose>
+-->
+      <c:choose>
+        <c:when test="${(month eq '1') and (monthisset ne '1')}">
+          <mm:link referids="mo...@m,y...@y">
+            <a href="${_}"><mm:time format="MMMM" inputformat="M" 
time="$month" /></a>
+          </mm:link>
+          <c:set var="monthisset">1</c:set> 
+        </c:when>
+        <c:when test="${(month eq '2') and (monthisset ne '2')}">
+          <c:if test="${(!empty monthisset)}"> - </c:if>
+          <mm:link referids="mo...@m,y...@y">
+            <a href="${_}"><mm:time format="MMMM" inputformat="M" 
time="$month" /></a>
+          </mm:link>
+          <c:set var="monthisset">2</c:set> 
+        </c:when>
+        <c:when test="${(month eq '3') and (monthisset ne '3')}">
+          <c:if test="${(!empty monthisset)}"> - </c:if>
+          <mm:link referids="mo...@m,y...@y">
+            <a href="${_}"><mm:time format="MMMM" inputformat="M" 
time="$month" /></a>
+          </mm:link>
+          <c:set var="monthisset">3</c:set> 
+        </c:when>
+        <c:when test="${(month eq '4') and (monthisset ne '4')}">
+          <c:if test="${(!empty monthisset)}"> - </c:if>
+          <mm:link referids="mo...@m,y...@y">
+            <a href="${_}"><mm:time format="MMMM" inputformat="M" 
time="$month" /></a>
+          </mm:link>
+          <c:set var="monthisset">4</c:set> 
+        </c:when>
+        <c:when test="${(month eq '5') and (monthisset ne '5')}">
+          <c:if test="${(!empty monthisset)}"> - </c:if>
+          <mm:link referids="mo...@m,y...@y">
+            <a href="${_}"><mm:time format="MMMM" inputformat="M" 
time="$month" /></a>
+          </mm:link>
+          <c:set var="monthisset">5</c:set> 
+        </c:when>
+        <c:when test="${(month eq '6') and (monthisset ne '6')}">
+          <c:if test="${(!empty monthisset)}"> - </c:if>
+          <mm:link referids="mo...@m,y...@y">
+            <a href="${_}"><mm:time format="MMMM" inputformat="M" 
time="$month" /></a>
+          </mm:link>
+          <c:set var="monthisset">6</c:set> 
+        </c:when>
+        <c:when test="${(month eq '7') and (monthisset ne '7')}">
+          <c:if test="${(!empty monthisset)}"> - </c:if>
+          <mm:link referids="mo...@m,y...@y">
+            <a href="${_}"><mm:time format="MMMM" inputformat="M" 
time="$month" /></a>
+          </mm:link>
+          <c:set var="monthisset">7</c:set> 
+        </c:when>
+        <c:when test="${(month eq '8') and (monthisset ne '8')}">
+          <c:if test="${(!empty monthisset)}"> - </c:if>
+          <mm:link referids="mo...@m,y...@y">
+            <a href="${_}"><mm:time format="MMMM" inputformat="M" 
time="$month" /></a>
+          </mm:link>
+          <c:set var="monthisset">8</c:set> 
+        </c:when>
+        <c:when test="${(month eq '9') and (monthisset ne '9')}">
+          <c:if test="${(!empty monthisset)}"> - </c:if>
+          <mm:link referids="mo...@m,y...@y">
+            <a href="${_}"><mm:time format="MMMM" inputformat="M" 
time="$month" /></a>
+          </mm:link>
+          <c:set var="monthisset">9</c:set> 
+        </c:when>
+        <c:when test="${(month eq '10') and (monthisset ne '10')}">
+          <c:if test="${(!empty monthisset)}"> - </c:if>
+          <mm:link referids="mo...@m,y...@y">
+            <a href="${_}"><mm:time format="MMMM" inputformat="M" 
time="$month" /></a>
+          </mm:link>
+          <c:set var="monthisset">10</c:set> 
+        </c:when>
+        <c:when test="${(month eq '11') and (monthisset ne '11')}">
+          <c:if test="${(!empty monthisset)}"> - </c:if>
+          <mm:link referids="mo...@m,y...@y">
+            <a href="${_}"><mm:time format="MMMM" inputformat="M" 
time="$month" /></a>
+          </mm:link>
+          <c:set var="monthisset">11</c:set> 
+        </c:when>
+        <c:when test="${(month eq '12') and (monthisset ne '12')}">
+          <c:if test="${(!empty monthisset)}"> - </c:if>
+          <mm:link referids="mo...@m,y...@y">
+            <a href="${_}"><mm:time format="MMMM" inputformat="M" 
time="$month" /></a>
+          </mm:link>
+          <c:set var="monthisset">12</c:set> 
+        </c:when>
+      </c:choose>
+
+    </mm:listnodes>
+  </p>
+</mm:listnodescontainer>  
+  </div><!-- /#sidebar -->
 </div><!-- /#wrap -->
 
 </body>

_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to