templates_auth_modulesdir = $(templates_authdir)/modules
templates_blog_DATA = \
- src/templates/blog/author.html \
src/templates/blog/compose.html \
src/templates/blog/delete.html \
src/templates/blog/drafts.html \
+++ /dev/null
-{% extends "../base.html" %}
-
-{% block title %}{{ author }}{% end block %}
-
-{% block container %}
- <section class="hero has-background-primary-light">
- <div class="hero-body">
- <div class="container">
- <nav class="breadcrumb is-medium" aria-label="breadcrumbs">
- <ul>
- <li>
- <a href="/">Home</a>
- </li>
- <li>
- <a href="/blog">Blog</a>
- </li>
- <li class="is-active">
- <a href="#" aria-current="page">{{ author }}</a>
- </li>
- </ul>
- </nav>
- <div class="columns">
- <div class="column is-one-third">
- <figure class="image is-256x256 is-inline-block">
- <img class="is-rounded" src="{{ author.avatar_url(size=256) }}">
- </figure>
- </div>
-
- <div class="column">
- <h2 class="title is-2">{{ author }}</h2>
-
- {% if author.description %}
- <div class="box">
- {% module Markdown(author.description) %}
- </div>
- {% end %}
- </div>
- </div>
- </div>
- </div>
- </section>
-
- <div class="container">
- <section class="section">
- <h3 class="title is-3">{{ _("Posts") }}</h3>
-
- {% module BlogList(posts, show_author=True) %}
- </section>
- </div>
-{% end block %}
{% if "lightningwirelabs.com" in post.tags %}
<span class="has-text-lwl">{{ _("by Lightning Wire Labs") }}</span>
{% elif show_author and post.author %}
- <a href="/blog/authors/{{ post.author.uid }}">{{ _("by %s") % post.author }}</a>
+ <a href="/users/{{ post.author.uid }}">{{ _("by %s") % post.author }}</a>
{% end %}
</h6>
</p>
{{ _("by") }}
{% if isinstance(post.author, accounts.Account) %}
- <a href="/blog/authors/{{ post.author.uid }}">{{ post.author.name }}</a>,
+ <a href="/users/{{ post.author.uid }}">{{ post.author.name }}</a>,
{% else %}
<strong>{{ post.author }}</strong>,
{% end %}
{{ _("by") }}
{% if isinstance(post.author, accounts.Account) %}
- <a href="/blog/authors/{{ post.author.uid }}">{{ post.author.name }}</a>,
+ <a href="/users/{{ post.author.uid }}">{{ post.author.name }}</a>,
{% else %}
<strong>{{ post.author }}</strong>,
{% end %}
# Blog
(r"/blog", blog.IndexHandler),
- (r"/blog/authors/(\w+)", blog.AuthorHandler),
(r"/blog/compose", blog.ComposeHandler),
(r"/blog/drafts", blog.DraftsHandler),
(r"/blog/feed.xml", blog.FeedHandler),
(r"/api/check/uid", auth.APICheckUID),
# Handle old pages that have moved elsewhere
+ (r"/blog/authors/(\w+)", tornado.web.RedirectHandler, { "url" : "/users/{0}" }),
(r"/donation", tornado.web.RedirectHandler, { "url" : "/donate" }),
(r"/download", tornado.web.RedirectHandler, { "url" : "/downloads" }),
(r"/download/([0-9a-z\-\.]+)", tornado.web.RedirectHandler, { "url" : "/downloads/{0}" }),
self.render("blog/index.html", q=q, posts=posts, latest_post=latest_post)
-class AuthorHandler(base.BaseHandler):
- def get(self, uid):
- author = self.accounts.get_by_uid(uid)
- if not author:
- raise tornado.web.HTTPError(404, "User is unknown")
-
- # Get all posts from this author
- posts = self.backend.blog.get_by_author(author)
- if not posts:
- raise tornado.web.HTTPError(404, "User has no posts")
-
- # Allow this to be cached for 10 minutes
- if not self.current_user:
- self.set_expires(600)
-
- self.render("blog/author.html", author=author, posts=posts)
-
-
class FeedHandler(base.BaseHandler):
def get(self):
posts = self.backend.blog.get_newest(limit=10)