diff options
| author | Bobby <[email protected]> | 2023-04-27 21:56:34 -0400 |
|---|---|---|
| committer | Bobby <[email protected]> | 2023-04-27 21:56:34 -0400 |
| commit | 714953207a6c01d88c826206a41423a597a2ca2c (patch) | |
| tree | e3f907bf716db7d2c5dff95c27afa1845ee0468f | |
| parent | 72ec724bd66aaab64eb7c618400d1b25078ebd49 (diff) | |
| download | thatcomputerscientist-714953207a6c01d88c826206a41423a597a2ca2c.tar.xz thatcomputerscientist-714953207a6c01d88c826206a41423a597a2ca2c.zip | |
small fixes
| -rw-r--r-- | blog/context_processors.py | 2 | ||||
| -rw-r--r-- | templates/blog/partials/sidebar.html | 46 |
2 files changed, 23 insertions, 25 deletions
diff --git a/blog/context_processors.py b/blog/context_processors.py index 968034b4..e59e6300 100644 --- a/blog/context_processors.py +++ b/blog/context_processors.py @@ -82,7 +82,7 @@ def comment_processor(comment): # any text between ``` and ``` must be highlighted as code code_blocks = re.findall(r'```(.+?)```', comment, re.DOTALL) for code_block in code_blocks: - comment = comment.replace('```' + code_block + '```', highlight_code_blocks(code_block)) + comment = comment.replace('```' + code_block + '```', highlight_code_blocks(code_block.replace('<', '<').replace('>', '>'))) # retain line breaks, for every newline character, add a <br> tag comment = comment.replace('\n', '<br>') diff --git a/templates/blog/partials/sidebar.html b/templates/blog/partials/sidebar.html index 3e0ea796..5525b6c6 100644 --- a/templates/blog/partials/sidebar.html +++ b/templates/blog/partials/sidebar.html @@ -5,28 +5,26 @@ <h2>Login</h2> <form method="post" action="{% url 'users:login' %}" id="login-form"> <input type="hidden" name="csrfmiddlewaretoken" value="{{ csrf_token }}"> - <table style="width: 100%; table-layout: fixed;"> - <tbody> - <tr> - <td style="width: 70px; padding-right: 10px;"><label for="username"><b>Username:</b></label></td> - <td style="padding-top: 10px; width: 160px;"><input style="width: 140px;" type="text" id="username" name="username" placeholder="Username" autocomplete="off" value="{{ request.GET.username }}"></td> - </tr> - <tr> - <td style="width: 70px; padding-right: 10px;"><label for="password"><b>Password:</b></label></td> - <td style="padding-top: 10px; width: 160px;"><input style="width: 140px;" type="password" id="password" name="password" placeholder="Password" autocomplete="off"></td> - </tr> - <tr> - <td style="padding-top: 10px;" colspan="2"> - <input type="hidden" name="next" value="{{ request.path }}"> - <input class="button button-special" type="submit" value="Login"> - {% if not user.is_authenticated %} - <a href="{% url 'blog:register' %}" class="button button" style="text-decoration: none;"> - New User? - </a> - {% endif %} - </td> - </tr> - </tbody> + <table style="width: 250px; border-spacing: 0; border-collapse: separate;"> + <tr> + <td style="width: 70px;"><label for="username"><b>Username:</b></label></td> + <td style="padding-top: 10px; width: 160px;"><input style="width: 150px;" type="text" id="username" name="username" placeholder="Username" autocomplete="off" value="{{ request.GET.username }}"></td> + </tr> + <tr> + <td style="width: 70px;"><label for="password"><b>Password:</b></label></td> + <td style="padding-top: 10px; width: 160px;"><input style="width: 150px;" type="password" id="password" name="password" placeholder="Password" autocomplete="off"></td> + </tr> + <tr> + <td style="padding-top: 10px;" colspan="2"> + <input type="hidden" name="next" value="{{ request.path }}"> + <input class="button button-special" type="submit" value="Login"> + {% if not user.is_authenticated %} + <a href="{% url 'blog:register' %}" class="button button" style="text-decoration: none;"> + New User? + </a> + {% endif %} + </td> + </tr> </table> {% for message in messages %} {% if 'loginError' in message.tags %} @@ -51,8 +49,8 @@ <form action="{% url 'blog:search' %}" method="get"> <table style="width: 250px; border-spacing: 0; border-collapse: separate;"> <tr> - <td style="width: 170px; padding-right: 10px;"> - <input type="text" name="q" placeholder="Search..." autocomplete="off" style="width: 100%; box-sizing: border-box;" value="{{ request.GET.query }}"> + <td style="width: 170px;"> + <input type="text" name="q" placeholder="Search..." autocomplete="off" style="width: 170px; box-sizing: border-box;" value="{{ request.GET.query }}"> </td> <td style="width: 60px;"> <input type="submit" align="center" class="button button-special" value="Search" style="max-width: 60px;"> |
