pvollenweider    2005/04/13 14:53:13 CEST

  Modified files:        (Branch: JAHIA-4-1-BRANCH)
    src/view/jsp         blog_listing.jsp 
  Log:
  Display message if no entries found.
  
  Revision  Changes    Path
  1.1.2.15  +58 -0     corporate_portal_templates/src/view/jsp/blog_listing.jsp
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/corporate_portal_templates/src/view/jsp/blog_listing.jsp.diff?r1=1.1.2.14&r2=1.1.2.15&f=h
  
  
  
  Index: blog_listing.jsp
  ===================================================================
  RCS file: 
/home/cvs/repository/corporate_portal_templates/src/view/jsp/Attic/blog_listing.jsp,v
  retrieving revision 1.1.2.14
  retrieving revision 1.1.2.15
  diff -u -r1.1.2.14 -r1.1.2.15
  --- blog_listing.jsp  13 Apr 2005 12:49:45 -0000      1.1.2.14
  +++ blog_listing.jsp  13 Apr 2005 12:53:13 -0000      1.1.2.15
  @@ -124,7 +124,9 @@
                   String ddMMyyyySaved = "";
                   String cacheStatus = jParams.getCacheStatus();
                   jParams.setCacheStatus(ParamBean.CACHE_OFFONCE);
  +                int entriesCounter = 0;
                   while (entriesEnum.hasMoreElements()) {
  +                    entriesCounter++;
                       JahiaContainer entry = (JahiaContainer) 
entriesEnum.nextElement();
                       ContainerBean entryBean = new 
ContainerBean(entry,jParams);
                       int blogPageId = entryBean.getPageID();
  @@ -204,6 +206,62 @@
                       </dd>
                       <%
                   }
  +
  +                if (entriesCounter == 0) {
  +                    %>
  +                    <br/>Could not found any entry
  +                    <%
  +                    if (requestedCategory != null) {
  +                        Category curCategory = 
Category.getCategory(requestedCategory);
  +                        String categoryTitle = requestedCategory;
  +                        if (curCategory != null) {
  +                            categoryTitle = 
curCategory.getTitle(jParams.getLocale());
  +                            if (categoryTitle == null) {
  +                                categoryTitle = requestedCategory;
  +                            }
  +                        }
  +                        %> for category <a 
href="<%=bypassUrl%>?category=<%=requestedCategory%>"><%=categoryTitle%></a> <%
  +                    } else {
  +                        Calendar cal = Calendar.getInstance();
  +                        cal.setTimeZone(TimeZone.getTimeZone("UTC"));
  +                        cal.setTime(new Date(t));
  +
  +                        cal.set( Calendar.HOUR_OF_DAY, 0 );
  +                        cal.set( Calendar.MINUTE, 0);
  +
  +                        if ("week".equals(range)){
  +                            cal.set( Calendar.DAY_OF_WEEK, Calendar.MONDAY);
  +                        }
  +                        if ("month".equals(range)){
  +                            cal.set( Calendar.DAY_OF_MONTH, 1);
  +                        }
  +                        if ("year".equals(range)){
  +                            cal.set( Calendar.DAY_OF_YEAR, 1);
  +                        }
  +                        Date lowerVal = cal.getTime();
  +                        if ("week".equals(range)){
  +                            cal.add( Calendar.HOUR_OF_DAY, 24*6 );
  +                        }
  +                        if ("month".equals(range)){
  +                            cal.add( Calendar.MONTH, 1 );
  +                        }
  +                        if ("year".equals(range)){
  +                            cal.add( Calendar.YEAR, 1 );
  +                        }
  +                        Date upperVal = cal.getTime();
  +                        sdf.applyPattern("d MMMM yyyy");
  +                        %>
  +                        from <%=sdf.format( (new Date(lowerVal.getTime())) 
)%> to
  +                        <%=sdf.format( (new Date(upperVal.getTime())) ) %>
  +                        <%
  +                    }
  +                    %>
  +                    <br/>
  +                    <br/>[<a href="<%=bypassUrl%>">back to 
<%=jData.page().getTitle()%></a>]
  +
  +                    <%
  +                }
  +
                   jParams.setCacheStatus(cacheStatus);
                   %>
               </dl>
  

Reply via email to