even better style xD

This commit is contained in:
Sebastian Hugentobler 2015-05-18 16:36:47 +02:00
parent 07beadbfb9
commit d2a1812a38
6 changed files with 34 additions and 25 deletions

View File

@ -30,7 +30,7 @@ def tohtml(value):
value = re.sub(r'\[url=\/user\/(.*?)\](.*?)\[\/url\]', user_replacer, value)
value = re.sub(r'\[url=(.*?)\](.*?)\[/url\]', r'<a href="\1">\2</a>', value)
value = re.sub(r'\[video\](.*?)\[/video\]', r'<a href="\1">\1</a>', value)
value = re.sub(r'\[color=(.*?)\](.*?)\[/color\]', r'<font color="\1">\2</font>', value)
value = re.sub(r'\[colour=(.*?)\](.*?)\[/colour\]', r'<font color="\1">\2</font>', value)
value = re.sub(r'\[b\](.*?)\[/b\]', r'<b>\1</b>', value)
value = re.sub(r'\[i\](.*?)\[/i\]', r'<i>\1</i>', value)
value = re.sub(r'\[u\](.*?)\[/u\]', r'<u>\1</u>', 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)

View File

@ -7,6 +7,10 @@
<title>{{ title }}</title>
</head>
<body>
<ul>
<li><a href="../boards.html">Boards</a></li>
</ul>
<hr>
{% if board.boards |length > 0 %}
<ul>
{% for board in board.boards %}

View File

@ -14,7 +14,7 @@
<ul>
{% for board in boards %}
<li>
<b><a href={{ "board/" + board.title.replace('/', '_').replace(' ', '_').replace('?', '') + ".html" }}>{{ board.title }}</a></b>
<a href={{ "board/" + board.title |url_replacer + ".html" }}>{{ board.title }}</a><br>
<i>{{ board.description }}</i>
</li>
{% endfor %}

View File

@ -7,10 +7,14 @@
<title>{{ title }}</title>
</head>
<body>
<ul>
<li><a href={{ "../" + board.title |url_replacer + ".html" }}>{{ board.title }}</a></li>
</ul>
<hr>
<h1>{{ thread.title }}</h1>
{% for post in thread.posts %}
<a href="#{{ loop.index }}">{{ loop.index }} - </a>
<b><a name="{{ loop.index }}" href={{ "../../user/" + post.user.name |url_replacer + ".html" }}>{{ post.user.name }}</a></b>
<a href="#{{ loop.index }}">{{ loop.index }} </a><i>by </i>
<a name="{{ loop.index }}" href={{ "../../user/" + post.user.name |url_replacer + ".html" }}>{{ post.user.name }}</a>
<i>({{ post.timestamp | fromunixtime }})</i>
<p>{{ post.message | tohtml }}</p>
{% for attachment in post.attachments %}

View File

@ -1,14 +1,16 @@
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<link href="../board/thread/static/styles.css" rel="stylesheet" type="text/css" />
<title>{{ title }}</title>
</head>
<body>
<ul>
<li><a href="../users.html">Users</a></li>
</ul>
<hr>
<h1>{{ user.name }}</h1>
<h3>{{ user.status }}</h3>
<p>
@ -18,5 +20,4 @@
<hr>
<i>{{ user.signature | tohtml }}</i> {% endif %}
</body>
</html>

View File

@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<link href="../../board/thread/static/styles.css" rel="stylesheet" type="text/css" />
<link href="board/thread/static/styles.css" rel="stylesheet" type="text/css" />
<title>{{ title }}</title>
</head>
<body>