svn commit: r627239 - in /ofbiz/trunk: applications/workeffort/webapp/workeffort/calendar/ applications/workeffort/widget/ framework/images/webapp/images/ specialpurpose/assetmaint/widget/

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r627239 - in /ofbiz/trunk: applications/workeffort/webapp/workeffort/calendar/ applications/workeffort/widget/ framework/images/webapp/images/ specialpurpose/assetmaint/widget/

adrianc
Author: adrianc
Date: Tue Feb 12 19:53:17 2008
New Revision: 627239

URL: http://svn.apache.org/viewvc?rev=627239&view=rev
Log:
Eliminated the need for a separate stylesheet for component calendars. Improved calendar styling.

Modified:
    ofbiz/trunk/applications/workeffort/webapp/workeffort/calendar/day.ftl
    ofbiz/trunk/applications/workeffort/webapp/workeffort/calendar/month.ftl
    ofbiz/trunk/applications/workeffort/webapp/workeffort/calendar/week.ftl
    ofbiz/trunk/applications/workeffort/widget/CommonScreens.xml
    ofbiz/trunk/framework/images/webapp/images/maincss.css
    ofbiz/trunk/specialpurpose/assetmaint/widget/FixedAssetScreens.xml

Modified: ofbiz/trunk/applications/workeffort/webapp/workeffort/calendar/day.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/webapp/workeffort/calendar/day.ftl?rev=627239&r1=627238&r2=627239&view=diff
==============================================================================
--- ofbiz/trunk/applications/workeffort/webapp/workeffort/calendar/day.ftl (original)
+++ ofbiz/trunk/applications/workeffort/webapp/workeffort/calendar/day.ftl Tue Feb 12 19:53:17 2008
@@ -27,28 +27,27 @@
     <br class="clear"/>
   </div>
 <#if periods?has_content>
-
-<#if (maxConcurrentEntries = 0)>
-  <#assign entryWidth = 100>
-<#elseif (maxConcurrentEntries < 2)>
-  <#assign entryWidth = (100 / (maxConcurrentEntries + 1))>
-<#else>
-  <#assign entryWidth = (100 / (maxConcurrentEntries))>
-</#if>
-<table width="100%" cellspacing="1" border="0" cellpadding="1" class="calendar">              
-  <tr>            
-    <td nowrap class="monthdayheader">${uiLabelMap.CommonTime}<br/>
-      <img src="<@ofbizContentUrl>/images/spacer.gif</@ofbizContentUrl>" alt="" height="1" width="88"></td>
-    <td colspan=${maxConcurrentEntries} class="monthdayheader">${uiLabelMap.WorkEffortCalendarEntries}<br/>
-      <img src="<@ofbizContentUrl>/images/spacer.gif</@ofbizContentUrl>" alt="" height="1" width="88"></td>
+  <#if (maxConcurrentEntries < 2)>
+    <#assign entryWidth = 100>
+  <#else>
+    <#assign entryWidth = (100 / (maxConcurrentEntries))>
+  </#if>
+<table cellspacing="0" class="basic-table calendar">              
+  <tr class="header-row">            
+    <td>${uiLabelMap.CommonTime}</td>
+    <td colspan=${maxConcurrentEntries}>${uiLabelMap.WorkEffortCalendarEntries}</td>
   </tr>
   <#list periods as period>              
-  <tr>                  
-    <td valign="top" nowrap width="1%" class="monthweekheader" height="36"><span class="monthweeknumber">${period.start?time?string.short}</span><br/>
-      <a href="<@ofbizUrl>EditWorkEffort?workEffortTypeId=EVENT&currentStatusId=CAL_TENTATIVE&estimatedStartDate=${period.start?string("yyyy-MM-dd HH:mm:ss")}&estimatedCompletionDate=${period.end?string("yyyy-MM-dd HH:mm:ss")}${addlParam?if_exists}</@ofbizUrl>">${uiLabelMap.CommonAddNew}</a></td>
+    <#assign currentPeriod = false/>
+    <#if (nowTimestamp >= period.start) && (nowTimestamp <= period.end)><#assign currentPeriod = true/></#if>
+  <tr<#if currentPeriod> class="current-period"<#else><#if (period.calendarEntries?size > 0)> class="active-period"</#if></#if>>
+    <td class="label">
+      ${period.start?time?string.short}<br/>
+      <a href="<@ofbizUrl>EditWorkEffort?workEffortTypeId=EVENT&currentStatusId=CAL_TENTATIVE&estimatedStartDate=${period.start?string("yyyy-MM-dd HH:mm:ss")}&estimatedCompletionDate=${period.end?string("yyyy-MM-dd HH:mm:ss")}${addlParam?if_exists}</@ofbizUrl>">${uiLabelMap.CommonAddNew}</a>
+    </td>
     <#list period.calendarEntries as calEntry>
     <#if calEntry.startOfPeriod>
-    <td class="calendarentry" rowspan="${calEntry.periodSpan}" colspan="1" width="${entryWidth?string("#")}%" valign="top">
+    <td<#if (calEntry.periodSpan > 1)> rowspan="${calEntry.periodSpan}"</#if> width="${entryWidth?string("#")}%">
     <#if (calEntry.workEffort.estimatedStartDate.compareTo(start)  <= 0 && calEntry.workEffort.estimatedCompletionDate.compareTo(next) >= 0)>
       ${uiLabelMap.CommonAllDay}
     <#elseif calEntry.workEffort.estimatedStartDate.before(start)>
@@ -58,17 +57,15 @@
     <#else>
       ${calEntry.workEffort.estimatedStartDate?time?string.short}-${calEntry.workEffort.estimatedCompletionDate?time?string.short}
     </#if>
-    <br/><a href="<@ofbizUrl>WorkEffortSummary?workEffortId=${calEntry.workEffort.workEffortId}${addlParam?if_exists}</@ofbizUrl>" class="event">${calEntry.workEffort.workEffortName?default("Undefined")}${addlParam?if_exists}</a>&nbsp;</td>
+    <br/><a href="<@ofbizUrl>WorkEffortSummary?workEffortId=${calEntry.workEffort.workEffortId}${addlParam?if_exists}</@ofbizUrl>">${calEntry.workEffort.workEffortName?default("Undefined")}${addlParam?if_exists}</a>&nbsp;</td>
     </#if>
     </#list>
-    <#if period.calendarEntries?size < maxConcurrentEntries>
-    <#assign emptySlots = (maxConcurrentEntries - period.calendarEntries?size)>
-    <#list 1..emptySlots as num>
-      <td width="${entryWidth?string("#")}%"  class="calendarempty"><br/></td>
-    </#list>
+    <#if (period.calendarEntries?size < maxConcurrentEntries)>
+      <#assign emptySlots = (maxConcurrentEntries - period.calendarEntries?size)>
+        <td<#if (emptySlots > 1)> colspan="${emptySlots}"</#if>>&nbsp;</td>
     </#if>
-    <#if maxConcurrentEntries < 2>
-    <td width="${entryWidth?string("#")}" class="calendarempty">&nbsp;</td>
+    <#if maxConcurrentEntries = 0>
+      <td width="${entryWidth?string("#")}%">&nbsp;</td>
     </#if>
   </tr>
   </#list>                  

Modified: ofbiz/trunk/applications/workeffort/webapp/workeffort/calendar/month.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/webapp/workeffort/calendar/month.ftl?rev=627239&r1=627238&r2=627239&view=diff
==============================================================================
--- ofbiz/trunk/applications/workeffort/webapp/workeffort/calendar/month.ftl (original)
+++ ofbiz/trunk/applications/workeffort/webapp/workeffort/calendar/month.ftl Tue Feb 12 19:53:17 2008
@@ -18,12 +18,18 @@
 -->
 
 <style type="text/css">
-.monthdayheader {
-text-align: center;
+.calendar tr td {
+height: 8em;
+width: 10em;
+vertical-align: top;
+padding: 0.5em;
+}
+.calendar .header-row td {
+height: auto;
 }
 </style>
 
-  <div class="screenlet-title-bar">
+  <div class="screenlet-title-bar h3">
     <ul>
       <li class="h3">${start?date?string("MMMM yyyy")?cap_first}</li>
       <li><a href='<@ofbizUrl>month?start=${next.time?string("#")}<#if eventsParam?has_content>&${eventsParam}</#if>${addlParam?if_exists}</@ofbizUrl>'>${uiLabelMap.WorkEffortNextMonth}</a></li>
@@ -33,22 +39,46 @@
     <br class="clear"/>
   </div>
 <#if periods?has_content>
-<table width="100%" cellspacing="1" border="0" cellpadding="1" class="calendar">
-  <tr class="bg">
-    <td width="1%" class="monthdayheader">&nbsp;<br/>
-      <img src="<@ofbizContentUrl>/images/spacer.gif</@ofbizContentUrl>" alt="" height="1" width="88"></td>
+<table cellspacing="0" class="basic-table calendar">              
+  <tr class="header-row">            
+    <td width="1%">&nbsp;</td>
     <#list periods as day>
-    <td width="14%" class="monthdayheader">${day.start?date?string("EEEE")?cap_first}<br/>
-      <img src="<@ofbizContentUrl>/images/spacer.gif</@ofbizContentUrl>" alt="" height="1" width="1"></td>
-    <#if (day_index > 5)><#break></#if>
+      <td>${day.start?date?string("EEEE")?cap_first}</td>
+      <#if (day_index > 5)><#break></#if>
     </#list>
   </tr>
   <#list periods as period>
-  <#assign indexMod7 = period_index % 7>
-  <#if indexMod7 = 0>
-  <tr class="bg">
-    <td valign="top" height="60" nowrap class="monthweekheader"><a href='<@ofbizUrl>week?start=${period.start.time?string("#")}<#if eventsParam?has_content>&${eventsParam}</#if>${addlParam?if_exists}</@ofbizUrl>' class="monthweeknumber">${uiLabelMap.CommonWeek} ${period.start?date?string("w")}</a></td>
-  </#if>
+    <#assign currentPeriod = false/>
+    <#if (nowTimestamp >= period.start) && (nowTimestamp <= period.end)><#assign currentPeriod = true/></#if>
+    <#assign indexMod7 = period_index % 7>
+    <#if indexMod7 = 0>
+      <tr>
+        <td class="label">
+          <a href='<@ofbizUrl>week?start=${period.start.time?string("#")}<#if eventsParam?has_content>&${eventsParam}</#if>${addlParam?if_exists}</@ofbizUrl>'>${uiLabelMap.CommonWeek} ${period.start?date?string("w")}</a>
+        </td>
+    </#if>
+    <td<#if currentPeriod> class="current-period"<#else><#if (period.calendarEntries?size > 0)> class="active-period"</#if></#if>>
+      <span class="h1"><a href='<@ofbizUrl>day?start=${period.start.time?string("#")}<#if eventsParam?has_content>&${eventsParam}</#if>${addlParam?if_exists}</@ofbizUrl>'>${period.start?date?string("d")?cap_first}</a></span>
+      <a class="add-new" href='<@ofbizUrl>EditWorkEffort?workEffortTypeId=EVENT&currentStatusId=CAL_TENTATIVE&estimatedStartDate=${period.start?string("yyyy-MM-dd HH:mm:ss")}&estimatedCompletionDate=${period.end?string("yyyy-MM-dd HH:mm:ss")}${addlParam?if_exists}</@ofbizUrl>'>${uiLabelMap.CommonAddNew}</a>
+      <br class="clear"/>
+      <#list period.calendarEntries as calEntry>
+        <hr/>
+        <#if (calEntry.workEffort.estimatedStartDate.compareTo(period.start)  <= 0 && calEntry.workEffort.estimatedCompletionDate.compareTo(period.end) >= 0)>
+          ${uiLabelMap.CommonAllDay}
+        <#elseif calEntry.workEffort.estimatedStartDate.before(period.start)>
+          ${uiLabelMap.CommonUntil} ${calEntry.workEffort.estimatedCompletionDate?time?string.short}
+        <#elseif calEntry.workEffort.estimatedCompletionDate.after(period.end)>
+          ${uiLabelMap.CommonFrom} ${calEntry.workEffort.estimatedStartDate?time?string.short}
+        <#else>
+          ${calEntry.workEffort.estimatedStartDate?time?string.short}-${calEntry.workEffort.estimatedCompletionDate?time?string.short}
+        </#if>
+        <br/>
+        <a href="<@ofbizUrl>WorkEffortSummary?workEffortId=${calEntry.workEffort.workEffortId}${addlParam?if_exists}</@ofbizUrl>" class="event">${calEntry.workEffort.workEffortName?default("Undefined")}</a>&nbsp;${calEntry.eventStatus?default("&nbsp;")}
+        <br/>
+      </#list>
+    </td>
+  
+<#--  
     <td valign="top">
       <table width="100%" cellspacing="0" cellpadding="0" border="0">
         <tr>
@@ -76,6 +106,7 @@
       </table>
       </#list>
     </td>
+-->
     <#if !period_has_next && indexMod7 != 6>
     <td colspan='${6 - (indexMod7)}'>&nbsp;</td>
     </#if>

Modified: ofbiz/trunk/applications/workeffort/webapp/workeffort/calendar/week.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/webapp/workeffort/calendar/week.ftl?rev=627239&r1=627238&r2=627239&view=diff
==============================================================================
--- ofbiz/trunk/applications/workeffort/webapp/workeffort/calendar/week.ftl (original)
+++ ofbiz/trunk/applications/workeffort/webapp/workeffort/calendar/week.ftl Tue Feb 12 19:53:17 2008
@@ -17,7 +17,7 @@
 under the License.
 -->
 
-  <div class="screenlet-title-bar">
+  <div class="screenlet-title-bar h3">
     <ul>
       <li class="h3">${uiLabelMap.CommonWeek} ${start?date?string("w")}</li>
       <li><a href="<@ofbizUrl>week?start=${next.time?string("#")}<#if eventsParam?has_content>&${eventsParam}</#if>${addlParam?if_exists}</@ofbizUrl>">${uiLabelMap.WorkEffortNextWeek}</a></li>
@@ -27,28 +27,27 @@
     <br class="clear"/>
   </div>
 <#if periods?has_content>
-<#if maxConcurrentEntries = 0>
-  <#assign entryWidth = 100>
-<#elseif maxConcurrentEntries < 2>
-  <#assign entryWidth = (100 / (maxConcurrentEntries + 1))>
-<#else>
-  <#assign entryWidth = (100 / (maxConcurrentEntries))>
-</#if>
-<table width="100%" cellspacing="1" border="0" cellpadding="1" class="calendar">      
-  <tr>
-    <td nowrap class="monthdayheader">${uiLabelMap.CommonTime}<br/>
-      <img src="<@ofbizContentUrl>/images/spacer.gif</@ofbizContentUrl>" alt="" height="1" width="88"></td>
-    <td colspan=${maxConcurrentEntries} class="monthdayheader">${uiLabelMap.WorkEffortCalendarEntries}<br/>
-      <img src="<@ofbizContentUrl>/images/spacer.gif</@ofbizContentUrl>" alt="" height="1" width="88"></td>
+  <#if (maxConcurrentEntries < 2)>
+    <#assign entryWidth = 100>
+  <#else>
+    <#assign entryWidth = (100 / (maxConcurrentEntries))>
+  </#if>
+<table cellspacing="0" class="basic-table calendar">              
+  <tr class="header-row">            
+    <td>${uiLabelMap.CommonTime}</td>
+    <td colspan=${maxConcurrentEntries}>${uiLabelMap.WorkEffortCalendarEntries}</td>
   </tr>
   <#list periods as period>
-  <tr>
-    <td valign="top" nowrap width="1%" class="monthweekheader" height="36"><a href="<@ofbizUrl>day?start=${period.start.time?string("#")}<#if eventsParam?has_content>&${eventsParam}</#if>${addlParam?if_exists}</@ofbizUrl>" class="monthweeknumber">${period.start?date?string("EEEE")?cap_first} ${period.start?date?string.short}</a><br/>
+    <#assign currentPeriod = false/>
+    <#if (nowTimestamp >= period.start) && (nowTimestamp <= period.end)><#assign currentPeriod = true/></#if>
+  <tr<#if currentPeriod> class="current-period"<#else><#if (period.calendarEntries?size > 0)> class="active-period"</#if></#if>>
+    <td class="centered" width="1%">
+      <a href="<@ofbizUrl>day?start=${period.start.time?string("#")}<#if eventsParam?has_content>&${eventsParam}</#if>${addlParam?if_exists}</@ofbizUrl>">${period.start?date?string("EEEE")?cap_first}&nbsp;${period.start?date?string.short}</a><br/>
       <a href="<@ofbizUrl>EditWorkEffort?workEffortTypeId=EVENT&currentStatusId=CAL_TENTATIVE&estimatedStartDate=${period.start?string("yyyy-MM-dd HH:mm:ss")}&estimatedCompletionDate=${period.end?string("yyyy-MM-dd HH:mm:ss")}${addlParam?if_exists}</@ofbizUrl>">${uiLabelMap.CommonAddNew}</a>
     </td>
     <#list period.calendarEntries as calEntry>
     <#if calEntry.startOfPeriod>
-    <td class="calendarentry" rowspan="${calEntry.periodSpan}" colspan="1" width="${entryWidth?string("#")}%" valign="top">
+    <td<#if (calEntry.periodSpan > 1)> rowspan="${calEntry.periodSpan}"</#if> width="${entryWidth?string("#")}%">
     <#if (calEntry.workEffort.estimatedStartDate.compareTo(start)  <= 0 && calEntry.workEffort.estimatedCompletionDate.compareTo(next) >= 0)>
       ${uiLabelMap.CommonAllWeek}
     <#elseif (calEntry.workEffort.estimatedStartDate.compareTo(period.start)  = 0 && calEntry.workEffort.estimatedCompletionDate.compareTo(period.end) = 0)>
@@ -63,14 +62,12 @@
       <br/><a href="<@ofbizUrl>WorkEffortSummary?workEffortId=${calEntry.workEffort.workEffortId}${addlParam?if_exists}</@ofbizUrl>" class="event">${calEntry.workEffort.workEffortName?default("Undefined")}</a>&nbsp;</td>
     </#if>
     </#list>
-    <#if period.calendarEntries?size < maxConcurrentEntries>
-    <#assign emptySlots = (maxConcurrentEntries - period.calendarEntries?size)>
-    <#list 1..emptySlots as num>
-      <td width="${entryWidth?string("#")}%"  class="calendarempty"><br/></td>
-    </#list>
+    <#if (period.calendarEntries?size < maxConcurrentEntries)>
+      <#assign emptySlots = (maxConcurrentEntries - period.calendarEntries?size)>
+        <td<#if (emptySlots > 1)> colspan="${emptySlots}"</#if>>&nbsp;</td>
     </#if>
-    <#if maxConcurrentEntries < 2>
-    <td width="${entryWidth?string("#")}" class="calendarempty">&nbsp;</td>
+    <#if maxConcurrentEntries = 0>
+      <td width="${entryWidth?string("#")}%">&nbsp;</td>
     </#if>
   </tr>
   </#list>

Modified: ofbiz/trunk/applications/workeffort/widget/CommonScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/widget/CommonScreens.xml?rev=627239&r1=627238&r2=627239&view=diff
==============================================================================
--- ofbiz/trunk/applications/workeffort/widget/CommonScreens.xml (original)
+++ ofbiz/trunk/applications/workeffort/widget/CommonScreens.xml Tue Feb 12 19:53:17 2008
@@ -36,9 +36,6 @@
                 <!-- layoutSettings.headerImageUrl can be used to specify an application specific logo; if not set,
                      then the global layoutSettings.commonHeaderImageUrl (specified in GlobalDecorator) will be used. -->
                 <!--<set field="layoutSettings.headerImageUrl" value="/images/ofbiz_logo.jpg" global="true"/>-->
-                <!-- The WorkEffort component's screens need the calendarstyles.css stylesheet to render the calendar pages:
-                     it is added to the list of default stylesheet (layoutSettings.styleSheets) defined in the GlobalDecorator -->
-                <set field="layoutSettings.styleSheets[]" value="/images/calendarstyles.css" global="true"/>
                 <!-- <set field="layoutSettings.headerMiddleBackgroundUrl" value="" global="true"/> -->
                 <!-- <set field="layoutSettings.headerRightBackgroundUrl" value="" global="true"/> -->
                 <set field="activeApp" value="workeffort" global="true"/>
@@ -180,4 +177,4 @@
             </widgets>
         </section>
     </screen>
-</screens>
\ No newline at end of file
+</screens>

Modified: ofbiz/trunk/framework/images/webapp/images/maincss.css
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/maincss.css?rev=627239&r1=627238&r2=627239&view=diff
==============================================================================
--- ofbiz/trunk/framework/images/webapp/images/maincss.css (original)
+++ ofbiz/trunk/framework/images/webapp/images/maincss.css Tue Feb 12 19:53:17 2008
@@ -1669,14 +1669,11 @@
 
 .calendar {
 border-right: 0.1em solid #cccccc;
-border-top: 0.1em solid #cccccc;
 }
 
 .calendar tr td {
 border-bottom: 0.1em solid #cccccc;
 border-left: 0.1em solid #cccccc;
-height: 8em;
-width: 10em;
 vertical-align: top;
 padding: 0.5em;
 }
@@ -1695,14 +1692,15 @@
 }
 
 .calendar tr td .h1 {
+color: #000099;
 float: left;
 }
 
-.calendar tr .current-period {
+.calendar .current-period {
 background-color: #ffffcc;
 }
 
-.calendar tr .active-period {
+.calendar .active-period {
 background-color: #eeeeee;
 }
 

Modified: ofbiz/trunk/specialpurpose/assetmaint/widget/FixedAssetScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/assetmaint/widget/FixedAssetScreens.xml?rev=627239&r1=627238&r2=627239&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/assetmaint/widget/FixedAssetScreens.xml (original)
+++ ofbiz/trunk/specialpurpose/assetmaint/widget/FixedAssetScreens.xml Tue Feb 12 19:53:17 2008
@@ -218,7 +218,6 @@
     <screen name="CommonCalendarDecorator">
         <section>
             <actions>
-                <set field="layoutSettings.styleSheets[]" value="/images/calendarstyles.css" global="true"/>
                 <set field="tabButtonItem" value="ListFixedAssetCalendar"/>
                 <script location="component://assetmaint/webapp/assetmaint/WEB-INF/actions/workeffort/viewCalendar.bsh"/>
                 <entity-one entity-name="FixedAsset" value-name="fixedAsset"/>
@@ -289,4 +288,4 @@
             </widgets>
         </section>
     </screen>
-</screens>
\ No newline at end of file
+</screens>