Browse Source

temp styling for colophon on about page (CHANGE)

joel
Simon Bowie 1 year ago
parent
commit
b25d88486a
4 changed files with 24 additions and 3 deletions
  1. +0
    -2
      web/app/book.py
  2. +3
    -0
      web/app/resources.py
  3. +16
    -0
      web/app/static/styles/main.css
  4. +5
    -1
      web/app/templates/about.html

+ 0
- 2
web/app/book.py View File

@book.route('/books/<int:book_id>') @book.route('/books/<int:book_id>')
def show_book(book_id): def show_book(book_id):
book = get_full_resource(book_id) book = get_full_resource(book_id)
# render Markdown as HTML
book.description = markdown.markdown(book.description)
return render_template('book.html', resource=book) return render_template('book.html', resource=book)


# route for editing a single book based on the ID in the database # route for editing a single book based on the ID in the database

+ 3
- 0
web/app/resources.py View File

import requests import requests
import re import re
from sqlalchemy.sql import func from sqlalchemy.sql import func
import markdown


# function to retrieve data about a single resource from the database # function to retrieve data about a single resource from the database
def get_resource(resource_id): def get_resource(resource_id):
resource = get_resource(resource_id) resource = get_resource(resource_id)
resource = append_relationships(resource) resource = append_relationships(resource)
if resource.type == 'book': if resource.type == 'book':
# render Markdown as HTML
resource.description = markdown.markdown(resource.description)
book_data = get_book_data(resource.isbn) book_data = get_book_data(resource.isbn)
if book_data: if book_data:
resource.__dict__.update(book_data) resource.__dict__.update(book_data)

+ 16
- 0
web/app/static/styles/main.css View File

width:1px; width:1px;
height:1px; height:1px;
overflow:hidden; overflow:hidden;
}

#about {
display: inline-block;
width: 60%;
}

#colophon {
float: right;
width: 30%;
}

hr {
clear: both;
margin-bottom: 25%;
visibility: hidden;
} }

+ 5
- 1
web/app/templates/about.html View File



{% block content %} {% block content %}


<div class="cell-margin text max-w-[65ch]">
<div id="about" class="cell-margin text max-w-[65ch]">
{{ about_text|safe }} {{ about_text|safe }}
</div> </div>


<div id="colophon" class="cell-margin text">
{{ colophon_text | safe }}
</div>

{% endblock %} {% endblock %}

Loading…
Cancel
Save