dodal logiko za ralikovaje med prikazom linka in pdfja

master
janko 2023-04-08 23:42:51 +02:00
parent e6186847c4
commit db037c62fa
1 changed files with 19 additions and 2 deletions

View File

@ -5,6 +5,9 @@ from sqlalchemy import desc
from share import share from share import share
from create_db import Card, Rating, get_session from create_db import Card, Rating, get_session
from settings import get_settings from settings import get_settings
from link_handler import render_embed_link
""" """
testing testing
""" """
@ -266,5 +269,19 @@ def sr_session():
show_card = dbsession.query(Card).get(next_card_id) show_card = dbsession.query(Card).get(next_card_id)
interval = get_interval(next_card_id) interval = get_interval(next_card_id)
card_type = show_card.card_type
print("card type: ", card_type)
if card_type == 'PDF':
#these factors should be better packaged #these factors should be better packaged
return render_template("deck.html", username=username, card=show_card, maybe_in=round(interval*maybe_factor), no_in=round(no_factor*interval)) return render_template("deck.html", username=username, card=show_card, maybe_in=round(interval*maybe_factor), no_in=round(no_factor*interval))
elif card_type == 'URL':
#templates for different kinds of links
return render_embed_link(cm_username=username,
card=show_card,
maybe_in=round(interval*maybe_factor),
no_in=round(no_factor*interval))
#return render_template("link.html", username=username, card=show_card, maybe_in=round(interval*maybe_factor), no_in=round(no_factor*interval))