Commit 09ff8645 authored by Olga Brani's avatar Olga Brani
Browse files

Bug fixes

parent 76048fc2
......@@ -211,12 +211,14 @@ def get_menu(request, with_extra_links=False, with_signout=True):
append(item(
url=absolute(request, reverse('resource_list')),
name="Resources"))
"""
append(item(
url=absolute(request, reverse('billing')),
name="Billing"))
append(item(
url=absolute(request, reverse('timeline')),
name="Timeline"))
"""
if with_signout:
append(item(
url=absolute(request, reverse('logout')),
......
......@@ -219,7 +219,9 @@ class DjangoBackend(BaseBackend):
@safe
def get_resource_usage(self, user_id):
user = self._lookup_user(user_id)
c, data = get_quota((user,))
r = get_quota((user,))
print '>>>', r
c, data = r
resources = []
append = resources.append
for t in data:
......@@ -305,4 +307,4 @@ class DjangoBackend(BaseBackend):
g.policies = policies
# g.members = members
g.owners = owners
return self._list(AstakosGroup, filter=(g.id,))
\ No newline at end of file
return self._list(AstakosGroup, filter=(g.id,))
......@@ -613,8 +613,8 @@ class AstakosGroupUpdateForm(forms.ModelForm):
class AddGroupMembersForm(forms.Form):
q = forms.CharField(
max_length=800, widget=forms.Textarea, label=_('Search users'),
help_text=_('Add comma separated user emails'),
max_length=800, widget=forms.Textarea, label=_('Add users'),
help_text=_('Add comma separated user emails, eg. user1@user.com, user2@user.com'),
required=True)
def clean(self):
......
......@@ -372,6 +372,7 @@ table.alt-style tr td a.open { background-position:-16px 0}
.quotas-form fieldset ul li a { display:block; width:82px; height:82px; overflow:hidden; }
.quotas-form fieldset ul li a:hover img { margin-top:-84px; }
.quotas-form fieldset ul li a.selected img { margin-top:-168px; }
.quotas-form fieldset ul li a.selected:hover { cursor:default }
.quotas-form fieldset ul li a.selected:focus { outline:0 none; }
.quotas-form fieldset ul li p { position:absolute; top:95px; left:0; display: none;}
.quotas-form fieldset ul li:hover p { display:block; }
......@@ -387,11 +388,16 @@ table.alt-style tr td a.open { background-position:-16px 0}
.quotas-form .double-checks .with-checkbox input[type="text"] { width:60px; float:left; margin:9px 15px -9px; display:none; padding:6px; }
.quotas-form .double-checks .with-checkbox label{ width:auto; float:left; margin-left:35px; }
.quotas-form .double-checks .with-checkbox input[type="text"].hideshow { display:block; }
form.quotas-form legend span.info { top:0; bottom:auto; left:225px; }
form.quotas-form legend span.info { top:1px; bottom:auto; left:225px; }
form.quotas-form legend span.info span { width:395px; }
.quotas-form .with-checkbox+.with-checkbox { width:196px; }
.summary dl.alt-style dt { color:#55B577; }
.quotas-form .with-info .double-checks p { clear:both; }
.quotas-form .with-info .with-checkbox+.with-checkbox { width:auto; }
.quotas-form .with-info .double-checks { position:relative; margin-bottom:70px; }
.quotas-form .with-info .double-checks .form-row+.form-row { position:absolute; left:224px; top:40px;}
.quotas-form .with-info .double-checks span.info { left:262px; }
/* stats */
.stats ul { margin:0; padding:0; list-style:none outside none; }
.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}
......
......@@ -19,7 +19,7 @@ $(document).ready(function() {
});
$('.quotas-form .group .delete').click(function(e){
e.preventDefault();
$(this).siblings('fieldset').find('input').val('');
$(this).siblings('fieldset').find('.checkbox-widget.unlimited').addClass('checked');
......
......@@ -11,18 +11,18 @@
{% if object.is_member %}
<em>
{% if object.is_owner %}
[ADMINISTRATOR]
[ ADMINISTRATOR ]
{% else %}
[ ENROLLED ]
{% endif %}
</em>
{% endif %}
<span>[ {{object.kindname|upper}} ]</span>
<span>{{object.kindname|upper}}</span>
</h2>
<div class="details">
{% if object.is_owner %}
<a href="#" class="edit">[ EDIT GROUP INFO ]</a>
<a href="#" class="edit">EDIT GROUP INFO</a>
{% endif %}
<div class="data">
<p>{{ object.desc }}</p>
......@@ -54,8 +54,8 @@
<dl class="alt-style">
<dt>Name</dt>
<dd>{{object.name}}&nbsp;</dd>
<dt>Type</dt>
<dd>{{object.kindname|capfirst}}&nbsp;</dd>
<!--<dt>Type</dt>
<dd>{{object.kindname|capfirst}}&nbsp;</dd>-->
<dt>Issue date:</dt>
<dd>{{object.issue_date|date:"d/m/Y"}}&nbsp;</dd>
<dt>Expiration Date</dt>
......
......@@ -10,7 +10,7 @@
<form action="" method="post" class="withlabels quotas-form">{% csrf_token %}
<fieldset>
<fieldset class="with-info">
<legend>
1. CREATE GROUP
<span class="info">
......@@ -27,6 +27,10 @@
<p class="clearfix">
<label for="members_unlimited">Unlimited</label>
<input type="checkbox" id="members_unlimited" name="members_unlimited" class="unlimited" checked="checked">
<span class="info">
<em>more info</em>
<span>Help Text Help Text Help Text Text Help Text Help Text</span>
</span>
</p>
</div>
<div class="form-row">
......@@ -34,8 +38,9 @@
<label for="members_limited">Limited</label>
<input type="checkbox" id="members_limited" name="members_limited" class="limited">
<input type="text" id="members_uplimit" name="members_uplimit" />
</p>
</div>
</div>
......@@ -79,7 +84,11 @@
{% with resources|lookup:r as resource%}
<fieldset class="quota storage">
<legend>
{{ r|get_value_after_dot|capfirst }}
{% if resource_info.is_abbreviation %}
{{ r|get_value_after_dot|upper }}
{% else %}
{{ r|get_value_after_dot|capfirst }}
{% endif %}
<span class="info">
<em>more info</em>
<span>{{ resource_info.help_text }}</span>
......@@ -94,7 +103,12 @@
</p>
</div>-->
<div class="double-checks">
<label>Max {{ r|get_value_after_dot }}{% if not resource.unit %}s {% endif %} per user</label>
<label>
Max {% if resource_info.is_abbreviation %}{{ r|get_value_after_dot|upper }}{% else %}{{ r|get_value_after_dot }}{% endif %}{% if not resource.unit %}s {% endif %} per user
{% if resource.unit %}
({{ resource.unit }})
{% endif %}
</label>
<div class="form-row">
<p class="clearfix">
<label for="{{r|add:'_unlimited'}}">Unlimited</label>
......@@ -122,7 +136,7 @@
{% endwith %}
<div class="form-row submit">
<input type="submit" value="VIEW REQUEST SUMMARY" class="submit altcol" autocomplete="off">
<input type="submit" value="SUBMIT" class="submit altcol" autocomplete="off">
</div>
</form>
......
......@@ -6,34 +6,36 @@
{{ data }}
<div class="projects summary">
<h2>GROUP REQUEST SUMMARY</h2>
<h2>CONFIRM YOUR REQUEST</h2>
<p>Lorem ipsum</p>
<form action="{% url group_add_complete %}" class="quotas-form">
{% for k,v in data.iteritems %}
<input type="hidden" name="{{ k }}" value="{{ v }}">
{% endfor %}
<div class="full-dotted">
<h3>DETAILS:</h3>
<dl class="alt-style">
<dt>Name</dt>
<dd>http://c2.grnet.gr/&nbsp;</dd>
<dd>{{ data.name|strip_http }}&nbsp;</dd>
<dt>Homepage Url</dt>
<dd>{{ data.homepage }}&nbsp;</dd>
<dt>Description</dt>
<dd>Description for this group</dd>
<dt>Type</dt>
<dd>Course&nbsp;</dd>
<dd>{{ data.desc }}</dd>
<!--<dt>Type</dt>
<dd>Course&nbsp;</dd>-->
<dt>Issue date:</dt>
<dd>08/08/2012&nbsp;</dd>
<dd>{{ data.issue_date|date:"d/m/Y"}}&nbsp;</dd>
<dt>Expiration Date</dt>
<dd>07/09/2012&nbsp;</dd>
<dd>{{ data.expiration_date|date:"d/m/Y"}}&nbsp;</dd>
<dt>Modaration</dt>
<dd>Yes</dd>
<dd>{% if object.moderation_enabled%}Yes{% else %}No{% endif %}</dd>
<dt>Max members per group</dt>
<dd>Unlimited</dd>
<dd>{% if data.max_participants %}{{ data.max_participants }}{% else %}Unlimited{% endif %}</dd>
</dl>
</div>
<div class="full-dotted">
<h3>RESOURCES:</h3>
<dl class="alt-style">
<dt>Max Storage per Unser</dt>
<dd>Unlimited</dd>
<dt>Max Vms per user</dt>
<dd>3</dd>
<dt>Max diskspace per user</dt>
......@@ -45,7 +47,10 @@
</dl>
</div>
<p>If you want to correct any of these <a href="">go back</a> to the form </p>
<div class="full-dotted">
</div>
<div class="form-row submit">
<input type="submit" value="SUBMIT" class="submit altcol" autocomplete="off">
</div>
......
......@@ -145,4 +145,8 @@ def items(d):
@register.filter
def get_value_after_dot(value):
return value.split(".")[1]
\ No newline at end of file
return value.split(".")[1]
@register.filter
def strip_http(value):
return value.replace('http://','')[:-1]
\ No newline at end of file
......@@ -704,15 +704,23 @@ def group_add(request, kind_name='default'):
},
'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,
}
}
......@@ -1255,4 +1263,4 @@ def timeline(request):
form=form,
timeline_header=timeline_header,
timeline_body=timeline_body)
return data
\ No newline at end of file
return data
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment