mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 15:02:21 -04:00
add review link
This commit is contained in:
parent
7c310e678c
commit
312af79c1e
3 changed files with 9 additions and 7 deletions
|
@ -8,7 +8,7 @@ appVersion="2.0-alpha2"
|
||||||
appWebsite="http://ankisrs.net/"
|
appWebsite="http://ankisrs.net/"
|
||||||
appHelpSite="http://ankisrs.net/docs/dev/"
|
appHelpSite="http://ankisrs.net/docs/dev/"
|
||||||
appDonate="http://ankisrs.net/support/"
|
appDonate="http://ankisrs.net/support/"
|
||||||
appShared="http://test.ankiweb.net/shared/decks/"
|
appShared="http://beta.ankiweb.net/shared/"
|
||||||
mw = None # set on init
|
mw = None # set on init
|
||||||
|
|
||||||
moduleDir = os.path.split(os.path.dirname(os.path.abspath(__file__)))[0]
|
moduleDir = os.path.split(os.path.dirname(os.path.abspath(__file__)))[0]
|
||||||
|
|
|
@ -150,4 +150,4 @@ Are you sure you wish to delete all of the cards in %s?""")%deck['name']):
|
||||||
|
|
||||||
def _onShared(self):
|
def _onShared(self):
|
||||||
print "fixme: check & warn if schema modified first"
|
print "fixme: check & warn if schema modified first"
|
||||||
openLink(aqt.appShared)
|
openLink(aqt.appShared+"decks")
|
||||||
|
|
|
@ -6,7 +6,7 @@ import simplejson
|
||||||
from aqt.qt import *
|
from aqt.qt import *
|
||||||
from anki.consts import NEW_CARDS_RANDOM
|
from anki.consts import NEW_CARDS_RANDOM
|
||||||
from anki.hooks import addHook
|
from anki.hooks import addHook
|
||||||
from aqt.utils import showInfo
|
from aqt.utils import showInfo, openLink
|
||||||
import aqt
|
import aqt
|
||||||
|
|
||||||
class Overview(object):
|
class Overview(object):
|
||||||
|
@ -45,6 +45,8 @@ class Overview(object):
|
||||||
self.mw.onDeckConf()
|
self.mw.onDeckConf()
|
||||||
elif url == "decks":
|
elif url == "decks":
|
||||||
self.mw.moveToState("deckBrowser")
|
self.mw.moveToState("deckBrowser")
|
||||||
|
elif url == "review":
|
||||||
|
openLink(aqt.appShared+"info/%s?v=%s"%(self.sid, self.sidVer))
|
||||||
|
|
||||||
# HTML
|
# HTML
|
||||||
############################################################
|
############################################################
|
||||||
|
@ -52,8 +54,9 @@ class Overview(object):
|
||||||
def _renderPage(self):
|
def _renderPage(self):
|
||||||
but = self.mw.button
|
but = self.mw.button
|
||||||
deck = self.mw.col.decks.current()
|
deck = self.mw.col.decks.current()
|
||||||
sid = deck.get("sharedFrom")
|
self.sid = deck.get("sharedFrom")
|
||||||
if sid:
|
if self.sid:
|
||||||
|
self.sidVer = deck.get("ver", None)
|
||||||
shareLink = '<a class=smallLink href="review">Reviews and Updates</a>'
|
shareLink = '<a class=smallLink href="review">Reviews and Updates</a>'
|
||||||
else:
|
else:
|
||||||
shareLink = ""
|
shareLink = ""
|
||||||
|
@ -67,7 +70,7 @@ class Overview(object):
|
||||||
def _desc(self, deck):
|
def _desc(self, deck):
|
||||||
desc = deck.get("desc", "")
|
desc = deck.get("desc", "")
|
||||||
if not desc:
|
if not desc:
|
||||||
return ""
|
return "<p>"
|
||||||
if len(desc) < 160:
|
if len(desc) < 160:
|
||||||
return '<div class="descfont descmid description">%s</div>' % desc
|
return '<div class="descfont descmid description">%s</div>' % desc
|
||||||
else:
|
else:
|
||||||
|
@ -106,7 +109,6 @@ class Overview(object):
|
||||||
<h3>%(deck)s</h3>
|
<h3>%(deck)s</h3>
|
||||||
%(shareLink)s
|
%(shareLink)s
|
||||||
%(desc)s
|
%(desc)s
|
||||||
<p>
|
|
||||||
%(table)s
|
%(table)s
|
||||||
</center>
|
</center>
|
||||||
<script>$(function () { $("#study").focus(); });</script>
|
<script>$(function () { $("#study").focus(); });</script>
|
||||||
|
|
Loading…
Reference in a new issue