From d2a1812a3844653f7323de187a7d4dea748f44ec Mon Sep 17 00:00:00 2001 From: Sebastian Hugentobler Date: Mon, 18 May 2015 16:36:47 +0200 Subject: [PATCH] even better style xD --- generator.py | 4 ++-- templates/board.html.j2 | 4 ++++ templates/boards.html.j2 | 2 +- templates/thread.html.j2 | 8 ++++++-- templates/user.html.j2 | 39 ++++++++++++++++++++------------------- templates/users.html.j2 | 2 +- 6 files changed, 34 insertions(+), 25 deletions(-) diff --git a/generator.py b/generator.py index 2059d95..f33576b 100755 --- a/generator.py +++ b/generator.py @@ -30,7 +30,7 @@ def tohtml(value): value = re.sub(r'\[url=\/user\/(.*?)\](.*?)\[\/url\]', user_replacer, value) value = re.sub(r'\[url=(.*?)\](.*?)\[/url\]', r'\2', value) value = re.sub(r'\[video\](.*?)\[/video\]', r'\1', value) - value = re.sub(r'\[color=(.*?)\](.*?)\[/color\]', r'\2', value) + value = re.sub(r'\[colour=(.*?)\](.*?)\[/colour\]', r'\2', value) value = re.sub(r'\[b\](.*?)\[/b\]', r'\1', value) value = re.sub(r'\[i\](.*?)\[/i\]', r'\1', value) value = re.sub(r'\[u\](.*?)\[/u\]', r'\1', value) @@ -77,7 +77,7 @@ def render_boards(boards, template_board, template_thread, outpath, title): write_render(rendered_board, os.path.join('board', url_replacer(board['title']) + '.html'), outpath) for thread in board['threads']: - rendered_thread = template_thread.render(thread=thread, title=title + ' - ' + thread['title']) + rendered_thread = template_thread.render(board=board, thread=thread, title=title + ' - ' + thread['title']) write_render(rendered_thread, os.path.join('board', 'thread', url_replacer(thread['title']) + '.html'), outpath) render_boards(board['boards'], template_board, template_thread, outpath, title) diff --git a/templates/board.html.j2 b/templates/board.html.j2 index 9b0e63f..b279fc9 100644 --- a/templates/board.html.j2 +++ b/templates/board.html.j2 @@ -7,6 +7,10 @@ {{ title }} + +
{% if board.boards |length > 0 %}