Revision ed2f0452

b/snf-astakos-app/.settings/org.eclipse.core.resources.prefs
1
#Mon Nov 05 15:29:48 EET 2012
1
#Mon Nov 05 16:04:44 EET 2012
2 2
eclipse.preferences.version=1
3 3
encoding//astakos/im/migrations/0010_auto__add_field_astakosuser_activation_sent__chg_field_service_url.py=utf-8
4 4
encoding//astakos/im/migrations/0011_set_old_activation_sent.py=utf-8
5 5
encoding//astakos/im/migrations/0017_populate_resource_data.py=utf-8
6
encoding//astakos/im/migrations/0030_populate_resource_data.py=utf-8
b/snf-astakos-app/astakos/im/static/im/css/modules.css
350 350
table.alt-style tr td a.open					{ background-position:-16px 0} 
351 351

  
352 352
.projects .details a.edit						{ float:right; margin-left:20px;  }
353
.projects .details .data						{ overflow:hidden; }
353
.projects .details .data						{ overflow:hidden; }

354 354
.projects .editable form textarea				{ width:70%; height:50px; max-width:70%; width:270px; height:120px;}
355 355

  
356 356

  
......
361 361
.quotas-form fieldset legend span				{ color:#222; }
362 362
.quotas-form .with-checkbox .checkbox-widget	{ margin-top:12px; } 
363 363
.quotas-form .with-checkbox span.info 			{ bottom:22px; }
364

  
365 364
.quotas-form .form-row.submit					{ text-align:center; }
366 365
.quotas-form input[type="submit"]				{ margin:15px 0; background-color:#B3B3B3 }
367 366
.quotas-form input[type="submit"]:hover			{ background:#55B577 }
368 367
.quotas-form input[type="submit"]:focus			{ border-color: #B3B3B3}
369 368
.quotas-form input[type="submit"]:focus:hover	{ border-color: #55B577}
370
.quotas-form fieldset ul						{ padding:0; margin:0 0 1em; }
369
.quotas-form fieldset ul						{ padding:0; margin:0 0 1em; position:relative; }
371 370
.quotas-form fieldset ul li						{ list-style:none outside none; float:left; padding:0 0 0 60px; margin:0; }
372 371
.quotas-form fieldset ul li:first-child			{ padding-left:0; }
373 372
.quotas-form fieldset ul li a					{ display:block; width:82px; height:82px; overflow:hidden; }
374
.quotas-form fieldset ul li a:hover	img			{ margin-top:-151px; }
375
.quotas-form fieldset ul li a.selected img		{ margin-top:-313px; }
376

  
373
.quotas-form fieldset ul li a:hover	img			{ margin-top:-84px; }
374
.quotas-form fieldset ul li a.selected img		{ margin-top:-168px; }
377 375
.quotas-form fieldset ul li a.selected:focus	{ outline:0 none; }
376
.quotas-form fieldset ul li p					{ position:absolute; top:95px; left:0; display: none;}
377
.quotas-form fieldset ul li:hover p				{ display:block; }
378 378
.quotas-form p.msg								{ color:#B3B3B3; }
379 379
.quotas-form a.delete							{ position:absolute; right:0; top:0; color:#B3B3B3; z-index:2 }
380 380
.quotas-form .group								{ display:none; position:relative; background:url(../images/dots.jpg) repeat-x scroll center bottom; margin-bottom:2em; padding-bottom:2em;}
......
391 391
form.quotas-form legend span.info span			{ width:400px; }
392 392
.quotas-form .with-checkbox+.with-checkbox		{ width:196px; }
393 393
 
394
.quotas-form .radios label						{ font-size:1.077em; } 
395
.quotas-form .radios .radio-wrap label			{ width:auto; margin-right:11px;}
396
.quotas-form .radios .radio-wrap>.radio			{ float:left; margin:10px 10px 0 0; }  
397
.quotas-form .radios input[type="text"]			{ width:60px;  margin:9px 15px -9px;  padding:6px; display:none;}
398

  
399 394
/* stats */
400 395
.stats ul										{ margin:0; padding:0; list-style:none outside none; }
401 396
.stats ul li 									{ margin:0 0 1em 0; padding:0 0 1em 0; list-style:none outside none; background:url(../images/stats-line.jpg) repeat-x left bottom}
402 397
.stats .bar										{ padding: 0; text-align:center;  float:left; width:200px;}
403
.quotas-form p.msg								{ color:#B3B3B3; }
404
.quotas-form fieldset legend 					{ margin-bottom:1em; font-size:1.154em }
405
.quotas-form a.delete							{ position:absolute; right:0; top:0; color:#B3B3B3; }
406
.quotas-form .quota								{ display:none; }
407
.quotas-form fieldset ul li.rel+li.rel			{ background:url(../images/quota-related-bg.png) no-repeat left center; }
408
.quotas-form .quota	.with-checkbox input[type="text"] { width:100px; margin:10px 0 0; float:left;}
409
.quotas-form .quota .with-checkbox label		{ position:absolute; left:0; top:0; }
410
.quotas-form .quota .with-checkbox p			{ padding-left:224px; float:left; }
411
.quotas-form .quota .double-checkbox			{ float:left; }
412
.quotas-form .quota .double-checkbox + .double-checkbox label   { display:none; }
413
.quotas-form .quota .double-checkbox + .double-checkbox p		{ padding-left:20px; }
414
.quotas-form .quota .double-checkbox .checkbox-widget			{ position:static; }
415

  
416

  
417
/* stats */
418
.stats ul										{ margin:0; padding:0; list-style:none outside none; }
419
.stats ul li 									{ margin:0 0 1em 0; padding:0 0 1em 0; list-style:none outside none; background:url(../images/stats-line.jpg) repeat-x left bottom}
420
.stats .bar										{ padding:20px 0; text-align:center;  float:left; width:200px;}
421

  
422 398
.stats .bar div									{ width:340px; height:30px; border:1px solid #000;}
423 399
.stats .bar span								{ text-align:right; display:block; height:100%; color:#fff;  line-height:30px; font-size:1.231em; text-indent:50px;}
424 400
.stats .red .bar span							{ background:#ef4f54; }
b/snf-astakos-app/astakos/im/static/im/js/common.js
229 229
		$(this).hide();
230 230
	})
231 231
	
232
// quota form actions
233
	
234
	$('.quotas-form ul li a').click(function(e){
235
		e.preventDefault();
236
		$(this).addClass('selected');
237
		var id = $(this).attr('id');
238
		$('.quotas-form fieldset').each(function() {
239
			if($(this).hasClass(id)) {
240
				$(this).show('slow');
241
			}
242
		}); 	
243
		
244
	});
245
	
246
	$('.quotas-form fieldset .delete').click(function(e){
247
		e.preventDefault();
248
		$(this).parents('fieldset').find('input').val('');
249
		$(this).parents('fieldset').hide('slow');
250
		fieldsetClass = $(this).parents('fieldset').attr('class').replace('quota ', '');
251
		$('.quotas-form ul li a').each(function() {
252
			if($(this).attr('id')==fieldsetClass) {
253
				$(this).removeClass('selected');
254
			}
255
		}); 
256
		 
257
		 
258
	})
232
 
259 233
	
260 234
	
235
});
261 236
	
262 237
$(window).resize(function() {
263 238
    
......
266 241
		$('.widjets  li div').equalHeights();
267 242
	}
268 243

  
269
});
244
});
b/snf-astakos-app/astakos/im/static/im/js/forms.js
22 22
                if (src == "LABEL" || src == "label") {
23 23
                    el.toggleClass("checked");	
24 24
                    $this.attr('checked', el.hasClass("checked"));
25
                    $this.trigger('changed');
25 26
                };
26 27
                
27 28
            })
......
37 38
	  el.addClass(className);	
38 39
		
39 40
      el.click(function() {
41

  
40 42
        el.toggleClass("checked");
41 43
        $this.attr('checked', el.hasClass("checked"));
44
        $this.trigger('changed');
42 45
      });
43 46
      
44 47
      el.keypress(function(e){
......
47 50
      		e.preventDefault();
48 51
      		el.toggleClass("checked");
49 52
        	$this.attr('checked', el.hasClass("checked"));
53
        	$this.trigger('changed');
50 54
      	}
51 55
      })
52 56

  
b/snf-astakos-app/astakos/im/static/im/js/quotas.js
1 1
$(document).ready(function() {
2 2

  
3
	// quota form actions
4 3
	$('.quotas-form ul li a').click(function(e){
5
		//e.preventDefault();
4
		if ( $(this).hasClass('selected')){
5
			e.preventDefault();
6
		}
6 7
		if ( !$(this).hasClass('selected')){
7 8
			$(this).addClass('selected');
8 9
			var id = $(this).attr('id');
......
34 35
				$(this).removeClass('selected');
35 36
			}
36 37
		}); 
37
		
38 38
		 
39 39
		 
40 40
	});
41 41
	 
42 42
		
43
	$('.quotas-form .checkbox-widget.limited').click(function(e){
44
		e.preventDefault();
43
	$('.quotas-form input.limited').bind("changed", function(e){
45 44
		$(this).siblings('input[type="text"]').toggle();
46 45
		$(this).siblings('input[type="text"]').focus();
47 46
	 	parentdiv = $(this).parents('.form-row').prev('.form-row');
......
50 49
		 
51 50
	});
52 51
	
53
	$('.quotas-form .checkbox-widget.unlimited').click(function(e){
52
	$('.quotas-form input.unlimited').bind("changed", function(e){
54 53
		parentdiv = $(this).parents('.form-row').next('.form-row');
55 54
		if (parentdiv.find('.checkbox-widget').hasClass('checked')){
56 55
			parentdiv.find('.checkbox-widget').removeClass('checked');
......
63 62
		
64 63
	})
65 64
	
66
	$('input:radio').uniform();
65
	//$('input:radio').uniform();
67 66
	$('.radio .radio span').each(function(index) {	    
68 67
		if ($(this).hasClass('checked')){
69 68
			alert('f');
b/snf-astakos-app/astakos/im/synnefo_settings.py
43 43
    'django.contrib.contenttypes',
44 44
    'django.contrib.sessions',
45 45
    'django.contrib.messages',
46
    'djcelery',
47
    'debug_toolbar',
46
#    'djcelery',
47
#    'debug_toolbar',
48 48
]
49 49

  
50 50
context_processors = [
......
68 68
    'synnefo.lib.middleware.LoggingConfigMiddleware',
69 69
    'synnefo.lib.middleware.SecureMiddleware',
70 70
    'django.middleware.csrf.CsrfViewMiddleware',
71
    'debug_toolbar.middleware.DebugToolbarMiddleware',
71
#    'debug_toolbar.middleware.DebugToolbarMiddleware',
72 72
]
73 73

  
74 74
loggers = {
b/snf-astakos-app/astakos/im/templates/im/astakosgroup_form_demo.html
1 1
{% extends "im/account_base.html" %}
2 2

  
3 3
{% load filters %}
4
{% block page.body %}
5
 
6 4
{% block headjs %}
7 5
	{{ block.super }}	 
8 6
	<script src="{{ IM_STATIC_URL }}js/quotas.js"></script>	
9
{% endblock %}		
7
{% endblock %}	
8
{% block page.body %}
9
 
10
	
10 11
<form action="" method="post" class="withlabels quotas-form">{% csrf_token %}
11 12
	 
12 13
    <fieldset>
......
38 39
    		</div>
39 40
    		
40 41
    	</div> 
41
    </fieldset>       
42
    </fieldset>     
43
    
42 44
    <fieldset id="icons">
43 45
    	<legend>
44 46
    		2. CHOOSE RESOURCES
......
51 53
    {% with resource_catalog|lookup:'resources' as resources %}
52 54
    {% with resource_catalog|lookup:'groups' as groups %}    	
53 55
    	<ul class="clearfix">
54
            {% for g, rs in groups.items %}    		
55
    		<li><a href="#{{'group_'|add:g}}" id="{{'group_'|add:g}}"><img src="/static/im/images/create-resource-vm.png" alt="vm"/></a></li>
56
<!-- 
57
    		<li><a href="#storage_1" id="storage_1"><img src="/static/im/images/create-resource-storage.png" alt="storage"/></a></li>
58
 -->
56
            {% for g, rs in groups.items %}   
57
            {% with resource_presentation|lookup:g as group_info %} 		
58
    		<li>
59
    			<a href="#{{ g }}" id="{{'group_'|add:g}}"><img src="/static/im/images/create-{{ g }}.png" alt="vm"/></a>
60
    			<p class="msg">{{ group_info.help_text }}</p>
61
    		</li>
62
    		{% endwith %}
59 63
            {% endfor %}
60 64
    	</ul>
61
    	<!--p class="msg">if you choose CPU without selecting any VMs you must also select RAM and DISKSPACE</p-->
65
    	
62 66
    </fieldset>
67
   
63 68
    <div class="foo">
64 69
    
65 70
    </div>
66
    
71
    <div class="not-foo">
67 72
        {% for g, rs in groups.items %}
68
        <div class="{{'group_'|add:g}}">
69
			<a href="#icons" class="delete"><strong>X</strong> remove resource</a>	
73
        
74
        <div class="group {{'group_'|add:g}}" id="{{ g }}">
75
			<a href="#icons" class="delete">X remove resource</a>	
70 76
		    {% for r in rs %}
77
		    {% with resource_presentation|lookup:r as resource_info %}
78
		    {% with resources|lookup:r as resource%}
71 79
		    <fieldset class="quota storage">
72
		    	<legend>{{r|upper}}</legend>
73
<!-- 
74
		    	<div class="form-row">
80
		    	<legend>
81
		    		{{ r|get_value_after_dot|capfirst }}
82
		    		<span class="info"> 
83
				    	<em>more info</em>
84
				    	<span>{{ resource_info.help_text }}</span>
85
			    	</span>  
86
		    	</legend>
87
<!--	    	<div class="form-row">
75 88
		    		<p class="clearfix">
76 89
		    			<label for="num_storage">Total storage</label>
77 90
		    			<input type="text" name="num_storage">
78 91
		    			<span class="extra-img">&nbsp;</span>
79
		         		<span class="info"> 
80
					    	<em>more info</em>
81
					    	<span>Help Text</span>
82
				    	</span>
92
		         		<span class="info"><em>more info</em><span>Help Text</span></span>
83 93
		    		</p>
84
		    	</div>
85
 -->
86
		    	<div class="double-checks">
87
		    		<label>Max Storage per user</label>
94
		    	</div>-->
95
 				<div class="double-checks">
96
		    		<label>Max {{ r|get_value_after_dot }}{% if not resource.unit %}s {% endif  %} per user</label>
88 97
		    		<div class="form-row">
89 98
		    			<p class="clearfix">
90 99
		    				<label for="{{r|add:'_unlimited'}}">Unlimited</label>
......
101 110
		    		
102 111
		    	</div> 
103 112
		    </fieldset>
113
		    {% endwith %}
114
		    {% endwith %}
104 115
		    {% endfor %}
105 116
	    </div>
106
    {% endfor %}
107

  
117
	    
118
    	{% endfor %}
119
	</div>
108 120
    {% endwith %}
109 121
    {% endwith %}
110
	</div>
122
	 
111 123
    <div class="form-row submit">
112 124
   		<input type="submit" value="SUBMIT" class="submit altcol" autocomplete="off">
113 125
	</div>     
......
117 129
	
118 130
</script>	 
119 131
 
120
{% endblock %}
132
{% endblock %}
b/snf-astakos-app/astakos/im/templatetags/filters.py
141 141
    if isinstance(d, defaultdict):
142 142
        return d.iteritems()
143 143
    return d
144

  
145

  
146
@register.filter
147
def get_value_after_dot(value):
148
    return value.split(".")[1]
b/snf-astakos-app/astakos/im/views.py
1162 1162
        }
1163 1163
        form = form_class(data)
1164 1164

  
1165
    resource_presentation = {
1166
       'compute': {
1167
            'help_text':'group compute help text',
1168
                     
1169
        },
1170
        'storage': {
1171
            'help_text':'group storage help text',
1172
                      
1173
        },  
1174
        'pithos+.diskspace': {
1175
            'help_text':'resource pithos+.diskspace help text',
1176
                      
1177
        },  
1178
        'cyclades.vm': {
1179
            'help_text':'resource cyclades.vm help text resource cyclades.vm help text resource cyclades.vm help text resource cyclades.vm help text',
1180
                      
1181
        },  
1182
        'cyclades.disksize': {
1183
            'help_text':'resource cyclades.disksize help text',
1184
                      
1185
        },  
1186
        'cyclades.ram': {
1187
            'help_text':'resource cyclades.ram help text',
1188
                      
1189
        }                        
1190
                             
1191
    }
1192
    
1165 1193
    # Create the template, context, response
1166 1194
    template_name = "%s/%s_form_demo.html" % (
1167 1195
        model._meta.app_label,
......
1171 1199
    c = RequestContext(request, {
1172 1200
        'form': form,
1173 1201
        'kind': kind,
1174
        'resource_catalog':resource_catalog
1202
        'resource_catalog':resource_catalog,
1203
        'resource_presentation':resource_presentation
1175 1204
    }, context_processors)
1176 1205
    return HttpResponse(t.render(c))
1177 1206

  
b/snf-astakos-app/setup.py
83 83
    'commissioning',
84 84
    'celery',
85 85
    'requests',
86
    'inflect'
86
    'inflect',
87
#TODO add commissioning
87 88
]
88 89

  
89 90
EXTRAS_REQUIRES = {

Also available in: Unified diff