NarWeb: remove the note type 'Html code' for notes (#1176)

* NarWeb: remove the note type 'Html code' for notes

Fixes #12184

Html code has no real meaning for a common reader

* better pylint score
This commit is contained in:
Serge Noiraud 2021-02-13 17:40:17 +01:00 committed by GitHub
parent 66680851f2
commit bfaab5645f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -742,13 +742,15 @@ class BasePage:
if this_note is not None:
idx += 1
if len(notelist) > 1:
if self.default_note(parent, int(this_note.type)):
if (self.default_note(parent, int(this_note.type)) or
int(this_note.type) == NoteType.HTML_CODE):
title_text = self._("Note: %s") % str(idx)
else:
title = " (" + title + ")"
title_text = self._("Note: %s") % str(idx) + title
else:
if self.default_note(parent, int(this_note.type)):
if (self.default_note(parent, int(this_note.type)) or
int(this_note.type) == NoteType.HTML_CODE):
title_text = self._("Note")
else:
title_text = title
@ -2393,13 +2395,15 @@ class BasePage:
note_text = self.get_note_format(note, True)
idx += 1
if len(notelist) > 1:
if self.default_note(parent, int(note.type)):
if (self.default_note(parent, int(note.type)) or
int(note.type) == NoteType.HTML_CODE):
title_text = self._("Note: %s") % str(idx)
else:
title = " (" + title + ")"
title_text = self._("Note: %s") % str(idx) + title
else:
if self.default_note(parent, int(note.type)):
if (self.default_note(parent, int(note.type)) or
int(note.type) == NoteType.HTML_CODE):
title_text = self._("Note")
else:
title_text = title