Revision 52343ac8

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; }
354
<<<<<<< HEAD
353
.projects .details .data						{ overflow:hidden; }
355 354
.projects .editable form textarea				{ width:70%; height:50px; max-width:70%; width:270px; height:120px;}
356 355

  
357 356

  
358 357
/* quotas-form  */
358

  
359 359
.quotas-form fieldset							{ background:url(../images/dots.jpg) repeat-x scroll center bottom transparent; margin-bottom:3em; padding-bottom:3em; position:relative; }
360 360
.quotas-form fieldset legend					{ color:#55B577; font-size:1.308em; margin-bottom:2em; }
361 361
.quotas-form .with-checkbox .checkbox-widget	{ margin-top:14px; } 
......
366 366
.quotas-form input[type="submit"]:focus			{ border-color: #B3B3B3}
367 367
.quotas-form input[type="submit"]:focus:hover	{ border-color: #55B577}
368 368
.quotas-form fieldset ul						{ padding:0; margin:0 0 1em; }
369
.quotas-form fieldset ul li						{ list-style:none outside none; float:left; padding:0 0 0 59px; margin:0; }
369
.quotas-form fieldset ul li						{ list-style:none outside none; float:left; padding:0 0 0 60px; margin:0; }
370 370
.quotas-form fieldset ul li:first-child			{ padding-left:0; }
371
.quotas-form fieldset ul li a					{ display:block; border:1px solid #222; color:#222; padding:10px 20px; }
372
.quotas-form fieldset ul li a:hover				{ text-decoration:none; border-color:#55B577; color:#55B577; }
373
.quotas-form fieldset ul li a.selected			{ background:#55B577; color:#fff; border-color:#55B577; }
371
.quotas-form fieldset ul li a					{ display:block; width:82px; height:82px; overflow:hidden; }
372
.quotas-form fieldset ul li a:hover	img			{ margin-top:-151px; }
373
.quotas-form fieldset ul li a.selected img		{ margin-top:-313px; }
374 374
.quotas-form p.msg								{ color:#B3B3B3; }
375 375
.quotas-form fieldset legend 					{ margin-bottom:1em; font-size:1.154em }
376 376
.quotas-form a.delete							{ position:absolute; right:0; top:0; color:#B3B3B3; }
377 377
.quotas-form .quota								{ display:none; }
378 378
.quotas-form fieldset ul li.rel+li.rel			{ background:url(../images/quota-related-bg.png) no-repeat left center; }
379
.quotas-form .quota	.with-checkbox input[type="text"] { width:100px; margin:10px 0 0; float:left;}
380
.quotas-form .quota .with-checkbox label		{ position:absolute; left:0; top:0; }
381
.quotas-form .quota .with-checkbox p			{ padding-left:224px; float:left; }
382
.quotas-form .quota .double-checkbox			{ float:left; }
383
.quotas-form .quota .double-checkbox + .double-checkbox label   { display:none; }
384
.quotas-form .quota .double-checkbox + .double-checkbox p		{ padding-left:20px; }
385
.quotas-form .quota .double-checkbox .checkbox-widget			{ position:static; }
386

  
379 387

  
380 388
/* stats */
381 389
.stats ul										{ margin:0; padding:0; list-style:none outside none; }
......
389 397
.stats .img-wrap								{ float:left; width:100px; background:url(../images/statistics_icons.png) no-repeat center center; padding:30px 0; }
390 398
.stats .info									{ margin:0 25px ; width:320px; float:left;  }
391 399
.stats .info p									{ color:#999; margin:0; }
392
.stats .info h3									{ font-size:1.231em; }
393
.stats .red.vm .img-wrap						{ background-position: 15px 7px; }
394
.stats .yellow.vm .img-wrap						{ background-position: -124px 7px; }
395
.stats .green.vm .img-wrap						{ background-position: -263px 7px; }
396
.stats .red.ram .img-wrap						{ background-position: 15px -125px; }
397
.stats .yellow.ram .img-wrap					{ background-position: -124px -125px; }
398
.stats .green.ram .img-wrap						{ background-position: -263px -125px;}
399
.stats .red.disks .img-wrap						{ background-position: 15px -248px; }
400
.stats .yellow.disks .img-wrap					{ background-position: -124px -248px; }
401
.stats .green.disks .img-wrap					{ background-position: -263px -248px;}
400
.stats .info h3									{ font-size:1.231em; color:#222222 }
401
.stats .vm .img-wrap							{ background-image:url(../images/vm-stats.png) }
402
.stats .ram .img-wrap							{ background-image:url(../images/ram-stats.png) }
403
.stats .network .img-wrap						{ background-image:url(../images/network-stats.png) }
404
.stats .disk .img-wrap							{ background-image:url(../images/disk-stats.png) }
405
.stats .storage .img-wrap						{ background-image:url(../images/storage-stats.png) }
406
.stats .bandwidth .img-wrap						{ background-image:url(../images/bandwidth-stats.png) }
407

  
408
.stats .red .img-wrap							{ background-position: 15px 7px; }
409
.stats .yellow .img-wrap						{ background-position: -124px 7px; }
410
.stats .green .img-wrap							{ background-position: -263px 7px; }
402 411
.projects .editable form textarea				{ width:70%; height:50px; max-width:70%; width:270px; height:120px;}
b/snf-astakos-app/astakos/im/templates/im/astakosuserquota_list.html
5 5
{% block page.body %}
6 6
<div class="maincol {% block innerpage.class %}{% endblock %}">
7 7
    <div class="stats clearfix">
8
    	<ul>
9
    		<li class="clearfix red vm">
8
		<ul>
9
			{% for r in data.resources %}
10
			 
11
    		<li class="clearfix  {{ r.load_class }} {{ r.name}}">
10 12
    			<div class="img-wrap">&nbsp;</div>
11 13
    			<div class="info">
12
    				<h3>Number of Vms</h3>
14
    				<h3>{{ r.description }}</h3>
13 15
    				<p>
14
    					XX% Used<br>
15
    					That is XXX of your XXX MB of virtual RAM - Aouch!
16
    					{{ r.ratio|floatformat }}% Used<br>
17
    					You are using {{ r.currValue }} {{ r.unit }} out of your {{ r.maxValue }}{{ r.unit }} {{ r.plural|capfirst }} - Aouch!
16 18
    				</p>
17 19
    			</div>
18 20
    			<div class="bar">
19
    				<div><span style="width:89%;">89%&nbsp;</span></div>
20
    			</div>
21
    		</li>
22
    		<li class="clearfix yellow ram">
23
    			<div class="img-wrap">&nbsp;</div>
24
    			<div class="info">
25
    				<h3>Number of RAMs</h3>
26
    				<p>
27
    					XX% Used<br>
28
    					That is XXX of your XXX MB of virtual RAM - Aouch!
29
    				</p>
30
    			</div>
31
    			<div class="bar">
32
    				<div><span style="width:30%;">30%&nbsp;</span></div>
33
    			</div>
34
    		</li>
35
    		<li class="clearfix green disks">
36
    			<div class="img-wrap">&nbsp;</div>
37
    			<div class="info">
38
    				<h3>Number of Vms</h3>
39
    				<p>
40
    					XX% Used<br>
41
    					That is XXX of your XXX MB of virtual RAM - Aouch!
42
    				</p>
43
    			</div>
44
    			<div class="bar">
45
    				<div><span style="width:60%;">30%&nbsp;</span></div>
21
    				<div><span style="width:{{ r.ratio|floatformat }}%;">{{ r.ratio|floatformat }}% &nbsp;&nbsp;</span></div>
46 22
    			</div>
47 23
    		</li>
24
    		{% endfor %}
48 25
    	</ul>
49 26
    </div>    
50 27
    <!--
......
83 60
                    </tbody>
84 61
                </table>
85 62
            {% endfor %}
86
    </div>-->
63
    </div>
87 64
        <form action="" method="post"
88 65
	            class="withlabels">{% csrf_token %}
89 66
	            {% include "im/form_render.html" %}
......
112 89
                {% endif %}
113 90
            {% endwith %}
114 91
        {% endif %}
115
	    </table>
92
	    </table>-->
116 93
    </div>
117 94
</div>
118 95
{% endblock %}
b/snf-astakos-app/astakos/im/views.py
1044 1044
    else:
1045 1045
        form = PickResourceForm()
1046 1046
        q = AstakosGroupQuota.objects.none()
1047
        
1048
    data ={
1049
        'resources':[{
1050
            'name': 'vm',
1051
            'description': 'Number Of Vms',
1052
            'unit':'',
1053
            'maxValue':'100',
1054
            'currValue':'50'
1055
            },{
1056
            'name': 'ram',
1057
            'description':'Total Ram Usage',
1058
            'unit':'GB',
1059
            'maxValue':'4',
1060
            'currValue':'1' 
1061
            },{
1062
            'name': 'storage', 
1063
            'description':'Total Disk Space Used',
1064
            'unit':'GB',
1065
            'maxValue':'200',
1066
            'currValue':'180'             
1067
            },{
1068
            'name': 'disk', 
1069
            'description':'Disks Used',
1070
            'unit':'GB',
1071
            'maxValue':'16',
1072
            'currValue':'16'
1073
            },{
1074
            'name': 'network', 
1075
            'description':'Private Networks Used',
1076
            'unit':'',
1077
            'maxValue':'2',
1078
            'currValue':'1'
1079
            },{
1080
            'name': 'bandwidth', 
1081
            'description':'Bandwidth Monitoring Device',
1082
            'unit':'Gbps',
1083
            'maxValue':'200',
1084
            'currValue':'50'
1085
            }]              
1086
    } 
1087
    
1088
    def with_class(entry):
1089
        entry['load_class'] = 'red'
1090
        max_value = float(entry['maxValue'])
1091
        curr_value = float(entry['currValue'])
1092
        entry['ratio'] = (curr_value/max_value)*100
1093
        if entry['ratio'] < 66:
1094
            entry['load_class']='yellow'
1095
        if entry['ratio'] < 33:
1096
            entry['load_class']='green'
1097
        
1098
        return entry 
1099
    
1100
    def pluralize(entry):
1101
        if entry['unit'] == '':
1102
            entry['plural'] = entry['name']+'s'
1103
        else:
1104
            entry['plural'] = entry['name']
1105
        
1106
        return entry       
1107

  
1108
    data['resources'] = map(with_class, data['resources']) 
1109
    data['resources'] = map(pluralize, data['resources'])        
1110
    
1047 1111
    return object_list(request, q,
1048 1112
                       template_name='im/astakosuserquota_list.html',
1049
                       extra_context={'form': form})
1113
                       extra_context={'form': form, 'data':data})
1050 1114

  
1051 1115

  
1052 1116
def group_create_list(request):
......
1062 1126
    
1063 1127
    today = datetime.today()
1064 1128
    month_last_day= calendar.monthrange(today.year, today.month)[1]
1065
    
1129
    data['resources'] = map(with_class,data['resources'])        
1066 1130
    start = request.POST.get('datefrom', None)
1067 1131
    if start:
1068 1132
        today = datetime.fromtimestamp(int(start))
......
1150 1214
                           form=form,
1151 1215
                           timeline_header=timeline_header,
1152 1216
                           timeline_body=timeline_body)
1153
    return data
1217
    return data 

Also available in: Unified diff