Changeset d92ba08


Ignore:
Timestamp:
05/27/11 17:04:33 (2 years ago)
Author:
Tomas Edwardsson <tommi@…>
Branches:
master
Children:
6cac7d2
Parents:
66fc4db
git-author:
Tomas Edwardsson <tommi@…> (05/27/11 17:04:33)
git-committer:
Tomas Edwardsson <tommi@…> (05/27/11 17:04:33)
Message:

Massed the addhost

Location:
adagios
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • adagios/media/css/style.css

    r63cbec6 rd92ba08  
    119119        display: none; 
    120120} 
     121 
     122 
     123 
     124fieldset .subtemplate { 
     125        display: none; 
     126} 
  • adagios/templates/configurator/addhost.html

    r63cbec6 rd92ba08  
    22{% extends "configurator/base.html" %} 
    33 
    4 {% block title %}Characters{% endblock %} 
     4{% block title %}Adagios - Add Host{% endblock %} 
    55 
    66{% block sidebar %}arg {% endblock %} 
     
    99                $(document).ready(function() { 
    1010                        $('#hostname').focus(); 
     11                        $.getJSON("/adagios/api/get_templates.json", function(json) { 
     12                                deferred = []; 
     13                                $.each(json.templates, function(key, object) { 
     14                                        if (object.parents.length == 0) { 
     15                                                 
     16                                                $('#os').append($('<option></option>').val(key).text(object.name)); 
     17                                                $('#subtemplates').append("<fieldset class='subtemplate' id='subtemplate_" + key + "'><legend>Templates</legend></fieldset>"); 
     18                                        } else { 
     19                                                deferred.push(key); 
     20                                        } 
     21                                                        /* <p><input type="checkbox" class="left" /> <label>Microsoft Exchange</p> 
     22                                                        <p style="clear: both"><input type="checkbox" class="left" /> <label>Microsoft SQL Server</p> 
     23                                        <fieldset class="subtemplates" id="subtemplates"> 
     24                                                    <legend>Templates</legend> 
     25                                                  </fieldset> */ 
     26                                }); 
     27                                $.each(deferred, function(key, template) { 
     28                                        $.each(json.templates[template].parents, function(i, parent) { 
     29                                                $('#subtemplate_' + parent).append('<p style="clear: both"><input type="checkbox" name="' + template + ' class="left" /> <label>' + json.templates[template].name + '</p>'); 
     30                                        }); 
     31                                }); 
     32                        }); 
    1133                }); 
    1234 
     
    108130                                                    <select id="os"> 
    109131                                                      <option value="none">-- select --</option> 
    110                                                       <option value="windows">Microsoft Windows</option> 
    111                                                       <option value="linux">Linux</option> 
    112                                                       <option value="switch">Switch</option> 
    113132                                                    </select> 
    114133                                                </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> 
     134                                                <p id="subtemplates"> 
     135                                                   
    121136                                                </p> 
    122137                        </fieldset> 
     
    137152        <button class="custom prev">&laquo; Previous</button> 
    138153        <button class="custom next">Next &raquo;</button> 
    139  
    140154</p> 
    141155 
     
    174188                                 
    175189                                $('#os').change(function() { 
    176                                         $('#subtemplates').show(); 
     190                                        $('.subtemplate').hide();                                        
     191                                        $('#subtemplate_' + $('#os').val()).show(); 
    177192                                }); 
    178193                                 
Note: See TracChangeset for help on using the changeset viewer.