Revision 5186eb04 ui/templates/machines.html

b/ui/templates/machines.html
185 185
    <hr class="topruler" />
186 186
    <hr class="fatruler" />
187 187
    <div class="content">
188
        <ul>
189
            <li class="meta-template">
188
        <ul class="meta-template" style="display:none">
189
            <li>
190 190
                <label>{% trans "Metadata key" %}</label>
191 191
                <button type="button" class="remove">{% trans "remove x" %}</button>
192 192
                <hr class="meta-separator">
......
194 194
                <button type="button" class="edit">{% trans "edit" %}</button>
195 195
            </li>
196 196
        </ul>
197
        <ul class="meta-list">
198
        </ul>
197 199
    </div>
198 200
    <button type="button" class="create">{% trans "Create New+" %}</button>
199 201
    <div class="bottomruler" /> 
......
593 595
        oneInstance: false,
594 596
        load: false
595 597
    });
596
    // get metadata for current server
597
    //get_metadata(serverID);
598
    // get metadata for current server and fill the dialog
599
    serverID = $("#editor-1 h3").attr('id');
600
    get_metadata(serverID);
598 601
    $("a#meta-editor-1").data('overlay').load();
599 602
    return false; 
600 603
}
......
652 655
    editMetadata();
653 656
});
654 657

  
658
// update metadata in edit dialog
659
function update_metadata(data) {
660

  
661
    meta = data.metadata.values;
662

  
663
    for (key in meta) {
664
        alert(key);
665
        alert(meta[key]);
666
        pair = $("ul.meta-template li").clone();
667
        pair.find("label").text(key);
668
        pair.find("p").text(meta[key]);
669
        pair.appendTo("#editor-1 div.content ul.meta-list");
670
    }
671
}
672

  
655 673
// basic functions executed on page load
656 674
if (images.length > 0) {
657 675
    // populate image list

Also available in: Unified diff