Revision 7d311ba1

b/ui/templates/home.html
32 32
            '404' : '{% trans "Your request has failed. Resource not found." %}',
33 33
            // internal server error
34 34
            '501' : '{% trans "There has been an Internal Error. Our administrators have been notified." %}',
35
            // no images unavailable
35 36
            // service unavailable
36 37
            '503' : '{% trans "This service is unavailable right now, please try again later." %}'
38
            'no_images' : '{% trans "Cannot show the Create machine wizard: No images found." %}',
39
            // no images unavailable
40
            'no_flavors' : '{% trans "Cannot show the Create machine wizard: No machine configurations found." %}',
37 41
        };
38 42
        
39 43
        var SUCCESS = {
b/ui/templates/machines.html
201 201
$("a#create").click(function(){
202 202

  
203 203
    //do not launch wizard if no images or flavors are found
204
    if (images.length == 0 || flavors.length == 0){
205
        ajax_error(503);
204
    if (images.length == 0)
205
      {
206
        function fake_jqXHR() {
207
        this.status = 'no_images';
208
        }
209
        var jqXHR = new fake_jqXHR();
210
        ajax_error(jqXHR);
211
        return false;
212
      } 
213
    else if (flavors.length == 0)
214
      {
215
        function fake_jqXHR() {
216
        this.status = 'no_flavors';
217
        }
218
        var jqXHR = new fake_jqXHR();
219
        ajax_error(jqXHR);
206 220
        return false;
207
    } else {
221
      } 
222
    else 
223
      {
208 224
        $("#wizard").scrollable().begin();
209 225
        $("#wizard").show();
210 226
        $('a#create').data('overlay').load()    
211
    }
227
      }
212 228
});
213 229

  
214 230
// create wizard overlay

Also available in: Unified diff