Преглед изворни кода

temp styling for colophon on about page (CHANGE)

joel
Simon Bowie пре 1 година
родитељ
комит
b25d88486a
4 измењених фајлова са 24 додато и 3 уклоњено
  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 Прегледај датотеку

@@ -62,8 +62,6 @@ def get_books():
@book.route('/books/<int:book_id>')
def show_book(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)

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

+ 3
- 0
web/app/resources.py Прегледај датотеку

@@ -16,6 +16,7 @@ from isbntools.app import *
import requests
import re
from sqlalchemy.sql import func
import markdown

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

+ 16
- 0
web/app/static/styles/main.css Прегледај датотеку

@@ -1516,4 +1516,20 @@ a.menuitem:hover {
width:1px;
height:1px;
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 Прегледај датотеку

@@ -2,8 +2,12 @@

{% block content %}

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

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

{% endblock %}

Loading…
Откажи
Сачувај