Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Do not try to render resources that end up with no description
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:b248e65e10e80504710cb4d33166f1850edfefa9
User & Date: brandon 2018-11-13 21:54:10
Context
2018-11-13
22:11
Be sure to include blorbed files in the list of possible file extensions check-in: a60434f578 user: brandon tags: trunk
21:54
Do not try to render resources that end up with no description check-in: b248e65e10 user: brandon tags: trunk
21:34
Properly escape the entirety of the Resources URLs in the infoview check-in: 7a468e8d7a user: brandon tags: trunk
Changes

Changes to src/grotesque/ui/gtk3/info/infoview.py.

325
326
327
328
329
330
331


332
333
334
335
336
337
338

    def _render_resources(self, text_buffer, text_iter, tag_table, story_row):
        resources = db.query.select_resources_by_story(self.conn, story_row["id"])
        if not resources:
            return
        text_buffer.insert(text_iter, "Resources:\n")
        for resource in resources:


            resource_anchor = text_buffer.create_child_anchor(text_iter)
            resource_label = Gtk.Label()
            resource_label.set_track_visited_links(False)
            resource_label.set_markup(
                '\t<a href="{0}">{1}</a>'.format(cgi.escape(resource["uri"]),
                                                 cgi.escape(resource["description"])))
            resource_label.connect("activate-link", self._on_resource_clicked)







>
>







325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340

    def _render_resources(self, text_buffer, text_iter, tag_table, story_row):
        resources = db.query.select_resources_by_story(self.conn, story_row["id"])
        if not resources:
            return
        text_buffer.insert(text_iter, "Resources:\n")
        for resource in resources:
            if not resource["description"]:
                continue
            resource_anchor = text_buffer.create_child_anchor(text_iter)
            resource_label = Gtk.Label()
            resource_label.set_track_visited_links(False)
            resource_label.set_markup(
                '\t<a href="{0}">{1}</a>'.format(cgi.escape(resource["uri"]),
                                                 cgi.escape(resource["description"])))
            resource_label.connect("activate-link", self._on_resource_clicked)