Пример #1
0
    def _passage_entry_text(self, passage_entry):
        """Gets the HTML for the given passage entry with its comment."""
        comment = text2html(passage_entry.comment)
        if self.expand_passages:
            comment = u"<i>%s</i>" % comment
        reference = str(passage_entry)
        localised_reference = text2html(
            passage_entry.passage.GetBestRange(userOutput=True))
        if self.expand_passages:
            passage_text = u'<div class="topic_passage_text">%s</div>' % (
                biblemgr.bible.GetReference(reference,
                                            exclude_topic_tag=self.topic))
            if comment:
                comment = u"<p>%s<p>" % comment
        else:
            passage_text = ""

        current_anchor = u""
        if passage_entry is self.selected_passage_entry:
            comment = u'<span style="color: #008000">%s</span>' % comment
            passage_text = u'<span style="color: #008000">%s</span>' % passage_text
            current_anchor = u'<a name="current" />'
        return (
            u'<div class="topic_passage">%(current_anchor)s<b><a href=\"bible:%(reference)s\">%(localised_reference)s</a></b> '
            u'%(passage_text)s%(comment)s</div>' % locals())
Пример #2
0
	def _passage_entry_text(self, passage_entry):
		"""Gets the HTML for the given passage entry with its comment."""
		comment = text2html(passage_entry.comment)
		if self.expand_passages:
			comment = u"<i>%s</i>" % comment
		reference = str(passage_entry)
		localised_reference = text2html(passage_entry.passage.GetBestRange(userOutput=True))
		if self.expand_passages:
			passage_text = u'<div class="topic_passage_text">%s</div>' % (
				biblemgr.bible.GetReference(reference, exclude_topic_tag=self.topic))
			if comment:
				comment = u"<p>%s<p>" % comment
		else:
			passage_text = ""

		current_anchor = u""
		if passage_entry is self.selected_passage_entry:
			comment = u'<span style="color: #008000">%s</span>' % comment
			passage_text = u'<span style="color: #008000">%s</span>' % passage_text
			current_anchor = u'<a name="current" />'
		return (u'<div class="topic_passage">%(current_anchor)s<b><a href=\"bible:%(reference)s\">%(localised_reference)s</a></b> '
			u'%(passage_text)s%(comment)s</div>' % locals())
Пример #3
0
	def get_text(self):
		if not self.text_needs_reloading:
			return self.text

		try:
			html = u'<h2 class="topic_title">%s</h2>' % text2html(self.topic.full_name)
		except AttributeError:
			# The topic has been deleted.
			return u""
		description = text2html(self.topic.description)
		if description:
			html += u'<div class="topic_description">%s</div>' % description

		passage_html = u"".join(self._passage_entry_text(passage_entry)
				for passage_entry in self.topic.passages)
		if passage_html:
			html += u'<div class="topic_passages">%s</div>' % passage_html
	
		self.text = html
		self.text_needs_reloading = False

		return html
Пример #4
0
    def get_text(self):
        if not self.text_needs_reloading:
            return self.text

        try:
            html = u'<h2 class="topic_title">%s</h2>' % text2html(
                self.topic.full_name)
        except AttributeError:
            # The topic has been deleted.
            return u""
        description = text2html(self.topic.description)
        if description:
            html += u'<div class="topic_description">%s</div>' % description

        passage_html = u"".join(
            self._passage_entry_text(passage_entry)
            for passage_entry in self.topic.passages)
        if passage_html:
            html += u'<div class="topic_passages">%s</div>' % passage_html

        self.text = html
        self.text_needs_reloading = False

        return html
Пример #5
0
	def get_text(self):
		reference = (u'<b><a href="bible:%s">%s</a></b>'
				% (str(self.passage_entry), text2html(self.localised_reference)))
		comment = text2html(self.passage_entry.comment)
		return u'<p>%(reference)s</p><p>%(comment)s</p>' % locals()