Revision d220292f snf-astakos-app/astakos/im/templates/im/astakosgroup_list.html

b/snf-astakos-app/astakos/im/templates/im/astakosgroup_list.html
39 39
		</ul>
40 40
        
41 41
    {% endif %}
42
    {% with object_list|enabled:is_search as object_list %}
42
    {% with page_obj.object_list|enabled:is_search as object_list %}
43 43
    {% if object_list %}
44
      {% with object_list|split:user as d %}
45
      	{% with d|lookup:'own' as mine %}
46
	      	{% if mine %}	
47
	      		<div class="full-dotted">
44
        <div class="full-dotted">
45
            <table class="alt-style complex">
46
                <caption>
47
                    {% if is_search %}
48
                        SEARCH RESULTS
49
                    {% else %}
50
                        I PARTICIPATE IN
51
                    {% endif %}
52
                </caption>
53
                <thead>
54
                  <tr>
55
                    <th>Name</th>
56
                    <th>Type</th>
57
                    <th>Issued</th>
58
                    <th>Expires</th>
59
                     
60
                    <th>Enrolled</th>
61
                   
62
                     
63
                    <th>Enrollment status</th>
64
                    <th>&nbsp;</th>
65
                  
66
                  </tr>
67
                </thead>
68
                <tbody>
69
                  {% for o in object_list %}
70
                  <tr class="{% cycle 'tr1' 'tr2' %}">
71
                    <td><a href="{% url group_detail o.id %}" title="visit group page">{{o.name|cut:"http://"|cut:"/" }}</a></td>
72
                    <td>{{o.kind|capfirst}}</td>
73
                    <td>{{o.issue_date|date:"d/m/Y"}}</td>
74
                    <td>{{o.expiration_date|date:"d/m/Y"}}</td>
75
                    
76
                    <td>{{ o.approved_members|length }}</td>
77
                    
78
                    <td>
79
                    {% if user in o.approved_members %}
80
    
81
                        Registered
82
                        <form action="{% url group_leave o.id %}" method="post" class="link-like">{% csrf_token %}
83
                             <input type="submit"  value="LEAVE GROUP" />
84
                        </form>	
85
                        
86
                            
87
                    {% else %}
88
                        {% if user in o.members %}
89
                            Pending
90
                        {% else %}
91
                            Not member 
92
                                <form action="{% url group_join o.id %}" method="post" class="link-like">{% csrf_token %}
93
                                    <input type="submit"   value="JOIN GROUP" />
94
                                </form>
95
                            
96
                        {% endif %}
97
                    {% endif %}
98
                    </td>
99
                    <td><a href="#" class="more-info" title="more info">&nbsp;</a></td>
100
                  </tr>
101
                  <tr class="{% cycle 'tmore1' 'tmore2' %}" style="display:none">
102
                    <td colspan="8" class="info-td">
103
                        <div>
104
                            <p>{{o.desc}}</p>
105
                            <p>{% if o.homepage%}
106
                                Visit it group's home page: <a href="{{ o.homepage }}">{{ o.homepage }}</a>
107
                            {% else %}
108
                                There is no homepage for this group yet.
109
                            {% endif %}
110
                            </p>
111
                        </div>	
112
                    </td>
113
                  </tr>
114
                  {% endfor %}
115
                </tbody>
116
            </table>
117
           
118
        </div>
119
    <div class="pagination">
120
        <span class="step-links">
121
            {% if page_obj.has_previous %}
122
                <a href="?page={{ page_obj.previous_page_number }}{% if q %}&q={{q}}{% endif %}">previous</a>
123
            {% endif %}
124
    
125
            <span class="current">
126
                Page {{ page_obj.number }} of {{ paginator.num_pages }}.
127
            </span>
128
    
129
            {% if page_obj.has_next %}
130
                <a href="?page={{ page_obj.next_page_number }}{% if q %}&q={{q}}{% endif %}">next</a>
131
            {% endif %}
132
        </span>
133
    </div>
134
      {% else %}
135
	      	{% if mine %}
136
	      	    <div class="full-dotted">
48 137
					<table class="alt-style complex" id="">
49 138
			            <caption>MY GROUPS</caption>
50 139
			            <thead>
......
61 150
			              </tr>
62 151
			            </thead>
63 152
			            <tbody>
64
			              {% for o in mine %}
153
			              {% for o in mine.object_list %}
65 154
			              <tr class="{% cycle 'tr1' 'tr2' %}">
66 155
			                <td><a  href="{% url group_detail o.id %}" title="visit group page">{{o.name|cut:"http://"|cut:"/" }}</a></td>
67 156
			                <td>{{o.kind|capfirst}}</td>
......
77 166
			                	<div>
78 167
			                		<p>{{o.desc}}</p>
79 168
					                <p>{% if o.homepage%}
80
							 			Vistit group's home page: <a href="{{ o.homepage }}">{{ o.homepage }}</a>
169
							 			Visit it group's home page: <a href="{{ o.homepage }}">{{ o.homepage }}</a>
81 170
							 		{% else %}
82 171
							 			There is no homepage for this group yet.
83 172
							 		{% endif %}
......
88 177
			              {% endfor %}
89 178
			            </tbody>
90 179
			        </table>
91
			       
92 180
				</div>
181
				<div class="pagination">
182
                    <span class="step-links">
183
                        {% if mine.has_previous %}
184
                            <a href="?own_page={{ mine.previous_page_number }}">previous</a>
185
                        {% endif %}
186
                
187
                        <span class="current">
188
                            Page {{ mine.number }} of {{ mine.paginator.num_pages }}.
189
                        </span>
190
                
191
                        {% if mine.has_next %}
192
                            <a href="?own_page={{ mine.next_page_number }}">next</a>
193
                        {% endif %}
194
                    </span>
195
                </div>
93 196
      		{% endif %}
94
      	{% endwith %}
95
      	{% with d|lookup:'other' as other %}
96 197
	      	{% if other %}	
97
	      		<div class="full-dotted">
198
 	      		<div class="full-dotted">
98 199
					<table class="alt-style complex">
99 200
			            <caption>
100 201
			            	{% if is_search %}
......
119 220
			              </tr>
120 221
			            </thead>
121 222
			            <tbody>
122
			              {% for o in other %}
223
			              {% for o in other.object_list %}
123 224
			              <tr class="{% cycle 'tr1' 'tr2' %}">
124 225
			                <td><a href="{% url group_detail o.id %}" title="visit group page">{{o.name|cut:"http://"|cut:"/" }}</a></td>
125 226
			                <td>{{o.kind|capfirst}}</td>
......
156 257
			                	<div>
157 258
			                		<p>{{o.desc}}</p>
158 259
					                <p>{% if o.homepage%}
159
							 			Vistit group's home page: <a href="{{ o.homepage }}">{{ o.homepage }}</a>
260
							 			Visit it group's home page: <a href="{{ o.homepage }}">{{ o.homepage }}</a>
160 261
							 		{% else %}
161 262
							 			There is no homepage for this group yet.
162 263
							 		{% endif %}
......
169 270
			        </table>
170 271
			       
171 272
				</div>
273
				<div class="pagination">
274
                    <span class="step-links">
275
                        {% if other.has_previous %}
276
                            <a href="?other_page={{ other.previous_page_number }}">previous</a>
277
                        {% endif %}
278
                
279
                        <span class="current">
280
                            Page {{ other.number }} of {{ other.paginator.num_pages }}.
281
                        </span>
282
                
283
                        {% if other.has_next %}
284
                            <a href="?other_page={{ other.next_page_number }}">next</a>
285
                        {% endif %}
286
                    </span>
287
                </div>
172 288
			{% endif %}
173
      	{% endwith %}
174
      {% endwith %}
175
      {% else %}
176
            {% if is_search %}
289
            {% if q %}
177 290
                <h2>No groups found!</h2>
178 291
            {% endif %}
179 292
      {% endif %}

Also available in: Unified diff