Edgewall Software

Ticket #37: posterity.diff

File posterity.diff, 2.8 KB (added by fgsch@…, 14 months ago)

Mark as unread support

  • trunk/posterity/model.py

     
    288288            msg.is_deleted = False 
    289289        self._update_date_cache() 
    290290 
    291     def mark_as_read(self, deleted=False): 
    292         """Mark all messages in the conversation as read 
     291    def mark_as_read(self, is_read=True, deleted=False): 
     292        """Mark all messages in the conversation as `is_read` 
    293293         
    294294        If @deleted is True all messages marked for deletions are marked 
    295         as read. 
     295        as `is_read`. 
    296296        """ 
    297297        if deleted: 
    298298            for msg in self.deleted_msgs: 
    299                 msg.is_unread = False 
     299                msg.is_unread = not is_read 
    300300        else: 
    301301            for msg in self.msgs: 
    302                 msg.is_unread = False 
     302                msg.is_unread = not is_read 
    303303             
    304304    def _update_date_cache(self): 
    305305        """ 
  • trunk/posterity/controllers.py

     
    8686            elif do_action == 'undelete': 
    8787                c.remove_tag('Trash') 
    8888                c.undelete() 
     89            elif do_action == 'unread': 
     90                c.mark_as_read(is_read=False) 
    8991            elif do_action.startswith('tag_'): 
    9092                t = do_action[4:] 
    9193                c.add_tag(t) 
  • trunk/posterity/templates/conv_index.html

     
    3434 
    3535    <select py:if="account.tags" 
    3636            onchange="submitAction(this.options[this.selectedIndex].value)"> 
    37       <option>Add/Remove Tag</option> 
     37      <option>More actions...</option> 
     38      <option value="unread">Mark as unread</option> 
    3839      <optgroup label="Add Tag"> 
    3940        <option py:for="t in account.tags" py:if="not t.is_special" 
    4041                value="tag_$t.name">$t.name</option> 
  • trunk/posterity/templates/conv_show.html

     
    4646            onclick="submitAction('undelete')">Undelete</button> 
    4747    <select py:if="account.tags" 
    4848            onchange="submitAction(this.options[this.selectedIndex].value)"> 
    49       <option>Add/Remove Tag</option> 
     49      <option>More actions...</option> 
     50      <option value="unread">Mark as unread</option> 
    5051      <optgroup label="Add Tag"> 
    5152        <option py:for="t in account.tags" py:if="not t.is_special" 
    5253                value="tag_$t.name">$t.name</option>