浏览代码

get book relationships for home page showcase

joel
Simon Bowie 2 年前
父节点
当前提交
d97b36bd0c
共有 2 个文件被更改,包括 4 次插入1 次删除
  1. +3
    -1
      web/app/main.py
  2. +1
    -0
      web/app/templates/index.html

+ 3
- 1
web/app/main.py 查看文件

from flask_login import login_required, current_user from flask_login import login_required, current_user
from .models import Resource from .models import Resource
from .resources import * from .resources import *
from .relationships import *
from sqlalchemy.sql import func from sqlalchemy.sql import func
import markdown import markdown


text = f.read() text = f.read()
text = markdown.markdown(text) text = markdown.markdown(text)
book_showcase = get_book('69') book_showcase = get_book('69')
return render_template('index.html', text=text, tools=tools, book=book_showcase)
book_showcase_relationships = get_relationships('69')
return render_template('index.html', text=text, tools=tools, book=book_showcase, book_relationships=book_showcase_relationships)


# route for profile page # route for profile page
@main.route('/profile') @main.route('/profile')

+ 1
- 0
web/app/templates/index.html 查看文件

{% extends "base.html" %} {% extends "base.html" %}


{% block content %} {% block content %}
{{book_relationships}}
<div class="std-grid"> <div class="std-grid">


<div class="std-margin text row-span-2 cell meta"> <div class="std-margin text row-span-2 cell meta">

正在加载...
取消
保存