Add: tmp templates for furaffinity
This commit is contained in:
parent
6ac3b14545
commit
6beedc9c56
6 changed files with 411 additions and 0 deletions
18
archivist/sites/templates/fa/import.html
Normal file
18
archivist/sites/templates/fa/import.html
Normal file
|
@ -0,0 +1,18 @@
|
|||
<!-- home.html -->
|
||||
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Import | Furaffinity Archive{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="row">
|
||||
<h2>Your att the import screen.</h2>
|
||||
<form method="post" class="mb-3">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<button class="btn btn-primary" type="submit">Save</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
160
archivist/sites/templates/fa/submission_detail.html
Normal file
160
archivist/sites/templates/fa/submission_detail.html
Normal file
|
@ -0,0 +1,160 @@
|
|||
<!-- submission_detail.html -->
|
||||
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}{{submission.title}} by {{submission.artist.artist}} | Submission Detail | Gallery-Archivist{% endblock %}
|
||||
|
||||
{% load custom_filters %}
|
||||
|
||||
{% load static %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col-xl-9">
|
||||
<h1 class="mt-2">{{ submission.title }}</h1>
|
||||
<div id="submission_container">
|
||||
{% if file_url %}
|
||||
{% if file_url|is_image %}
|
||||
<img src="{{ file_url }}" alt="Image" width="100%" height="auto">
|
||||
{% elif submission.file.file.url|is_flash %}
|
||||
<div id="flash_embed"></div>
|
||||
{% elif submission.file.file.url|is_pdf %}
|
||||
<object data="{{ submission.file.file.url }}" type="application/pdf" width="100%" height="600px">
|
||||
<iframe src="{{ submission.file.file.url }}" width="100%" height="100%">
|
||||
This browser does not support PDFs. Please download the PDF to view it:
|
||||
<a href="{{ submission.file.file.url }}">Download PDF</a>
|
||||
</iframe>
|
||||
</object>
|
||||
{% else %}
|
||||
<div class="my-4 justify-content-center text-center">
|
||||
<p>No preview avilable of file.</p>
|
||||
<a class="btn btn-outline-primary" href="{{ file_url }}">Download File</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<p>No file attached.</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="my-2 px-2 border border-2 overflow-y-scroll">
|
||||
{{ submission.description|stylizeDescription|safe }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-xl-3 bg-secondary-subtle border border-2">
|
||||
<div class="mt-2">
|
||||
<div class="row-cols-auto">
|
||||
<a class="btn btn-outline-secondary" href="{% url 'fa:user_page' fa_user=submission.artist.artist_url %}">User Page</a>
|
||||
<a class="btn btn-outline-secondary" href="{{ file_url }}">Download File</a>
|
||||
</div>
|
||||
<div class="m-2 overflow-hidden">
|
||||
<strong>Tags: </strong>
|
||||
{% if submission.tags.exists %}
|
||||
{% for tag in submission.tags.all %}
|
||||
<span class="">
|
||||
<a class="badge bg-primary tag" href="{% url 'fa:tag_details' tag.tag_slug %}">{{ tag.tag|capfirst }}</a>
|
||||
</span>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<span class="badge bg-secondary">This submission has no tags</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="">
|
||||
<div>
|
||||
<strong class="text-info">Category:</strong>
|
||||
<span class="">{{ submission.fa_category }}</span>
|
||||
</div>
|
||||
<div>
|
||||
<strong class="text-info">Species:</strong>
|
||||
<span class="">{{ submission.species }}</span>
|
||||
</div>
|
||||
<div>
|
||||
<strong class="text-info">Gender:</strong>
|
||||
<span class="">{{ submission.gender }}</span>
|
||||
</div>
|
||||
<div>
|
||||
<strong class="text-info">Size:</strong>
|
||||
<span class="">{{ submission.image_width }} x {{ submission.image_height }}</span>
|
||||
</div>
|
||||
<div class="separator"></div>
|
||||
<div>
|
||||
<strong class="text-info">Mature Rating:</strong>
|
||||
<span class="badge bg-secondary text-2xl">{{ submission.mature_rating.mature }}</span>
|
||||
</div>
|
||||
<div>
|
||||
<strong class="text-info">Orginal Date:</strong>
|
||||
<span class="">{{ submission.date |date:'Y-m-d H:i:s' }}</span>
|
||||
</div>
|
||||
<div>
|
||||
<strong class="text-info">Archive date:</strong>
|
||||
<span class="">{{ submission.date_added |date:'Y-m-d H:i:s' }}</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<a class="btn btn-outline-danger" href="https://www.furaffinity.net/view/{{submission.submission_id}}" target="_blank" rel="noopener noreferrer">View on Furaffinity...</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block scripts %}
|
||||
<script>
|
||||
|
||||
var flash_embed = document.getElementById('flash_embed');
|
||||
|
||||
if (flash_embed) {
|
||||
window.RufflePlayer = window.RufflePlayer || {};
|
||||
window.RufflePlayer.config = {
|
||||
"wmode": "direct",
|
||||
"quality": "high",
|
||||
}
|
||||
window.addEventListener("load", (event) => {
|
||||
const ruffle = window.RufflePlayer.newest();
|
||||
const player = ruffle.createPlayer();
|
||||
const container = document.getElementById("flash_embed");
|
||||
container.appendChild(player);
|
||||
//player.style.width = "auto";
|
||||
player.style.width = "{{ submission.image_width }}px";
|
||||
player.style.height = "{{ submission.image_height }}px";
|
||||
player.load("{{ submission.file.file.url }}").then(() => {
|
||||
console.info("Ruffle successfully loaded the file");
|
||||
}).catch((e) => {
|
||||
console.error(`Ruffle failed to load the file: ${e}`);
|
||||
});
|
||||
/* player.addEventListener('loadedmetadata', () => {
|
||||
console.info(player.metadata.isActionScript3);
|
||||
console.info(player.metadata.isPlaying);
|
||||
}); */
|
||||
});
|
||||
|
||||
|
||||
function resizeFlashEmbed() {
|
||||
var submission_container = document.getElementById("submission_container");
|
||||
var flash_embed = document.getElementById('flash_embed');
|
||||
var flash_embed_player = flash_embed.firstChild
|
||||
|
||||
var flash_width = parseInt("{{ submission.image_width }}");
|
||||
var flash_height = parseInt("{{ submission.image_height }}");
|
||||
|
||||
var container_width = submission_container.offsetWidth;
|
||||
var container_height = submission_container.offsetHeight;
|
||||
|
||||
if (flash_width < flash_height) {
|
||||
var originalAspectRatio = flash_height / flash_width;
|
||||
} else {
|
||||
var originalAspectRatio = flash_width / flash_height;
|
||||
};
|
||||
|
||||
flash_embed_player.style.width = container_width + 'px';
|
||||
flash_embed_player.style.height = (container_width * originalAspectRatio) + 'px';
|
||||
}
|
||||
|
||||
// Call the function on page load and window resize
|
||||
window.addEventListener('load', resizeFlashEmbed);
|
||||
window.addEventListener('resize', resizeFlashEmbed);
|
||||
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
<script src="{% static 'libs/ruffle-nightly-2023_05_04-web-selfhosted/ruffle.js' %}"></script>
|
||||
{% endblock %}
|
35
archivist/sites/templates/fa/tag_details.html
Normal file
35
archivist/sites/templates/fa/tag_details.html
Normal file
|
@ -0,0 +1,35 @@
|
|||
<!-- tag_details.html -->
|
||||
|
||||
<!-- tags.html -->
|
||||
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}{{ tag.tag}} | Tag Details | Gallery-Archivist{% endblock %}
|
||||
|
||||
{% load custom_filters %}
|
||||
|
||||
{% load static %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="row">
|
||||
<a href="{% url 'fa:tags' %}">Back to Tags Page</a>
|
||||
<h1>{{ tag.tag }}</h1>
|
||||
<h2>Submissions</h2>
|
||||
{% if submissions %}
|
||||
<ul>
|
||||
{% for submission in submissions %}
|
||||
<li>
|
||||
<a href="{% url 'fa:submission_detail' submission_id=submission.submission_id %}">{{ submission.title }} by {{ submission.artist.artist }}</a>
|
||||
<p>{{ submission.description|truncatechars:100 }}</p>
|
||||
</li>
|
||||
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% else %}
|
||||
<p>No submissions yet.</p>
|
||||
{% endif %}
|
||||
<a href="https://www.furaffinity.net/view/">View on Furaffinity..</a>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
50
archivist/sites/templates/fa/tags.html
Normal file
50
archivist/sites/templates/fa/tags.html
Normal file
|
@ -0,0 +1,50 @@
|
|||
<!-- tags.html -->
|
||||
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %} Tags {% endblock %}
|
||||
|
||||
{% load custom_filters %}
|
||||
|
||||
{% load static %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<strong>Furaffinity's Tag list:</strong>
|
||||
<div class="m-2 overflow-hidden">
|
||||
{% if list_tags %}
|
||||
{% for tag in list_tags %}
|
||||
<span class="">
|
||||
<a class="badge bg-primary tag" href="{% url 'fa:tag_details' tag.tag_slug %}">{{ tag.tag|capfirst }}</a>
|
||||
</span>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<span class="badge bg-secondary">This submission has no tags</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% comment %} <ul>
|
||||
{% for tag in list_tags %}
|
||||
<li><a href="{% url 'fa:tag_details' tag.tag_slug %}">{{ tag.tag }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
<div>
|
||||
<strong>Tags:</strong>
|
||||
{% for tag in list_tags %}
|
||||
<span class="badge bg-primary">{{ tag.name }}</span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
<p>No tags available.</p> {% endcomment %}
|
||||
<div>
|
||||
<p>Links:</p>
|
||||
<ul>
|
||||
<li><a href="users">Users</a></li>
|
||||
<li><a href="config">Config</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
129
archivist/sites/templates/fa/user_page.html
Normal file
129
archivist/sites/templates/fa/user_page.html
Normal file
|
@ -0,0 +1,129 @@
|
|||
<!-- user_page.html -->
|
||||
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}{{ user.artist }}'s User Page{% endblock %}
|
||||
|
||||
{% load custom_filters %}
|
||||
|
||||
{% load static %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="row g-4 mt-4">
|
||||
<h1 class="">Archive of {{ user.artist }}'s Submissions</h1>
|
||||
<div class="gallery-container">
|
||||
{% for submission in page_obj %}
|
||||
<a class="img-holder" href="{% url 'fa:submission_detail' submission_id=submission.submission_id %}">
|
||||
<div class="layer">
|
||||
<h3>{{ submission.title }}</h3>
|
||||
<p>{{ submission.date |date:'Y-m-d H:i' }}</p>
|
||||
<p class="badge bg-secondary text-2xl"> {{ submission.mature_rating.mature }}</p>
|
||||
</div>
|
||||
{% if submission.file %}
|
||||
{% if submission.file.file.url|is_image %}
|
||||
{% if submission.mature_rating.mature == "Adult" or submission.mature_rating.mature == "Mature" %}
|
||||
<img class="blur" src="{{ submission.file.file.url }}" alt="{{ submission.title }}">
|
||||
{% else %}
|
||||
<img src="{{ submission.file.file.url }}" alt="{{ submission.title }}">
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<img src="{% static 'img/no-image-dark.webp' %}" alt="No image">
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<img src="{% static 'img/no-image-dark.webp' %}" alt="No image">
|
||||
{% endif %}
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row justify-content-center border border-2">
|
||||
|
||||
<!-- Display Bootstrap pagination -->
|
||||
<div class="col-6">
|
||||
<nav aria-label="Page navigation">
|
||||
<ul class="pagination justify-content-center">
|
||||
{% if page_obj.has_previous %}
|
||||
<li class="page-item">
|
||||
<a class="page-link" href="?page=1" aria-label="First">
|
||||
«
|
||||
</a>
|
||||
</li>
|
||||
<li class="page-item">
|
||||
<a class="page-link" href="?page={{ page_obj.previous_page_number }}" aria-label="Previous">
|
||||
<span aria-hidden="true">‹</span>
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
<li class="page-item disabled">
|
||||
<span class="page-link">
|
||||
Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }}.
|
||||
</span>
|
||||
</li>
|
||||
|
||||
{% if page_obj.has_next %}
|
||||
<li class="page-item">
|
||||
<a class="page-link" href="?page={{ page_obj.next_page_number }}" aria-label="Next">
|
||||
<span aria-hidden="true">›</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="page-item">
|
||||
<a class="page-link" href="?page={{ page_obj.paginator.num_pages }}" aria-label="Last">
|
||||
»
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<!-- Jump-to field -->
|
||||
<div class="col-3">
|
||||
<form method="GET" class="row g-3">
|
||||
<label for="jumpToPage" class="col-auto col-form-label">Jump to:</label>
|
||||
<div class="col-3">
|
||||
<input type="number" name="page" id="jumpToPage" class="form-control" min="1" max="{{ page_obj.paginator.num_pages }}" value="{{ page_obj.number }}">
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<button type="submit" class="btn btn-primary">Go</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% comment %} <div class="pagination">
|
||||
<span class="step-links">
|
||||
{% if page_obj.has_previous %}
|
||||
<a href="?page=1">« First</a>
|
||||
<a href="?page={{ page_obj.previous_page_number }}">Previous</a>
|
||||
{% endif %}
|
||||
|
||||
<span class="current">
|
||||
Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }}.
|
||||
</span>
|
||||
|
||||
{% if page_obj.has_next %}
|
||||
<a href="?page={{ page_obj.next_page_number }}">Next</a>
|
||||
<a href="?page={{ page_obj.paginator.num_pages }}">Last »</a>
|
||||
{% endif %}
|
||||
</span>
|
||||
</div> {% endcomment %}
|
||||
{% endblock %}
|
||||
|
||||
{% comment %} {% block scripts %}
|
||||
{{ block.super }}
|
||||
<script>
|
||||
// Enable Bootstrap tooltips
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
const tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'));
|
||||
const tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
|
||||
return new bootstrap.Tooltip(tooltipTriggerEl);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
{% endblock %} {% endcomment %}
|
19
archivist/sites/templates/fa/users.html
Normal file
19
archivist/sites/templates/fa/users.html
Normal file
|
@ -0,0 +1,19 @@
|
|||
<div>
|
||||
<h2>Archived Furaffinity user list:</h2>
|
||||
{% if list_users %}
|
||||
<ul>
|
||||
{% for user in list_users %}
|
||||
<li><a href="{% url 'fa:user_page' user.artist_url %}"> {{ user.artist }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% else %}
|
||||
<p>No users available.</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div>
|
||||
<p>Links:</p>
|
||||
<ul>
|
||||
<li><a href="tags">Tags</a></li>
|
||||
<li><a href="config">Config</a></li>
|
||||
</ul>
|
||||
</div>
|
Loading…
Reference in a new issue