]> err.no Git - sope/commitdiff
work on cal
authorhelge <helge@e4a50df8-12e2-0310-a44c-efbce7f8a7e3>
Tue, 23 Aug 2005 01:05:04 +0000 (01:05 +0000)
committerhelge <helge@e4a50df8-12e2-0310-a44c-efbce7f8a7e3>
Tue, 23 Aug 2005 01:05:04 +0000 (01:05 +0000)
git-svn-id: http://svn.opengroupware.org/SOPE/trunk@1066 e4a50df8-12e2-0310-a44c-efbce7f8a7e3

sope-appserver/samples/CoreDataBlog/MonthPage.wo/MonthPage.html
sope-appserver/samples/CoreDataBlog/MonthPage.wo/MonthPage.wod
sope-appserver/samples/CoreDataBlog/MonthPage.wo/MonthPage.woo

index 5ecdf94bb87788868927638ac20bbf4dfb6186d3..42e38b26ed29d073b732f0245a513c15515ea81a 100644 (file)
@@ -4,49 +4,31 @@
     <title>SOPE CoreData Test: MonthPage</title>
 
     <style>
-/*
-      table.calendar {
-        border-left:   1px solid #AAAAAA;
-        border-top:    1px solid #AAAAAA;
-        border-right:  1px solid black;
-        border-bottom: 1px solid black;
-      }
-      table.calendar tr td {
-        text-align: right;
-        font-size:  10pt;
-      }
-      table.calendar tr td.calendar-title {
-        text-align:  center;
-        font-weight: bold;
-      }
-      table.calendar tr td.calendar-othermonth {
-        font-style: italic;
-        color:      #888888;
-      }
-*/
-
-      /* Nat! blog */
-
       div#content {
         position:    absolute;
-        margin-left: 225px;
+        margin-left: 14em;
       }
       div#links {
-        width:   200px;
+        width:   12em;
         padding: 15px;
       }
+      div#banner {
+        text-align:    right;
+        border-bottom: 1px solid #BE5303;
+      }
 
       .date {
-        font-family:   palatino, georgia, times new roman, serif;
+        /* font-family:   palatino, georgia; */
+        font-family:   palatino, georgia;
         font-size:     large;
-        color:         #333;
-        border-bottom: 1px solid #999;
+        color:         #333333;
+        border-bottom: 1px solid #999999;
         margin-bottom: 10px;
         font-weight:bold;
       }        
       .blogbody {
         font-family: palatino, georgia, verdana, arial, sans-serif;
-        color:       #333;
+        color:       #333333;
         font-size:   small;
         font-weight: normal;
        background:  white;
@@ -59,7 +41,7 @@
         margin-bottom: 25px;
       }
       .title {
-        font-family: palatino, georgia, times new roman, serif;
+        font-family: palatino, georgia;
         font-size: medium;
         color: #666;
        margin-bottom:10px;
 
       /* Calendar */
       .calendar {
-        font-family: verdana, arial, sans-serif;
+        font-family: Verdana, Arial;
         color:       #666666;
         font-size:   x-small;
         line-height: 140%;
         padding:     2px;
+        text-align:  center;
       }
       caption.calendarhead { 
-        font-family: palatino, georgia, times new roman, serif;
-        color:       #BE5303;
-        font-size:   small;
-        padding:     2px;
+        font-family:    Palatino, Georgia;
+        color:          #BE5303;
+        font-size:      small;
+        padding:        2px;
         letter-spacing: .3em;
-        text-transform:uppercase;
+        text-transform: uppercase;
       }       
 
       .side {
@@ -90,7 +73,7 @@
         padding:     2px;                            
       }       
       .sidetitle {
-        font-family: palatino, georgia, times new roman, serif;
+        font-family: palatino, georgia;
         color:       #BE5303;
         font-size:   small;
         padding:     2px;
 
           <div class="blogbody">
             <h3 class="title"><#PostTitle/></h3>
+
             <#PostBody/>
 
             <div class="posted">
     <div id="links">
 
       <div class="calendar">
-        <table width="100%">
+        <table style="width: 11em;">
           <caption class="calendarhead"><#CalMonthName/></caption>
           <tr class="calendar">
             <th>Mon</th><th>Tue</th><th>Wed</th><th>Thu</th>
           <#Weeks>
             <tr class="calendar">
               <#Week>
+<!--
+   we want to update:
+     calendarDisplayGroup.queryMin.creationDate = day.beginningOfDay;
+     calendarDisplayGroup.queryMax.creationDate = day.endOfDay;
+   then fetch ...
+   => DO we need the 'set value' element here?
+-->
+                <#SetupCalDayDisplayGroup/>
+
                 <#IsSameMonth>
-                  <td><#Day/></td>
+                  <td>
+                    <#Day/> (<#Count/>)
+                  </td>
                 </#IsSameMonth>
                 <#IsOtherMonth>
                   <td class="calendar-othermonth"><#Day/></td>
index 07186b841a77a6be28ff8bc1f5f58755124acd22..466501be17f20dc651f40a3c3f2d870f7b386563 100644 (file)
@@ -66,3 +66,17 @@ IsOtherMonth: WOConditional {
   value     = day.monthOfYear;
   negate    = YES;
 }
+
+SetupCalDayDisplayGroup: WOCopyValue {
+  copyValues = {
+    "calendarDisplayGroup.queryMin.creationDate" = "day.beginOfDay";
+    "calendarDisplayGroup.queryMax.creationDate" = "day.tomorrow.beginOfDay";
+  };
+  finishValues = {
+    dummy = "calendarDisplayGroup.qualifyDataSource";
+  };
+}
+
+Count: WOString {
+  value = calendarDisplayGroup.displayedObjects.count;
+}
index 7fb1103bfa97bf99f64af13e73cb64cdbba3ede5..c7033723a476bdb80efe4b6219d4812f27e29711 100644 (file)
               selector = "compareDescending:";
             }
           );
+          qualifier = {
+            class = "EOKeyValueQualifier";
+            key   = "creationDate";
+            value = "";
+          };
+        };
+      };
+      formatForLikeQualifier       = "%@*";
+      localKeys                    = ();
+      numberOfObjectsPerBatch      = 0;
+      selectsFirstObjectAfterFetch = YES;
+      fetchesOnLoad                = YES;
+    };
+
+    calendarDisplayGroup = {
+      class      = WODisplayGroup;
+      dataSource = {
+        class              = EOCoreDataSource;
+        editingContext     = session.defaultManagedObjectContext;
+        fetchSpecification = {
+          class      = EOFetchSpecification;
+          entityName = Post;
+          fetchLimit = 1;
+          isDeep     = YES;
         };
       };
       formatForLikeQualifier       = "%@*";