| 1 | |
|---|
| 2 | {% extends "configurator/base.html" %} |
|---|
| 3 | |
|---|
| 4 | {% block title %}Characters{% endblock %} |
|---|
| 5 | |
|---|
| 6 | {% block sidebar %}arg {% endblock %} |
|---|
| 7 | |
|---|
| 8 | {% block javascript %} |
|---|
| 9 | $(document).ready(function() { |
|---|
| 10 | $('#hostname').focus(); |
|---|
| 11 | }); |
|---|
| 12 | |
|---|
| 13 | {% endblock %} |
|---|
| 14 | |
|---|
| 15 | {% block head %} |
|---|
| 16 | |
|---|
| 17 | |
|---|
| 18 | <!-- tab styling --> |
|---|
| 19 | <link rel="stylesheet" type="text/css" href="/static/css/tabs-flowplayer-v2.css"/> |
|---|
| 20 | |
|---|
| 21 | <style> |
|---|
| 22 | |
|---|
| 23 | |
|---|
| 24 | /* override the root element to enable scrolling */ |
|---|
| 25 | #flowpanes { |
|---|
| 26 | position:relative; |
|---|
| 27 | overflow:hidden; |
|---|
| 28 | clear:both; |
|---|
| 29 | } |
|---|
| 30 | |
|---|
| 31 | /* override single pane */ |
|---|
| 32 | #flowpanes div { |
|---|
| 33 | float:left; |
|---|
| 34 | display:block; |
|---|
| 35 | width:670px; |
|---|
| 36 | font-size:14px; |
|---|
| 37 | } |
|---|
| 38 | |
|---|
| 39 | /* our additional wrapper element for the items */ |
|---|
| 40 | #flowpanes .items { |
|---|
| 41 | width:20000em; |
|---|
| 42 | position:absolute; |
|---|
| 43 | clear:both; |
|---|
| 44 | margin:0; |
|---|
| 45 | padding:0; |
|---|
| 46 | } |
|---|
| 47 | |
|---|
| 48 | #flowpanes .less, #flowpanes .less a { |
|---|
| 49 | color:#999 !important; |
|---|
| 50 | font-size:11px; |
|---|
| 51 | } |
|---|
| 52 | </style> |
|---|
| 53 | {% endblock %} |
|---|
| 54 | |
|---|
| 55 | |
|---|
| 56 | {% block content %} |
|---|
| 57 | |
|---|
| 58 | |
|---|
| 59 | <!-- tabs work as navigator for scrollable --> |
|---|
| 60 | <ul id="flowtabs" class="navi"> |
|---|
| 61 | <li><a id="t1" href="#host">Host</a></li> |
|---|
| 62 | <li><a id="t2" href="#templates">Templates</a></li> |
|---|
| 63 | <li><a id="t3" href="#review">Review</a></li> |
|---|
| 64 | <li><a id="t4" href="#complete">Complete</a></li> |
|---|
| 65 | |
|---|
| 66 | </ul> |
|---|
| 67 | |
|---|
| 68 | <form action="#" method="POST"> |
|---|
| 69 | <!-- panes --> |
|---|
| 70 | <div id="flowpanes"> |
|---|
| 71 | |
|---|
| 72 | |
|---|
| 73 | <!-- wrapper for scrollable items --> |
|---|
| 74 | <div class="items"> |
|---|
| 75 | |
|---|
| 76 | <div> |
|---|
| 77 | |
|---|
| 78 | <fieldset id="hostinfo"> |
|---|
| 79 | <legend>Host Information</legend> |
|---|
| 80 | |
|---|
| 81 | |
|---|
| 82 | <p> |
|---|
| 83 | <label for="hostname">Hostname <em>*</em></label> |
|---|
| 84 | <input id="hostname" type="text" name="hostname" /> |
|---|
| 85 | <span id="warn_hostname"></span> |
|---|
| 86 | </p> |
|---|
| 87 | <p> |
|---|
| 88 | <label for="description">Description</label> |
|---|
| 89 | <input id="description" type="text" name="description" /> |
|---|
| 90 | <span id="warn_description"></span> |
|---|
| 91 | </p> |
|---|
| 92 | <p> |
|---|
| 93 | <label for="ipaddress">IP Address <em>*</em></label> |
|---|
| 94 | <input id="ipaddress" type="text" name="ipaddress" /> |
|---|
| 95 | <span id="warn_hostname"></span> |
|---|
| 96 | </p> |
|---|
| 97 | |
|---|
| 98 | </fieldset> |
|---|
| 99 | |
|---|
| 100 | </div> |
|---|
| 101 | |
|---|
| 102 | <div> |
|---|
| 103 | |
|---|
| 104 | <fieldset id="templateinfo"> |
|---|
| 105 | <legend>Select Relevant Templates</legend> |
|---|
| 106 | |
|---|
| 107 | <p> |
|---|
| 108 | <select id="os"> |
|---|
| 109 | <option value="none">-- select --</option> |
|---|
| 110 | <option value="windows">Microsoft Windows</option> |
|---|
| 111 | <option value="linux">Linux</option> |
|---|
| 112 | <option value="switch">Switch</option> |
|---|
| 113 | </select> |
|---|
| 114 | </p> |
|---|
| 115 | <p> |
|---|
| 116 | <fieldset id="subtemplates"> |
|---|
| 117 | <legend>Templates</legend> |
|---|
| 118 | <p><input type="checkbox" class="left" /> <label>Microsoft Exchange</p> |
|---|
| 119 | <p style="clear: both"><input type="checkbox" class="left" /> <label>Microsoft SQL Server</p> |
|---|
| 120 | </fieldset> |
|---|
| 121 | </p> |
|---|
| 122 | </fieldset> |
|---|
| 123 | </div> |
|---|
| 124 | |
|---|
| 125 | <div> |
|---|
| 126 | <h2>Review</h2> |
|---|
| 127 | </div> |
|---|
| 128 | <div> |
|---|
| 129 | <h2>Complete</h2> |
|---|
| 130 | </div> |
|---|
| 131 | |
|---|
| 132 | </div> |
|---|
| 133 | |
|---|
| 134 | </div> |
|---|
| 135 | </form> |
|---|
| 136 | <p style="text-align:center;width:500px"> |
|---|
| 137 | <button class="custom prev">« Previous</button> |
|---|
| 138 | <button class="custom next">Next »</button> |
|---|
| 139 | |
|---|
| 140 | </p> |
|---|
| 141 | |
|---|
| 142 | <!-- activate tabs with JavaScript --> |
|---|
| 143 | <script> |
|---|
| 144 | |
|---|
| 145 | |
|---|
| 146 | // wait until document is fully scriptable |
|---|
| 147 | $(function() { |
|---|
| 148 | |
|---|
| 149 | // select #flowplanes and make it scrollable. use circular and navigator plugins |
|---|
| 150 | $("#flowpanes").scrollable({ circular: true, mousewheel: true }).navigator({ |
|---|
| 151 | |
|---|
| 152 | // select #flowtabs to be used as navigator |
|---|
| 153 | navi: "#flowtabs", |
|---|
| 154 | |
|---|
| 155 | // select A tags inside the navigator to work as items (not direct children) |
|---|
| 156 | naviItem: 'a', |
|---|
| 157 | |
|---|
| 158 | // assign "current" class name for the active A tag inside navigator |
|---|
| 159 | activeClass: 'current', |
|---|
| 160 | |
|---|
| 161 | // make browser's back button work |
|---|
| 162 | history: true |
|---|
| 163 | |
|---|
| 164 | }); |
|---|
| 165 | }); |
|---|
| 166 | </script> |
|---|
| 167 | <script type="text/javascript"> |
|---|
| 168 | $('#hostname').keypress(function() { |
|---|
| 169 | if ($('#warn_hostname').html() != "") { |
|---|
| 170 | $('#warn_hostname').html(""); |
|---|
| 171 | } |
|---|
| 172 | }); |
|---|
| 173 | |
|---|
| 174 | |
|---|
| 175 | $('#os').change(function() { |
|---|
| 176 | $('#subtemplates').show(); |
|---|
| 177 | }); |
|---|
| 178 | |
|---|
| 179 | $('#hostname').blur(function(e) { |
|---|
| 180 | if ($(this).val() == "") { |
|---|
| 181 | return false; |
|---|
| 182 | } |
|---|
| 183 | $.getJSON("/adagios/api/host/" + $(this).val() + ".json", function(json) { |
|---|
| 184 | if (json.host.host_name != "null") { |
|---|
| 185 | $('#warn_hostname').html('<img src="/static/attention.png" title="Hostname already exists" />'); |
|---|
| 186 | $("#warn_hostname img[title]").tooltip({ |
|---|
| 187 | |
|---|
| 188 | // place tooltip on the right edge |
|---|
| 189 | position: "center right", |
|---|
| 190 | |
|---|
| 191 | // a little tweaking of the position |
|---|
| 192 | offset: [-2, 10], |
|---|
| 193 | |
|---|
| 194 | // use the built-in fadeIn/fadeOut effect |
|---|
| 195 | effect: "fade", |
|---|
| 196 | |
|---|
| 197 | // custom opacity setting |
|---|
| 198 | opacity: 0.7 }); |
|---|
| 199 | $('#hostname').select(); |
|---|
| 200 | e.stopImmediatePropagation(); |
|---|
| 201 | } |
|---|
| 202 | }); |
|---|
| 203 | $.getJSON("/adagios/api/gethostbyname/" + $('#hostname').val(), function(json) { |
|---|
| 204 | $('#ipaddress').val(json.host); |
|---|
| 205 | }); |
|---|
| 206 | }); |
|---|
| 207 | |
|---|
| 208 | </script> |
|---|
| 209 | {% endblock %} |
|---|