Changeset 288


Ignore:
Timestamp:
03/04/10 04:44:49 (2 years ago)
Author:
takanori
Message:

use getFolderContents() method for marker lists

Location:
Products.ATGoogleMaps/trunk/Products/ATGoogleMaps/skins/ATGoogleMaps
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • Products.ATGoogleMaps/trunk/Products/ATGoogleMaps/skins/ATGoogleMaps/gmap.kml.pt

    r263 r288  
    1010    <latitude tal:content="context/center/latitude">35.73</latitude> 
    1111  </LookAt> 
    12   <Placemark tal:repeat="context python:context.objectValues('GMarker')"> 
    13     <name tal:content="context/pretty_title_or_id">Marker title</name> 
    14     <description tal:content="context/kml_description">Description</description> 
    15     <Point> 
    16       <coordinates tal:content="string:${context/point/longitude},${context/point/latitude}">139.71,35.73</coordinates> 
    17     </Point> 
    18   </Placemark> 
     12  <tal:marker tal:repeat="item context/getFolderContents"> 
     13    <Placemark tal:define="marker item/getObject"> 
     14      <name tal:content="item/pretty_title_or_id">Marker title</name> 
     15      <description tal:content="item/Description">Description</description> 
     16      <Point> 
     17        <coordinates tal:content="string:${marker/point/longitude},${marker/point/latitude}">139.71,35.73</coordinates> 
     18      </Point> 
     19    </Placemark> 
     20  </tal:marker> 
    1921</Document> 
    2022</kml> 
  • Products.ATGoogleMaps/trunk/Products/ATGoogleMaps/skins/ATGoogleMaps/gmap.py

    r287 r288  
    11site_encoding =  context.plone_utils.getSiteEncoding() 
    22 
    3 def add_markers(js, markers): 
    4     for marker in markers: 
     3def add_markers(js, items): 
     4    for item in items: 
     5        marker = item.getObject() 
    56        lat = marker.point['latitude'] 
    67        lng = marker.point['longitude'] 
     
    1516               )) 
    1617 
    17     add_markers(js, context.objectValues(['GMarker'])) 
     18    add_markers(js, context.getFolderContents()) 
    1819 
    1920    js.append('}') 
  • Products.ATGoogleMaps/trunk/Products/ATGoogleMaps/skins/ATGoogleMaps/gmap_view.pt

    r287 r288  
    3434 
    3535    <!-- gmarker --> 
    36     <ul tal:define="markers python: context.objectValues(['GMarker'])"> 
    37       <tal:gmarker tal:repeat="marker markers"> 
    38         <li id="" 
    39             tal:define="mid marker/id;" 
    40             tal:condition="marker/point | nothing" 
    41             tal:attributes="id string:infowindow_link_${mid}"> 
    42           <a href="javascript:void(0)" onclick="this.blur()" tal:content="marker/pretty_title_or_id"> 
    43             Gmarker title 
    44           </a> 
    45           <!-- info window --> 
     36    <ul tal:define="folderContents context/getFolderContents"> 
     37      <tal:entry tal:repeat="item folderContents"> 
     38        <tal:block tal:define="marker item/getObject; 
     39                               item_id item/getId|item/id; 
     40                               item_title_or_id item/pretty_title_or_id; 
     41                               item_wf_state item/review_state|python: wtool.getInfoFor(item, 'review_state', ''); 
     42                               item_wf_state_class python:'state-' + normalizeString(item_wf_state); 
     43                               "> 
     44          <li id="" 
     45            tal:attributes="id string:infowindow_link_${item_id}"> 
     46            <a href="javascript:void(0)" 
     47               onclick="this.blur()" 
     48               tal:content="item_title_or_id" 
     49               tal:attributes="class string:${item_wf_state_class}"> 
     50              Marker title 
     51            </a> 
    4652          <div id="" style="display: none;" 
    47                tal:attributes="id string:infowindow_html_${mid}"> 
     53               tal:attributes="id string:infowindow_html_${item_id}"> 
    4854            <h2 class="documentFirstHeading"> 
    4955              <metal:field use-macro="python:marker.widget('title', mode='view')"> 
     
    100106              </ul> 
    101107            </div> 
    102  
    103108          </div> 
    104         </li> 
    105       </tal:gmarker> 
     109          </li> 
     110        </tal:block> 
     111      </tal:entry> 
    106112    </ul> 
    107113     
Note: See TracChangeset for help on using the changeset viewer.