fixed bugs
This commit is contained in:
8
shop.py
8
shop.py
@@ -14,6 +14,7 @@ SECRET_KEY = 'development key'
|
|||||||
USERNAME = 'admin'
|
USERNAME = 'admin'
|
||||||
PASSWORD = 'default'
|
PASSWORD = 'default'
|
||||||
URLFINDER = re.compile("((news|telnet|nttp|file|http|ftp|https)://[^ ]+)")
|
URLFINDER = re.compile("((news|telnet|nttp|file|http|ftp|https)://[^ ]+)")
|
||||||
|
URLPARSER = re.compile(r'(\[)([^\]]+)(\])\(([^\)]+)\)')
|
||||||
|
|
||||||
# create our little application :)
|
# create our little application :)
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
@@ -87,6 +88,8 @@ def scan_for_new_documents(id):
|
|||||||
g.db.commit()
|
g.db.commit()
|
||||||
|
|
||||||
def urlify(s):
|
def urlify(s):
|
||||||
|
if URLPARSER.search(s):
|
||||||
|
return URLPARSER.sub(r'[<a href="\4" target="_blank">\2</a>]',s)
|
||||||
return URLFINDER.sub(r'<a href="\1" target="_blank">\1</a>', s)
|
return URLFINDER.sub(r'<a href="\1" target="_blank">\1</a>', s)
|
||||||
|
|
||||||
@app.before_request
|
@app.before_request
|
||||||
@@ -129,7 +132,10 @@ def show_shop(shopid):
|
|||||||
continue
|
continue
|
||||||
icon=" "
|
icon=" "
|
||||||
extra_class="noitem"
|
extra_class="noitem"
|
||||||
if "[ ]" in row or "[x]" in row:
|
if "[ ]" in row:
|
||||||
|
icon=u" "
|
||||||
|
extra_class=""
|
||||||
|
if "[x]" in row:
|
||||||
icon=u"\u2714"
|
icon=u"\u2714"
|
||||||
extra_class=""
|
extra_class=""
|
||||||
row=urlify(row).encode('ascii', 'xmlcharrefreplace')
|
row=urlify(row).encode('ascii', 'xmlcharrefreplace')
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ td { height: 1.75em; }
|
|||||||
.tickbox { margin-right: 0.5em; }
|
.tickbox { margin-right: 0.5em; }
|
||||||
.noitem { background-color: transparent; border-color:transparent; }
|
.noitem { background-color: transparent; border-color:transparent; }
|
||||||
.page { border: 5px solid #ccc; padding: 0.5em;
|
.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 { margin-top: 1em; margin-bottom: 1em; }
|
||||||
.entries input { margin-top: 0.125em; margin-bottom: 0.125em; }
|
.entries input { margin-top: 0.125em; margin-bottom: 0.125em; }
|
||||||
.entries li { margin: 0.8em 1.2em; }
|
.entries li { margin: 0.8em 1.2em; }
|
||||||
@@ -24,6 +24,11 @@ td { height: 1.75em; }
|
|||||||
.hidden { display: none; }
|
.hidden { display: none; }
|
||||||
.pointer { cursor: pointer; text-decoration: underline; }
|
.pointer { cursor: pointer; text-decoration: underline; }
|
||||||
.hspacer { width: 1em; display: inline-block;}
|
.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 */
|
/* 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 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;}
|
.show {display:block;}
|
||||||
|
|
||||||
|
@keyframes notifier {
|
||||||
|
0% { box-shadow: 0px 0px 4px 4px #fff; }
|
||||||
|
100% { box-shadow: 0px 0px 4px 4px #cee5F5; }
|
||||||
|
}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
<form id="disp_edit" class=hidden name="area_edit" action="{{ url_for('edit_md') }}" method=post class=add-entry>
|
<form id="disp_edit" class=hidden name="area_edit" action="{{ url_for('edit_md') }}" method=post class=add-entry>
|
||||||
<dl>Edit content file:
|
<dl>Edit content file:
|
||||||
<dt><textarea cols=40 rows=5 id=edit_md name=edit_md onkeyup="growTextarea('edit_md')">{{ content }}</textarea><br>
|
<dt><textarea cols=40 rows=5 id=edit_md name=edit_md onkeyup="growTextarea('edit_md')">{{ content }}</textarea><br>
|
||||||
<input type=hidden name=shopid value={{ shopid }}><input class=submit type=submit value=Save onclick="return confirm('Do you really want to replace content?');" >
|
<input type=hidden name=shopid value={{ shopid }}><input class="submit notify" type=submit value=Save onclick="return confirm('Do you really want to replace content?');" >
|
||||||
</dl>
|
</dl>
|
||||||
</form>
|
</form>
|
||||||
<div class=hidden id=disp_share>
|
<div class=hidden id=disp_share>
|
||||||
@@ -41,17 +41,17 @@
|
|||||||
</form>
|
</form>
|
||||||
<form name="area_share" action="{{ url_for('add_share') }}" method=post class=add-entry>
|
<form name="area_share" action="{{ url_for('add_share') }}" method=post class=add-entry>
|
||||||
<dl>
|
<dl>
|
||||||
<dt><input class=submit type=text length=10 name=share><input type=hidden name=shopid value={{ shopid }}><input class=submit type=submit value=Share>
|
<dt><input class=submit type=text length=10 name=share><input type=hidden name=shopid value={{ shopid }}><input class="submit notify" type=submit value=Share>
|
||||||
</dl>
|
</dl>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<form id="disp_restore" class=hidden action="{{ url_for('restore_md') }}" method=post class=add-entry>
|
<form id="disp_restore" class=hidden action="{{ url_for('restore_md') }}" method=post class=add-entry>
|
||||||
<dl>Shop state is backed up with "Edit items" and "Remove ticked" actions.</dl>
|
<dl>Shop state is backed up with "Edit items" and "Remove ticked" actions.</dl>
|
||||||
<dl><input type=hidden name=shopid value={{ shopid }}><input class=submit type=submit value=Restore onclick="return confirm('Do you really want to restore previous version?');">
|
<dl><input type=hidden name=shopid value={{ shopid }}><input class="submit notify" type=submit value=Restore onclick="return confirm('Do you really want to restore previous version?');">
|
||||||
</dl></form>
|
</dl></form>
|
||||||
<form id="disp_delete" class=hidden action="{{ url_for('remove_shop') }}" method=post class=add-entry>
|
<form id="disp_delete" class=hidden action="{{ url_for('remove_shop') }}" method=post class=add-entry>
|
||||||
<dl>Delete shop permanently. Can not be restored.</dl>
|
<dl>Delete shop permanently. Can not be restored.</dl>
|
||||||
<dl><input type=hidden name=shopid value={{ shopid }}><input class=submit type=submit value=Delete onclick="return confirm('Do you really want to remove shop {{ shop }}?');">
|
<dl><input type=hidden name=shopid value={{ shopid }}><input class="submit notify" type=submit value=Delete onclick="return confirm('Do you really want to remove shop {{ shop }}?');">
|
||||||
</dl></form>
|
</dl></form>
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
Reference in New Issue
Block a user