def _formatHtml(self, document):
     title = document.getTitle()
     modified = document.getLastModifiedTime()
     created = document.getCreationTime()
     id = document.getId()
     args = {
         u"title" : title, #$NON-NLS-1$
         u"modified" : formatLocalDateAndTime(modified), #$NON-NLS-1$
         u"created" :  formatLocalDateAndTime(created), #$NON-NLS-1$
         u"entryid" :  id #$NON-NLS-1$
     }
     return ZGeneralBlogPostDetailsPanel.GENERAL_HTML_TEMPLATE % args
Exemple #2
0
 def _formatHtml(self, document):
     title = document.getTitle()
     modified = document.getLastModifiedTime()
     created = document.getCreationTime()
     id = document.getId()
     args = {
         u"title": title,  #$NON-NLS-1$
         u"modified": formatLocalDateAndTime(modified),  #$NON-NLS-1$
         u"created": formatLocalDateAndTime(created),  #$NON-NLS-1$
         u"entryid": id  #$NON-NLS-1$
     }
     return ZGeneralBlogPostDetailsPanel.GENERAL_HTML_TEMPLATE % args
Exemple #3
0
 def getRowText(self, rowIndex, columnIndex):
     data = self.model.getEntries()[rowIndex]
     if columnIndex == 0:
         title = data.getTitle()
         if not title:
             title = u"(%s)" % _extstr(u"postsview.NoTitle") #$NON-NLS-1$ #$NON-NLS-2$
         return title
     if columnIndex == 1:
         blogId = self.model.getCurrentFilter().getBlogIdCriteria()
         pdIDO = data.getPubDataIDO(blogId)
         if pdIDO:
             return formatLocalDateAndTime( pdIDO.getPublishedTime() )
         else:
             return formatLocalDateAndTime( data.getLastModifiedTime())
     return u"" #$NON-NLS-1$
Exemple #4
0
 def getRowText(self, rowIndex, columnIndex):
     data = self.model.getEntries()[rowIndex]
     if columnIndex == 0:
         title = data.getTitle()
         if not title:
             title = u"(%s)" % _extstr(
                 u"postsview.NoTitle")  #$NON-NLS-1$ #$NON-NLS-2$
         return title
     if columnIndex == 1:
         blogId = self.model.getCurrentFilter().getBlogIdCriteria()
         pdIDO = data.getPubDataIDO(blogId)
         if pdIDO:
             return formatLocalDateAndTime(pdIDO.getPublishedTime())
         else:
             return formatLocalDateAndTime(data.getLastModifiedTime())
     return u""  #$NON-NLS-1$
Exemple #5
0
 def _createStatusBarModel(self):
     # FIXME (PJ) need a proper implementation of the status bar model, this is just a sample
     # Instead showing datetime, show word count, current tag name etc.
     sbModel = ZStatusBarModel()
     pane = sbModel.addPane(u"datetime") #$NON-NLS-1$
     pane.text = formatLocalDateAndTime( self.model.getDocument().getCreationTime() )
     
     pane = sbModel.addPane(u"rowcol") #$NON-NLS-1$
     sbModel.setPaneWidth(u"rowcol", 80) #$NON-NLS-1$
     pane.text = u"" #$NON-NLS-1$
     return sbModel
 def getRowText(self, rowIndex, columnIndex):
     posts = self.blogPostsListQueryModel.getBlogPosts()
     if posts and rowIndex < len(posts):            
         data = posts[rowIndex]
         if columnIndex == 0:
             title = data.getTitle()
             if not title:
                 title = u"(%s)" % _extstr(u"blogpostslist.NoTitle") #$NON-NLS-1$ #$NON-NLS-2$
             return title
         if columnIndex == 1:
             # note: data.getPublishedTime() is None for local/unpublished documents
             return formatLocalDateAndTime (data.getCreationTime() )
     return u"" #$NON-NLS-1$
Exemple #7
0
 def getRowText(self, rowIndex, columnIndex):
     posts = self.blogPostsListQueryModel.getBlogPosts()
     if posts and rowIndex < len(posts):
         data = posts[rowIndex]
         if columnIndex == 0:
             title = data.getTitle()
             if not title:
                 title = u"(%s)" % _extstr(
                     u"blogpostslist.NoTitle")  #$NON-NLS-1$ #$NON-NLS-2$
             return title
         if columnIndex == 1:
             # note: data.getPublishedTime() is None for local/unpublished documents
             return formatLocalDateAndTime(data.getCreationTime())
     return u""  #$NON-NLS-1$
 def getRowText(self, rowIndex, columnIndex):
     if self.document is not None and rowIndex < len(self.document.getBlogInfoList()) :
         blogInfo = self.document.getBlogInfoList()[rowIndex]
         pubData = blogInfo.getPublishInfo()
         blog = getBlogFromIds(blogInfo.getAccountId(), blogInfo.getBlogId())
         if columnIndex == 0 and blog is not None:
             return blog.getName()
         elif columnIndex == 1:
             issuedTime = pubData.getPublishedTime()
             return formatLocalDateAndTime(issuedTime)
         elif columnIndex == 2:
             return unicode(pubData.getBlogEntryId())
         elif columnIndex == 3:
             return u"" # FIXME impl this #$NON-NLS-1$
         elif columnIndex == 4:
             return u"False"  # FIXME impl this #$NON-NLS-1$
     return u"" #$NON-NLS-1$
Exemple #9
0
 def getRowText(self, rowIndex, columnIndex):
     if self.document is not None and rowIndex < len(
             self.document.getBlogInfoList()):
         blogInfo = self.document.getBlogInfoList()[rowIndex]
         pubData = blogInfo.getPublishInfo()
         blog = getBlogFromIds(blogInfo.getAccountId(),
                               blogInfo.getBlogId())
         if columnIndex == 0 and blog is not None:
             return blog.getName()
         elif columnIndex == 1:
             issuedTime = pubData.getPublishedTime()
             return formatLocalDateAndTime(issuedTime)
         elif columnIndex == 2:
             return unicode(pubData.getBlogEntryId())
         elif columnIndex == 3:
             return u""  # FIXME impl this #$NON-NLS-1$
         elif columnIndex == 4:
             return u"False"  # FIXME impl this #$NON-NLS-1$
     return u""  #$NON-NLS-1$