pvollenweider    2005/09/01 17:56:31 CEST

  Modified files:
    src/jsp/box          box.jsp news.inc 
    src/jsp/css          screen.css 
  Log:
  Add news
  
  Revision  Changes    Path
  1.3       +3 -1      corporate_portal_templates_v2/src/jsp/box/box.jsp
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/corporate_portal_templates_v2/src/jsp/box/box.jsp.diff?r1=1.2&r2=1.3&f=h
  1.3       +44 -47    corporate_portal_templates_v2/src/jsp/box/news.inc
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/corporate_portal_templates_v2/src/jsp/box/news.inc.diff?r1=1.2&r2=1.3&f=h
  1.7       +46 -16    corporate_portal_templates_v2/src/jsp/css/screen.css
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/corporate_portal_templates_v2/src/jsp/css/screen.css.diff?r1=1.6&r2=1.7&f=h
  
  
  
  Index: box.jsp
  ===================================================================
  RCS file: 
/home/cvs/repository/corporate_portal_templates_v2/src/jsp/box/box.jsp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- box.jsp   1 Sep 2005 13:55:48 -0000       1.2
  +++ box.jsp   1 Sep 2005 15:56:31 -0000       1.3
  @@ -16,6 +16,8 @@
               <bean:define id="layoutValue"   name="boxContainer" 
property='field(layout).value'/>
               <%
               String layout = (String) 
pageContext.findAttribute("layoutValue");
  +            JahiaContainer boxContainer = ((ContainerBean) 
pageContext.findAttribute("boxContainer")).getJahiaContainer();
  +
               %>
               <div class='<%=getCss(layout,resBundleID)%>'>
                   <h2>
  @@ -36,7 +38,7 @@
                               <%//@ include file="webapps.inc"%>
                           </c:when>
                           <c:when test="${boxTypeValue == news}">
  -                            <%//@ include file="news.inc"%>
  +                            <%@ include file="news.inc"%>
                           </c:when>
                           <c:otherwise>
                               <%@ include file="texts.inc"%>
  
  
  
  Index: news.inc
  ===================================================================
  RCS file: 
/home/cvs/repository/corporate_portal_templates_v2/src/jsp/box/news.inc,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- news.inc  1 Sep 2005 13:55:48 -0000       1.2
  +++ news.inc  1 Sep 2005 15:56:31 -0000       1.3
  @@ -1,85 +1,82 @@
  -this is news box
   <%
  -JahiaContainerList newsContainerList = theContainer.getContainerList( 
"newsContainer" + id);
  +JahiaContainerList newsContainerList = boxContainer.getContainerList( "news" 
+ id);
   Enumeration newsEnumeration = newsContainerList.getContainers();
   long cacheExpirationDelay = Long.MAX_VALUE;
   int newsCount = 0;
   while (newsEnumeration.hasMoreElements()) {
       JahiaContainer newsContainer = 
(JahiaContainer)newsEnumeration.nextElement();
   
  -    String newsTitle = newsContainer.getFieldValue("newsTitle" , "", true , 
jData.params());
  -    String newsDesc = newsContainer.getFieldValue("newsDesc" , "", true , 
jData.params());
  -    JahiaPage myNewsLink = (JahiaPage) 
newsContainer.getFieldObject("newsLink" );
  -    String newsDate = (String) newsContainer.getFieldValue("newsStartDate" 
,"");
  -    String newsStartDateStr = (String) 
newsContainer.getFieldObject("newsStartDate" );
  -    String newsEndDateStr = (String) 
newsContainer.getFieldObject("newsEndDate" );
  -    long newsStartDate = -1;
  -    long newsEndDate = -1;
  +    String title = newsContainer.getFieldValue("title" , "", true , 
jData.params());
  +    String description = newsContainer.getFieldValue("description" , "", 
true , jData.params());
  +    JahiaPage link = (JahiaPage) newsContainer.getFieldObject("link" );
  +    String dateStr = (String) newsContainer.getFieldObject("date");
  +    String dateVal = (String) newsContainer.getFieldValue("date" ,"");
  +    long date = -1;
       try {
  -        newsStartDate = Long.parseLong(newsStartDateStr);
  -    } catch (NumberFormatException nfe) {
  -        //System.out.println("box_new.jsp> " + nfe);
  -    }
  -    try {
  -        newsEndDate = Long.parseLong(newsEndDateStr);
  +        date = Long.parseLong(dateStr);
       } catch (NumberFormatException nfe) {
           //System.out.println("box_new.jsp> " + nfe);
       }
       long now = (new Date()).getTime();
   
       // set cacheExpirationDelay
  -    long tmpCacheExpirationDelay1 = newsStartDate - now;
  -    long tmpCacheExpirationDelay2 = newsEndDate - now;
  +    long tmpCacheExpirationDelay1 = date - now;
       if (tmpCacheExpirationDelay1 > 0) {
           cacheExpirationDelay = Math.min(tmpCacheExpirationDelay1, 
cacheExpirationDelay);
       }
  -    if (tmpCacheExpirationDelay2 > 0) {
  -        cacheExpirationDelay = Math.min(tmpCacheExpirationDelay2, 
cacheExpirationDelay);
  -    }
       if ((cacheExpirationDelay > 0) && (cacheExpirationDelay < 
Long.MAX_VALUE)) {
           jParams.setCacheExpirationDelay(cacheExpirationDelay);
  +        logger.debug("Set cacheExpirationDelay to " + cacheExpirationDelay + 
"[ms]");
       }
   
  +    // should use filters
       boolean displayNew = false;
       if (! jData.gui().isEditMode()){
  -        if (! "".equals(newsTitle)){
  -            if (newsStartDate == -1){
  -                if (newsEndDate == -1){
  -                    displayNew = true;
  -                } else if (now <= newsEndDate) {
  -                    displayNew = true;
  -                }
  -            } else if (newsStartDate <= now){
  -                if (newsEndDate == -1){
  -                    displayNew = true;
  -                } else if (now <= newsEndDate) {
  -                    displayNew = true;
  -                }
  +        if (! "".equals(title)){
  +            if (date <= now){
  +                displayNew = true;
               }
           }
       } else {
           displayNew = true;
       }
       ContainerBean newsContainerBean = new 
ContainerBean(newsContainer,jData.params());
  -    jData.gui().html().drawBeginActionMenu(newsContainerBean , null, null, 
true, "", "jahiatemplates.Corporate_portal_templates", null, out);
  +    jData.gui().html().drawBeginActionMenu(newsContainerBean , null, null, 
true,
  +        ".new", "jahiatemplates.Corporate_portal_templates", null, out);
       if (displayNew){
           newsCount++;
  -        %><span class="bold"><%=newsTitle%></span><br><%
  -        if (! "".equals(newsDate)){
  -            %><i><%=newsDate%></i><br/><%
  -        }
  -        %><%=newsDesc%><br/><%
  -        if (myNewsLink != null){
  -            %><a 
href="<%=myNewsLink.getUrl(jData.params())%>"><%=myNewsLink.getTitle()%></a><br><%
  -        }
  -        %><br/><br/><%
  +        %><div class="new">
  +            <div class="title">
  +                <%
  +                if (link != null){
  +                    %><a href="<%=link.getUrl(jData.params())%>"
  +                        title="<%=link.getTitle()%>"><%
  +                }
  +                %><%=title%><%
  +                if (link != null){
  +                    %></a><%
  +                }
  +                %>
  +            </div>
  +            <div class="description">
  +                <%=description%>
  +            </div>
  +            <%
  +            if (! "".equals(dateStr)){
  +                %><div class="date"><%=dateVal%></div><%
  +            }
  +        %></div><%
       }
  -    jData.gui().html().drawEndActionMenu(newsContainerBean , null, null, 
true, "", "jahiatemplates.Corporate_portal_templates", null, out);
  +    jData.gui().html().drawEndActionMenu(newsContainerBean , null, null, 
true,
  +        ".new", "jahiatemplates.Corporate_portal_templates", null, out);
   }
   if (newsCount == 0){
  -    %><jahia:resourceBundle 
resourceBundle="jahiatemplates.Corporate_portal_templates" 
resourceName="noNews"/><br/><%
  +    %><jahia:resourceBundle 
resourceBundle="jahiatemplates.Corporate_portal_templates"
  +        resourceName="noNews"/><br/><%
   }
   
   ContainerListBean newsContainerListBean = new 
ContainerListBean(newsContainerList,jData.params());
  -jData.gui().html().drawBeginActionMenu(newsContainerListBean , null, theURL 
+ "/images/add.gif", false, "", "jahiatemplates.Corporate_portal_templates", 
"addNew", out);
  +jData.gui().html().drawBeginActionMenu(newsContainerListBean , null,
  +    contextURL + "/img/actions/add.gif", false, ".news",
  +    "jahiatemplates.Corporate_portal_templates", "add.news", out);
   %>
  
  
  
  Index: screen.css
  ===================================================================
  RCS file: 
/home/cvs/repository/corporate_portal_templates_v2/src/jsp/css/screen.css,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- screen.css        1 Sep 2005 13:55:48 -0000       1.6
  +++ screen.css        1 Sep 2005 15:56:31 -0000       1.7
  @@ -204,7 +204,10 @@
       margin: 2px 2px 2px 0;
       text-width: bold;
   }
  -#nav .box {
  +#nav .box,
  +#nav .layout1,
  +#nav .layout2,
  +#nav .layout3 {
        display: block;
        float: left;
        clear:both;
  @@ -216,7 +219,34 @@
       width: 175px;
       display: block;
   }
  +.layout1 h2 {
   
  +}
  +.layout2 h2 {
  +
  +}
  +.layout3 h2 {
  +
  +}
  +.layout1 .content,
  +.layout2 .content,
  +.layout3 .content {
  +    padding: 0 3px 5px 0;
  +}
  +.new {
  +    padding: 5px 0px 5px 0;
  +    display: block;
  +}
  +.new .title,
  +.new .title a {
  +    color: #548a94;
  +    font-size:11px;
  +    font-weight: bold;
  +}
  +.new .date {
  +    font-site:9px;
  +    color: #d2d2d2;
  +}
   /* ------------------------------------------------ */
   /*                  navigation                      */
   /* ------------------------------------------------ */
  @@ -370,67 +400,67 @@
       display: block;
       padding-bottom: 2px;
   }
  -table.files a.file {
  +a.file {
       background: url(../img/files/file.gif) no-repeat;
       padding-left: 20px !important;
   }
  -table.files a.video {
  +a.video {
       background: url(../img/files/video.gif) no-repeat;
       padding-left: 20px !important;
   }
  -table.files a.ppt {
  +a.ppt {
       background: url(../img/files/ppt.gif) no-repeat;
       padding-left: 20px !important;
   }
  -table.files a.exe {
  +a.exe {
       background: url(../img/files/exe.gif) no-repeat;
       padding-left: 20px !important;
   }
  -table.files a.doc {
  +a.doc {
       background: url(../img/files/doc.gif) no-repeat;
       padding-left: 20px !important;
   }
  -table.files a.doc {
  +a.doc {
       background: url(../img/files/doc.gif) no-repeat;
       padding-left: 20px !important;
   }
   
  -table.files a.exe {
  +a.exe {
       background: url(../img/files/exe.gif) no-repeat;
       padding-left: 20px !important;
   }
   
  -table.files a.html {
  +a.html {
       background: url(../img/files/html.gif) no-repeat;
       padding-left: 20px !important;
   }
   
  -table.files a.img {
  +a.img {
       background: url(../img/files/img.gif) no-repeat;
       padding-left: 20px !important;
   }
   
  -table.files a.pdf {
  +a.pdf {
       background: url(../img/files/pdf.gif) no-repeat;
       padding-left: 20px !important;
   }
   
  -table.files a.sound {
  +a.sound {
       background: url(../img/files/sound.gif) no-repeat;
       padding-left: 20px !important;
   }
   
  -table.files a.txt {
  +a.txt {
       background: url(../img/files/txt.gif) no-repeat;
       padding-left: 20px !important;
   }
   
  -table.files a.xls {
  +a.xls {
       background: url(../img/files/xls.gif) no-repeat;
       padding-left: 20px !important;
   }
   
  -table.files a.zip {
  +a.zip {
       background: url(../img/files/zip.gif) no-repeat;
       padding-left: 20px !important;
  -}
  \ No newline at end of file
  +}
  

Reply via email to