dodal logiko za ralikovaje med prikazom linka in pdfja
parent
e6186847c4
commit
db037c62fa
|
@ -5,6 +5,9 @@ from sqlalchemy import desc
|
|||
from share import share
|
||||
from create_db import Card, Rating, get_session
|
||||
from settings import get_settings
|
||||
from link_handler import render_embed_link
|
||||
|
||||
|
||||
"""
|
||||
testing
|
||||
"""
|
||||
|
@ -266,5 +269,19 @@ def sr_session():
|
|||
show_card = dbsession.query(Card).get(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
|
||||
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))
|
Loading…
Reference in New Issue