Fixes for report page
authorOlga Brani <olgabrani@grnet.gr>
Thu, 8 Nov 2012 13:23:19 +0000 (15:23 +0200)
committerOlga Brani <olgabrani@grnet.gr>
Thu, 8 Nov 2012 13:23:19 +0000 (15:23 +0200)
Bypass group list page

snf-astakos-app/astakos/im/static/im/css/modules.css
snf-astakos-app/astakos/im/templates/im/astakosgroup_list.html
snf-astakos-app/astakos/im/templates/im/resource_list.html
snf-astakos-app/astakos/im/views.py

index 44148aa..5f98021 100644 (file)
@@ -402,7 +402,7 @@ form.quotas-form legend span.info span                      { width:395px; }
 .stats ul                                                                              { margin:0; padding:0; list-style:none outside none; }\r
 .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}\r
 .stats .bar                                                                            { padding: 0; text-align:center;  float:left; width:200px;}\r
-.stats .bar div                                                                        { width:340px; height:30px; border:1px solid #000;}\r
+.stats .bar div                                                                        { width:340px; height:30px; border:1px solid #000; margin-top:20px;}\r
 .stats .bar span                                                               { text-align:right; display:block; height:100%; color:#fff;  line-height:30px; font-size:1.231em; text-indent:50px;}\r
 .stats .red .bar span                                                  { background:#ef4f54; }\r
 .stats .yellow .bar span                                               { background:#f6921e; }\r
@@ -414,8 +414,8 @@ form.quotas-form legend span.info span                      { width:395px; }
 .stats .vm .img-wrap                                                   { background-image:url(../images/vm-stats.png) }\r
 .stats .ram .img-wrap                                                  { background-image:url(../images/ram-stats.png) }\r
 .stats .network .img-wrap                                              { background-image:url(../images/network-stats.png) }\r
-.stats .disk .img-wrap                                                 { background-image:url(../images/disk-stats.png) }\r
-.stats .storage .img-wrap                                              { background-image:url(../images/storage-stats.png) }\r
+.stats .disksize .img-wrap                                                     { background-image:url(../images/disk-stats.png) }\r
+.stats .diskspace .img-wrap                                            { background-image:url(../images/storage-stats.png) }\r
 .stats .bandwidth .img-wrap                                            { background-image:url(../images/bandwidth-stats.png) }\r
 \r
 .stats .red .img-wrap                                                  { background-position: 15px 7px; }\r
index fc9fd35..2c42be2 100644 (file)
@@ -22,7 +22,7 @@
            </form>
            {% else %}
     
-               <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. <br>You can <a href="{% url group_create_list %}">create a new group</a> or <a href="{% url group_search %}">join</a> to an existing one.</p>
+               <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. <br>You can <!--<a href="{% url group_create_list %}">create a new group</a>--> <a href="{% url group_add 'course' %}">create a new group</a>or <a href="{% url group_search %}">join</a> to an existing one.</p>
                
                <div class="widjets"> 
                        <a href="#" class="widjet-x" title="remove boxes">X</a>
@@ -30,7 +30,8 @@
                                <li>
                                        <div>
                                                <p>WELCOME!<br>Connect with a world of people who share your passions.<br>With millions of groups at your fingertips, it's easy to find the group that's best for you -- no matter your interest.</p><p style="text-align: center"><img alt="THINK ABOUT IT" src="/static/im/images/create.png"></p>
-                                               <p class="btn"><a href="{% url group_create_list %}" class="submit">CREATE</a></p>
+                                               <p class="btn"><a href="{% url group_add 'course' %}" class="submit">CREATE</a></p>
+                                               <!--<p class="btn"><a href="{% url group_create_list %}" class="submit">CREATE</a></p>-->
                                        </div>
                                </li>
                                <li>
index 4feec73..365b66d 100644 (file)
@@ -7,20 +7,21 @@
     <div class="stats clearfix">
                <ul>
                        {% for r in data %}
-                        
-               <li class="clearfix  {{ r.load_class }} {{ r.name}}">
+                       {% with resource_presentation|lookup:r.name as resource_info %}
+               <li class="clearfix  {{ r.load_class }} {{ r.name|get_value_after_dot}}">
                        <div class="img-wrap">&nbsp;</div>
                        <div class="info">
-                               <h3>{{ r.description }}</h3>
+                               <h3>{{ resource_info.report_desc }}</h3>
                                <p>
                                        {{ r.ratio|floatformat }}% Used<br>
-                                       You are using {{ r.currValue }} {{ r.unit }} out of your {{ r.maxValue }}{{ r.unit }} {{ r.plural|capfirst }} - Aouch!
+                                       You are using {{ r.currValue }} {{ r.unit }} out of your {{ r.maxValue }} {{ r.unit }} {% if resource_info.is_abbreviation %}{{ r.name|get_value_after_dot|upper }}{% else %}{{ r.name|get_value_after_dot }}{% endif %}{% if not r.unit %}s {% endif  %} 
                                </p>
                        </div>
                        <div class="bar">
                                <div><span style="width:{{ r.ratio|floatformat }}%;">{{ r.ratio|floatformat }}% &nbsp;&nbsp;</span></div>
                        </div>
                </li>
+               {% endwith %}
                {% endfor %}
        </ul>
     </div>    
index 50a28a4..2987280 100644 (file)
@@ -664,6 +664,45 @@ def change_email(request, activation_key=None,
                                                         extra_context))
 
 
+
+resource_presentation = {
+       'compute': {
+            'help_text':'group compute help text',
+            'is_abbreviation':False,
+            'report_desc':''
+        },
+        'storage': {
+            'help_text':'group storage help text',
+            'is_abbreviation':False,
+            'report_desc':''
+        },
+        'pithos+.diskspace': {
+            'help_text':'resource pithos+.diskspace help text',
+            'is_abbreviation':False,
+            'report_desc':'Diskspace used'
+        },
+        'cyclades.vm': {
+            'help_text':'resource cyclades.vm help text resource cyclades.vm help text resource cyclades.vm help text resource cyclades.vm help text',
+            'is_abbreviation':True,
+            'report_desc':'Number of Virtual Machines'
+        },
+        'cyclades.disksize': {
+            'help_text':'resource cyclades.disksize help text',
+            'is_abbreviation':False,
+            'report_desc':'Amount of Disksize used'
+        },
+        'cyclades.ram': {
+            'help_text':'resource cyclades.ram help text',
+            'is_abbreviation':True,
+            'report_desc':'RAM used'
+        },
+        'cyclades.cpu': {
+            'help_text':'resource cyclades.cpu help text',
+            'is_abbreviation':True,
+            'report_desc':'CPUs used'
+        }
+    }
+
 @require_http_methods(["GET", "POST"])
 @signed_terms_required
 @login_required
@@ -695,34 +734,7 @@ def group_add(request, kind_name='default'):
     except:
         return HttpResponseBadRequest(_('No such group kind'))
     
-    resource_presentation = {
-       'compute': {
-            'help_text':'group compute help text',
-        },
-        'storage': {
-            'help_text':'group storage help text',
-        },
-        'pithos+.diskspace': {
-            'help_text':'resource pithos+.diskspace help text',
-            'is_abbreviation':False,
-        },
-        'cyclades.vm': {
-            'help_text':'resource cyclades.vm help text resource cyclades.vm help text resource cyclades.vm help text resource cyclades.vm help text',
-            'is_abbreviation':True,
-        },
-        'cyclades.disksize': {
-            'help_text':'resource cyclades.disksize help text',
-            'is_abbreviation':False,
-        },
-        'cyclades.ram': {
-            'help_text':'resource cyclades.ram help text',
-            'is_abbreviation':True,
-        },
-        'cyclades.cpu': {
-            'help_text':'resource cyclades.cpu help text',
-            'is_abbreviation':True,
-        }
-    }
+    
 
     post_save_redirect = '/im/group/%(id)s/'
     context_processors = None
@@ -1166,6 +1178,7 @@ def resource_list(request):
         messages.error(request, result.reason)
     return render_response('im/resource_list.html',
                            data=data,
+                           resource_presentation=resource_presentation,
                            context_instance=get_context(request))