Commit 612b4d3c authored by CapsLock's avatar CapsLock

[design] alias modal design

parent 16f9dd43
.idea
uploads/*
venv
core
......@@ -47,6 +47,11 @@ def get_host_name():
return result
def get_scheme():
url_parse = urlparse(request.url)
return url_parse.scheme
def get_root_url():
url_parse = urlparse(request.url)
str = "%s://%s:%s" % (url_parse.scheme, domain_name, url_parse.port)
......@@ -90,7 +95,8 @@ def default(db):
current_hostname=current_hostname,
base_url=get_base_url(),
domain_name=domain_name,
display_new_links=get_host_name() != '')
display_new_links=get_host_name() != '',
scheme=get_scheme())
# upload new pictures
......@@ -179,5 +185,5 @@ def send_static(filename):
if __name__ == "__main__":
run(app, host='localhost', port=8080)
run(app, host='localhost', port=8080, reloader=True)
.alias-field span {
float: left;
margin: 0.5em;
}
.alias-field input {
float: left;
width:200px;
}
\ No newline at end of file
......@@ -62,13 +62,22 @@
</h2>
<form action="/newAlias" method="post">
<input type="text" name="domain" />
<div class="row alias-field">
<span>{{scheme}}://</span><input id="inputDomain" type="text" name="domain" /><span>.{{domain_name}}</span>
</div>
<span id="aliasResult"></span>
% if display_new_links:
<input type="submit" value="Create alias" class="button" />
% else:
<input type="submit" value="Create host name" class="button" />
%end
</form>
<script type="text/javascript">
$('#inputDomain').change(function(){
$('#aliasResult').html($('#inputDomain').val());
});
</script>
<a class="close-reveal-modal">&#215;</a>
</div>
<a href="#" data-reveal-id="modal-create-alias">
......
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