Changeset 186:7b8834c6118d

Show
Ignore:
Timestamp:
09/03/08 20:19:24 (2 years ago)
Author:
rgrp
Branch:
default
convert_revision:
svn:10edda23-d834-0410-9182-b00384516d49/trunk@198
Message:

[thread][m]: various misc fixes to thread user experience.

  • Fix it so successful thread create now leads dirctly to thread update/edit page.
  • Add docs to side of thread edit page
  • Fix up template when no factlets in thread.
Location:
microfacts
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • microfacts/controllers/thread.py

    r170 r186  
    4646            if self.mode.response_code == 200: 
    4747                c.thread = self.mode.entity 
    48                 return render('thread/create') 
     48                # return render('thread/create') 
     49                h.redirect_to(controller='thread', action='update', 
     50                        id=c.thread.id) 
    4951            else: 
    5052                abort(self.mode.response_code) 
  • microfacts/templates/thread/read.html

    r185 r186  
    5353        <p py:otherwise=""> 
    5454          There are no factlets in this thread. Would you like to  
    55           ${h.link_to("add a new one", h.url_for(controller='factlet', action='new'))}? 
     55          ${h.link_to("add a new one", h.url_for(controller='thread', 
     56          action='update'))}? 
    5657        </p> 
    5758      </py:choose> 
  • microfacts/templates/thread/update.html

    r174 r186  
    3131 
    3232  <body> 
     33    <aside id="thread-control-${c.thread.id}"> 
     34      <h2>Adding Factlets:</h2> 
     35      <ol> 
     36        <li>Search for the factlets you want to add using the search 
     37        facility.</li> 
     38        <li>Then click on append</li> 
     39      </ol> 
     40 
     41      <h2>Deleting Factlets:</h2> 
     42      <ol> 
     43        <li>Select it (by clicking on it in the list)</li> 
     44        <li>Click the delete button</li> 
     45      </ol> 
     46    </aside> 
     47 
    3348    <div id="thread-${c.thread.id}" class="thread"> 
    3449       
    3550      <h2 id="thread-title">Editing Thread: ${c.thread.title}</h2> 
    36        
    37       <py:choose>   
    38         <div py:when="len(c.thread.factlets) > 0" class="thread-factlets"> 
    39          
     51        <h3>Thread Factlets</h3> 
     52        <div class="thread-factlets"> 
    4053          <py:for each="factlet in c.thread.factlets"> 
    4154            <div id="factlet-${factlet['id']}" class="factlet"> 
     
    4659         
    4760        </div><!--! /thread-factlets --> 
    48         <p py:otherwise=""> 
    49           There are no factlets in this thread. Would you like to  
    50           ${h.link_to("add a new one", h.url_for(controller='factlet', action='new'))}? 
    51         </p> 
    52       </py:choose> 
    5361    </div><!--! /thread --> 
    5462     
  • microfacts/tests/functional/test_thread.py

    r172 r186  
    9696        form = response.forms[0] 
    9797        form['title'] = self.title 
    98         response = form.submit(status=[200]) 
    99         assert 'Create successful.' in response 
     98        response = form.submit(status=[302]) 
     99        response = response.follow() 
     100        assert 'Editing Thread' in response 
    100101        self.thread = model.Thread.query.filter_by(title=self.title).one() 
    101102