dockerized structure
This commit is contained in:
52
code/templates/layout.html
Normal file
52
code/templates/layout.html
Normal file
@@ -0,0 +1,52 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset=utf-8/>
|
||||
<title>MDShop</title>
|
||||
<script language="javascript" src="{{ url_for('static', filename='script.js') }}"></script>
|
||||
<script language="javascript" src="{{ url_for('static', filename='table.js') }}"></script>
|
||||
<link rel=stylesheet type=text/css href="{{ url_for('static', filename='style.css') }}">
|
||||
<link rel="icon" href="{{ url_for('static', filename='favicon.ico') }}" type="image/x-icon" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<meta name="HandheldFriendly" content="true" />
|
||||
<meta name="viewport" content="width=device-width, height=device-height, user-scalable=yes" />
|
||||
</head>
|
||||
<body>
|
||||
<div class=page>
|
||||
<div class=metanav>
|
||||
<a href="{{ url_for('list_shops') }}" id="shopsList">MDShops</a>
|
||||
<span class="hspacer"></span>
|
||||
<div class="dropdown">
|
||||
<p onclick="dropDown('userAct')" class="dropbtn">⊆⊇</p>
|
||||
<div id="userAct" class="dropdown-content">
|
||||
<a href="#" onclick="reload();">↻ Reload</a>
|
||||
<a href="{{ url_for('profile') }}">♙ Profile</a>
|
||||
<a href="{{ url_for('logout') }}">➲ Logout</a>
|
||||
</div>
|
||||
</div>
|
||||
{% if shop %}
|
||||
<span class="hspacer"></span>
|
||||
<div class="dropdown">
|
||||
<p onclick="dropDown('shopAct')" class="dropbtn">☝☔</p>
|
||||
<div id="shopAct" class="dropdown-content">
|
||||
<a id="h2_add" onclick="hidetoggle('disp_add')" class=pointer>± Add/remove</a>
|
||||
<a id="h2_sort" onclick="sortMarkdown()" class=pointer>↕ Sort once</a>
|
||||
<a id="h2_edit" onclick="hidetoggle('disp_edit');growTextarea('edit_md');" class=pointer>✎ Edit items</a>
|
||||
<a id="h2_share" onclick="hidetoggle('disp_share')" class=pointer>♟ Share shop</a>
|
||||
<a id="h2_restore" onclick="hidetoggle('disp_restore')" class=pointer>♻ Restore backup</a>
|
||||
<a id="h2_delete" onclick="hidetoggle('disp_delete')" class=pointer>⊗ Delete shop</a>
|
||||
</div>
|
||||
</div>
|
||||
<span class="hspacer"></span>
|
||||
<span class="iconbox fixed_topright" onclick="hidetoggle('disp_add')" title="Add/remove">±</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% for message in get_flashed_messages() %}
|
||||
<div class=flash>{{ message }}</div>
|
||||
{% endfor %}
|
||||
<hr/>
|
||||
{% block body %}{% endblock %}
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
17
code/templates/list_shops.html
Normal file
17
code/templates/list_shops.html
Normal file
@@ -0,0 +1,17 @@
|
||||
{% extends "layout.html" %}
|
||||
{% block body %}
|
||||
<table class="sortable" id="shoplist">
|
||||
<tr><th>Shop</th><th>Last edited</th><th>Owner</th></tr>
|
||||
{% for entry in entries %}
|
||||
<tr><td><a href="{{ url_for('show_shop',shopid=entry.shopid) }}">{{ entry.shop }}</a></td><td>{{ entry.date }}</td><td>{{ entry.owner }}</td>
|
||||
{% else %}
|
||||
<tr><td><em>Unbelievable. You dont have any shops</em>
|
||||
{% endfor %}
|
||||
|
||||
</table>
|
||||
<form action="{{ url_for('add_shop') }}" method=post class=add-entry>
|
||||
<h2>Add new shop:</h2>
|
||||
<input class=submit type=text size=30 name=shop> <input class=submit type=submit value=Submit>
|
||||
</form>
|
||||
|
||||
{% endblock %}
|
||||
15
code/templates/login.html
Normal file
15
code/templates/login.html
Normal file
@@ -0,0 +1,15 @@
|
||||
{% extends "layout.html" %}
|
||||
{% block body %}
|
||||
<h2>Login</h2>
|
||||
{% if error %}<p class=error><strong>Error:</strong> {{ error }}{% endif %}
|
||||
<form action="{{ url_for('login') }}" method=post>
|
||||
<dl>
|
||||
<dt>Username:
|
||||
<dd><input type=text name=username autofocus>
|
||||
<dt>Password:
|
||||
<dd><input type=password name=password>
|
||||
<dd><input class=submit type=submit value=Login>
|
||||
</dl>
|
||||
</form>
|
||||
<!--a href="{{ url_for('register') }}">Register</a-->
|
||||
{% endblock %}
|
||||
14
code/templates/profile.html
Normal file
14
code/templates/profile.html
Normal file
@@ -0,0 +1,14 @@
|
||||
{% extends "layout.html" %}
|
||||
{% block body %}
|
||||
<h2>Profile</h2>
|
||||
{% if error %}<p class=error><strong>Error:</strong> {{ error }}{% endif %}
|
||||
<form action="{{ url_for('profile') }}" method=post>
|
||||
<dl>
|
||||
<dt>Username:
|
||||
<dd>{{ user }}
|
||||
<dt>Password:
|
||||
<dd><input type=password name=password>
|
||||
<dd><input type=submit value=Update>
|
||||
</dl>
|
||||
</form>
|
||||
{% endblock %}
|
||||
14
code/templates/register.html
Normal file
14
code/templates/register.html
Normal file
@@ -0,0 +1,14 @@
|
||||
{% extends "layout.html" %}
|
||||
{% block body %}
|
||||
<h2>Register</h2>
|
||||
{% if error %}<p class=error><strong>Error:</strong> {{ error }}{% endif %}
|
||||
<form action="{{ url_for('register') }}" method=post>
|
||||
<dl>
|
||||
<dt>Username:
|
||||
<dd><input type=text name=username>
|
||||
<dt>Password:
|
||||
<dd><input type=password name=password>
|
||||
<dd><input type=submit value=register>
|
||||
</dl>
|
||||
</form>
|
||||
{% endblock %}
|
||||
104
code/templates/show_shop.html
Normal file
104
code/templates/show_shop.html
Normal file
@@ -0,0 +1,104 @@
|
||||
{% extends "layout.html" %}
|
||||
{% block body %}
|
||||
<H2># {{ shop }}</H2>
|
||||
<div class=entries>
|
||||
<form action="{{ url_for('toggle_item') }}" method=post class=toggle-item>
|
||||
<input type=hidden name=shopid value="{{ shopid }}" >
|
||||
<div id="entry_loop">
|
||||
{% for entry in entries %}
|
||||
<div class=entry><input class="submit tickbox {{ entry.extra_class }}" type=submit name=item{{ entry.row }} id=itemId{{ entry.row }} value="{{ entry.icon }}" ><span class=md_entry>{{ entry.text|safe }}</span><br></div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</form>
|
||||
<div class=date>{{ date }}</div>
|
||||
</div>
|
||||
<div id=iconarea>
|
||||
<span class=iconbox> </span>
|
||||
<span class=iconbox onclick="hidetoggle('disp_add')" title="Add/remove">±</span>
|
||||
<span class=iconbox onclick="reload();" title="Reload">↻</span>
|
||||
<span class=iconbox onclick="sortMarkdown()" title="Sort once">↕</span>
|
||||
<span class=iconbox onclick="hidetoggle('disp_edit');growTextarea('edit_md');" title="Edit file">✎</span>
|
||||
<span class=iconbox onclick="hidetoggle('disp_share')" title="Share">♟</span>
|
||||
<span class=iconbox onclick="hidetoggle('disp_restore')" title="Restore">♻</span>
|
||||
<span class=iconbox onclick="hidetoggle('disp_delete')" title="Delete">⊗</span>
|
||||
</div>
|
||||
<hr>
|
||||
<div id="disp_add">
|
||||
<form name="area_add" action="{{ url_for('add_items') }}" method=post class=add-entry>
|
||||
<dl>
|
||||
<dt><textarea cols=40 rows=1 id=add_md name=add_md onkeyup="growTextarea('add_md')"></textarea>
|
||||
<dt>
|
||||
<input type=hidden name=shopid value={{ shopid }}><input class="submit submitNextTo" type=submit value="Add items">
|
||||
<input class="submit" type=button value="Insert Date" onclick="insertDate('add_md');" >
|
||||
</dl>
|
||||
</form>
|
||||
<hr>
|
||||
<div class="button-panel-row">
|
||||
<span class="button-panel-col">
|
||||
<form action="{{ url_for('toggle_item') }}" method=post>
|
||||
<input type=hidden name=shopid value="{{ shopid }}">
|
||||
<input class=submit type=submit name=toggleAll value="Invert ticks">
|
||||
</form>
|
||||
</span>
|
||||
<span class="button-panel">
|
||||
<form action="{{ url_for('toggle_item') }}" method=post>
|
||||
<input type=hidden name=shopid value="{{ shopid }}">
|
||||
<input class=submit type=submit name=unTickAll value="Clear ticks" onclick="return confirm('Do you really want to untick all entries?');">
|
||||
</form>
|
||||
</span>
|
||||
</div>
|
||||
<div class="button-panel-row">
|
||||
<span class="button-panel-col">
|
||||
<form action="{{ url_for('sort_flip') }}" method=post>
|
||||
<input type=hidden name=shopid value="{{ shopid }}">
|
||||
{% if autosort %}
|
||||
<input class=submit type=submit name=toggleAll value="Auto order: On">
|
||||
{% else %}
|
||||
<input class=submit type=submit name=toggleAll value="Auto order: Off">
|
||||
{% endif %}
|
||||
</form>
|
||||
</span>
|
||||
<span class="button-panel">
|
||||
<form action="{{ url_for('remove_toggled') }}" method=post>
|
||||
<input type=hidden name=shopid value={{ shopid }}>
|
||||
<input class=submit type=submit onclick="return confirm('Do you really want to remove ticked entries?');" value="Remove ticked">
|
||||
</form>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<form id="disp_edit" class=hidden name="area_edit" action="{{ url_for('edit_md') }}" method=post class=add-entry>
|
||||
<dl>Edit content file:
|
||||
<dt><textarea cols=40 rows=5 id=edit_md name=edit_md onkeyup="growTextarea('edit_md')">{{ content }}</textarea>
|
||||
<dt>
|
||||
<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?');" >
|
||||
<input class="submit" type=button value="Insert Date" onclick="insertDate('edit_md');" >
|
||||
</dl>
|
||||
</form>
|
||||
<div class=hidden id=disp_share>
|
||||
<form action="{{ url_for('remove_share') }}" method=post class=toggle-item>
|
||||
<dl>Share the shop with other users:</dl>
|
||||
<input type=hidden name=shopid value="{{ shopid }}" >
|
||||
<ul>
|
||||
{% for user in shares %}
|
||||
<li> Remove: <input class="submit" type=submit name=user value="{{ user }}" onclick="return confirm('Do you really want to remove {{ user }}?');" ><br>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</form>
|
||||
<form name="area_share" action="{{ url_for('add_share') }}" method=post class=add-entry>
|
||||
<dl>
|
||||
<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>
|
||||
</form>
|
||||
</div>
|
||||
<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. Last backup: <span class=date>{{ date_bkp }}</span></dl>
|
||||
<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>
|
||||
<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><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>
|
||||
{% if autosort %}
|
||||
<script language=javascript>sortMarkdown(boughtOrder=true);</script>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user