old_contents: from website.util.sanitize import escape_html
  from website.files.models.base import File, Folder, FileNode, FileVersion
  
  
  __all__ = ('FigshareFile', 'FigshareFolder', 'FigshareFileNode')
  
  
  class FigshareFileNode(FileNode):
      provider = 'figshare'
  
  
  class FigshareFolder(FigshareFileNode, Folder):
      pass
  
  
  class FigshareFile(FigshareFileNode, File):
  
      def touch(self, bearer, revision=None, **kwargs):
          return super(FigshareFile, self).touch(bearer, revision=None, **kwargs)
  
      def update(self, revision, data, user=None):
          """Figshare does not support versioning.
          Always pass revision as None to avoid conflict.
          """
          self.name = data['name']
          self.materialized_path = data['materialized']
          self.save()
  
          version = FileVersion(identifier=None)
          version.update_metadata(data, save=False)
  
          # Draft files are not renderable
          if data['extra']['status'] == 'drafts':
              return (version, u'''
              <style>
              .file-download{{display: none;}}
              .file-share{{display: none;}}
              </style>
              <div class="alert alert-info" role="alert">
              The file "{name}" is still a draft on figshare. <br>
              To view it  on the OSF <a href="http://figshare.com/faqs">publish</a> it on figshare.
              </div>
              '''.format(name=escape_html(self.name)))
  
          return version
  
new_contents: from website.util.sanitize import escape_html
  from website.files.models.base import File, Folder, FileNode, FileVersion
  
  
  __all__ = ('FigshareFile', 'FigshareFolder', 'FigshareFileNode')
  
  
  class FigshareFileNode(FileNode):
      provider = 'figshare'
  
  
  class FigshareFolder(FigshareFileNode, Folder):
      pass
  
  
  class FigshareFile(FigshareFileNode, File):
  
      def touch(self, bearer, revision=None, **kwargs):
          return super(FigshareFile, self).touch(bearer, revision=None, **kwargs)
  
      def update(self, revision, data, user=None):
          """Figshare does not support versioning.
          Always pass revision as None to avoid conflict.
          """
          self.name = data['name']
          self.materialized_path = data['materialized']
          self.save()
  
          version = FileVersion(identifier=None)
          version.update_metadata(data, save=False)
  
          # Draft files are not renderable
          if data['extra']['status'] == 'drafts':
              return (version, u'''
              <style>
              .file-download{{display: none;}}
              .file-share{{display: none;}}
              </style>
              <div class="alert alert-info" role="alert">
              The file "{name}" is still a draft on figshare. <br>
              To view it  on the OSF
              <a href="https://figshare.zendesk.com/hc/en-us/articles/203712033-How-do-I-publish-my-data-/">publish</a>
              it on figshare.
              </div>
              '''.format(name=escape_html(self.name)))
  
          return version
  
subject: Correct figshare publish faq link.