]> git.ipfire.org Git - ipfire.org.git/commitdiff
blog: Drop authors page and link to user's page
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 26 Jul 2023 14:27:24 +0000 (14:27 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 26 Jul 2023 14:27:24 +0000 (14:27 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Makefile.am
src/templates/blog/author.html [deleted file]
src/templates/blog/modules/list.html
src/templates/blog/modules/post.html
src/templates/blog/post.html
src/web/__init__.py
src/web/blog.py

index 33d4eec2194395b1526fc41065b5154e14b18a5a..8b2766322302637f425aaad6b2517e3850f268a2 100644 (file)
@@ -145,7 +145,6 @@ templates_auth_modules_DATA = \
 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 \
diff --git a/src/templates/blog/author.html b/src/templates/blog/author.html
deleted file mode 100644 (file)
index 86af62d..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-{% 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 %}
index 6d704b42560a09c94a7835abc78e7e90c333a5c7..3980591a985bf74926130296acd83a62d914b418 100644 (file)
@@ -12,7 +12,7 @@
                        {% 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>
index 004e7bbb60556a5438ab3d0e4e6773786737f070..41e4b4d9a1a287e79c48354b38d8d9ec239b3376 100644 (file)
@@ -12,7 +12,7 @@
                        {{ _("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 %}
index 8865998f1976da2dbd1d24f29b3567c993fa823d..be74862da298a45166daa2c32873102a17b30150 100644 (file)
@@ -60,7 +60,7 @@
                                        {{ _("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 %}
index 4c59132f0b34be45ce1702d531044501e6a24b8e..9041b861953d9ab87dca8f35175efd68d9a4f823 100644 (file)
@@ -126,7 +126,6 @@ class Application(tornado.web.Application):
 
                        # 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),
@@ -195,6 +194,7 @@ class Application(tornado.web.Application):
                        (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}" }),
index 365888f4acbfd17e9a88bb8250cdc5b987fccb98..fe88fdae844cf2fc9236b3706b6af4d58ecbcacf 100644 (file)
@@ -29,24 +29,6 @@ class IndexHandler(base.BaseHandler):
                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)