Revision aca1d431

View differences:

src/sunstone/public/js/plugins/clusters-tab.js
160 160
    <div class="form_buttons row">\
161 161
        <button class="button success right radius" type="submit" id="create_cluster_submit" value="OpenNebula.Cluster.create">' + tr("Create") + '</button>\
162 162
        <button class="button right radius" type="submit" id="update_cluster_submit">' + tr("Update") + '</button>\
163
        <button class="button secondary radius" type="reset" value="reset">' + tr("Reset") + '</button>\
164 163
        <button class="close-reveal-modal button secondary radius" type="button" value="close">' + tr("Close") + '</button>\
165 164
    </div>\
166 165
        <a class="close-reveal-modal">&#215;</a>\
src/sunstone/public/js/plugins/files-tab.js
74 74
  <div class="panel">\
75 75
    <h3><small>'+tr("Create File")+'</small></h4>\
76 76
  </div>\
77
  <div class="reveal-body">\
78 77
     <form id="create_file_form_easy" action="" class="custom creation">\
78
  <div class="reveal-body">\
79 79
            <div class="row vm_param">\
80 80
              <div class="six columns">\
81 81
                <div class="row">\
......
172 172
            </div>\
173 173
            </div>\
174 174
            <hr>\
175
      </form>\
176 175
      <div class="form_buttons">\
177 176
        <button class="button success radius right" id="create_file_submit" value="file/create">'+tr("Create")+'</button>\
178 177
        <button class="button secondary radius" type="reset" value="reset">'+tr("Reset")+'</button>\
179 178
        <button class="close-reveal-modal button secondary radius" type="button" value="close">' + tr("Close") + '</button>\
180 179
      </div>\
181 180
  <a class="close-reveal-modal">&#215;</a>\
181
      </form>\
182 182
</div>';
183 183

  
184 184
var dataTable_files;
src/sunstone/public/js/plugins/images-tab.js
74 74
  <div class="panel">\
75 75
    <h3><small>'+tr("Create Image")+'</small></h4>\
76 76
  </div>\
77
  <form id="create_image" action="" class="custom creation">\
77 78
        <dl class="tabs">\
78 79
        <dd class="active"><a href="#img_easy">'+tr("Wizard")+'</a></dd>\
79 80
          <dd><a href="#img_manual">'+tr("Advanced mode")+'</a></dd>\
......
81 82
        <ul class="tabs-content">\
82 83
        <li id="img_easyTab" class="active">\
83 84
        <div class="reveal-body">\
84
           <form id="create_image_form_easy" action="" class="custom creation">\
85 85
                  <div class="row vm_param">\
86 86
                    <div class="six columns">\
87 87
                      <div class="row">\
......
256 256
                  </div>\
257 257
                  </div>\
258 258
                  <hr>\
259
            </form>\
260 259
            <div class="form_buttons">\
261 260
              <button class="button success radius right" id="create_image_submit" value="image/create">'+tr("Create")+'</button>\
262 261
              <button class="button secondary radius" type="reset" value="reset">'+tr("Reset")+'</button>\
......
265 264
        </li>\
266 265
        <li id="img_manualTab">\
267 266
        <div class="reveal-body">\
268
            <form id="create_image_form_manual" action="" class="custom">\
269 267
                 <h4><small>'+tr("Write the image template here")+'</small></h4>\
270 268
                 <label for="img_datastores_raw">'+tr("Datastore")+':</label>\
271 269
                 <select id="img_datastore_raw" name="img_datastore_raw">\
......
278 276
                 <button class="button secondary radius" type="reset" value="reset">'+tr("Reset")+'</button>\
279 277
                 <button class="close-reveal-modal button secondary radius" type="button" value="close">' + tr("Close") + '</button>\
280 278
               </div>\
281
           </form>\
282 279
        </li>\
283 280
        </ul>\
284 281
        <a class="close-reveal-modal">&#215;</a>\
282
           </form>\
285 283
</div>';
286 284

  
287 285
var dataTable_images;
src/sunstone/public/js/plugins/templates-tab.js
67 67

  
68 68

  
69 69
var create_template_tmpl = '<div class="panel">'+
70
  '<h3><small>'+tr("Create VM Template")+'</small></h4>'+
70
  '<h3><small id="create_template_header">'+tr("Create VM Template")+'</small><small id="update_template_header" class="hidden">'+tr("Update VM Template")+'</small></h3>'+
71 71
  '</div>'+
72
  '<form class="custom creation">'+
73
        '<div class="reveal-body">'+
72 74
  '<div class="row">'+
73 75
    '<div class="columns three">'+
74 76
        '<dl id="template_create_tabs" class="tabs vertical">'+
75 77
        '</dl>'+
76 78
    '</div>'+
77 79
    '<div class="columns nine">'+
78
        '<div class="reveal-body">'+
79
        '<form class="custom creation">'+
80 80
            '<ul id="template_create_tabs_content" class="tabs-content">'+
81 81
            '</ul>'+
82
        '</form>'+
83
        '</div>'+
84 82
    '</div>'+
85 83
  '</div>'+
84
        '</div>'+
86 85
  '<div class="">'+
87 86
      '<hr>'+
88 87
      '<button class="success button radius" id="create_template_form_easy" value="OpenNebula.Template.create" style="float: right">'+tr("Create")+'</button>'+
89 88
      '<button class="button hidden radius" id="template_template_update_button" value="Template.update_template" style="float: right">'+tr("Update")+'</button>'+
90
      '<button class="button secondary radius" id="template_template_reset_button" value="">'+tr("Reset")+'</button>'+
89
      '<button class="button secondary radius" id="template_template_reset_button" value="reset" type="reset">'+tr("Reset")+'</button>'+
90
      '<button class="button secondary hidden radius" id="template_template_reset_button_update" value="reset" type="reset">'+tr("Reset")+'</button>'+
91 91
      '<button class="close-reveal-modal button secondary radius" type="button" value="close">' + tr("Close") + '</button>'+
92 92
  '</div>'+
93
  '<a class="close-reveal-modal">&#215;</a>';
93
  '<a class="close-reveal-modal">&#215;</a>'+
94
  '</form>';
94 95

  
95 96

  
96 97
var update_template_tmpl =
......
3012 3013
    //  tabs.tabs("option", "active", selected-1);
3013 3014
    //});
3014 3015

  
3016

  
3015 3017
    $('#template_template_reset_button').click(function(){
3016
        $create_template_dialog.trigger("reveal:close")
3017 3018
        $create_template_dialog.empty();
3018 3019
        setupCreateTemplateDialog();
3019
        $create_template_dialog.reveal();
3020

  
3021
        $('button#create_template_form_easy', $create_template_dialog).show();
3022
        $('button#template_template_update_button', $create_template_dialog).hide();
3023
        $('button#template_template_reset_button', $create_template_dialog).show();
3024
        $('button#template_template_reset_button_update', $create_template_dialog).hide();
3025

  
3026
        $('#create_template_header', $create_template_dialog).show();
3027
        $('#update_template_header', $create_template_dialog).hide();
3028

  
3029
    });
3030

  
3031
    $('#template_template_reset_button_update').click(function(){
3032
        $create_template_dialog.empty();
3033
        setupCreateTemplateDialog();
3034

  
3035
        $('button#create_template_form_easy', $create_template_dialog).hide();
3036
        $('button#template_template_update_button', $create_template_dialog).show();
3037
        $('button#template_template_reset_button', $create_template_dialog).hide();
3038
        $('button#template_template_reset_button_update', $create_template_dialog).show();
3039

  
3040
        $('#create_template_header', $create_template_dialog).hide();
3041
        $('#update_template_header', $create_template_dialog).show();
3020 3042
    });
3021 3043

  
3022 3044
    add_capacityTab();
......
3231 3253
    });
3232 3254

  
3233 3255
    //Reset form - empty boxes
3234
    $('button#reset_vm_form',dialog).click(function(){
3235
        $('select#disks_box option',section_disks).remove();
3236
       $('select#nics_box option',section_networks).remove();
3237
        $('select#inputs_box option',section_inputs).remove();
3238
        $('select#custom_var_box option',section_custom_var).remove();
3239
        return true;
3240
    });
3256
    //$('button#reset_vm_form',dialog).click(function(){
3257
    //    $('select#disks_box option',section_disks).remove();
3258
    //   $('select#nics_box option',section_networks).remove();
3259
    //    $('select#inputs_box option',section_inputs).remove();
3260
    //    $('select#custom_var_box option',section_custom_var).remove();
3261
    //    return true;
3262
    //});
3241 3263
}
3242 3264

  
3243 3265
function popUpUpdateTemplateDialog(){
3244 3266
    $('button#create_template_form_easy', $create_template_dialog).hide();
3245 3267
    $('button#template_template_update_button', $create_template_dialog).show();
3268
    $('button#template_template_reset_button', $create_template_dialog).hide();
3269
    $('button#template_template_reset_button_update', $create_template_dialog).show();
3270

  
3271
    $('#create_template_header', $create_template_dialog).hide();
3272
    $('#update_template_header', $create_template_dialog).show();
3246 3273

  
3247 3274
    $create_template_dialog.reveal();
3248 3275
};
......
3250 3277
function popUpCreateTemplateDialog(){
3251 3278
    $('button#create_template_form_easy', $create_template_dialog).show();
3252 3279
    $('button#template_template_update_button', $create_template_dialog).hide();
3280
    $('button#template_template_reset_button', $create_template_dialog).show();
3281
    $('button#template_template_reset_button_update', $create_template_dialog).hide();
3282

  
3283
    $('#create_template_header', $create_template_dialog).show();
3284
    $('#update_template_header', $create_template_dialog).hide();
3253 3285

  
3254 3286
    $create_template_dialog.reveal();
3255 3287
};
src/sunstone/public/js/plugins/vnets-tab.js
78 78
        </dl>\
79 79
        <ul class="tabs-content">\
80 80
        <li class="active" id="easyTab">\
81
        <div class="reveal-body">\
82 81
           <form id="create_vn_form_easy" action="" class="creation">\
82
        <div class="reveal-body">\
83 83
            <div class="row">\
84 84
              <div class="three columns">\
85 85
                <label class="right inline" for="name" >' + tr("Name") + ':</label>\
......
240 240
                  <div class="one columns">\
241 241
                  </div>\
242 242
                </div>\
243
              </div>\<div class="six columns">\
243
              </div>\
244
              <div class="six columns">\
244 245
                <div class="row">\
245 246
                  <div class="four columns">\
246 247
                    <label class="right inline" for="vlan">'+tr("VLAN")+':</label>\
......
316 317
                 </div>\
317 318
              </fieldset>\
318 319
            </div>\
319
        </form>\
320 320
        </div>\
321 321
        <hr>\
322 322
        <div class="form_buttons">\
......
326 326
          <button class="button secondary radius" type="reset" value="reset">'+tr("Reset")+'</button>\
327 327
          <button class="close-reveal-modal button secondary radius" type="button" value="close">' + tr("Close") + '</button>\
328 328
        </div>\
329
        </form>\
329 330
      </li>\
330 331
      <li id="manualTab">\
331
        <div class="reveal-body">\
332 332
        <form id="create_vn_form_manual" action="">\
333
        <div class="reveal-body">\
333 334
           <h4><small>'+tr("Write the Virtual Network template here")+'</small></h4>\
334 335
               <textarea id="template" rows="15" style="width:100%;"></textarea>\
335
          </form>\
336 336
          </div>\
337 337
          <hr>\
338 338
                <div class="form_buttons">\
......
342 342
                <button class="button secondary radius" type="reset" value="reset">'+tr("Reset")+'</button>\
343 343
                <button class="close-reveal-modal button secondary radius" type="button" value="close">' + tr("Close") + '</button>\
344 344
                </div>\
345
          </form>\
345 346
        </li>\
346 347
    </ul>\
347 348
    <a class="close-reveal-modal">&#215;</a>\

Also available in: Unified diff