mirror of
https://github.com/TrentSPalmer/trentpalmerdotorg.git
synced 2024-12-21 12:32:49 -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):
|
||||
default_auto_field = 'django.db.models.BigAutoField'
|
||||
name = 'audio'
|
||||
|
@ -23,7 +23,8 @@
|
||||
<p class="text-center mb-2 mt-3">{{ i.created_on }}</p>
|
||||
<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="#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>
|
||||
<a href="#x{{ i.slug }}-attributions" data-toggle="collapse" class="text-center text-dark" style="text-decoration: underline">license/attribution</a>
|
||||
</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="#x{{ j.slug }}-rss" data-toggle="collapse">Pod</a></p>
|
||||
{% 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 %}
|
||||
</div>
|
||||
<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(
|
||||
request, 'audio/index.html',
|
||||
{
|
||||
'episodes': (episode, ), 'IMAGES_URL': IMAGES_URL, 'is_episode': True,
|
||||
'MP3_URL': MP3_URL, 'title': episode.title, 'heading': episode.title,
|
||||
'episodes': (episode, ), 'IMAGES_URL': IMAGES_URL,
|
||||
'is_episode': True, 'MP3_URL': MP3_URL,
|
||||
'title': episode.title, 'heading': episode.title,
|
||||
'ogtitle': episode.title, 'ogurl': og_url, 'ogmp3': episode.mp3,
|
||||
'feed': episode.feed, 'twitter_image': episode.image,
|
||||
})
|
||||
@ -53,9 +54,10 @@ def feed_list_api(request):
|
||||
feeds = Feed.objects.all().order_by('created_on')
|
||||
result = []
|
||||
for feed in feeds:
|
||||
x = reverse('audio:rss', kwargs={'slug': feed.slug})
|
||||
result.append({
|
||||
'title': feed.title,
|
||||
'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)
|
||||
|
@ -33,6 +33,7 @@ INSTALLED_APPS = [
|
||||
'crispy_forms',
|
||||
'audio.apps.AudioConfig',
|
||||
'accounts.apps.AccountsConfig',
|
||||
'about.apps.AboutConfig',
|
||||
'storages',
|
||||
]
|
||||
|
||||
|
@ -16,6 +16,7 @@
|
||||
{% url 'audio:new_feed' as new_feed_url %}
|
||||
{% url 'audio:feeds' as feeds_url %}
|
||||
{% url 'accounts:register' as register_url %}
|
||||
{% url 'about:apps' as apps_url %}
|
||||
|
||||
{% if request.path == home_url %}
|
||||
Home
|
||||
@ -37,6 +38,8 @@
|
||||
Feeds
|
||||
{% elif request.path == register_url %}
|
||||
Register
|
||||
{% elif request.path == apps_url %}
|
||||
Applications
|
||||
{% endif %}
|
||||
|
||||
{{ title }}
|
||||
|
@ -1,18 +1,9 @@
|
||||
<div class="container">
|
||||
<div class="row justify-content-center my-2 mx-0">
|
||||
<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_done' as password_reset_done_url %}
|
||||
{% url 'accounts:password_reset_complete' as password_reset_complete_url %}
|
||||
{% url 'accounts:register' as register_url %}
|
||||
|
||||
{% if request.path == login_url %}
|
||||
Login?
|
||||
@ -38,6 +29,8 @@
|
||||
Password Reset Complete
|
||||
{% elif request.path == register_url %}
|
||||
Register?
|
||||
{% elif request.path == apps_url %}
|
||||
Applications
|
||||
{% endif %}
|
||||
|
||||
{{ heading }}
|
||||
|
@ -7,6 +7,7 @@
|
||||
<div class="collapse navbar-collapse" id="navbarNavAltMarkup">
|
||||
<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 '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>
|
||||
{% if user.is_authenticated %}
|
||||
<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('', include('audio.urls')),
|
||||
path('accounts/', include('accounts.urls')),
|
||||
path('about/', include('about.urls')),
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user