mirror of
https://github.com/TrentSPalmer/trentpalmerdotorg.git
synced 2024-11-21 09:01:31 -08:00
add about/apps
This commit is contained in:
parent
a26348b001
commit
2d1c912be2
0
about/__init__.py
Normal file
0
about/__init__.py
Normal file
3
about/admin.py
Normal file
3
about/admin.py
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
from django.contrib import admin
|
||||||
|
|
||||||
|
# Register your models here.
|
6
about/apps.py
Normal file
6
about/apps.py
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
from django.apps import AppConfig
|
||||||
|
|
||||||
|
|
||||||
|
class AboutConfig(AppConfig):
|
||||||
|
default_auto_field = 'django.db.models.BigAutoField'
|
||||||
|
name = 'about'
|
0
about/migrations/__init__.py
Normal file
0
about/migrations/__init__.py
Normal file
3
about/models.py
Normal file
3
about/models.py
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# from django.db import models
|
||||||
|
|
||||||
|
# Create your models here.
|
27
about/templates/about/apps.html
Normal file
27
about/templates/about/apps.html
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
{% extends "base.html" %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
{% include "base_navbar.html" %}
|
||||||
|
{% include "base_heading.html" %}
|
||||||
|
<div id="main">
|
||||||
|
<div class="row w-100 mx-0">
|
||||||
|
<div class="col-0 col-sm-3">
|
||||||
|
</div>
|
||||||
|
<div class="col-12 col-sm-6 px-2 mx-0">
|
||||||
|
<h2 class="text-center">Native Android Application</h2>
|
||||||
|
<p class="text-justify">
|
||||||
|
<a href="https://play.google.com/store/apps/details?id=org.trentpalmer.trentreads" target="_blank" rel="noopener noreferrer">
|
||||||
|
You can consume and listen to the audiobooks now using my new native Android Application, Trent Reads.
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
<h2 class="text-center">Podcast Applications</h2>
|
||||||
|
<p class="text-justify">
|
||||||
|
You can also subscribe to each AudioBook individually as a podcast feed using a podcast client.
|
||||||
|
Copy and paste the link for the associated feed into a podcast client.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div class="col-0 col-sm-3">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endblock content %}
|
3
about/tests.py
Normal file
3
about/tests.py
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# from django.test import TestCase
|
||||||
|
|
||||||
|
# Create your tests here.
|
8
about/urls.py
Normal file
8
about/urls.py
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
from django.urls import path
|
||||||
|
from . import views
|
||||||
|
|
||||||
|
app_name = "about"
|
||||||
|
|
||||||
|
urlpatterns = [
|
||||||
|
path('apps/', views.apps, name='apps'),
|
||||||
|
]
|
5
about/views.py
Normal file
5
about/views.py
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
from django.shortcuts import render
|
||||||
|
|
||||||
|
|
||||||
|
def apps(request):
|
||||||
|
return render(request, 'about/apps.html')
|
@ -2,4 +2,5 @@ from django.apps import AppConfig
|
|||||||
|
|
||||||
|
|
||||||
class AudioConfig(AppConfig):
|
class AudioConfig(AppConfig):
|
||||||
|
default_auto_field = 'django.db.models.BigAutoField'
|
||||||
name = 'audio'
|
name = 'audio'
|
||||||
|
@ -23,7 +23,8 @@
|
|||||||
<p class="text-center mb-2 mt-3">{{ i.created_on }}</p>
|
<p class="text-center mb-2 mt-3">{{ i.created_on }}</p>
|
||||||
<div class="d-flex flex-row justify-content-around align-items-center">
|
<div class="d-flex flex-row justify-content-around align-items-center">
|
||||||
<p class="mb-1"><a type="button" class="btn btn-dark" href="{% url 'audio:feed' pk=i.pk slug=i.slug %}">Items</a></p>
|
<p class="mb-1"><a type="button" class="btn btn-dark" href="{% url 'audio:feed' pk=i.pk slug=i.slug %}">Items</a></p>
|
||||||
<p class="mb-1"><a type="button" class="btn btn-dark" href="#x{{ i.slug }}-rss" data-toggle="collapse">PodCast</a></p>
|
<p class="mb-1"><a type="button" class="btn btn-dark" href="{% url 'about:apps' %}">Apps</a></p>
|
||||||
|
<p class="mb-1"><a type="button" class="btn btn-dark" href="#x{{ i.slug }}-rss" data-toggle="collapse">Pod</a></p>
|
||||||
</div>
|
</div>
|
||||||
<a href="#x{{ i.slug }}-attributions" data-toggle="collapse" class="text-center text-dark" style="text-decoration: underline">license/attribution</a>
|
<a href="#x{{ i.slug }}-attributions" data-toggle="collapse" class="text-center text-dark" style="text-decoration: underline">license/attribution</a>
|
||||||
</div>
|
</div>
|
||||||
|
@ -47,7 +47,8 @@
|
|||||||
<p class="mb-1"><a type="button" class="btn btn-dark" href="{% url 'audio:feed' pk=j.feed.id slug=j.feed.slug %}">Feed</a></p>
|
<p class="mb-1"><a type="button" class="btn btn-dark" href="{% url 'audio:feed' pk=j.feed.id slug=j.feed.slug %}">Feed</a></p>
|
||||||
<p class="mb-1"><a type="button" class="btn btn-dark" href="#x{{ j.slug }}-rss" data-toggle="collapse">Pod</a></p>
|
<p class="mb-1"><a type="button" class="btn btn-dark" href="#x{{ j.slug }}-rss" data-toggle="collapse">Pod</a></p>
|
||||||
{% else %}
|
{% else %}
|
||||||
<p class="mb-1"><a type="button" class="btn btn-dark" href="#x{{ j.slug }}-rss" data-toggle="collapse">PodCast</a></p>
|
<p class="mb-1"><a type="button" class="btn btn-dark" href="{% url 'about:apps' %}">Apps</a></p>
|
||||||
|
<p class="mb-1"><a type="button" class="btn btn-dark" href="#x{{ j.slug }}-rss" data-toggle="collapse">Pod</a></p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
<a href="#x{{ j.slug }}-attributions" data-toggle="collapse" class="text-center text-dark" style="text-decoration: underline">license/attribution</a>
|
<a href="#x{{ j.slug }}-attributions" data-toggle="collapse" class="text-center text-dark" style="text-decoration: underline">license/attribution</a>
|
||||||
|
@ -34,8 +34,9 @@ def episode(request, pk, slug):
|
|||||||
return render(
|
return render(
|
||||||
request, 'audio/index.html',
|
request, 'audio/index.html',
|
||||||
{
|
{
|
||||||
'episodes': (episode, ), 'IMAGES_URL': IMAGES_URL, 'is_episode': True,
|
'episodes': (episode, ), 'IMAGES_URL': IMAGES_URL,
|
||||||
'MP3_URL': MP3_URL, 'title': episode.title, 'heading': episode.title,
|
'is_episode': True, 'MP3_URL': MP3_URL,
|
||||||
|
'title': episode.title, 'heading': episode.title,
|
||||||
'ogtitle': episode.title, 'ogurl': og_url, 'ogmp3': episode.mp3,
|
'ogtitle': episode.title, 'ogurl': og_url, 'ogmp3': episode.mp3,
|
||||||
'feed': episode.feed, 'twitter_image': episode.image,
|
'feed': episode.feed, 'twitter_image': episode.image,
|
||||||
})
|
})
|
||||||
@ -53,9 +54,10 @@ def feed_list_api(request):
|
|||||||
feeds = Feed.objects.all().order_by('created_on')
|
feeds = Feed.objects.all().order_by('created_on')
|
||||||
result = []
|
result = []
|
||||||
for feed in feeds:
|
for feed in feeds:
|
||||||
|
x = reverse('audio:rss', kwargs={'slug': feed.slug})
|
||||||
result.append({
|
result.append({
|
||||||
'title': feed.title,
|
'title': feed.title,
|
||||||
'read_by': feed.user.username,
|
'read_by': feed.user.username,
|
||||||
'rss_feed': f'{get_current_site(request)}' + reverse('audio:rss', kwargs={'slug': feed.slug})
|
'rss_feed': f'{get_current_site(request)}' + x
|
||||||
})
|
})
|
||||||
return JsonResponse(result, safe=False)
|
return JsonResponse(result, safe=False)
|
||||||
|
@ -33,6 +33,7 @@ INSTALLED_APPS = [
|
|||||||
'crispy_forms',
|
'crispy_forms',
|
||||||
'audio.apps.AudioConfig',
|
'audio.apps.AudioConfig',
|
||||||
'accounts.apps.AccountsConfig',
|
'accounts.apps.AccountsConfig',
|
||||||
|
'about.apps.AboutConfig',
|
||||||
'storages',
|
'storages',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
{% url 'audio:new_feed' as new_feed_url %}
|
{% url 'audio:new_feed' as new_feed_url %}
|
||||||
{% url 'audio:feeds' as feeds_url %}
|
{% url 'audio:feeds' as feeds_url %}
|
||||||
{% url 'accounts:register' as register_url %}
|
{% url 'accounts:register' as register_url %}
|
||||||
|
{% url 'about:apps' as apps_url %}
|
||||||
|
|
||||||
{% if request.path == home_url %}
|
{% if request.path == home_url %}
|
||||||
Home
|
Home
|
||||||
@ -37,6 +38,8 @@
|
|||||||
Feeds
|
Feeds
|
||||||
{% elif request.path == register_url %}
|
{% elif request.path == register_url %}
|
||||||
Register
|
Register
|
||||||
|
{% elif request.path == apps_url %}
|
||||||
|
Applications
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{{ title }}
|
{{ title }}
|
||||||
|
@ -1,18 +1,9 @@
|
|||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row justify-content-center my-2 mx-0">
|
<div class="row justify-content-center my-2 mx-0">
|
||||||
<h1 class="text-center">
|
<h1 class="text-center">
|
||||||
{% url 'accounts:login' as login_url %}
|
|
||||||
{% url 'accounts:edit_profile' as edit_profile_url %}
|
|
||||||
{% url 'accounts:password_change' as password_change_url %}
|
|
||||||
{% url 'accounts:enable_totp' as enable_totp_url %}
|
|
||||||
{% url 'accounts:disable_totp' as disable_totp_url %}
|
|
||||||
{% url 'audio:new_feed' as new_feed_url %}
|
|
||||||
{% url 'audio:feeds' as feeds_url %}
|
|
||||||
{% url 'audio:home' as home_url %}
|
|
||||||
{% url 'accounts:password_reset' as password_reset_url %}
|
{% url 'accounts:password_reset' as password_reset_url %}
|
||||||
{% url 'accounts:password_reset_done' as password_reset_done_url %}
|
{% url 'accounts:password_reset_done' as password_reset_done_url %}
|
||||||
{% url 'accounts:password_reset_complete' as password_reset_complete_url %}
|
{% url 'accounts:password_reset_complete' as password_reset_complete_url %}
|
||||||
{% url 'accounts:register' as register_url %}
|
|
||||||
|
|
||||||
{% if request.path == login_url %}
|
{% if request.path == login_url %}
|
||||||
Login?
|
Login?
|
||||||
@ -38,6 +29,8 @@
|
|||||||
Password Reset Complete
|
Password Reset Complete
|
||||||
{% elif request.path == register_url %}
|
{% elif request.path == register_url %}
|
||||||
Register?
|
Register?
|
||||||
|
{% elif request.path == apps_url %}
|
||||||
|
Applications
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{{ heading }}
|
{{ heading }}
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
<div class="collapse navbar-collapse" id="navbarNavAltMarkup">
|
<div class="collapse navbar-collapse" id="navbarNavAltMarkup">
|
||||||
<div class="navbar-nav">
|
<div class="navbar-nav">
|
||||||
<a class="nav-item nav-link text-light" href="{% url 'audio:feeds' %}">Feeds</a>
|
<a class="nav-item nav-link text-light" href="{% url 'audio:feeds' %}">Feeds</a>
|
||||||
|
<a class="nav-item nav-link text-light" href="{% url 'about:apps' %}">Apps</a>
|
||||||
<a class="nav-item nav-link text-light" href="https://github.com/TrentSPalmer/trentpalmerdotorg" target="_blank" rel="noopener noreferrer">Fork-About</a>
|
<a class="nav-item nav-link text-light" href="https://github.com/TrentSPalmer/trentpalmerdotorg" target="_blank" rel="noopener noreferrer">Fork-About</a>
|
||||||
{% if user.is_authenticated %}
|
{% if user.is_authenticated %}
|
||||||
<a class="nav-item nav-link text-light" href="{% url 'accounts:logout' %}">Logout</a>
|
<a class="nav-item nav-link text-light" href="{% url 'accounts:logout' %}">Logout</a>
|
||||||
|
@ -20,4 +20,5 @@ urlpatterns = [
|
|||||||
path('admin/', admin.site.urls),
|
path('admin/', admin.site.urls),
|
||||||
path('', include('audio.urls')),
|
path('', include('audio.urls')),
|
||||||
path('accounts/', include('accounts.urls')),
|
path('accounts/', include('accounts.urls')),
|
||||||
|
path('about/', include('about.urls')),
|
||||||
]
|
]
|
||||||
|
Loading…
Reference in New Issue
Block a user