| {#- |
| Licensed to the Apache Software Foundation (ASF) under one |
| or more contributor license agreements. See the NOTICE file |
| distributed with this work for additional information |
| regarding copyright ownership. The ASF licenses this file |
| to you under the Apache License, Version 2.0 (the |
| "License"); you may not use this file except in compliance |
| with the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, |
| software distributed under the License is distributed on an |
| "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| KIND, either express or implied. See the License for the |
| specific language governing permissions and limitations |
| under the License. |
| -#} |
| {% import 'allura:templates/jinja_master/lib.html' as lib with context %} |
| |
| {% set app = app or c.app %} |
| <div> |
| <h1 id="short-url-form-title" style="display:none"><span id="short-url-form-action-label">Add</span> Short URL</h1> |
| <form method="post" action="{{c.project.url()}}admin/{{app.config.options.mount_point}}/add" id="short-url-form"> |
| <input type="hidden" name="update"/> |
| <label class="grid-13">Short Name</label> |
| <div class="grid-13"><input type="text" name="short_url" style="width: 250px"/> <span class="name_len">0</span> / <span class="url_len">{{url_len}}</span> |
| </div> |
| <label class="grid-13">Full URL</label> |
| <div class="grid-13"><input type="text" name="full_url" style="width: 250px"/></div> |
| <label class="grid-13">Description</label> |
| <div class="grid-13"><textarea name="description" style="width: 250px; height: 100px"></textarea></div> |
| <div class="grid-1"><input type="checkbox" name="private" id="private"></div> |
| <label for="private" class="grid-12">Private</label> |
| <div class="grid-13"> </div> |
| <hr> |
| <div class="grid-13"><div class="grid-13"> </div> |
| <input type="submit" value="Save"> |
| <a href="#" class="close">Cancel</a></div> |
| {{lib.csrf_token()}} |
| </form> |
| </div> |
| |
| {% block extra_js %} |
| <script type="text/javascript"> |
| $(function() { |
| $('#short-url-form input[name="short_url"]').keyup(function(e) { |
| var form = $('#short-url-form'); |
| var name_len = $(this).val().length; |
| var url_len = name_len + {{url_len}}; |
| form.find('.name_len').text(name_len); |
| form.find('.url_len').text(url_len); |
| }); |
| }); |
| </script> |
| {% endblock %} |