Skip to content

Commit

Permalink
Merge pull request #147 from stuartmaxwell:base-allow-wide-screen
Browse files Browse the repository at this point in the history
Allow markdown editor to be widescreen
  • Loading branch information
stuartmaxwell authored Nov 21, 2024
2 parents dd5112c + b337ea5 commit 3480f98
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 76 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
<script type="module" src="https://pyscript.net/releases/2024.6.1/core.js"></script>
{% endblock head %}

{% block main_classes %}container-fluid{% endblock %}

{% block content %}

<h1>Markdown Editor</h1>
Expand Down
146 changes: 73 additions & 73 deletions spf_generator/templates/spf_generator/generator.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,84 +5,84 @@
<script src="https://unpkg.com/[email protected]" integrity="sha384-0895/pl2MU10Hqc6jd4RvrthNlDiE9U1tWmX7WRESftEDRosgxNsQG/Ze9YMRzHq" crossorigin="anonymous"></script>
{% endblock head %}

{% block content %}
<div class="container">
<article>
<header>
<h1>SPF Record Generator</h1>
<p><strong>Please note:</strong> I have made best efforts to ensure the information below is correct. But I highly recommend checking and validating the SPF record before updating it in your DNS. Please contact me if you spot any mistakes.</p>
<p>Select the email services that you use with your domain from the lists below.</p>
</header>

<form hx-post="{% url 'spf_generator:spf_generator' %}"
hx-target="#result">
{% csrf_token %}
{% block main_classes %}container{% endblock %}

{% block content %}
<article>
<header>
<h1>SPF Record Generator</h1>
<p><strong>Please note:</strong> I have made best efforts to ensure the information below is correct. But I highly recommend checking and validating the SPF record before updating it in your DNS. Please contact me if you spot any mistakes.</p>
<p>Select the email services that you use with your domain from the lists below.</p>
</header>

<form hx-post="{% url 'spf_generator:spf_generator' %}"
hx-target="#result">
{% csrf_token %}

<div class="grid">
{% for category, category_name in categories %}
<div>
<article>
<header>
<h2>{{ category_name }}</h2>
</header>
<ul>
{% for field in form %}
{% if field.name|startswith:'provider_' %}
{% with provider=providers|get_provider:field.name %}
{% if provider.category == category %}
<li>
<label>
{{ field }}
<strong{% if field.help_text %} data-tooltip="{{ field.help_text }}"{% endif %}>{{ field.label }}</strong>
</label>
</li>
{% endif %}
{% endwith %}
{% endif %}
{% endfor %}
</ul>
</article>
</div>
{% endfor %}
</div>

<p>Optionally, you can add the IP address of your own server to your SPF record. This is useful if you have a server that sends emails directly to the internet.</p>

<article>
<header>
<h2>Custom Server</h2>
</header>
{{ form.custom_ip }}
{% if form.custom_ip.help_text %}
<small>{{ form.custom_ip.help_text }}</small>
{% endif %}
{% if form.custom_ip.errors %}
<small class="error">{{ form.custom_ip.errors.0 }}</small>
{% endif %}
</article>

<p>Now select the policy you want to apply with this SPF record. This is an important choice and is explained below.</p>

<article>
<header>
<h2>Default Policy</h2>
</header>
<div class="grid">
{% for category, category_name in categories %}
<div>
<article>
<header>
<h2>{{ category_name }}</h2>
</header>
<ul>
{% for field in form %}
{% if field.name|startswith:'provider_' %}
{% with provider=providers|get_provider:field.name %}
{% if provider.category == category %}
<li>
<label>
{{ field }}
<strong{% if field.help_text %} data-tooltip="{{ field.help_text }}"{% endif %}>{{ field.label }}</strong>
</label>
</li>
{% endif %}
{% endwith %}
{% endif %}
{% endfor %}
</ul>
</article>
</div>
{% endfor %}
</div>

<p>Optionally, you can add the IP address of your own server to your SPF record. This is useful if you have a server that sends emails directly to the internet.</p>

<article>
<header>
<h2>Custom Server</h2>
</header>
{{ form.custom_ip }}
{% if form.custom_ip.help_text %}
<small>{{ form.custom_ip.help_text }}</small>
{% endif %}
{% if form.custom_ip.errors %}
<small class="error">{{ form.custom_ip.errors.0 }}</small>
{% endif %}
</article>

<p>Now select the policy you want to apply with this SPF record. This is an important choice and is explained below.</p>

<article>
<header>
<h2>Default Policy</h2>
</header>
<div class="grid">
<div>
{{ form.all_mechanism }}
{% if form.all_mechanism.help_text %}
<small>{{ form.all_mechanism.help_text|safe }}</small>
{% endif %}
</div>
<div>
{{ form.all_mechanism }}
{% if form.all_mechanism.help_text %}
<small>{{ form.all_mechanism.help_text|safe }}</small>
{% endif %}
</div>
</article>
</div>
</article>

<button type="submit">Generate SPF Record</button>
</form>
<button type="submit">Generate SPF Record</button>
</form>

<div id="result" role="alert"></div>
</article>
</div>
<div id="result" role="alert"></div>
</article>

{% endblock content %}

Expand Down
2 changes: 1 addition & 1 deletion templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
{% include "snippets/navbar.html" %}
</header>

<main class="container {% block main_classes %}{% endblock %}">
<main class="{% block main_classes %}{% endblock %}">
{% block content %}
{% endblock content %}
</main>
Expand Down
2 changes: 1 addition & 1 deletion templates/djpress/stuartmnz/base.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% extends 'base.html' %}
{% load djpress_tags %}

{% block main_classes %}main-sidebar{% endblock %}
{% block main_classes %}container main-sidebar{% endblock %}

{% block content %}

Expand Down
1 change: 0 additions & 1 deletion templates/snippets/navbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
<ul>
{% get_pages as pages %}
{% for page in pages %}
<!-- {{ page.title }} - {{ page.is_parent }} -->
{% if page.is_parent %}
<li>
<details class="dropdown">
Expand Down

0 comments on commit 3480f98

Please sign in to comment.