diff --git a/shop.py b/shop.py index 28afdf0..12e226d 100644 --- a/shop.py +++ b/shop.py @@ -14,6 +14,7 @@ SECRET_KEY = 'development key' USERNAME = 'admin' PASSWORD = 'default' URLFINDER = re.compile("((news|telnet|nttp|file|http|ftp|https)://[^ ]+)") +URLPARSER = re.compile(r'(\[)([^\]]+)(\])\(([^\)]+)\)') # create our little application :) app = Flask(__name__) @@ -87,6 +88,8 @@ def scan_for_new_documents(id): g.db.commit() def urlify(s): + if URLPARSER.search(s): + return URLPARSER.sub(r'[\2]',s) return URLFINDER.sub(r'\1', s) @app.before_request @@ -129,7 +132,10 @@ def show_shop(shopid): continue icon=" " extra_class="noitem" - if "[ ]" in row or "[x]" in row: + if "[ ]" in row: + icon=u" " + extra_class="" + if "[x]" in row: icon=u"\u2714" extra_class="" row=urlify(row).encode('ascii', 'xmlcharrefreplace') diff --git a/static/style.css b/static/style.css index c7940da..5cdb7cf 100644 --- a/static/style.css +++ b/static/style.css @@ -9,7 +9,7 @@ td { height: 1.75em; } .tickbox { margin-right: 0.5em; } .noitem { background-color: transparent; border-color:transparent; } .page { border: 5px solid #ccc; padding: 0.5em; - background: white; overflow:hidden; min-height:16em;} + background: white; overflow:auto; min-height:16em;} .entries { margin-top: 1em; margin-bottom: 1em; } .entries input { margin-top: 0.125em; margin-bottom: 0.125em; } .entries li { margin: 0.8em 1.2em; } @@ -24,6 +24,11 @@ td { height: 1.75em; } .hidden { display: none; } .pointer { cursor: pointer; text-decoration: underline; } .hspacer { width: 1em; display: inline-block;} +.notify { -webkit-animation: notifier 500ms alternate infinite; + -moz-animation: notifier 500ms alternate infinite; + -o-animation: notifier 500ms alternate infinite; + animation: notifier 500ms alternate infinite; } +#date { font-size: 0.75em; margin-top: 1.2em; } /* dropdown */ @@ -69,3 +74,7 @@ td { height: 1.75em; } /* Show the dropdown menu (use JS to add this class to the .dropdown-content container when the user clicks on the dropdown button) */ .show {display:block;} +@keyframes notifier { + 0% { box-shadow: 0px 0px 4px 4px #fff; } + 100% { box-shadow: 0px 0px 4px 4px #cee5F5; } +} diff --git a/templates/show_shop.html b/templates/show_shop.html index af79949..ae1d413 100644 --- a/templates/show_shop.html +++ b/templates/show_shop.html @@ -26,7 +26,7 @@