Commit 612c385e authored by Sofia Papagiannaki's avatar Sofia Papagiannaki
Browse files

Progress V

parent 7af1dcf1
...@@ -922,8 +922,7 @@ class ProjectApplicationForm(forms.ModelForm): ...@@ -922,8 +922,7 @@ class ProjectApplicationForm(forms.ModelForm):
class Meta: class Meta:
model = ProjectDefinition model = ProjectDefinition
exclude = ('resource_grants') exclude = ('resource_grants', 'serial')
def clean(self): def clean(self):
userid = self.data.get('user', None)[0] userid = self.data.get('user', None)[0]
...@@ -976,3 +975,17 @@ class ProjectApplicationForm(forms.ModelForm): ...@@ -976,3 +975,17 @@ class ProjectApplicationForm(forms.ModelForm):
precursor_application, precursor_application,
commit commit
) )
class ProjectSortForm(forms.Form):
sorting = forms.ChoiceField(
label='Sort by',
choices=(('definition__name', 'Sort by Name'),
('issue_date', 'Sort by Issue date'),
('definition__start_date', 'Sort by Start Date'),
('definition__end_date', 'Sort by End Date'),
# ('approved_members_num', 'Sort by Participants'),
('definition__member_accept_policy', 'Sort by Member Accept Policy'),
('definition__member_reject_policy', 'Sort by Member Reject Policy')
),
required=True
)
\ No newline at end of file
...@@ -13,7 +13,7 @@ class Migration(SchemaMigration): ...@@ -13,7 +13,7 @@ class Migration(SchemaMigration):
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('person', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['im.AstakosUser'])), ('person', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['im.AstakosUser'])),
('project', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['im.Project'])), ('project', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['im.Project'])),
('request_date', self.gf('django.db.models.fields.DateField')(default=datetime.datetime(2012, 12, 7, 16, 55, 19, 659537))), ('request_date', self.gf('django.db.models.fields.DateField')(default=datetime.datetime(2012, 12, 8, 1, 2, 7, 352304))),
('removal_date', self.gf('django.db.models.fields.DateField')(null=True)), ('removal_date', self.gf('django.db.models.fields.DateField')(null=True)),
('rejection_date', self.gf('django.db.models.fields.DateField')(null=True)), ('rejection_date', self.gf('django.db.models.fields.DateField')(null=True)),
)) ))
...@@ -52,7 +52,7 @@ class Migration(SchemaMigration): ...@@ -52,7 +52,7 @@ class Migration(SchemaMigration):
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('person', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['im.AstakosUser'])), ('person', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['im.AstakosUser'])),
('project', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['im.Project'])), ('project', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['im.Project'])),
('request_date', self.gf('django.db.models.fields.DateField')(default=datetime.datetime(2012, 12, 7, 16, 55, 19, 658816))), ('request_date', self.gf('django.db.models.fields.DateField')(default=datetime.datetime(2012, 12, 8, 1, 2, 7, 351571))),
('acceptance_date', self.gf('django.db.models.fields.DateField')(null=True, db_index=True)), ('acceptance_date', self.gf('django.db.models.fields.DateField')(null=True, db_index=True)),
)) ))
db.send_create_signal('im', ['ProjectMembership']) db.send_create_signal('im', ['ProjectMembership'])
...@@ -70,7 +70,7 @@ class Migration(SchemaMigration): ...@@ -70,7 +70,7 @@ class Migration(SchemaMigration):
# Adding model 'ProjectDefinition' # Adding model 'ProjectDefinition'
db.create_table('im_projectdefinition', ( db.create_table('im_projectdefinition', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ('serial', self.gf('django.db.models.fields.CharField')(unique=True, max_length=30, primary_key=True)),
('name', self.gf('django.db.models.fields.CharField')(max_length=80)), ('name', self.gf('django.db.models.fields.CharField')(max_length=80)),
('homepage', self.gf('django.db.models.fields.URLField')(max_length=255, null=True, blank=True)), ('homepage', self.gf('django.db.models.fields.URLField')(max_length=255, null=True, blank=True)),
('description', self.gf('django.db.models.fields.TextField')(null=True)), ('description', self.gf('django.db.models.fields.TextField')(null=True)),
...@@ -185,14 +185,14 @@ class Migration(SchemaMigration): ...@@ -185,14 +185,14 @@ class Migration(SchemaMigration):
}, },
'im.approvalterms': { 'im.approvalterms': {
'Meta': {'object_name': 'ApprovalTerms'}, 'Meta': {'object_name': 'ApprovalTerms'},
'date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2012, 12, 7, 16, 55, 19, 649024)', 'db_index': 'True'}), 'date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2012, 12, 8, 1, 2, 7, 341713)', 'db_index': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'location': ('django.db.models.fields.CharField', [], {'max_length': '255'}) 'location': ('django.db.models.fields.CharField', [], {'max_length': '255'})
}, },
'im.astakosgroup': { 'im.astakosgroup': {
'Meta': {'object_name': 'AstakosGroup', '_ormbases': ['auth.Group']}, 'Meta': {'object_name': 'AstakosGroup', '_ormbases': ['auth.Group']},
'approval_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), 'approval_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
'creation_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2012, 12, 7, 16, 55, 19, 641334)'}), 'creation_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2012, 12, 8, 1, 2, 7, 333863)'}),
'desc': ('django.db.models.fields.TextField', [], {'null': 'True'}), 'desc': ('django.db.models.fields.TextField', [], {'null': 'True'}),
'estimated_participants': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}), 'estimated_participants': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
'expiration_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), 'expiration_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
...@@ -258,7 +258,7 @@ class Migration(SchemaMigration): ...@@ -258,7 +258,7 @@ class Migration(SchemaMigration):
'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '40', 'db_index': 'True'}), 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '40', 'db_index': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'new_email_address': ('django.db.models.fields.EmailField', [], {'max_length': '75'}), 'new_email_address': ('django.db.models.fields.EmailField', [], {'max_length': '75'}),
'requested_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2012, 12, 7, 16, 55, 19, 650690)'}), 'requested_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2012, 12, 8, 1, 2, 7, 343372)'}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'emailchange_user'", 'unique': 'True', 'to': "orm['im.AstakosUser']"}) 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'emailchange_user'", 'unique': 'True', 'to': "orm['im.AstakosUser']"})
}, },
'im.groupkind': { 'im.groupkind': {
...@@ -292,7 +292,7 @@ class Migration(SchemaMigration): ...@@ -292,7 +292,7 @@ class Migration(SchemaMigration):
'im.membership': { 'im.membership': {
'Meta': {'unique_together': "(('person', 'group'),)", 'object_name': 'Membership'}, 'Meta': {'unique_together': "(('person', 'group'),)", 'object_name': 'Membership'},
'date_joined': ('django.db.models.fields.DateField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), 'date_joined': ('django.db.models.fields.DateField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}),
'date_requested': ('django.db.models.fields.DateField', [], {'default': 'datetime.datetime(2012, 12, 7, 16, 55, 19, 646801)', 'blank': 'True'}), 'date_requested': ('django.db.models.fields.DateField', [], {'default': 'datetime.datetime(2012, 12, 8, 1, 2, 7, 339429)', 'blank': 'True'}),
'group': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.AstakosGroup']"}), 'group': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.AstakosGroup']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'person': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.AstakosUser']"}) 'person': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.AstakosUser']"})
...@@ -337,12 +337,12 @@ class Migration(SchemaMigration): ...@@ -337,12 +337,12 @@ class Migration(SchemaMigration):
'description': ('django.db.models.fields.TextField', [], {'null': 'True'}), 'description': ('django.db.models.fields.TextField', [], {'null': 'True'}),
'end_date': ('django.db.models.fields.DateTimeField', [], {}), 'end_date': ('django.db.models.fields.DateTimeField', [], {}),
'homepage': ('django.db.models.fields.URLField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), 'homepage': ('django.db.models.fields.URLField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'limit_on_members_number': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}), 'limit_on_members_number': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
'member_accept_policy': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.MemberAcceptPolicy']"}), 'member_accept_policy': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.MemberAcceptPolicy']"}),
'member_reject_policy': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.MemberRejectPolicy']"}), 'member_reject_policy': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.MemberRejectPolicy']"}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '80'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '80'}),
'resource_grants': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['im.Resource']", 'null': 'True', 'through': "orm['im.ProjectResourceGrant']", 'blank': 'True'}), 'resource_grants': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['im.Resource']", 'null': 'True', 'through': "orm['im.ProjectResourceGrant']", 'blank': 'True'}),
'serial': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30', 'primary_key': 'True'}),
'start_date': ('django.db.models.fields.DateTimeField', [], {}) 'start_date': ('django.db.models.fields.DateTimeField', [], {})
}, },
'im.projectmembership': { 'im.projectmembership': {
...@@ -351,7 +351,7 @@ class Migration(SchemaMigration): ...@@ -351,7 +351,7 @@ class Migration(SchemaMigration):
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'person': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.AstakosUser']"}), 'person': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.AstakosUser']"}),
'project': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.Project']"}), 'project': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.Project']"}),
'request_date': ('django.db.models.fields.DateField', [], {'default': 'datetime.datetime(2012, 12, 7, 16, 55, 19, 658816)'}) 'request_date': ('django.db.models.fields.DateField', [], {'default': 'datetime.datetime(2012, 12, 8, 1, 2, 7, 351571)'})
}, },
'im.projectmembershiphistory': { 'im.projectmembershiphistory': {
'Meta': {'unique_together': "(('person', 'project'),)", 'object_name': 'ProjectMembershipHistory'}, 'Meta': {'unique_together': "(('person', 'project'),)", 'object_name': 'ProjectMembershipHistory'},
...@@ -360,7 +360,7 @@ class Migration(SchemaMigration): ...@@ -360,7 +360,7 @@ class Migration(SchemaMigration):
'project': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.Project']"}), 'project': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.Project']"}),
'rejection_date': ('django.db.models.fields.DateField', [], {'null': 'True'}), 'rejection_date': ('django.db.models.fields.DateField', [], {'null': 'True'}),
'removal_date': ('django.db.models.fields.DateField', [], {'null': 'True'}), 'removal_date': ('django.db.models.fields.DateField', [], {'null': 'True'}),
'request_date': ('django.db.models.fields.DateField', [], {'default': 'datetime.datetime(2012, 12, 7, 16, 55, 19, 659537)'}) 'request_date': ('django.db.models.fields.DateField', [], {'default': 'datetime.datetime(2012, 12, 8, 1, 2, 7, 352304)'})
}, },
'im.projectresourcegrant': { 'im.projectresourcegrant': {
'Meta': {'unique_together': "(('resource', 'project_definition'),)", 'object_name': 'ProjectResourceGrant'}, 'Meta': {'unique_together': "(('resource', 'project_definition'),)", 'object_name': 'ProjectResourceGrant'},
......
...@@ -185,7 +185,10 @@ class AstakosGroup(Group): ...@@ -185,7 +185,10 @@ class AstakosGroup(Group):
_('Creation date'), _('Creation date'),
default=datetime.now() default=datetime.now()
) )
issue_date = models.DateTimeField('Start date', null=True) issue_date = models.DateTimeField(
_('Start date'),
null=True
)
expiration_date = models.DateTimeField( expiration_date = models.DateTimeField(
_('Expiration date'), _('Expiration date'),
null=True null=True
...@@ -1037,6 +1040,11 @@ def get_auto_accept(): ...@@ -1037,6 +1040,11 @@ def get_auto_accept():
return auto_accept return auto_accept
class ProjectDefinition(models.Model): class ProjectDefinition(models.Model):
serial = models.CharField(
primary_key=True,
max_length=30,
unique=True
)
name = models.CharField(max_length=80) name = models.CharField(max_length=80)
homepage = models.URLField(max_length=255, null=True, blank=True) homepage = models.URLField(max_length=255, null=True, blank=True)
description = models.TextField(null=True) description = models.TextField(null=True)
...@@ -1053,6 +1061,8 @@ class ProjectDefinition(models.Model): ...@@ -1053,6 +1061,8 @@ class ProjectDefinition(models.Model):
) )
def save(self): def save(self):
if not self.serial:
self.serial = uuid.uuid4().hex[:30]
self.validate_name() self.validate_name()
super(ProjectDefinition, self).save() super(ProjectDefinition, self).save()
...@@ -1140,19 +1150,37 @@ class ProjectApplication(models.Model): ...@@ -1140,19 +1150,37 @@ class ProjectApplication(models.Model):
self.serial = uuid.uuid4().hex[:30] self.serial = uuid.uuid4().hex[:30]
super(ProjectApplication, self).save() super(ProjectApplication, self).save()
@property
def status(self):
try:
self.project
except Project.DoesNotExist:
return 'PENDING'
else:
if self.project.is_terminated:
return 'ALIVE'
else:
return 'TERMINATED'
@staticmethod @staticmethod
def submit(definition, applicant, comments, precursor_application=None, commit=True): def submit(definition, applicant, comments, precursor_application=None, commit=True):
if precursor_application and precursor_application.project.is_valid: application = None
application = precursor_application.copy() if precursor_application:
application.precursor_application = precursor_application try:
else: precursor_application.project
except:
pass
else:
if precursor_application.project.is_valid:
application = precursor_application.copy()
application.precursor_application = precursor_application
if not application:
application = ProjectApplication(owner=applicant) application = ProjectApplication(owner=applicant)
application.definition = definition application.definition = definition
application.applicant = applicant application.applicant = applicant
application.comments = comments application.comments = comments
application.issue_date = datetime.now() application.issue_date = datetime.now()
if commit: if commit:
definition.save()
application.save() application.save()
if applicant.is_superuser: if applicant.is_superuser:
self.approve_application() self.approve_application()
...@@ -1165,6 +1193,7 @@ class ProjectApplication(models.Model): ...@@ -1165,6 +1193,7 @@ class ProjectApplication(models.Model):
notification.send() notification.send()
return application return application
class Project(models.Model): class Project(models.Model):
serial = models.CharField( serial = models.CharField(
primary_key=True, primary_key=True,
...@@ -1186,7 +1215,7 @@ class Project(models.Model): ...@@ -1186,7 +1215,7 @@ class Project(models.Model):
if not self.serial: if not self.serial:
self.serial = uuid.uuid4().hex[:30] self.serial = uuid.uuid4().hex[:30]
super(ProjectApplication, self).save() super(ProjectApplication, self).save()
@property @property
def definition(self): def definition(self):
return self.application.definition return self.application.definition
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
{% block page.body %} {% block page.body %}
{% with object.project.members as members %} {% with object.project.members as members %}
{% with object.project.approved_members as approved_members %} {% with object.project.approved_members as approved_members %}
<div class="projects"> <div class="projects">
...@@ -28,6 +27,7 @@ ...@@ -28,6 +27,7 @@
<span>{{ object.definition.name|upper }}</span> <span>{{ object.definition.name|upper }}</span>
</h2> </h2>
<!--
<div class="details"> <div class="details">
<h3> <h3>
GENERAL INFO GENERAL INFO
...@@ -39,18 +39,6 @@ ...@@ -39,18 +39,6 @@
<div class="data"> <div class="data">
<p class="restricted">{{ object.definition.description|safe }}</p> <p class="restricted">{{ object.definition.description|safe }}</p>
<dl class="alt-style"> <dl class="alt-style">
<dt>Homepage url</dt>
<dd>
{% if object.definition.homepage%}
<a href="{{ object.definition.homepage }}">{{ object.definition.homepage }}</a>
{% else %}
Not set yet
{% endif %}
</dd>
<dt>Member accept policy</dt>
<dd>
{{ object.definition.member_accept_policy }}
</dd>
</dl> </dl>
</div> </div>
<div class="editable" style="display:none;"> <div class="editable" style="display:none;">
...@@ -65,29 +53,39 @@ ...@@ -65,29 +53,39 @@
</form> </form>
</div> </div>
</div> </div>
-->
<div class="full-dotted"> <div class="full-dotted">
<h3>DETAILS</h3> <h3>DETAILS</h3>
<dl class="alt-style"> <dl class="alt-style">
<dt>Name</dt> <dt>Name</dt>
<dd>{{ object.definition.name }}&nbsp;</dd> <dd>{{ object.definition.name }}&nbsp;</dd>
<dt>Description</dt>
<dd>{{ object.definition.description|safe }}&nbsp;</dd>
<dt>Homepage url</dt>
<dd>
{% if object.definition.homepage%}
<a href="{{ object.definition.homepage }}">{{ object.definition.homepage }}</a>
{% else %}
Not set yet
{% endif %}
</dd>
<dt>Member accept policy</dt>
<dd>
{{ object.definition.member_accept_policy }}
</dd>
<dt>Issue date:</dt> <dt>Issue date:</dt>
<dd>{{object.issue_date|date:"d/m/Y"}}&nbsp;</dd> <dd>{{object.issue_date|date:"d/m/Y"}}&nbsp;</dd>
<dt>Start date:</dt> <dt>Start date:</dt>
<dd>{{object.definition.start_date|date:"d/m/Y"}}&nbsp;</dd> <dd>{{object.definition.start_date|date:"d/m/Y"}}&nbsp;</dd>
<dt>End Date</dt> <dt>End Date</dt>
<dd>{{object.definition.end_date|date:"d/m/Y"}}&nbsp;</dd> <dd>{{object.definition.end_date|date:"d/m/Y"}}&nbsp;</dd>
<!--
<dt>Moderation</dt>
<dd>{% if object.moderation_enabled%}Yes{% else %}No{% endif %}</dd>
-->
<dt>Activated</dt> <dt>Activated</dt>
<dd>{% if object.is_active %}Yes{% else %}No{% endif %}</dd> <dd>{% if object.is_active %}Yes{% else %}No{% endif %}</dd>
<dt>Owner</dt> <dt>Owner</dt>
<dd>{% if user == object.owner %} <dd>{% if user == object.owner %}
Me Me
{% else%} {% else%}
{{object.owner.realname}} ({{object.owner.email}}) {{object.owner.realname}} {% if user.is_superuser %}({{object.owner.email}}){% endif %}
{% endif %} {% endif %}
&nbsp; &nbsp;
</dd> </dd>
...@@ -96,25 +94,32 @@ ...@@ -96,25 +94,32 @@
</dl> </dl>
</div> </div>
<div class="full-dotted"> <div class="full-dotted">
<h3>RESOURCES</h3> <h3>RESOURCES</h3>
{% if object.definition.projectresourcegrant_set.all %} {% if object.definition.projectresourcegrant_set.all %}
<dl class="alt-style"> <dl class="alt-style">
{% for q in object.definition.projectresourcegrant_set.all %} {% for rp in object.definition.projectresourcegrant_set.all %}
q.resource <dt>
{{rp.resource}}
</dt>
<dd>
{{rp.member_limit}}
<dd/>
<!--
<dt> <dt>
Max {% if q.is_abbreviation %}{{ q.verbose_name|upper }}{% else %}{{ q.verbose_name }}{% endif %}{% if not q.unit %}s {% endif %} per user Max {% if q.is_abbreviation %}{{ q.verbose_name|upper }}{% else %}{{ q.verbose_name }}{% endif %}{% if not q.unit %}s {% endif %} per user
</dt> </dt>
<dd> <dd>
{% if q.member_limit %} {% if q.value %}
{% if q.unit %} {% if q.unit %}
{{ q.member_limit|sizeof_fmt }} {{ q.value|sizeof_fmt }}
{% else %} {% else %}
{{ q.member_limit|isinf }} {{ q.value|isinf }}
{% endif %} {% endif %}
{% else %} {% else %}
Unlimited Unlimited
{% endif %} {% endif %}
</dd> </dd>
-->
{% empty %} {% empty %}
No resources No resources
{% endfor %} {% endfor %}
...@@ -125,7 +130,7 @@ ...@@ -125,7 +130,7 @@
<p>No resources</p> <p>No resources</p>
{% endif %} {% endif %}
</div> </div>
{% if user == object.owner %} {% if object.is_alive %}
<div class="full-dotted"> <div class="full-dotted">
{% with page|concat:sorting as args %} {% with page|concat:sorting as args %}
{% with object.project.projectmembership_set.select_related.all|paginate:args as membership %} {% with object.project.projectmembership_set.select_related.all|paginate:args as membership %}
...@@ -143,7 +148,7 @@ ...@@ -143,7 +148,7 @@
<caption>MEMBERS:</caption> <caption>MEMBERS:</caption>
<thead> <thead>
<tr> <tr>
<th>User Id</th> <th>User Email</th>
<th>Name</th> <th>Name</th>
<th>Status</th> <th>Status</th>
</tr> </tr>
...@@ -151,7 +156,7 @@ ...@@ -151,7 +156,7 @@
<tbody> <tbody>
{% for m in membership.object_list %} {% for m in membership.object_list %}
<tr> <tr>
<td>{{m.person.email}}</td> <td>{%if user.is_superuser or user == o.owner %}{{m.person.email}}{% endif %}</td>
<td>{{m.person.realname}}</td> <td>{{m.person.realname}}</td>
{% if m.person == o.owner %} {% if m.person == o.owner %}
<td>Owner</td> <td>Owner</td>
......
...@@ -66,7 +66,9 @@ ...@@ -66,7 +66,9 @@
<option value="definition__start_date" {% if sorting == 'definition__start_date' %}selected{% endif %}>Sort by Start Date</option> <option value="definition__start_date" {% if sorting == 'definition__start_date' %}selected{% endif %}>Sort by Start Date</option>
<option value="definition__end_date" {% if sorting == 'definition__end_date' %}selected{% endif %}>Sort by End Date</option> <option value="definition__end_date" {% if sorting == 'definition__end_date' %}selected{% endif %}>Sort by End Date</option>
<!-- <option value="approved_members_num" {% if sorting == 'approved_members_num' %}selected{% endif %}>Sort by Participants</option> --> <!-- <option value="approved_members_num" {% if sorting == 'approved_members_num' %}selected{% endif %}>Sort by Participants</option> -->
<!-- <option value="status" {% if sorting == '' %}selected{% endif %}>Sort by Member Accept Policy</option> -->
<option value="definition__member_accept_policy" {% if sorting == 'definition__member_accept_policy' %}selected{% endif %}>Sort by Member Accept Policy</option> <option value="definition__member_accept_policy" {% if sorting == 'definition__member_accept_policy' %}selected{% endif %}>Sort by Member Accept Policy</option>
<option value="definition__member_reject_policy" {% if sorting == 'definition__member_reject_policy' %}selected{% endif %}>Sort by Member Reject Policy</option>
</select> </select>
<input type="hidden" name="q" value="{{q}}"/> <input type="hidden" name="q" value="{{q}}"/>
</div> </div>
...@@ -81,14 +83,13 @@ ...@@ -81,14 +83,13 @@
<!--<th>Type</th>--> <!--<th>Type</th>-->
<th>Issued</th> <th>Issued</th>
<th>Starts</th> <th>Starts</th>
<th>Expires</th> <th>Ends</th>
<th>Enrolled</th> <th>Enrolled</th>
<th>Status</th> <th>Status</th>
<th>Membership Status</th>
<th>&nbsp;</th> <th>&nbsp;</th>
<th>Member accept policy</th> <th>Member accept policy</th>
<th>Member reject policy</th>
<!-- <th>&nbsp;</th>--> <!-- <th>&nbsp;</th>-->
</tr> </tr>
...@@ -104,7 +105,9 @@ ...@@ -104,7 +105,9 @@
<td style="width:13%">{{o.definition.start_date|date:"d/m/Y"}}</td> <td style="width:13%">{{o.definition.start_date|date:"d/m/Y"}}</td>
<td style="width:13%">{{o.definition.end_date|date:"d/m/Y"}}</td> <td style="width:13%">{{o.definition.end_date|date:"d/m/Y"}}</td>
<td style="width:11%">{{approved_members|length}}</td> <td style="width:11%">{{approved_members|length}}</td>
<td style="width:11%">
{{o.status}} <a href="{% url project_update o.serial %}">Update</a>
</td>
<td style="width:17%"> <td style="width:17%">
<div class="msg-wrap"> <div class="msg-wrap">
{% if user == o.owner %} {% if user == o.owner %}
...@@ -126,27 +129,20 @@ ...@@ -126,27 +129,20 @@
<div class="msg-wrap"> <div class="msg-wrap">
{% if user in members %} {% if user in members %}