Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions ohmg/accounts/urls.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from django.urls import include, path
from django.views.generic import RedirectView

from .views import OHMGSignupView, ProfilesView, ProfileView

Expand All @@ -9,8 +8,4 @@
path("account/", include("allauth.urls")),
path("profile/<str:username>/", ProfileView.as_view(), name="profile_detail"),
path("profiles/", ProfilesView.as_view(), name="profiles"),
## these are all past versions of the profiles page
path("participants/", RedirectView.as_view(pattern_name="profiles", permanent=False)),
path("participation/", RedirectView.as_view(pattern_name="profiles", permanent=False)),
path("people/", RedirectView.as_view(pattern_name="profiles", permanent=False)),
]
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,23 @@

$: blogItems = [];

fetch('https://blog.oldinsurancemaps.net/rss.xml')
fetch('https://blog.oldinsurancemaps.net/feed.xml')
.then((response) => response.text())
.then((str) => new window.DOMParser().parseFromString(str, 'text/xml'))
.then((data) => {
const items = data.querySelectorAll('item');
items.forEach((el) => {
blogItems = [
...blogItems,
{
title: el.querySelector('title').innerHTML,
link: el.querySelector('link').innerHTML,
pubDate: el.querySelector('pubDate').innerHTML,
date: new Date(el.querySelector('pubDate').innerHTML).toDateString(),
},
];
if (el.querySelector('title').innerHTML) {
blogItems = [
...blogItems,
{
title: el.querySelector('title').innerHTML,
link: el.querySelector('link').innerHTML,
pubDate: el.querySelector('pubDate').innerHTML,
date: new Date(el.querySelector('pubDate').innerHTML).toDateString(),
},
];
}
});
blogItems.sort(function (a, b) {
return new Date(b.pubDate) - new Date(a.pubDate);
Expand Down
78 changes: 43 additions & 35 deletions ohmg/frontend/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,39 +45,47 @@ <h1 style="word-wrap: break-word; display:inline;">OldInsuranceMaps.net</h1>
<section>
<div class="double-column-section" style="padding:0;">
<div style="padding:10px;">
<div style="border-bottom: dashed grey 1px; padding-bottom: 20px;">
{% include '_svelte_component.html' with component_name='LatestBlogPosts' no_css=True %}
</div>
<div class="level is-mobile" style="margin-bottom:0;">
<div class="level-left">
<div class="level-item">
<h3>Newsletter</h3>
</div>
</div>
<div class="level-right">
<div class="level-item">
<a href="/newsletter/{{NEWSLETTER_SLUG}}/archive/" rightArrow={true}>read past newsletters</a>
</div>
</div>
</div>
<form enctype="multipart/form-data" method="post" action="/newsletter/{{NEWSLETTER_SLUG}}/subscribe/">
<input type="hidden" name="csrfmiddlewaretoken" value={{csrf_token}} />
<label for="id_email_field" style="margin-right:0; font-size: 1.15em;">Subscribe:</label>
<input
type="email"
name="email_field"
required=""
id="id_email_field"
disabled={{USER_SUBSCRIBED}}
/>
{%if USER_SUBSCRIBED %}
<a href="/newsletter/{{NEWSLETTER_SLUG}}">manage your subscription</a>
{% else %}
<button id="id_submit" title="Subscribe to newsletter" name="submit" value="Subscribe" type="submit"
>Subscribe</button
>
{% endif %}
</form>
<div style="padding-bottom: 20px;">
{% include '_svelte_component.html' with component_name='LatestBlogPosts' no_css=True %}
</div>
{% if NEWSLETTER_SLUG %}
<div class="level is-mobile" style="margin-bottom:0;">
<div class="level-left">
<div class="level-item">
<h3>Newsletter</h3>
</div>
</div>
<div class="level-right">
<div class="level-item">
<a href="/newsletter/{{NEWSLETTER_SLUG}}/archive/" rightArrow={true}>read past newsletters</a>
</div>
</div>
</div>
<form enctype="multipart/form-data" method="post" action="/newsletter/{{NEWSLETTER_SLUG}}/subscribe/">
<input type="hidden" name="csrfmiddlewaretoken" value={{csrf_token}} />
<label for="id_email_field" style="margin-right:0; font-size: 1.15em;">Subscribe:</label>
<input
type="email"
name="email_field"
required=""
id="id_email_field"
{% if USER_SUBSCRIBED %}
disabled
{% endif %}
/>
{%if USER_SUBSCRIBED %}
<a href="/newsletter/{{NEWSLETTER_SLUG}}">manage your subscription</a>
{% else %}
{% if PROSOPO_SITE_KEY %}
{% include '_captcha_submit.html' %}
{% else %}
<button id="id_submit" title="Subscribe to newsletter" name="submit" value="Subscribe" type="submit"
>Subscribe</button
>
{% endif %}
{% endif %}
</form>
{% endif %}
</div>
<div class="hidden-mobile" style="padding:0;">
<div style="padding:10px; min-height:75px;">
Expand Down Expand Up @@ -110,8 +118,8 @@ <h3>{{MAP_CT}} maps in {{PLACES_CT}} cities</h3>
</section>
<section id="who">
<div>
<h2>Who uses this platform?</h2>
<p>Here's how some organizations have used <em>OldInsuranceMaps.net</em> to support their research and community mapping efforts.</p>
<h2>Who uses <em>OldInsuranceMaps.net?</em></h2>
<p>Here's how some organizations have used this platform to support their research and community mapping efforts.</p>
{% for partner in PARTNERS %}
<article class="media partner-listing" style="margin-top:15px;">
{% if partner.logo_url %}
Expand Down
4 changes: 2 additions & 2 deletions ohmg/frontend/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
from django.views.generic import RedirectView, TemplateView

from .converters import PageConverter

# from .models import Redirect
from .sitemap import sitemaps
from .views import (
ActivityView,
Expand All @@ -20,8 +22,6 @@
path("activity/", ActivityView.as_view(), name="activity"),
path("search/", Browse.as_view(), name="search"),
path("<page-slug:page>/", PageView.as_view(), name="page-view"),
# make sure old links go to the proper page, use permanent=False for now...
path("browse/", RedirectView.as_view(pattern_name="search"), name="browse"),
## conventional url paths
path(
"robots.txt",
Expand Down
2 changes: 2 additions & 0 deletions ohmg/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
"django.contrib.auth",
"django.contrib.sessions",
"django.contrib.sites",
"django.contrib.redirects",
"django.contrib.admin",
"django.contrib.sitemaps",
"django.contrib.staticfiles",
Expand Down Expand Up @@ -256,6 +257,7 @@
"django.contrib.auth.middleware.AuthenticationMiddleware",
"django.middleware.clickjacking.XFrameOptionsMiddleware",
"django.middleware.security.SecurityMiddleware",
"django.contrib.redirects.middleware.RedirectFallbackMiddleware",
"ohmg.conf.middleware.CORSMiddleware",
)

Expand Down