Add detail page for webpages
This commit is contained in:
@ -4,6 +4,7 @@ from typing import Dict
|
||||
import trafilatura
|
||||
from uuid import uuid4
|
||||
|
||||
from django.apps import apps
|
||||
from django.contrib.auth import get_user_model
|
||||
from django.conf import settings
|
||||
from django.db import models
|
||||
|
||||
@ -93,6 +93,7 @@ INSTALLED_APPS = [
|
||||
"django.contrib.humanize",
|
||||
"django_filters",
|
||||
"django_extensions",
|
||||
"markdownify",
|
||||
"imagekit",
|
||||
"storages",
|
||||
"taggit",
|
||||
|
||||
@ -101,6 +101,7 @@ INSTALLED_APPS = [
|
||||
"django.contrib.humanize",
|
||||
"django_filters",
|
||||
"django_extensions",
|
||||
"markdownify",
|
||||
"imagekit",
|
||||
"storages",
|
||||
"taggit",
|
||||
|
||||
48
vrobbler/templates/webpages/webpage_detail.html
Normal file
48
vrobbler/templates/webpages/webpage_detail.html
Normal file
@ -0,0 +1,48 @@
|
||||
{% extends "base_list.html" %}
|
||||
{% load static %}
|
||||
|
||||
{% block title %}{{object.title}}{% endblock %}
|
||||
|
||||
{% block head_extra %}
|
||||
<style>
|
||||
.webpage-body {float:left: width:500px; margin-right:10px; font-size:larger;}
|
||||
.webpage-body br { margin-bottom: 1em; }
|
||||
.webpage-source {float:left; width:600px; margin-left:10px;}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block lists %}
|
||||
<div class="row webpage">
|
||||
|
||||
<div class="webpage-source">
|
||||
<p>Source: <a href="{{object.url}}">{{object.url}}</a></p>
|
||||
</div>
|
||||
{% if object.extract %}
|
||||
<div class="webpage-body">
|
||||
{{object.extract|linebreaks}}
|
||||
</div>
|
||||
{% endif %}
|
||||
<hr/>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md">
|
||||
<h3>Last scrobbles</h3>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-sm">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Date</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for scrobble in object.scrobble_set.all %}
|
||||
<tr>
|
||||
<td>{{scrobble.timestamp}}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user