def single_topic(topic_id): form = CommentForm() topic = Topic.get_topic(topic_id) topic['Time'] = time_diff(topic['Time']) topic['Content'] = topic['Content'].replace('\n', "<div class='text-gap'></div>") comments = Comment.get_comments_by_topic(topic['TopicID']) for c in comments: c['Time'] = time_diff(c['Time']) Topic.add_click_num(topic_id) nodes = Node.get_nodes(16) return render_template('topic/single_topic.html', topic=topic, comments=comments, nodes=nodes, form=form)
def single_topic(topic_id): form = CommentForm() topic = Topic.get_topic(topic_id) topic['Time'] = time_diff(topic['Time']) topic['Content'] = markdown2.markdown(topic['Content']) comments = Comment.get_comments_by_topic(topic['TopicID']) for c in comments: c['Time'] = time_diff(c['Time']) Topic.add_click_num(topic_id) nodes = Node.get_nodes(16) return render_template('single_topic.html', topic=topic, comments=comments, nodes=nodes, form=form)