Commit b9c471e1 authored by Olga Brani's avatar Olga Brani

Merge branch '0.6.4' into devel-0.13

Conflicts:
	snf-astakos-app/astakos/im/views.py
parents 0bf959de b589dbac
......@@ -184,7 +184,7 @@ def get_menu(request, with_extra_links=False, with_signout=True):
append(item(
url=absolute(request, reverse('group_list')),
name="Groups",
name="Projects",
submenu=(item(
url=absolute(request,
reverse('group_list')),
......
......@@ -724,7 +724,7 @@ class AstakosGroupCreationSummaryForm(forms.ModelForm):
class AstakosGroupUpdateForm(forms.ModelForm):
class Meta:
model = AstakosGroup
fields = ('homepage', 'desc')
fields = ( 'desc','homepage')
class AddGroupMembersForm(forms.Form):
......@@ -753,7 +753,7 @@ class AddGroupMembersForm(forms.Form):
class AstakosGroupSearchForm(forms.Form):
q = forms.CharField(max_length=200, label='Search group')
q = forms.CharField(max_length=200, label='Search project')
class TimelineForm(forms.Form):
......
......@@ -183,6 +183,9 @@ AQUARIUM_URL = getattr(settings, 'ASTAKOS_AQUARIUM_URL', '')
# Set how many objects should be displayed per page
PAGINATE_BY = getattr(settings, 'ASTAKOS_PAGINATE_BY', 8)
# Set how many objects should be displayed per page in show all groups page
PAGINATE_BY_ALL = getattr(settings, 'ASTAKOS_PAGINATE_BY_ALL', 15)
# Enforce token renewal on password change/reset
NEWPASSWD_INVALIDATE_TOKEN = getattr(
settings, 'ASTAKOS_NEWPASSWD_INVALIDATE_TOKEN', True)
......@@ -253,4 +256,4 @@ RESOURCES_PRESENTATION_DATA = getattr(
})
# Permit local account migration
ENABLE_LOCAL_ACCOUNT_MIGRATION = getattr(settings, 'ASTAKOS_ENABLE_LOCAL_ACCOUNT_MIGRATION', True)
\ No newline at end of file
ENABLE_LOCAL_ACCOUNT_MIGRATION = getattr(settings, 'ASTAKOS_ENABLE_LOCAL_ACCOUNT_MIGRATION', True)
......@@ -137,7 +137,7 @@ form+p:first-child, form legend + p { margin-bottom:2em; }
form.link-like { display:inline-block; margin:0 5px; float:right;}
form.link-like input[type="submit"] { margin:0; padding:0 5px; background:transparent; color:#F89A1C; cursor:pointer; height:auto; line-height:120%; }
form.link-like input[type="submit"]:hover { text-decoration:underline; }
form.link-like.alone { float:none; margin:0;}
form.link-like.alone { float:none; margin:0; position:absolute; right:0; top:96px;}
form.link-like.alone .form-row { margin:0; }
form.link-like.alone input[type="submit"] { padding:0; }
.projects form.withlabels .checkbox-widget { margin-top:5px; }
......@@ -193,4 +193,7 @@ form.link-like.alone input[type="submit"] { padding:0; }
form input[type="text"],
form input[type="password"] { width:90%; }
.form-row .dk_container { width:100%; }
}
\ No newline at end of file
}
form.submit-inline { position:relative }
form.submit-inline .form-row.submit { position:absolute; left:578px; top:0; margin:0; }
form.submit-inline .form-row input { margin:0 20px 0 0 ; }
\ No newline at end of file
......@@ -194,8 +194,9 @@ a.button { border:0 none; color: #FFFFFF; display: inline-block; te
a.button:hover { background-color: #F89A1C; border:0 none; color:#fff;}*/
/*pagination*/
.pagination .next-prev { float:left; }
.pagination .nums { text-align:right;}
.pagination .next-prev { float:right; }
.pagination .next-prev a { margin-left:15px; }
.pagination .nums { text-align:left;}
.pagination .nums span { color:#000;}
.two-cols .lt .clients-wrapper p { padding:0; }
......@@ -236,7 +237,7 @@ table.alt-style tr:nth-child(2n) td { background:#F2F2F2 }
dl.alt-style { width:500px; }
dl.alt-style dt { width:50%; float:left; color:#3582AC; font-weight:normal;}
dl.alt-style dt:nth-child(2n) { background:black; }
.projects { padding-bottom:30px; }
.projects { padding-bottom:30px; position:relative; }
.projects h2 span { color:#3582AC;}
.projects h2 em { float:right; }
.projects h3 { font-size:1.154em; }
......@@ -304,7 +305,7 @@ dl.alt-style dt:nth-child(2n) { background:black; }
.widjets li div .wrap { background:url(../images/dots.jpg) repeat-x bottom ; }
.widjets li:first-child div { margin-right:20px; margin-left:0; }
.widjets li div img { max-width:100%; margin:2em 0; }
.widjets li div .txt { height:100px; }
.widjets li div .txt { height:130px; }
.widjets .widjet-x { position:absolute; right:0;top:0; font-weight:bold; font-size:1.5em; }
.widjets .widjet-x:hover { text-decoration:none; color:#000; }
.widjets li.create h2,
......@@ -312,7 +313,7 @@ dl.alt-style dt:nth-child(2n) { background:black; }
.widjets li.join h2,
.widjets li.join a { color: #F24E53}
.widjets li a { font-size:1.154em; }
.widjets .wrap p:first-child { height:200px;margin-bottom:2em; }
/* billing styles */
.alt-style .table-div { border:1px dashed #000; }
......@@ -366,7 +367,7 @@ table.alt-style tr td.info-td { padding:5px; }
table.alt-style tr td.info-td div { padding:15px; border:1px dashed #000 }
.projects .details a.edit { float:right; margin-left:20px; }
.projects .details a.edit { margin-left:20px; }
.projects .details .data { overflow:hidden; }
.projects .editable form textarea { width:70%; height:50px; max-width:70%; width:270px; height:120px;}
......@@ -468,3 +469,6 @@ form.quotas-form span.error-msg:hover em { background-position:-58px -3px; }
.two-cols-links p:first-child { width:224px; float:left; overflow:auto }
.two-cols-links p:first-child a { color:#222; }
.two-cols-links p:first-child a:hover { color:#F89A1C }
.summary .quotas-form legend { margin-bottom:1em; }
.projects p.restricted { width:524px; }
......@@ -228,7 +228,7 @@ $(document).ready(function() {
$('.projects .details .edit').click( function(e){
e.preventDefault();
$(this).parents('.details').children('.data').hide();
$(this).parents('.details').children('.editable').show();
$(this).parents('.details').children('.editable').slideDown(500, 'linear');
$(this).hide();
});
......
......@@ -4,6 +4,7 @@ function group_form_show_resources(el){
var id = el.attr('id');
$('.quotas-form .group').each(function() {
if( $(this).hasClass(id) ) {
$(this).appendTo('.visible');
$(this).show('slow');
$(this).find('input')[0].focus()
......
......@@ -21,11 +21,15 @@
</h2>
<div class="details">
{% if object.is_owner %}
<a href="#" class="edit">EDIT GROUP INFO</a>
{% endif %}
<h3>
GENERAL INFO
{% if object.is_owner %}
<a href="#" class="edit">EDIT</a>
{% endif %}
</h3>
<div class="data">
<p>{{ object.desc }}</p>
<p class="restricted">{{ object.desc }}</p>
<dl class="alt-style">
<dt>Homepage url</dt>
<dd>
......@@ -43,14 +47,14 @@
{% with update_form as form %}
{% include "im/form_render.html" %}
<div class="form-row submit">
<input type="submit" class="submit altcol" value="FINISHED EDITING" />
<input type="submit" class="submit altcol" value="SAVE" />
</div>
{% endwith %}
</form>
</div>
</div>
<div class="full-dotted">
<h3>DETAILS:</h3>
<h3>DETAILS</h3>
<dl class="alt-style">
<dt>Name</dt>
<dd>{{ object.name|strip_http }}&nbsp;</dd>
......@@ -80,7 +84,7 @@
</dl>
</div>
<div class="full-dotted">
<h3>RESOURCES:</h3>
<h3>RESOURCES</h3>
{% if quota %}
<dl class="alt-style">
{% for q in quota %}
......@@ -99,7 +103,11 @@
Unlimited
{% endif %}
</dd>
{% empty %}
No resources
{% endfor %}
</dl>
{% else %}
<p>No resources</p>
......@@ -113,10 +121,9 @@
<form method="GET" class="minimal" action="#members-table">
<div class="form-row">
<select name="sorting" onchange="this.form.submit();" class="dropkicked">
<option value="">Sort by</option>
<option value="person__email" {% if sorting == 'person__email' %}selected{% endif %}>User Id</option>
<option value="person__first_name" {% if sorting == 'person__first_name' %}selected{% endif %}>Name</option>
<option value="date_joined" {% if sorting == 'date_joined' %}selected{% endif %}>Status</option>
<option value="person__email" {% if sorting == 'person__email' %}selected{% endif %}>Sort by User Id</option>
<option value="person__first_name" {% if sorting == 'person__first_name' %}selected{% endif %}>Sort by Name</option>
<option value="date_joined" {% if sorting == 'date_joined' %}selected{% endif %}>Sort by Status</option>
</select>
</div>
</form>
......
......@@ -48,7 +48,7 @@
</div>
<div class="not-visible">
{% for gname, resources in resource_catalog.get_groups_resources %}
<div class="group {{'group_'|add:gname}}" id="{{ g }}">
<div class="group {{'group_'|add:gname}}" id="{{ gname }}">
<a href="#icons" class="delete">X remove resource</a>
{% for rname, rdata in resources.items %}
<fieldset class="quota">
......
......@@ -7,22 +7,24 @@
{% with form.data as data %}
<div class="projects summary">
<form action="{% url group_add_complete %}" method="post" class="quotas-form">{% csrf_token %}
<legend>3. CONFIRM YOUR REQUEST</legend>
<legend>CONFIRMATION REQUEST</legend>
<P>These are the specifications of the Project you want to create. If you hit the "Submit" button this form will be officially sent to GRNET for review. Please make sure the following reflect exactly your request. After submitting, there is no way to modify your Project request. </P>
<!--
{% for k,v in data.iteritems %}
<input type="hidden" name="{{ k }}" value="{{ v }}">
{% endfor %}
-->
{% include "im/form_render.html" %}
<p>{{ data.desc|safe }}</p>
<dl class="alt-style">
<dt>Homepage Url</dt>
<dd>{{ data.homepage }}&nbsp;</dd>
</dl>
<div class="full-dotted">
<h3>DETAILS:</h3>
<h3>GENERAL INFO</h3>
<p class="restricted">{{ data.desc|safe }}</p>
<dl class="alt-style">
<dt>Homepage Url</dt>
<dd>{{ data.homepage }}&nbsp;</dd>
</dl>
</div>
<div class="full-dotted">
<h3>DETAILS</h3>
<dl class="alt-style">
<dt>Name</dt>
<dd>{{ data.name|strip_http }}&nbsp;</dd>
......@@ -41,7 +43,8 @@
<div class="full-dotted">
<h3>RESOURCES:</h3>
<h3>RESOURCES</h3>
<p>The following ~okeanos resources will be granted to each member of this Project:</p>
<dl class="alt-style">
{% for p in policies %}
......@@ -59,6 +62,8 @@
Unlimited
{% endif %}
</dd>
{% empty %}
No resources
{% endfor %}
</dl>
</div>
......
......@@ -5,30 +5,27 @@
{% block page.body %}
<div class="maincol {% block innerpage.class %}{% endblock %}">
<div class="projects">
<h2>GROUPS</h2>
<h2>PROJECTS </h2>
{% if form %}
<p>You can search for a group by name</p>
<form action="{% url group_search %}" method="post" class="withlabels signup">{% csrf_token %}
<p>Search for existing Projects and join the ones you like. Please search by Project name. </p>
<form action="{% url group_search %}" method="post" class="withlabels signup submit-inline">{% csrf_token %}
{% include "im/form_render.html" %}
<div class="form-row submit">
<div class="form-row submit">
<input type="submit" class="submit altcol" value="SEARCH" />
</div>
{% if q %}<a href="{% url group_all %}">clear</a>{% endif %}
</div>
</form>
<form action="{% url group_all %}" method="post" class="link-like alone">{% csrf_token %}
<!--<form action="{% url group_all %}" method="post" class="link-like alone">{% csrf_token %}
<div class="form-row submit">
<input type="submit" class="submit altcol" value="Show all groups" />
<input type="submit" class="submit altcol" value="clear" />
</div>
</form>
<-->
{% else %}
<p>Okeanos grants resources according to activities organized by groups.
Join or create a group to get access to more resources.
<a href="{% url group_search %}">Join an existing one</a>
or
<!--<a href="{% url group_create_list %}">Create a new group</a>-->
<a href="{% url group_add 'default' %}">create a new group</a>.
</p>
<p>~okeanos gives the opportunity to Greek Academic or Research Organizations/Institutions/Faculty to run their own projects remotely on virtual infrastructure. Simple, fast and with minimal to no cost at all.
</p>
<div class="widjets">
<!--<a href="#" class="widjet-x" title="remove boxes">X</a>-->
......@@ -36,10 +33,9 @@
<li class="create">
<div>
<div class="wrap">
<h2>WELCOME!</h2>
<p><a href="{% url group_add 'course' %}"><img alt="THINK ABOUT IT" src="/static/im/images/create.png"></a></p>
<p class="txt">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><a href="{% url group_add 'default' %}">create a group ></a></p>
<p class="txt">Create a new Project in seconds. Specify how many members it will have, which and how many virtual resources it will provide to its members. Describe its purpose. Submit your request and if accepted, you and your colleagues are ready to deploy! </p>
<p><a href="{% url group_add 'default' %}">create a project ></a></p>
<!--<p class="btn"><a href="{% url group_create_list %}" class="submit">CREATE</a></p>-->
</div>
</div>
......@@ -47,11 +43,10 @@
<li class="join">
<div>
<div class="wrap">
<h2>ALREADY AWARE?</h2>
<p><a href="{% url group_search %}"><img alt="THINK ABOUT IT" src="/static/im/images/join.png"></a></p>
<p class="txt">Well, this is the place to start!<br>sdofuisd ofuaofi usdiof uiofu osifuaoi ufisdfiousf oiusd<br></p>
<p><a href="{% url group_all %}"><img alt="THINK ABOUT IT" src="/static/im/images/join.png"></a></p>
<p class="txt">Become a member of an existing Project and instantly gain access to the resources it has to offer you. Search for open Projects and join for free. Contact the closed Projects administrators, if you think they will accept you. In two words: try to Join now. </p>
<p><a href="{% url group_search %}">join a group ></a></p>
<p><a href="{% url group_all %}">join a project ></a></p>
</div>
</div>
</li>
......@@ -67,16 +62,17 @@
<div class="form-row">
<select name="sorting" onchange="this.form.submit();" class="dropkicked" tabindex="1">
<option value="">Sort by Name</option>
<option value="issue_date" {% if sorting == 'issue_date' %}selected{% endif %}>Issue date</option>
<option value="expiration_date" {% if sorting == 'expiration_date' %}selected{% endif %}>Expiration Date</option>
<option value="approved_members_num" {% if sorting == 'approved_members_num' %}selected{% endif %}>Participants</option>
<option value="issue_date" {% if sorting == 'issue_date' %}selected{% endif %}>Sort by Issue date</option>
<option value="expiration_date" {% if sorting == 'expiration_date' %}selected{% endif %}>Sort by Expiration Date</option>
<option value="approved_members_num" {% if sorting == 'approved_members_num' %}selected{% endif %}>Sort by Participants</option>
<option value="moderation_enabled" {% if sorting == 'moderation_enabled' %}selected{% endif %}>Sort by Moderation</option>
</select>
<input type="hidden" name="q" value="{{q}}"/>
</div>
</form>
<table class="alt-style complex" id="searchResults">
<caption>
SEARCH RESULTS
{% if q %}SEARCH RESULTS{% else %}ALL PROJECTS{% endif %}
</caption>
<thead>
<tr>
......@@ -90,19 +86,21 @@
<th>Status</th>
<th>&nbsp;</th>
<th>Moderated</th>
<!-- <th>&nbsp;</th>-->
</tr>
</thead>
<tbody>
{% for o in object_list %}
<tr class="{% cycle 'tr1' 'tr2' %}">
<td><a href="{% url group_detail o.id %}" title="visit group page">{{o.groupname|rcut:"/"}}</a></td>
<td style="width:22%"><a href="{% url group_detail o.id %}" title="visit group page">{{o.groupname|rcut:"/"|truncatename}}</a></td>
<!--td>{{o.kindname|capfirst}}</td-->
<td>{{o.issue_date|date:"d/m/Y"}}</td>
<td>{{o.expiration_date|date:"d/m/Y"}}</td>
<td>{{o.approved_members_num}}</td>
<td style="width:13%">{{o.issue_date|date:"d/m/Y"}}</td>
<td style="width:13%">{{o.expiration_date|date:"d/m/Y"}}</td>
<td style="width:13%">{{o.approved_members_num}}</td>
<td>
<td style="width:15%">
<div class="msg-wrap">
{% if o.is_member %}
......@@ -111,6 +109,32 @@
{% if not o.is_owner %}
Registered
{% else %}
Owner
{% endif %}
{% else %}
Pending
{% endif %}
{% else %}
Not member
{% endif %}
</div>
</td>
<td style="width:15%">
<div class="msg-wrap">
{% if o.is_member %}
{% if o.membership_approval_date %}
{% if not o.is_owner %}
<form action="{% url group_leave o.id %}" method="post" class="link-like">{% csrf_token %}
<input type="submit" value="x leave group" class="leave"/>
</form>
......@@ -122,16 +146,16 @@
<a href="#" class="yes submit">Yes</a>&nbsp;&nbsp;&nbsp;<a href="#" class="no submit">No</a>
</div>
{% else %}
Owner
&nbsp;
{% endif %}
{% else %}
Pending
&nbsp;
{% endif %}
{% else %}
Not member
<form action="{% url group_join o.id %}" method="post" class="link-like">{% csrf_token %}
<input type="submit" value="+ join group" class="join_group join" />
</form>
......@@ -146,7 +170,8 @@
{% endif %}
</div>
</td>
<td><a href="#" class="more-info" title="more info">+ more info</a></td>
<td class="centered" style="width:9%">{% if o.moderation_enabled%}Yes{% else %}No{% endif %}</td>
<!--td><a href="#" class="more-info" title="more info">+ more info</a></td-->
</tr>
<tr class="{% cycle 'tmore1' 'tmore2' %}" style="display:none">
<td colspan="7" class="info-td">
......@@ -202,7 +227,7 @@
</div>
</form>
<table class="alt-style complex" id="allGroups">
<caption>MY GROUPS</caption>
<caption>MY PROJECTS</caption>
<thead>
<tr>
<th>Name</th>
......@@ -211,20 +236,21 @@
<th>Expires</th>
<th>Enrolled</th>
<th>Status</th>
<th class="centered">Moderated</th>
<th>&nbsp;</th>
<th class="centered">Moderated</th>
<!-- <th>&nbsp;</th>-->
</tr>
</thead>
<tbody>
{% for o in page_obj.object_list %}
<tr class="{% cycle 'tr1' 'tr2' %}">
<td><a href="{% url group_detail o.id %}" title="visit group page">{{o.groupname|rcut:"/" }}</a></td>
<td style="width:22%"><a href="{% url group_detail o.id %}" title="visit group page">{{o.groupname|rcut:"/"|truncatename }}</a></td>
<!--td>{{o.kindname|capfirst}}</td-->
<td>{{o.issue_date|date:"d/m/Y"}}</td>
<td>{{o.expiration_date|date:"d/m/Y"}}</td>
<td>{{ o.approved_members_num }}</td>
<td>
<td style="width:13%">{{o.issue_date|date:"d/m/Y"}}</td>
<td style="width:13%">{{o.expiration_date|date:"d/m/Y"}}</td>
<td style="width:13%">{{ o.approved_members_num }}</td>
<td style="width:15%">
<div class="msg-wrap">
{% if user.email = o.groupowner %}
{% if o.is_enabled %}
......@@ -236,6 +262,29 @@
{% if o.is_enabled %}
{% if o.membership_status %}
Registered
{% else %}
Pending
{% endif %}
{% else %}
-
{% endif %}
{% endif %}
</div>
</td>
<td style="width:15%">
<div class="msg-wrap">
{% if user.email = o.groupowner %}
{% if o.is_enabled %}
&nbsp;
{% else %}
&nbsp;
{% endif %}
{% else %}
{% if o.is_enabled %}
{% if o.membership_status %}
<form action="{% url group_leave o.id %}" method="post" class="link-like">{% csrf_token %}
<input type="submit" value="x leave" class="leave" />
</form>
......@@ -247,17 +296,17 @@
<a href="#" class="yes submit">Yes</a>&nbsp;&nbsp;&nbsp;<a href="#" class="no submit">No</a>
</div>
{% else %}
Pending
&nbsp;
{% endif %}
{% else %}
-
&nbsp;
{% endif %}
{% endif %}
</div>
</td>
<td class="centered">{% if o.moderation_enabled%}Yes{% else %}No{% endif %}</td>
<td><a href="#" class="more-info" title="more info">+ more info </a></td>
<td class="centered" style="width:9%">{% if o.moderation_enabled%}Yes{% else %}No{% endif %}</td>
<!-- <td><a href="#" class="more-info" title="more info">+ more info </a></td>-->
</tr>
<tr class="{% cycle 'tmore1' 'tmore2' %}" style="display:none">
<td colspan="8" class="info-td">
......@@ -295,7 +344,7 @@
{% endif %}
{% if form %}
{% if q %}
<h2>No groups found!</h2>
<h2>No projects found!</h2>
{% endif %}
{% endif %}
{% endif %}
......
......@@ -191,4 +191,13 @@ def isinf(v):
if math.isinf(v):
return 'Unlimited'
else:
return v
\ No newline at end of file
return v
@register.filter
def truncatename(v):
max = 18
length = len(v)
if length>max:
return v[:max]+'...'
else:
return v[:20]
......@@ -82,7 +82,7 @@ from astakos.im.functions import (send_feedback, SendMailError,
SendNotificationError)
from astakos.im.endpoints.qh import timeline_charge
from astakos.im.settings import (COOKIE_DOMAIN, LOGOUT_NEXT,
LOGGING_LEVEL, PAGINATE_BY, RESOURCES_PRESENTATION_DATA)
LOGGING_LEVEL, PAGINATE_BY, RESOURCES_PRESENTATION_DATA, PAGINATE_BY_ALL)
from astakos.im.tasks import request_billing
from astakos.im.api.callpoint import AstakosCallpoint
......@@ -988,7 +988,8 @@ def group_detail(request, group_id):
if form.is_valid():
sorting = form.cleaned_data.get('sort_by')
else:
form = MembersSortForm({'sort_by': 'person_first_name'})
result = callpoint.list_resources()
resource_catalog = ResourcePresentation(RESOURCES_PRESENTATION_DATA)
......@@ -1074,7 +1075,7 @@ def group_search(request, extra_context=None, **kwargs):
return object_list(
request,
queryset,
paginate_by=PAGINATE_BY,