Changeset 107

Show
Ignore:
Timestamp:
08/06/08 16:21:20 (5 months ago)
Author:
rgrp
Message:

[thread/timeline][s]: factor thread timeline out of default read view into a dedicated read_timeline view.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/microfacts/controllers/thread.py

    r91 r107  
    7171            abort(mode.response_code) 
    7272 
     73    def read_timeline(self, id): 
     74        c.has_inline_edit = False 
     75        try: 
     76            id = int(id) 
     77        except: 
     78            id = 0 
     79        mode = EntityGet('/thread/%s' % id).execute() 
     80        if mode.response_code == 200: 
     81            c.thread = mode.entity 
     82            if len(c.thread.factlets) > 0: 
     83                import microfacts.controllers.factlet 
     84                id = c.thread.factlets[0].id 
     85                fc = microfacts.controllers.factlet.FactletController() 
     86                html = fc.read_core(id) 
     87                c.factlet_info = genshi.XML(html) 
     88            return render('thread/read_timeline') 
     89        else: 
     90            abort(mode.response_code) 
     91 
    7392    def update(self, id): 
    7493        c.has_inline_edit = True 
  • trunk/microfacts/templates/thread/read.html

    r103 r107  
    2828    </aside> 
    2929 
    30     <aside id="thread-timeline-control-${c.thread.id}"> 
    31       <h2>Timeline control:</h2> 
    32       <p>To scroll the timeline click and drag horizontally (in any band). To resize the timeline click and drag vertically.</p> 
    33       <p><strong>TODO: make these buttons functional (js only)</strong></p> 
    34       <form> 
    35         <input type="button" value="Show Timeline" class="show" /> 
    36         <input type="button" value="Hide Timeline" class="hide" /> 
    37       </form> 
    38       <p><strong>TODO: might want to move to having an explicit thread timeline view in which timeline is vertical and replaces the factlet-info box on the right ...</strong></p> 
    39     </aside> 
    40      
    4130    <div id="thread-${c.thread.id}" class="thread"> 
    4231       
     
    4534        (${h.link_to("Edit", h.url_for(controller='thread', action='update'))}) 
    4635        </h2> 
    47       <div id="thread-timeline" style="height: 150px; border: 1px solid #aaa; margin-bottom: 20px;"></div> 
    48        
     36 
    4937      <py:choose>   
    5038        <div py:when="len(c.thread.factlets) > 0" class="thread-factlets">