diff options
| author | Bobby <[email protected]> | 2023-05-13 17:47:49 -0400 |
|---|---|---|
| committer | Bobby <[email protected]> | 2023-05-13 17:47:49 -0400 |
| commit | 3f596631c576cac7c89849650217a8fb4167d5fd (patch) | |
| tree | e56288c97b489d7c44ca9f1fd2ff47cf1313e985 | |
| parent | eaef978dc6bc95cb7302990d5451fe5b0101d2ef (diff) | |
| download | thatcomputerscientist-3f596631c576cac7c89849650217a8fb4167d5fd.tar.xz thatcomputerscientist-3f596631c576cac7c89849650217a8fb4167d5fd.zip | |
Generic Refactoring. No Functionality or Visual Changes
| -rw-r--r-- | templates/blog/activity.html | 4 | ||||
| -rw-r--r-- | templates/blog/donate.html | 70 | ||||
| -rw-r--r-- | templates/blog/home.html | 8 | ||||
| -rw-r--r-- | templates/blog/partials/base.html | 104 | ||||
| -rw-r--r-- | templates/blog/post.html | 4 |
5 files changed, 96 insertions, 94 deletions
diff --git a/templates/blog/activity.html b/templates/blog/activity.html index 86a3a64a..8f1c9976 100644 --- a/templates/blog/activity.html +++ b/templates/blog/activity.html @@ -41,7 +41,7 @@ {% endif %} <ul> {% for comment in activity_recent_comments %} - <li style="background: #1c1c1c;padding: 20px 10px 10px 10px;margin-bottom: 10px;border-radius: 8px;" + <li style="background: #1c1c1c;padding: 20px 10px 10px 10px;margin-bottom: 10px;border-radius: 8px;"> <p>On <a href="{% url 'blog:post' comment.post.slug %}#comment-{{ comment.id }}">{{ comment.post.title }}</a>: <blockquote style="background: none; margin-top: 15px; padding: 0px 20px; width: 640px; margin-left: 20px;">{{ comment.body|safe }}</blockquote></p> </li> @@ -55,5 +55,7 @@ {% endif %} </div> +{% endblock %} +{% block scripts%} {% include 'blog/partials/mathjax.html' %} {% endblock %} diff --git a/templates/blog/donate.html b/templates/blog/donate.html deleted file mode 100644 index 40cff2d9..00000000 --- a/templates/blog/donate.html +++ /dev/null @@ -1,70 +0,0 @@ -{% extends 'blog/partials/base.html' %} {% block content %} -{% load static %} - -{% if not request.GET.payment_intent and request.GET.tab != 'success' and request.GET.tab != 'error' %} -<div id="donation"> - <h2 style="text-transform: none; border: none; padding: 0; font-size: 16px;"> - {% if request.GET.referrer %} - Complete your donation of ${{ amount }}: - {% else %} - Donate to the blog: - {% endif %} - </h2> - <form method="POST" action="{% url 'blog:donate' %}"> - {% csrf_token %} - <table> - {{ payment_form.as_table }} - </table> - <input type="submit" value="Donate" class="button button-special" /> - </form> -</div> -<div id="fineprint" class="mtsbitem"> - <h2>Donation Fine Print</h2> - <ul> - <li>Donations are processed by Stripe, no credit card information is stored on this site.</li> - <li>Donations are processed in INR. All conversions will be made according to the latest rates.</li> - <li>Donations are non-refundable. If you donate by accident, please contact me and I will refund your donation.</li> - </ul> -</div> -<div id="testing-info" class="mtsbitem error"> - <h2>Testing Info</h2> - <p>The current payment form is only for testing purposes. It will not actually process a payment. If you would like to test the payment form, please use the following information:</p> - <ul> - <li>Card Number: 4242 4242 4242 4242</li> - <li>Expiration Date: Any date in the future</li> - <li>CVV: Any 3 digits</li> - </ul> -</div> -{% endif %} - -{% if request.GET.payment_intent and request.GET.tab == 'success' %} -<div id="donation-success" style="width: 400px; margin: 0 auto;"> - <h1>Thank you for your donation!</h1> - <p>Your donation of ${{ request.GET.amount }} has been processed successfully. Thank you for your support! You can find the transaction details below.</p> - <p><b>Transaction ID:</b> {{ request.GET.payment_intent }}</p> - <p><b>Amount:</b> ${{ request.GET.amount }}</p> - <p><b>Amount Charged:</b> INR {{ request.GET.payment_amount }}</p> - <p><b>Payment Method:</b> <span style="text-transform:uppercase">card</span></p> - <p><b>Payment Status:</b> <span style="text-transform:uppercase">success</span></p> - <a href="{% url 'blog:home' %}" class="button button-special" style="text-decoration: none;">Return to Blog</a> - <a href="{% url 'blog:donate' %}" class="button" style="text-decoration: none;">Donate Again</a> -</div> -{% endif %} - -{% if request.GET.tab == 'error' %} -<div id="donation-failed" style="width: 400px; margin: 0 auto;"> - <h1>Donation Failed</h1> - <p>Your donation of ${{ request.GET.amount }} has failed. You can find the transaction details below.</p> - {% if request.GET.payment_intent %} - <p><b>Transaction ID:</b> {{ request.GET.payment_intent }}</p> - {% endif %} - <p><b>Amount:</b> ${{ request.GET.amount }}</p> - <p><b>Amount To Be Charged:</b> INR {{ request.GET.payment_amount }}</p> - <p><b>Payment Method:</b> <span style="text-transform:uppercase">card</span></p> - <p><b>Payment Status:</b> <span style="text-transform:uppercase">failed</span></p> - <p><b>Error Message:</b> {{ request.GET.error }}</p> - <a href="{% url 'blog:donate' %}?amount={{ amount }}" class="button button-special" style="text-decoration: none;">Try Again</a> -</div> -{% endif %} - -{% endblock %} diff --git a/templates/blog/home.html b/templates/blog/home.html index 5509f8ca..5f00f91f 100644 --- a/templates/blog/home.html +++ b/templates/blog/home.html @@ -55,9 +55,11 @@ <h2>Recent Posts</h2> {% include 'blog/partials/post_list.html' %} </div> -{% include 'blog/partials/mathjax.html' %} {% endif %} -<script src="{% static 'js/jquery-1.12.4.min.js' %}"></script> +{% endblock %} + +{% block scripts %} +{% include 'blog/partials/mathjax.html' %} <script type="text/javascript"> var username = "{{ user.username }}" ? "{{ user.username }}" : "Anonymous"; $(document).ready(function() { @@ -76,5 +78,5 @@ }); }); </script> - {% endblock %} + diff --git a/templates/blog/partials/base.html b/templates/blog/partials/base.html index 10592371..af1f4da1 100644 --- a/templates/blog/partials/base.html +++ b/templates/blog/partials/base.html @@ -5,7 +5,7 @@ <meta charset="UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> - <meta name="description"content="{{ request.meta.description }}" /> + <meta name="description" content="{{ request.meta.description }}" /> <meta name="image" content="{{ request.meta.image }}" /> <meta name="url" content="{{ request.meta.url }}" /> <meta name="title" content="{{ request.meta.title }}" /> @@ -19,24 +19,72 @@ <meta name="twitter:image" content="{{ request.meta.image }}" /> <meta name="robots" content="{{ request.meta.robots }}" /> <title>That Computer Scientist - {{ title }}</title> - <link type="text/css" rel="stylesheet" href="{% static 'css/styles.css' %}" /> - <link rel="apple-touch-icon" sizes="180x180" href="{% static 'images/favicons/apple-touch-icon.png' %}"/> - <link rel="icon" type="image/png" sizes="32x32" href="{% static 'images/favicons/favicon-32x32.png' %}"/> - <link rel="icon" type="image/png" sizes="16x16" href="{% static 'images/favicons/favicon-16x16.png' %}"/> - <link rel="manifest" href="{% static 'images/favicons/site.webmanifest' %}"/> + <link + type="text/css" + rel="stylesheet" + href="{% static 'css/styles.css' %}" + /> + <link + rel="apple-touch-icon" + sizes="180x180" + href="{% static 'images/favicons/apple-touch-icon.png' %}" + /> + <link + rel="icon" + type="image/png" + sizes="32x32" + href="{% static 'images/favicons/favicon-32x32.png' %}" + /> + <link + rel="icon" + type="image/png" + sizes="16x16" + href="{% static 'images/favicons/favicon-16x16.png' %}" + /> + <link + rel="manifest" + href="{% static 'images/favicons/site.webmanifest' %}" + /> + <style> + .transition-fade { + transition: 0.4s; + opacity: 1; + } + + html.is-animating .transition-fade { + opacity: 0; + } + </style> </head> <body> - <video id="bg-video" muted autoplay playsinline loop preload="auto" poster="{% static 'images/backgrounds/poster.png' %}"> - <source src="{% static 'videos/background.mp4' %}#t=0.1" type="video/mp4" /> + <video + id="bg-video" + muted + autoplay + playsinline + loop + preload="auto" + poster="{% static 'images/backgrounds/poster.png' %}" + > + <source + src="{% static 'videos/background.mp4' %}#t=0.1" + type="video/mp4" + /> </video> <div id="overlay"></div> <div id="wrap"> <div id="header"> <div id="search-area"> <form action="{% url 'blog:search' %}" method="get" id="search-form"> - <input type="text" name="q" placeholder="Search..." autocomplete="off" value="{{ request.GET.q }}"> + <input + type="text" + name="q" + placeholder="Search..." + autocomplete="off" + value="{{ request.GET.q }}" + /> </form> - </div> + </div> </div> <table id="main-section" cellpadding="0" cellspacing="0"> @@ -44,36 +92,54 @@ <td id="sidebar" valign="top"> {% include 'blog/partials/sidebar.html' %} </td> - <td id="content" valign="top" style="padding-left: 20px;"> + <td id="content" valign="top" style="padding-left: 20px"> {% block content %} {% endblock %} </td> </tr> - </table> + </table> <div id="footer" style="clear: both"> <hr style="margin: 2rem 0" /> <center> {% load ad %} {% for i in '12345789'|make_list %} - <span><img src="{{'buttons'|ad }}" alt="Ad" style="width: 88px; height: 31px;" /></span> + <span + ><img + src="{{'buttons'|ad }}" + alt="Ad" + style="width: 88px; height: 31px" + /></span> {% endfor %} <br /> {% for i in '12345'|make_list %} - <span><img src="{{'buttons'|ad }}" alt="Ad" style="width: 88px; height: 31px;" /></span> + <span + ><img + src="{{'buttons'|ad }}" + alt="Ad" + style="width: 88px; height: 31px" + /></span> {% endfor %} <br /> </center> - <p style="text-align: center; margin-top: 1rem">© {% now "Y" %} That Computer Scientist. Source code available on + <p style="text-align: center; margin-top: 1rem"> + © {% now "Y" %} That Computer Scientist. Source code available on <a href="https://github.com/luciferreeves/thatcomputerscientist" - >GitHub - </a>. All rights reserved. + >GitHub </a + >. All rights reserved. </p> <p style="text-align: center"> <b>PS:</b> The ads shown on this website are fake and purely for - aesthetic purposes. I do not earn any money from them, neither clicking - them will redirect you to any other website. If you have any questions, comments, or concerns about how this site operates and how your data is handled, please check out the <a href="{% url 'blog:policy' %}">site policy</a> page. View <a href="{% url 'django.contrib.sitemaps.views.sitemap' %}">Sitemap</a>. + aesthetic purposes. I do not earn any money from them, neither + clicking them will redirect you to any other website. If you have any + questions, comments, or concerns about how this site operates and how + your data is handled, please check out the + <a href="{% url 'blog:policy' %}">site policy</a> page. View + <a href="{% url 'django.contrib.sitemaps.views.sitemap' %}">Sitemap</a + >. </p> </div> </div> </body> <script src="{% static 'js/oneko.js' %}"></script> + <script src="{% static 'js/jquery-1.12.4.min.js' %}"></script> + {% block scripts %} {% endblock %} </html> diff --git a/templates/blog/post.html b/templates/blog/post.html index 040f9e34..9bbcd674 100644 --- a/templates/blog/post.html +++ b/templates/blog/post.html @@ -113,7 +113,8 @@ <p><em>You must be logged in to leave a comment.</em></p> </div> {% endif %} -<script type="text/javascript" src="/static/js/jquery-1.12.4.min.js"></script> +{% endblock %} +{% block scripts %} <script type="text/javascript"> function editComment(id) { document.getElementById('comment-body-' + id).style.display = 'none'; @@ -180,3 +181,4 @@ {% include 'blog/partials/mathjax.html' %} {% endblock %} + |
