Unverified Commit 6392c820 by CapsLock

[design] modals for upload and create alias

Signed-off-by: 's avatarCapsLock <faimaison@legeox.net>
parent 19f6ab60
......@@ -47,6 +47,11 @@ def get_host_name():
return result
def get_base_url():
str = "%s://%%s.%s" % (request.urlparts.scheme, request.urlparts.netloc)
return str
# accueil
@app.route('/')
def default(db):
......@@ -69,7 +74,12 @@ def default(db):
pictures = db.fetchall()
current_domain = get_host_name()
return template('default', pictures=pictures, domain_names=domain_names, current_domain=current_domain)
return template('default',
pictures=pictures,
domain_names=domain_names,
current_domain=current_domain,
base_url=get_base_url(),
domain_name=domain_name)
# # create new alias
......
......@@ -66,51 +66,35 @@
<!-- Right Nav Section -->
<ul class="right">
<li class="divider"></li>
<li class="has-dropdown">
<a href="#">Main Item 4</a>
<ul class="dropdown">
<li><label>Section Name</label></li>
<li class="has-dropdown">
<a href="#" class="">Has Dropdown, Level 1</a>
<ul class="dropdown">
<li><a href="#">Dropdown Options</a></li>
<li><a href="#">Dropdown Options</a></li>
<li class="has-dropdown">
<a href="#">Has Dropdown, Level 2</a>
<ul class="dropdown test">
<li><a href="#">Subdropdown Option</a></li>
<li><a href="#">Subdropdown Option</a></li>
<li><a href="#">Subdropdown Option</a></li>
</ul>
</li>
<li><a href="#">Subdropdown Option</a></li>
<li><a href="#">Subdropdown Option</a></li>
<li><a href="#">Subdropdown Option</a></li>
</ul>
</li>
<li><a href="#">Dropdown Option</a></li>
<li><a href="#">Dropdown Option</a></li>
<li class="divider"></li>
<li><label>Section Name</label></li>
<li><a href="#">Dropdown Option</a></li>
<li><a href="#">Dropdown Option</a></li>
<li><a href="#">Dropdown Option</a></li>
<li class="divider"></li>
<li><a href="#">See all &rarr;</a></li>
</ul>
<li>
<div id="modal-upload" class="reveal-modal" data-reveal>
<h2>Upload new photo</h2>
<form action="/new" method="post" enctype="multipart/form-data">
<input type="hidden" name="domain" value="{{current_domain}}"/>
description: <input type="text" name="description" />
Select a file: <input type="file" name="upload" />
<input type="submit" value="Start upload" class="button" />
</form>
<a class="close-reveal-modal">&#215;</a>
</div>
<a href="#" data-reveal-id="modal-upload">
Upload
</a>
</li>
<li class="divider"></li>
<li><a href="#">Main Item 5</a></li>
<li class="divider"></li>
<li class="has-dropdown">
<a href="#">Main Item 6</a>
<ul class="dropdown">
<li><a href="#">Dropdown Option</a></li>
<li><a href="#">Dropdown Option</a></li>
<li><a href="#">Dropdown Option</a></li>
<li class="divider"></li>
<li><a href="#">See all &rarr;</a></li>
</ul>
<li>
<div id="modal-create-alias" class="reveal-modal" data-reveal>
<h2>Create domain alias</h2>
<form action="/newAlias" method="post">
<input type="hidden" name="domain" value="{{current_domain}}"/>
description: <input type="text" name="description" />
<input type="submit" value="Create alias" class="button" />
</form>
<a class="close-reveal-modal">&#215;</a>
</div>
<a href="#" data-reveal-id="modal-create-alias">
Create Alias
</a>
</li>
</ul>
</section>
......
% rebase('base.html', title='coin')
% for d in domain_names:
<a href="http://{{d['name']}}.coin.pan:8080/">{{d['name']}}.coin.pan</a><br />
<a href="{{ base_url % d['name'] }}">{{ '{0}.{1}'.format(d['name'], domain_name) }}</a><br />
%end
% item_count = 0
% tag_closed = True
......@@ -41,21 +39,3 @@
%if not tag_closed:
</div>
%end
<h1>upload new photo:</h1>
<form action="/new" method="post" enctype="multipart/form-data">
<input type="hidden" name="domain" value="{{current_domain}}"/>
description: <input type="text" name="description" />
Select a file: <input type="file" name="upload" />
<input type="submit" value="Start upload" class="button" />
</form>
<h1>Create domain alias</h1>
<form action="/newAlias" method="post">
<input type="hidden" name="domain" value="{{current_domain}}"/>
description: <input type="text" name="description" />
<input type="submit" value="Create alias" class="button" />
</form>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment