예제 #1
0
파일: post.py 프로젝트: guoyu07/firefly
 def get(self, id):
     post = Post.objects.get_or_404(id=id)
     Post.objects(id=id).update_one(inc__views=1)
     return render_template('posts/detail.html', post=post,
                            Markdown=Markdown, gen_author=gen_author,
                            gen_author_name=gen_author_name,
                            short_timesince=short_timesince)
예제 #2
0
 def get(self, slug):
     category = Category.objects.get_or_404(_slug=slug)
     posts = Post.objects.filter(
         category=category
     ).order_by("-recent_activity_time")
     return render_template('categories/detail.html',
                            category=category.name,
                            posts=posts)
예제 #3
0
 def get(self):
     url = request.args.get('url', '')
     url_pattern = url.rsplit('/', 1)[0]
     keyboards = KEYBOARD_URL_MAPS['default']
     if url_pattern in KEYBOARD_URL_MAPS:
         keyboards += KEYBOARD_URL_MAPS[url_pattern]
     columns = zip(*[iter(keyboards)] * 2)
     return render_template('widgets/keyboard.html', columns=columns)
예제 #4
0
파일: post.py 프로젝트: pino2046/firefly-1
 def get(self, id):
     post = Post.objects.get_or_404(id=id)
     Post.objects(id=id).update_one(inc__views=1)
     return render_template('posts/detail.html',
                            post=post,
                            Markdown=Markdown,
                            gen_author=gen_author,
                            gen_author_name=gen_author_name,
                            short_timesince=short_timesince)
예제 #5
0
파일: keyboard.py 프로젝트: guoyu07/firefly
 def get(self):
     url = request.args.get('url', '')
     url_pattern = url.rsplit('/', 1)[0]
     keyboards = KEYBOARD_URL_MAPS['default']
     if url_pattern in KEYBOARD_URL_MAPS:
         keyboards += KEYBOARD_URL_MAPS[url_pattern]
     columns = zip(*[iter(keyboards)] * 2)
     return render_template(
         'widgets/keyboard.html', columns=columns
     )
예제 #6
0
파일: home.py 프로젝트: pino2046/firefly-1
 def get(self):
     posts = get_all_posts()
     return render_template('index.html', posts=posts)
예제 #7
0
파일: user.py 프로젝트: pino2046/firefly-1
 def get(self):
     return render_template('user/settings.html', user=current_user)
예제 #8
0
파일: user.py 프로젝트: guoyu07/firefly
 def get(self):
     return render_template('user/settings.html', user=current_user)
예제 #9
0
파일: app.py 프로젝트: guoyu07/firefly
 def forbidden_page(error):
     return render_template('403.html'), 403
예제 #10
0
파일: app.py 프로젝트: guoyu07/firefly
 def not_found_page(error):
     return render_template('404.html'), 404
예제 #11
0
파일: app.py 프로젝트: pino2046/firefly-1
 def not_found_page(error):
     return render_template('404.html'), 404
예제 #12
0
파일: app.py 프로젝트: pino2046/firefly-1
 def forbidden_page(error):
     return render_template('403.html'), 403
예제 #13
0
파일: auth.py 프로젝트: soszrg/firefly
def profile():
    return render_template("security/accounts/profile.html")
예제 #14
0
파일: auth.py 프로젝트: pino2046/firefly-1
def profile():
    return render_template('security/accounts/profile.html')
예제 #15
0
파일: home.py 프로젝트: guoyu07/firefly
 def get(self):
     posts = get_all_posts()
     return render_template('index.html', posts=posts)