Revision b27c104d snf-astakos-app/astakos/im/templates/im/astakosgroup_detail.html

b/snf-astakos-app/astakos/im/templates/im/astakosgroup_detail.html
3 3
{% load filters %}
4 4

  
5 5
{% block page.body %}
6
<div class="maincol {% block innerpage.class %}{% endblock %}">
7
        <table class="zebra-striped id-sorted">
8
              <tr>
9
                <th>Name: {{object.name}}</th>
10
              </tr>
11
              <tr>
12
                <th>Type: {{object.kind}}</th>
13
              </tr>
14
              <tr>
15
                <th>Issue date: {{object.issue_date|date:"d/m/Y"}}</th>
16
              </tr>
17
              <tr>
18
                <th>Expiration date: {{object.expiration_date|date:"d/m/Y"}}</th>
19
              </tr>
20
              <tr>
21
                <th>Moderation: {% if object.moderation_enabled%}Yes{% else %}No{% endif %}</th>
22
              </tr>
23
              <tr>
24
                <th>Owner: {% for o in object.owner.all %}
25
                                {% if user == o %}
26
                                    Me
27
                                {% else%}
28
                                    {{o.realname}} ({{o.email}})
29
                                
30
                                {% endif %}
31
                            {% endfor %}
32
                </th>
33
              </tr>
34
              <tr>
35
                <th>Enabled: {% if object.is_enabled %}Yes{% else %}No{% endif %}</th>
36
              </tr>
37
        </table>
38
    <div class="section">
39
        <h2>Members:</h2>
40
        {% if object.members %}
41
          <table class="zebra-striped id-sorted">
42
            <thead>
43
              <tr>
44
                <th>Email</th>
45
                <th>Realname</th>
46
                <th>Status</th>
47
              </tr>
48
            </thead>
49
            <tbody>
50
            {% for m in object.membership_set.all %}
6
<div class="projects">
7
	
8
	<h2>
9
	 	{% if request.user in object.members %}
10
			<em>[ ENROLLED ]</em>		
11
		{% endif %}
12
	 	<span>[ {{object.kind|upper}} ]</span>  
13
	 </h2>
14
	 <div class="details">
15
	 	<p>{{ object.desc }}</p>
16
	 </div>
17
	 <div class="full-dotted">
18
		 <h3>DETAILS:</h3>
19
		 <dl class="alt-style">
20
		 	<dt>Name</dt>
21
		 	<dd>{{object.name}}</dd>
22
		 	<dt>Type</dt>
23
		 	<dd>{{object.kind|capfirst}}</dd>
24
		 	<dt>Issue date:</dt>
25
		 	<dd>{{object.issue_date|date:"d/m/Y"}}</dd>
26
		 	<dt>Expiration Date</dt>
27
		 	<dd>{{object.expiration_date|date:"d/m/Y"}}</dd>
28
		 	<dt>Modaration</dt>
29
		 	<dd>{% if object.moderation_enabled%}Yes{% else %}No{% endif %}</dd>
30
		 	<dt>Activated</dt>
31
		 	<dd>{% if object.is_enabled %}Yes{% else %}No{% endif %}</dd>
32
		 	<dt>Owner</dt>
33
		 	<dd>{% for o in object.owner.all %}
34
                    {% if user == o %}
35
                        Me
36
                    {% else%}
37
                        {{o.realname}} ({{o.email}})
38
                    
39
                    {% endif %}
40
                {% endfor %}
41
            </dd>
42
		 </dl>
43
	 </div>
44
	 
45
     <div class="full-dotted">
46
		 <h3>POLICIES:</h3>
47
		 {% if quota %}
48
		 <dl class="alt-style">
49
		 	<dt>Resrouce</dt>
50
		 	<dd>Limit</dd>
51
		 	{% for k in quota|dkeys %}
52
                
53
                <dt>{{ k }}</dt>
54
                <dd>{{ quota|lookup:k }}</dd>
55
                  
56
            {% endfor %}
57
		</dl>
58
		{% else %}
59
            <p>No policies</p>
60
        {% endif %} 
61
	 </div>
62
	 <div class="full-dotted">
63
	 	{% if object.members %}
64
		 <table class="alt-style table_sorting">
65
		 	<caption>MEMBERS:</caption>
66
		 	<thead>
67
			 	<tr>
68
			 		<th>Email</th>
69
			 		<th>Name</th>
70
			 		<th>Status</th>
71
			 	</tr>
72
		 	</thead>
73
		 	<tbody>
74
		 	{% for m in object.membership_set.all %}
51 75
              <tr>
52 76
                <td>{{m.person.email}}</td>
53 77
                <td>{{m.person.realname}}</td>
......
57 81
                    {% if m.is_approved %}
58 82
                    <td>Approved</td>
59 83
                    {% else %}
60
                    <td>Pending</td>
84
                    <td>Pending 
61 85
                        {% if user in m.group.owner.all %}
62
                            <td><a href="{% url approve_member m.group.id m.person.id %}">Approve</a></td>
63
                            <td><a href="{% url disapprove_member m.group.id m.person.id  %}">Disapprove</a></td>
86
                            <a href="{% url approve_member m.group.id m.person.id %}">Approve</a>
87
                            <a href="{% url disapprove_member m.group.id m.person.id  %}">Disapprove</a>
64 88
                        {% endif %}
89
                    </td>    
65 90
                    {% endif %}
66 91
                {% endif %}
67 92
              </tr>
68 93
            {% endfor %}
69 94
            </tbody>
70
        </table>
71
        {% else %}
95
		 </table>
96
		 {% else %}
72 97
            <p>No members yet!</p>
73 98
        {% endif %}
74
    </div>
75
    <div class="section">
76
        <h2>Policies:</h2>
77
        {% if quota %}
78
          <table class="zebra-striped id-sorted">
79
            <thead>
80
              <tr>
81
                <th>Resource</th>
82
                <th>Limit</th>
83
              </tr>
84
            </thead>
85
            <tbody>
86
            {% for k in quota|dkeys %}
87
                <tr>
88
                    <td>{{ k }}</td>
89
                    <td>{{ quota|lookup:k }}</td>
90
                  </tr>
91
            {% endfor %}
92
            </tbody>
93
        </table>
94
        {% else %}
95
            <p>No policies</p>
96
        {% endif %}
97
    </div>
99
	 </div>
100
     
101
     
98 102
    {% if user in object.owner.all and more_policies %}
99
    <div class="rightcol">
100
        <form action="{% url group_policies_add object.id %}" method="post" class="innerlabels signup">{% csrf_token %}
101
            <h2><span>NEW POLICY</span></h2>
103
    <div class="full-dotted">
104
        <form action="{% url group_policies_add object.id %}" method="post" class="withlabels">{% csrf_token %}
105
            <h2>NEW POLICY</h2>
102 106
                {% include "im/form_render.html" %}
103 107
                <div class="form-row submit">
104
                    <input type="submit" class="submit altcol" value="+" />
108
                    <input type="submit" class="submit altcol" value="ADD POLICY" />
105 109
                </div>
106 110
        </form>
107 111
    </div>
108 112
    {% endif %}
113
     
114
    
109 115
</div>
110 116
{% endblock %}

Also available in: Unified diff