From 07beadbfb99a68b108756ed21a17002ceeb852eb Mon Sep 17 00:00:00 2001 From: Sebastian Hugentobler Date: Mon, 18 May 2015 16:18:04 +0200 Subject: [PATCH 01/10] use seperate css file --- templates/board.html.j2 | 17 +---------------- templates/boards.html.j2 | 17 +---------------- templates/thread.html.j2 | 17 +---------------- templates/user.html.j2 | 17 +---------------- templates/users.html.j2 | 17 +---------------- 5 files changed, 5 insertions(+), 80 deletions(-) diff --git a/templates/board.html.j2 b/templates/board.html.j2 index a03498e..9b0e63f 100644 --- a/templates/board.html.j2 +++ b/templates/board.html.j2 @@ -3,22 +3,7 @@ - + {{ title }} diff --git a/templates/boards.html.j2 b/templates/boards.html.j2 index c0b9472..8976959 100644 --- a/templates/boards.html.j2 +++ b/templates/boards.html.j2 @@ -3,22 +3,7 @@ - + {{ title }} diff --git a/templates/thread.html.j2 b/templates/thread.html.j2 index e8a8e49..016818f 100644 --- a/templates/thread.html.j2 +++ b/templates/thread.html.j2 @@ -3,22 +3,7 @@ - + {{ title }} diff --git a/templates/user.html.j2 b/templates/user.html.j2 index 77d4eb0..f3ec4ef 100644 --- a/templates/user.html.j2 +++ b/templates/user.html.j2 @@ -4,22 +4,7 @@ - + {{ title }} diff --git a/templates/users.html.j2 b/templates/users.html.j2 index 829e60d..8a816be 100644 --- a/templates/users.html.j2 +++ b/templates/users.html.j2 @@ -3,22 +3,7 @@ - + {{ title }} From d2a1812a3844653f7323de187a7d4dea748f44ec Mon Sep 17 00:00:00 2001 From: Sebastian Hugentobler Date: Mon, 18 May 2015 16:36:47 +0200 Subject: [PATCH 02/10] 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 %}