Example #1
0
 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)
Example #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)
Example #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)
Example #4
0
 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)
Example #5
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
     )
Example #6
0
 def get(self):
     posts = get_all_posts()
     return render_template('index.html', posts=posts)
Example #7
0
 def get(self):
     return render_template('user/settings.html', user=current_user)
Example #8
0
 def get(self):
     return render_template('user/settings.html', user=current_user)
Example #9
0
 def forbidden_page(error):
     return render_template('403.html'), 403
Example #10
0
 def not_found_page(error):
     return render_template('404.html'), 404
Example #11
0
 def not_found_page(error):
     return render_template('404.html'), 404
Example #12
0
 def forbidden_page(error):
     return render_template('403.html'), 403
Example #13
0
def profile():
    return render_template("security/accounts/profile.html")
Example #14
0
def profile():
    return render_template('security/accounts/profile.html')
Example #15
0
 def get(self):
     posts = get_all_posts()
     return render_template('index.html', posts=posts)