commit f3342849159848dd265b77165f075bcf688a7cd5
Author: Sofia Papagiannaki <papagian@gmail.com>
Date:   Thu Dec 6 18:49:27 2012 +0200

    Progress II

diff --git a/snf-astakos-app/astakos/im/templates/im/projects/projectapplication_detail.html b/snf-astakos-app/astakos/im/templates/im/projects/projectapplication_detail.html
index 3b2d35f..ace1fac 100644
--- a/snf-astakos-app/astakos/im/templates/im/projects/projectapplication_detail.html
+++ b/snf-astakos-app/astakos/im/templates/im/projects/projectapplication_detail.html
@@ -3,59 +3,41 @@
 {% load filters %}
 
 {% block page.body %}
-{% with object.owners as owners %}
- 
+
 <div class="projects">
 	
 
 	<h2>
-	 	{% if object.is_member %}
-			<em>
-				{% if object.is_owner %}
-					{% if object.is_enabled %}
-						[ ADMINISTRATOR - ACTIVE ]
-					{% else %}
-						[ ADMINISTRATOR - PENDING ]
-					{% endif %}
-				{%  else %}
-					{% if  object.is_active_member %}
-						[ ENROLLED - ACTIVE ]
-					{% else %}
-						[ ENROLLED - PENDING ]
-					{% endif %}
-				{% endif %}
-			</em>		
-		{% endif %}
-	 	<span>{{ object.name|upper }}</span>
+	 	<span>{{ object.definition.name|upper }}</span>
 	 </h2>
 	 
 	 <div class="details">
 	 	<h3>
 	 		GENERAL INFO
-		 	{% if object.is_owner %}
+		 	{% if object.owner == user %}
 		 		<a href="#" class="edit">EDIT</a>
 		 	{% endif %}
 	 	</h3>
 	 	
 	 	<div class="data">
-		 	<p class="restricted">{{ object.desc|safe }}</p>
+		 	<p class="restricted">{{ object.definition.description|safe }}</p>
 		 	<dl class="alt-style">
 			 	<dt>Homepage url</dt>
 			 	<dd>
-			 		{% if object.homepage%}
-			 			<a href="{{ object.homepage }}">{{ object.homepage }}</a>
+			 		{% if object.definition.homepage%}
+			 			<a href="{{ object.homepage }}">{{ object.definition.homepage }}</a>
 			 		{% else %}
 			 			Not set yet
 			 		{% endif %}
 			 	</dd>
 			 	<dt>Moderation</dt>
 			 	<dd>
-			 		{{ object.moderation_enabled|yesno:"Yes, No" }}
+			 		{{ object.definition.member_accept_policy.description }}
 			 	</dd>
 			 </dl>
 		</div>
 		<div class="editable" style="display:none;">
-		<form action="{% url astakos.im.views.group_detail object.id %}" method="post"
+		<form action="{% url astakos.im.views.project_application_detail object.serial %}" method="post"
 	            class="withlabels">{% csrf_token %}
 	            {% with update_form as form %}
                     {% include "im/form_render.html" %}
@@ -70,49 +52,51 @@
 		 <h3>DETAILS</h3>
 		 <dl class="alt-style">
 		 	<dt>Name</dt>
-		 	<dd>{{ object.name }}&nbsp;</dd>
-		 	<!--<dt>Type</dt>
-		 	<dd>{{object.kindname|capfirst}}&nbsp;</dd>-->
+		 	<dd>{{ object.definition.name }}&nbsp;</dd>
 		 	<dt>Issue date:</dt>
 		 	<dd>{{object.issue_date|date:"d/m/Y"}}&nbsp;</dd>
-		 	<dt>Expiration Date</dt>
-		 	<dd>{{object.expiration_date|date:"d/m/Y"}}&nbsp;</dd>
-<!--
-		 	<dt>Moderation</dt>
-		 	<dd>{% if object.moderation_enabled%}Yes{% else %}No{% endif %}</dd>
- -->
+		 	<dt>Start Date</dt>
+		 	<dd>{{object.definition.start_date|date:"d/m/Y"}}&nbsp;</dd>
+		 	<dt>End Date</dt>
+		 	<dd>{{object.definition.end_date|date:"d/m/Y"}}&nbsp;</dd>
+		 	<dt>Valid</dt>
+		 	<dd>{% if object.is_valid %}Yes{% else %}No{% endif %}</dd>
 		 	<dt>Activated</dt>
-		 	<dd>{% if object.is_enabled %}Yes{% else %}No{% endif %}</dd>
+		 	<dd>{% if object.is_active %}Yes{% else %}No{% endif %}</dd>
+		 	<dt>Terminated</dt>
+		 	<dd>{% if object.is_terminated %}Yes{% else %}No{% endif %}</dd>
+		 	<dt>Suspended</dt>
+		 	<dd>{% if object.is_suspended %}Yes{% else %}No{% endif %}</dd>
+		 	<dt>Alive</dt>
+		 	<dd>{% if object.is_alive %}Yes{% else %}No{% endif %}</dd>
+		 	<dt>Inconsistent</dt>
+		 	<dd>{% if object.is_inconsistent %}Yes{% else %}No{% endif %}</dd>
 		 	<dt>Owner</dt>
-		 	{{ o.owners }}
-		 	<dd>{% for o in owners %}
-                    {% if object.is_owner %}
+		 	<dd>{% if object.object == user %}
                         Me
                     {% else%}
-                        {{o.realname}} ({{o.email}})
+                        {{object.owner.realname}} ({{object.owner.email}})
                     
-                    {% endif %}
-                {% endfor %}&nbsp;
+                    {% endif %}&nbsp;
             </dd>
             <dt>Max participants</dt>
-		 	<dd>{% if object.max_participants%}{{object.max_participants}}{% else %}&nbsp;{% endif %}</dd>
+		 	<dd>{% if object.definition.%}{{object.definition.limit_on_members_number}}{% else %}&nbsp;{% endif %}</dd>
 		 </dl>
 	 </div>
 	 <div class="full-dotted">
-		 <h3>RESOURCES</h3>		 
-		 {% if quota %}
+		 <h3>RESOURCES</h3>
+		 {% if object.definition.projectresourcegrant_set.all %}
 		 <dl class="alt-style">	
-	 		{% for q in quota %}
-		 		 
+	 		{% for q in object.definition.projectresourcegrant_set.all %}
 		 		<dt>
        				Max {% if q.is_abbreviation %}{{ q.verbose_name|upper }}{% else %}{{ q.verbose_name }}{% endif %}{% if not q.unit %}s {% endif  %}  per user
        			</dt>
 		 		<dd>
-       			{% if q.value %}
+       			{% if q.member_limit %}
        				 {% if q.unit %}
-       				 	{{ q.value|sizeof_fmt }}
+       				 	{{ q.member_limit|sizeof_fmt }}
        				 {% else %}
-       				 	{{ q.value|isinf }}
+       				 	{{ q.member_limit|isinf }}
        				 {% endif %}
        			{% else %}
        				Unlimited
@@ -128,92 +112,6 @@
             <p>No resources</p>
         {% endif %} 
 	 </div>
-     {% if object.is_owner %}
-	 <div class="full-dotted">
-	    {% with page|concat:sorting as args %}
-	    {% with object.membership_set.select_related.all|paginate:args as membership %}
-            {% if membership %}
-            <form method="GET" class="minimal" action="#members-table">
-                <div class="form-row">
-                    <select name="sorting" onchange="this.form.submit();" class="dropkicked">
-                        <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>
-             <table class="alt-style" id="members-table">
-                <caption>MEMBERS:</caption>
-                <thead>
-                    <tr>
-                        <th>User Id</th>
-                        <th>Name</th>
-                        <th>Status</th>
-                    </tr>
-                </thead>
-                <tbody>
-                {% for m in membership.object_list %}
-                  <tr>
-                    <td>{{m.person.email}}</td>
-                    <td>{{m.person.realname}}</td>
-                    {% if m.person in owners %}
-                    <td>Owner</td>
-                    {% else %}
-                        {% if m.is_approved %}
-                        <td>Approved
-                            {% if object.is_owner %}
-                                <a href="{% url disapprove_member object.id m.person.id  %}?{% if page %}page={{ page }}{% endif %}{% if sorting %}&sorting={{sorting}}{% endif %}">Remove</a>
-                            {% endif %}
-                        </td>
-                        {% else %}
-                        <td>Pending
-                            {% if object.is_owner %}
-                                <a href="{% url approve_member object.id m.person.id %}?{% if page %}page={{ page }}{% endif %}{% if sorting %}&sorting={{sorting}}{% endif %}">Accept</a>
-                                <a href="{% url disapprove_member object.id m.person.id  %}?{% if page %}page={{ page }}{% endif %}{% if sorting %}&sorting={{sorting}}{% endif %}">Remove</a>
-                            {% endif %}
-                        </td>    
-                        {% endif %}
-                    {% endif %}
-                  </tr>
-                {% endfor %}
-                </tbody>
-             </table>
-             <div class="pagination">
-                <p class="next-prev">
-                    {% if membership.has_previous %}
-                        <a href="?page={{ membership.previous_page_number }}{% if sorting %}&sorting={{sorting}}{% endif %}">previous</a>
-                    {% endif %}
-                    {% if membership.has_next %}
-                        <a href="?page={{ membership.next_page_number }}{% if sorting %}&sorting={{sorting}}{% endif %}">next</a>
-                    {% endif %}
-                </p>
-                <p class="nums">
-                    <span class="current">
-                        Page {{ membership.number }} of {{ membership.paginator.num_pages }}
-                    </span>
-                </p>
-            </div>
-             {% else %}
-                <p>No members yet!</p>
-            {% endif %}
-        {% endwith %}
-        {% endwith %}
-	 </div>
-     
-     
-    
-    <div class="full-dotted">
-        <form action="{% url astakos.im.views.group_detail object.id %}#members-table" method="post" class="withlabels" >{% csrf_token %}
-            <h2>Enroll more members</h2>
-                {% with addmembers_form as form %}
-                    {% include "im/form_render.html" %}
-                {% endwith %}
-                <div class="form-row submit">
-                    <input type="submit" class="submit altcol" value="ADD MEMBERS" />
-                </div>
-        </form>
-    </div>
-    {% endif %}
     <div class="full-dotted">
     	<p>
     		<a href="{% url group_all %}">back to All Projects &gt;</a></li>
@@ -227,5 +125,4 @@
     
 </div>
  
-{% endwith %}
 {% endblock %}
