#NEWLINE# def add_publish_button( self ) : #NEWLINE# #INDENT# '\n        Adds the publish button to the toolbar if the current post is unpublished\n        ' #NEWLINE# current_post = getattr ( self . request , get_setting ( 'CURRENT_POST_IDENTIFIER' ) , None ) #NEWLINE# if ( self . toolbar . edit_mode and self and ( not current_post . publish ) and self . request . user . has_perm ( 'djangocms_blog.change_post' ) ) : #NEWLINE# #INDENT# classes = [ 'cms-btn-action' , 'blog-publish' ] #NEWLINE# title = _ ( 'Publish {0} now' ) . format ( current_post . app_config . object_name ) #NEWLINE# url = admin_reverse ( 'djangocms_blog_publish_article' , args = ( current_post . pk , ) ) #NEWLINE# self . toolbar . add_button ( title , url = url , extra_classes = classes , side = self . toolbar . RIGHT )