예제 #1
0
파일: activity.py 프로젝트: leeccong/code
 def rendered_description(self):
     from libs.text import render_markdown
     description = self.description
     if description:
         description = render_desc(self.type, description)
         return render_markdown(description)
     return ''
예제 #2
0
파일: issue.py 프로젝트: leeccong/code
 def edit(self, request):
     if request.method == 'POST':
         title = request.get_form_var('title', '').decode('utf-8')
         if not title.strip():
             return {'r': 1}
         content = request.get_form_var('content', '').decode('utf-8')
         user = request.user
         user = user.name if user else None
         if self.issue and user == self.issue.creator_id:
             self.issue.update(title, content)
             if self.issue == "project":
                 content_html = render_markdown_with_project(content, self.target.name)
             else:
                 content_html = render_markdown(content)
             content_html += st('/widgets/markdown_checklist.html', **locals())
             return {'r': 0,
                     'title': title,
                     'content': content,
                     'title_html': parse_emoji(title),
                     'content_html': content_html}
     return {'r': 1}