diff --git a/one/static/script/store.js b/one/static/script/store.js index 5411b48..fdbca6a 100644 --- a/one/static/script/store.js +++ b/one/static/script/store.js @@ -479,6 +479,10 @@ var cloud = (function(cloud) { var model = new Model(); $(function() { ko.applyBindings(model); + $('#keys').click(function(e) { + $('.key').slideDown(700); + $('#keys').slideUp(700); + }); }); document.addEventListener('dragenter', function(e) { e.stopPropagation(); diff --git a/one/static/style/box.less b/one/static/style/box.less index 5576289..eab406b 100644 --- a/one/static/style/box.less +++ b/one/static/style/box.less @@ -101,6 +101,21 @@ float: none; } } + &.key { + .name { + background-image: url(/static/icons/key.png); + } + textarea { + margin: 10px; + width: 93%; + } + #new-key .name { + background-image: url(/static/icons/key--plus.png); + } + #reset-key .name { + background-image: url(/static/icons/key--exclamation.png); + } + } .quota{ left: 0; top: 0; @@ -599,21 +614,7 @@ table { } } -#keys { - .name { - background-image: url(/static/icons/key.png); - } - textarea { - margin: 10px; - width: 93%; - } - #new-key .name { - background-image: url(/static/icons/key--plus.png); - } - #reset-key .name { - background-image: url(/static/icons/key--exclamation.png); - } -} + .boxhelp { position: relative; diff --git a/one/templates/box/file/box.html b/one/templates/box/file/box.html index 84ec70d..50ab0ca 100644 --- a/one/templates/box/file/box.html +++ b/one/templates/box/file/box.html @@ -93,6 +93,25 @@ {% for key in keys %} {% include "box/key/entry.html" %} {% endfor %} + <li class="entry small-row key" style="display: none"> + <div class="summary" id="new-key"> + <div class="name">{% trans "Add public key" %}</div> + <div class="clear"></div> + </div> + <div class="details"> + <form style="padding-bottom: 10px" action="/key/add/" method="POST"> + {% csrf_token %} + <textarea style="margin-bottom: 5px" name="key" placeholder="{% trans "Public key in OpenSSH format" %}"></textarea><br /> + <input type="submit" style="margin-left: 10px;" value="{% trans "Save" %}" /> + </form> + </div> + </li> + <li class="entry small-row key" style="display: none"> + <div class="summary" id="reset-key"> + <div class="name">{% trans "Reset key" %}</div> + <div class="clear"></div> + </div> + </li> <li class="file-upload entry small-row"> <div class="summary" data-bind="click: getUploadURL"> <div class="quota"> diff --git a/one/templates/box/key/box.html b/one/templates/box/key/box.html index 4f4a891..ed2d39a 100644 --- a/one/templates/box/key/box.html +++ b/one/templates/box/key/box.html @@ -12,24 +12,5 @@ {% for key in keys %} {% include "box/key/entry.html" %} {% endfor %} - <li class="entry small-row" style="display: none"> - <div class="summary" id="new-key"> - <div class="name">{% trans "Add public key" %}</div> - <div class="clear"></div> - </div> - <div class="details"> - <form style="padding-bottom: 10px" action="/key/add/" method="POST"> - {% csrf_token %} - <textarea style="margin-bottom: 5px" name="key" placeholder="{% trans "Public key in OpenSSH format" %}"></textarea><br /> - <input type="submit" style="margin-left: 10px;" value="{% trans "Save" %}" /> - </form> - </div> - </li> - <li class="entry small-row" style="display: none"> - <div class="summary" id="reset-key"> - <div class="name">{% trans "Reset key" %}</div> - <div class="clear"></div> - </div> - </li> </ul> {% endblock content %}