Skip to content

/ Zope / gocept svn checkins / Archive / 2005 / 2005-10 / SVN: r3619 - LeuBsm/trunk/skins/leu_content

[ << ] [ >> ]

[ SVN: r3610 - in zope3-products: . lms lms/trunk / ... ] [ SVN: r3622 - in LeuBsm/trunk: Extensions workflow ... ]

SVN: r3619 - LeuBsm/trunk/skins/leu_content
Christian Zagrodnick <cz(at)gocept.com>
2005-10-03 19:21:09 [ FULL ]
Author: zagy
Date: Mon Oct  3 19:20:59 2005
New Revision: 3619

Modified:
   LeuBsm/trunk/skins/leu_content/examples_statistics.pt
Log:
removed 'n/a'



Modified: LeuBsm/trunk/skins/leu_content/examples_statistics.pt
==============================================================================
--- LeuBsm/trunk/skins/leu_content/examples_statistics.pt	(original)
+++ LeuBsm/trunk/skins/leu_content/examples_statistics.pt	Mon Oct  3 19:20:59
2005
(at)(at) -40,7 +40,7 (at)(at)
                         <td tal:content="subject/Title" />
                         <td tal:repeat="school schools">
                             <span tal:define="x
python:stat[school.getId()].get(subject.getId())"
-                                  tal:replace="python:test(x is None, 'n/a',
x)" />
+                                  tal:replace="python:test(x is None, '', x)"
/>
                         </td>
                         <td
tal:content="python:stat['all'][subject.getId()]" />
                     </tr>

SVN: r3620 - in LeuBsm/trunk: Extensions skins/leu_scripts
Christian Zagrodnick <cz(at)gocept.com>
2005-10-03 19:22:53 [ FULL ]
Author: zagy
Date: Mon Oct  3 19:22:45 2005
New Revision: 3620

Modified:
   LeuBsm/trunk/Extensions/Install.py
   LeuBsm/trunk/skins/leu_scripts/getExamplesStatistics.py
Log:
statistics generation doesn't wake up objects


Modified: LeuBsm/trunk/Extensions/Install.py
==============================================================================
--- LeuBsm/trunk/Extensions/Install.py	(original)
+++ LeuBsm/trunk/Extensions/Install.py	Mon Oct  3 19:22:45 2005
(at)(at) -26,6 +26,33 (at)(at)
 from Products.LeuBsm import config
 
 
+def installCatalogIndexes(self, out, catalog_name, indexes):
+    cat = getToolByName(self, catalog_name)
+    available_indexes = cat.Indexes.objectIds()
+
+    added = 0
+    for index_name, index_type, index_default in indexes:
+        if index_name in available_indexes:
+            continue
+        cat.addIndex(index_name, index_type, index_default)
+        added += 1
+
+    return added
+    
+def installCatalogMetadata(self, out, catalog_name, columns):
+    cat = getToolByName(self, catalog_name)
+    available_columns = cat.schema()
+
+    added = 0
+    for column in columns:
+        if column in available_columns:
+            continue
+        cat.addColumn(column)
+        added += 1
+
+    return added
+
+
 
 
 
(at)(at) -137,6 +164,26 (at)(at)
         for x in direct_mappings:
             luf.manage_addLDAPSchemaItem(x,friendly_name=x, multivalued=True)
 
+    def configure_catalog():
+
+        class Record:
+            def __init__(self, **kw):
+                self.__dict__.update(kw)
+
+        print >>out, "Configuring portal catalog"
+        added = installCatalogIndexes(
+            self, out, 'portal_catalog',
+            [("defaultClass", "FieldIndex", None),
+             ("schoolSubjects", "KeywordIndex",
+              Record(indexed_attrs="getSchoolSubjectsIndex")),
+             ("school", "FieldIndex", None)])
+        added += installCatalogMetadata(
+            self, out, 'portal_catalog',
+            ['school', 'getSchoolSubjectsIndex', 'getSpanning'])
+
+        if added > 0:
+            pc = getToolByName(self, 'portal_catalog')
+            pc.refreshCatalog(clear=1)
 
     ### Main part
 
(at)(at) -218,15 +265,7 (at)(at)
     pfc.addFormAction('content_status_modify', 'success', config.mtNiveau, '',
                       'redirect_to', 'string:../niveaus_listing')
 
-    print >>out, "Configuring portal catalog"
-    ct = getToolByName(self, "portal_catalog")
-    ct.addIndex("defaultClass", "FieldIndex")
-
-    class iExtra(object):
-        indexed_attrs = "getSchoolSubjectsIndex"
-    indexInstallExtra = iExtra()
-    ct.addIndex("schoolSubjects", "KeywordIndex", extra=indexInstallExtra)
-    ct.addIndex("school", "FieldIndex")
+    configure_catalog()
 
     print >>out, "Configuring folder actions ..."
     use_folder_tabs = (
(at)(at) -271,8 +310,3 (at)(at)
     print >>out, "Successfully installed %s." % PROJECTNAME
     return out.getvalue()
 
-def uninstall(self):
-    ct = getToolByName(self, "portal_catalog")
-    ct.delIndex("defaultClass")
-    ct.delIndex("schoolSubjects")
-    ct.delIndex("school")

Modified: LeuBsm/trunk/skins/leu_scripts/getExamplesStatistics.py
==============================================================================
--- LeuBsm/trunk/skins/leu_scripts/getExamplesStatistics.py	(original)
+++ LeuBsm/trunk/skins/leu_scripts/getExamplesStatistics.py	Mon Oct  3 19:22:45
2005
(at)(at) -9,8 +9,7 (at)(at)
 
 examples = dict([(s.getId(), []) for s in schools])
 for b in brains:
-    o = b.getObject()
-    examples[o.getSchool().getId()].append(o)
+    examples[b.school].append(b)
 
 stat = {'all': {'total':0, 'spanning':0, 'nonspanning':0}}
 
(at)(at) -18,17 +17,18 (at)(at)
     sid = s.getId()
 
     total = len(examples[sid])
-    spanning = len([e for e in examples[sid] if e.getSpanning()])
+    spanning = len([e for e in examples[sid] if e.getSpanning])
     stat[sid] = {'total': total,
                  'spanning': spanning,
                  'nonspanning': total - spanning}
 
     subjects = s.getSchoolSubjects()
-    for sub in subjects:
-        stat[sid][sub.getId()] = len([e for e in examples[sid]
-                                        if sub in e.getSchoolSubjects()])
+    subject_ids = [ sub.getId() for sub in subjects ]
 
-    for r in [sub.getId() for sub in subjects] + \
+    for sub in subject_ids:
+        stat[sid][sub] = len([e for e in examples[sid]
+                                 if sub in e.getSchoolSubjectsIndex])
+    for r in subject_ids + \
              ['total', 'spanning', 'nonspanning']:
         stat['all'][r] = stat['all'].get(r, 0) + stat[sid][r]

SVN: r3621 - in LeuBsm/trunk/skins: leu_content leu_scripts
Christian Zagrodnick <cz(at)gocept.com>
2005-10-03 19:58:47 [ FULL ]
Author: zagy
Date: Mon Oct  3 19:58:31 2005
New Revision: 3621

Added:
   LeuBsm/trunk/skins/leu_scripts/getStatistics.py
      - copied, changed from r3620,
LeuBsm/trunk/skins/leu_scripts/getExamplesStatistics.py
Removed:
   LeuBsm/trunk/skins/leu_scripts/getExamplesStatistics.py
Modified:
   LeuBsm/trunk/skins/leu_content/examples_statistics.pt
   LeuBsm/trunk/skins/leu_content/listing_macros.pt
Log:
statistik ueber nivau (statistik mit niveau?) ;)


Modified: LeuBsm/trunk/skins/leu_content/examples_statistics.pt
==============================================================================
--- LeuBsm/trunk/skins/leu_content/examples_statistics.pt	(original)
+++ LeuBsm/trunk/skins/leu_content/examples_statistics.pt	Mon Oct  3 19:58:31
2005
(at)(at) -12,63 +12,39 (at)(at)
     </div>
 
     <div metal:fill-slot="content">
-
-        <h1 class="documentFirstHeading">Statistik über
Umsetzungsbeispiele</h1>
-
-        <p>
-            Fächerübergreifende Umsetzungsbeispiele werden in jedem
-            der betreffenden Fächer gezählt. Deshalb kann die Summe
-            der Anzahlen von Beispielen in den einzelnen Fächern
-            größer als die Gesamtzahl der fachbezogenen Beispiele
-            sein.
-        </p>
-
-        <div class="leu-stat">
-            <table class="leu-stat"
-                   tal:define="stat here/getExamplesStatistics;
-                               schools here/leubsm_tool/listAllSchools">
-                <thead>
-                    <tr>
-                        <th />
-                        <th tal:repeat="school schools"
-                            tal:content="school/Title" />
-                        <th>Gesamt</th>
-                    </tr>
-                </thead>
-                <tbody>
-                    <tr tal:repeat="subject
here/leubsm_tool/listUniqueSchoolSubjects">
-                        <td tal:content="subject/Title" />
-                        <td tal:repeat="school schools">
-                            <span tal:define="x
python:stat[school.getId()].get(subject.getId())"
-                                  tal:replace="python:test(x is None, '', x)"
/>
-                        </td>
-                        <td
tal:content="python:stat['all'][subject.getId()]" />
-                    </tr>
-                </tbody>
-                <tbody>
-                    <tr class="sum-row">
-                        <td>fachbezogen</td>
-                        <td tal:repeat="school schools"
-                           
tal:content="python:stat[school.getId()]['nonspanning']" />
-                        <td tal:content="stat/all/nonspanning" />
-                    </tr>
-                    <tr>
-                        <td>übergreifend</td>
-                        <td tal:repeat="school schools"
-                           
tal:content="python:stat[school.getId()]['spanning']" />
-                        <td tal:content="stat/all/spanning" />
-                    </tr>
-                </tbody>
-                <tbody>
-                    <tr class="sum-row">
-                        <td>Gesamt</td>
-                        <td tal:repeat="school schools"
-                            tal:content="python:stat[school.getId()]['total']"
/>
-                        <td tal:content="stat/all/total" />
-                    </tr>
-                </tbody>
-            </table>
+      <div tal:define="portal_type string:Example">
+        <div metal:use-macro="here/listing_macros/macros/statistics">
+          <p metal:fill-slot="description">
+              Fächerübergreifende Umsetzungsbeispiele werden in jedem
+              der betreffenden Fächer gezählt. Deshalb kann die Summe
+              der Anzahlen von Beispielen in den einzelnen Fächern
+              größer als die Gesamtzahl der fachbezogenen Beispiele
+              sein.
+          </p>
+          
+          <tbody metal:fill-slot="grouping">
+            <tr class="sum-row">
+                <td>fachbezogen</td>
+                <td tal:repeat="school schools"
+                    tal:content="python:stat[school.getId()]['nonspanning']"
/>
+                <td tal:content="stat/all/nonspanning" />
+            </tr>
+            <tr>
+                <td>übergreifend</td>
+                <td tal:repeat="school schools"
+                    tal:content="python:stat[school.getId()]['spanning']"
/>
+                <td tal:content="stat/all/spanning" />
+            </tr>
+        </tbody>
         </div>
+      </div>
+    <div tal:define="portal_type string:Niveau">
+      <div metal:use-macro="here/listing_macros/macros/statistics">
+        <h1 metal:fill-slot="title">
+          Statistik über Niveaukonkretisierungen
+        </h1>
+      </div>
     </div>
+  </div>
 </body>
 </html>

Modified: LeuBsm/trunk/skins/leu_content/listing_macros.pt
==============================================================================
--- LeuBsm/trunk/skins/leu_content/listing_macros.pt	(original)
+++ LeuBsm/trunk/skins/leu_content/listing_macros.pt	Mon Oct  3 19:58:31 2005
(at)(at) -102,4 +102,52 (at)(at)
       </tal:wfstates>
     </metal:block>
 
+    <metal:block define-macro="statistics">
+      <!-- statistics
+
+      parameters: portal_type
+      -->
+
+        <h1 class="documentFirstHeading"
+          metal:define-slot="title">Statistik über
Umsetzungsbeispiele</h1>
+
+        <p metal:define-slot="description">
+        </p>
+
+        <div class="leu-stat">
+            <table class="leu-stat"
+                   tal:define="stat python:here.getStatistics(portal_type);
+                               schools here/leubsm_tool/listAllSchools">
+                <thead>
+                    <tr>
+                        <th />
+                        <th tal:repeat="school schools"
+                            tal:content="school/Title" />
+                        <th>Gesamt</th>
+                    </tr>
+                </thead>
+                <tbody>
+                    <tr tal:repeat="subject
here/leubsm_tool/listUniqueSchoolSubjects">
+                        <td tal:content="subject/Title" />
+                        <td tal:repeat="school schools">
+                            <span tal:define="x
python:stat[school.getId()].get(subject.getId())"
+                                  tal:replace="python:test(x is None, '', x)"
/>
+                        </td>
+                        <td
tal:content="python:stat['all'][subject.getId()]" />
+                    </tr>
+                </tbody>
+                <metal:group
metal:define-slot="grouping"></metal:group>
+                <tbody>
+                    <tr class="sum-row">
+                        <td>Gesamt</td>
+                        <td tal:repeat="school schools"
+                            tal:content="python:stat[school.getId()]['total']"
/>
+                        <td tal:content="stat/all/total" />
+                    </tr>
+                </tbody>
+            </table>
+        </div>
+     
+    </metal:block>
+    
 </metal:block>

Copied: LeuBsm/trunk/skins/leu_scripts/getStatistics.py (from r3620,
LeuBsm/trunk/skins/leu_scripts/getExamplesStatistics.py)
==============================================================================
--- LeuBsm/trunk/skins/leu_scripts/getExamplesStatistics.py	(original)
+++ LeuBsm/trunk/skins/leu_scripts/getStatistics.py	Mon Oct  3 19:58:31 2005
(at)(at) -1,3 +1,4 (at)(at)
+##parameters=portal_type
 from Products.CMFCore.utils import getToolByName
 
 lt = getToolByName(context, 'leubsm_tool')
(at)(at) -5,7 +6,7 (at)(at)
 
 cat = getToolByName(context, 'portal_catalog')
 brains = cat(review_state=['freigegeben', 'zurueckgerufen'],
-             portal_type='Example')
+             portal_type=portal_type)
 
 examples = dict([(s.getId(), []) for s in schools])
 for b in brains:

SVN: r3626 - LeuBsm/trunk/skins/leu_content
Christian Zagrodnick <cz(at)gocept.com>
2005-10-04 10:38:22 [ FULL ]
Author: zagy
Date: Tue Oct  4 10:38:13 2005
New Revision: 3626

Modified:
   LeuBsm/trunk/skins/leu_content/schoolsubjectview_view.pt
Log:
huge performance boost by not rendering the school.... 




Modified: LeuBsm/trunk/skins/leu_content/schoolsubjectview_view.pt
==============================================================================
--- LeuBsm/trunk/skins/leu_content/schoolsubjectview_view.pt	(original)
+++ LeuBsm/trunk/skins/leu_content/schoolsubjectview_view.pt	Tue Oct  4
10:38:13 2005
(at)(at) -32,7 +32,7 (at)(at)
 
                         <tal:block define="school ex/getSchool">
                             <div class="leu-categories"
-                                 tal:condition="school">
+                                 tal:condition="nocall:school">
                                 <span tal:content="school/Title"
/><span
                                     tal:condition="ex/getDefaultClass">,
                                     Klasse <span
tal:content="ex/getDefaultClass" /></span><span
(at)(at) -40,7 +40,7 (at)(at)
                                 <span tal:content="python:',
'.join([sub.getTitle() for sub in ex.getSchoolSubjects()])" /></span>
                             </div>
                             <div class="leu-categories"
-                                 tal:condition="not:school">
+                                 tal:condition="nocall:not:school">
                                 Keine Schulart ausgewählt!
                             </div>
                         </tal:block>

SVN: r3631 - LeuBsm/trunk/skins/leu_content
Christian Zagrodnick <cz(at)gocept.com>
2005-10-04 15:01:24 [ FULL ]
Author: zagy
Date: Tue Oct  4 15:01:18 2005
New Revision: 3631

Modified:
   LeuBsm/trunk/skins/leu_content/public_listing.pt
Log:
fixed redirect after wf-action




Modified: LeuBsm/trunk/skins/leu_content/public_listing.pt
==============================================================================
--- LeuBsm/trunk/skins/leu_content/public_listing.pt	(original)
+++ LeuBsm/trunk/skins/leu_content/public_listing.pt	Tue Oct  4 15:01:18 2005
(at)(at) -78,7 +78,7 (at)(at)
 
                                         <tal:workflow repeat="transition
python:wtool.getTransitionsFor(it, it)">
                                             <a class="leu-actionlink"
href=""
-                                               tal:attributes="href
string:${url}/content_status_modify_redirect?workflow_action=${transition/id}&redirect_to=${here/absolute_url}/public_listing"
+                                              tal:attributes="href
string:${url}/content_status_modify_redirect?workflow_action=${transition/id}&redirect_to=${here/absolute_url}/public_listing%3Ftypename=${request/typename}"
                                               
tal:content="transition/name">
                                                 Workflow-Action</a>
                                         </tal:workflow>

SVN: r3633 - LeuBsm/trunk/skins/leu_content
Christian Zagrodnick <cz(at)gocept.com>
2005-10-04 15:41:52 [ FULL ]
Author: zagy
Date: Tue Oct  4 15:41:47 2005
New Revision: 3633

Modified:
   LeuBsm/trunk/skins/leu_content/schoolsubjectview_view.pt
Log:
batching 


Modified: LeuBsm/trunk/skins/leu_content/schoolsubjectview_view.pt
==============================================================================
--- LeuBsm/trunk/skins/leu_content/schoolsubjectview_view.pt	(original)
+++ LeuBsm/trunk/skins/leu_content/schoolsubjectview_view.pt	Tue Oct  4
15:41:47 2005
(at)(at) -14,9 +14,16 (at)(at)
           tal:content="python:here.acquireView().archetype_name"
           >Umsetzungsbeispiele</h1>
 
-            <tal:examples define="examples python:here.listExamples()">
+            <tal:examples define="examples python:here.listExamples();
+                                  result_len python:len(examples);
+                                  Batch
python:modules['Products.CMFPlone'].Batch;
+                                  b_size  python:request.get('batch_size',
20);
+                                  b_start python:0;
+                                  b_start request/b_start | b_start;
+                                  batch python:Batch(examples, b_size,
int(b_start), orphan=1);">
 
-                <tal:example repeat="ex examples">
+            <metal:block use-macro="here/batch_macros/macros/navigation"
/>
+                <tal:example repeat="ex batch">
                     <div class="leu-item"
                         tal:define="url
string:${here/absolute_url}/(at)(at)${ex/UID}">
                         <div tal:define="icon python:ex.getIcon(1)"
(at)(at) -58,6 +65,7 (at)(at)
                         </div>
                     </div>
                 </tal:example>
+              <metal:block use-macro="here/batch_macros/macros/navigation"
/>
             </tal:examples>
     </div>

SVN: r3675 - LFODTool/trunk/skins/lfodtool
Thomas Lotze <tl(at)gocept.com>
2005-10-18 14:46:11 [ FULL ]
Author: thomas
Date: Tue Oct 18 14:46:08 2005
New Revision: 3675

Modified:
   LFODTool/trunk/skins/lfodtool/portlet_lfod.pt
Log:
adapting template to integer credits

Modified: LFODTool/trunk/skins/lfodtool/portlet_lfod.pt
==============================================================================
--- LFODTool/trunk/skins/lfodtool/portlet_lfod.pt	(original)
+++ LFODTool/trunk/skins/lfodtool/portlet_lfod.pt	Tue Oct 18 14:46:08 2005
(at)(at) -46,8 +46,8 (at)(at)
                       </td>
                       <td tal:attributes="style
python:test(repeat['lfod'].start,
                                                
'color:red','color:black')">
-                          <span tal:content="python:'%.2f' % lfod.credits"
-		      	                    tal:on-error="string:0">2.0</span>
+                          <span tal:content="lfod/credits"
+		      	        tal:on-error="string:0">2</span>
                       </td>
                     </tr>
                   </tbody>

MailBoxer