Statistics
| Branch: | Tag: | Revision:

root / snf-astakos-app / astakos / im / templates / im / astakosgroup_list.html @ 12269b45

History | View | Annotate | Download (15.1 kB)

1
{% extends "im/account_base.html" %}
2

    
3
{% load filters %}
4

    
5
{% block page.body %}
6
<div class="maincol {% block innerpage.class %}{% endblock %}">
7
    <div class="projects">
8
            <h2>GROUPS</h2>
9
            {% if form %}
10
            <p>You can search for a group by name</p>
11
            <form action="{% url group_search %}" method="post" class="withlabels signup">{% csrf_token %}
12
                    {% include "im/form_render.html" %}
13
                    <div class="form-row submit">
14
                        <input type="submit" class="submit altcol" value="SEARCH" />
15
                    </div>
16
            </form>
17
             
18
            <form action="{% url group_all %}" method="post" class="link-like alone">{% csrf_token %}
19
                <div class="form-row submit">
20
                    <input type="submit" class="submit altcol" value="Show all groups" />
21
                </div>
22
            </form>
23
            {% else %}
24
    
25
                <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. <br>You can <!--<a href="{% url group_create_list %}">create a new group</a>--> <a href="{% url group_add 'course' %}">create a new group</a>or <a href="{% url group_search %}">join</a> to an existing one.</p>
26
                
27
                <div class="widjets"> 
28
                        <a href="#" class="widjet-x" title="remove boxes">X</a>
29
                        <ul class="clearfix">        
30
                                <li>
31
                                        <div>
32
                                                <p>WELCOME!<br>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 style="text-align: center"><img alt="THINK ABOUT IT" src="/static/im/images/create.png"></p>
33
                                                <p class="btn"><a href="{% url group_add 'course' %}" class="submit">CREATE</a></p>
34
                                                <!--<p class="btn"><a href="{% url group_create_list %}" class="submit">CREATE</a></p>-->
35
                                        </div>
36
                                </li>
37
                                <li>
38
                                        <div>
39
                                                <p>LOOKING FOR A GROUP?</p><p>Well, this is the place to start!<br>sdofuisd ofuaofi usdiof uiofu osifuaoi ufisdfiousf oiusd<br></p>
40
                                                <p style="text-align: center"><img alt="THINK ABOUT IT" src="/static/im/images/join.png"></p>
41
                                                <p class="btn"><a href="{% url group_search %}" class="submit">JOIN</a></p>
42
                                        </div>
43
                                </li>
44
                        </ul>
45
                </div>
46
        
47
    {% endif %}
48
    {% with page_obj.object_list as object_list %}
49
    <!-- Search group -->
50
    {% if object_list %}
51
        <div class="full-dotted">
52
                <form method="GET" class="minimal" action="#searchResults"> 
53
                                <div class="form-row">
54
                                        <select name="sorting" onchange="this.form.submit();">
55
                                            <option value="">Sort by</option>
56
                                            <option value="groupname" {% if  == 'groupname' %}selected{% endif %}>Name</option>
57
                                    <option value="kindname" {% if  == 'kindname' %}selected{% endif %}>Type</option>                        
58
                                    <option value="issue_date" {% if  == 'issue_date' %}selected{% endif %}>Issue date</option>                        
59
                                    <option value="expiration_date" {% if  == 'expiration_date' %}selected{% endif %}>Expiration Date</option>
60
                                    <option value="approved_members_num" {% if  == 'approved_members_num' %}selected{% endif %}>Participants</option> 
61
                                        </select>
62
                                        <input type="hidden" name="q" value="{{q}}"/>
63
                                </div>
64
                        </form>
65
            <table class="alt-style complex" id="searchResults">
66
                <caption>
67
                    SEARCH RESULTS
68
                </caption>
69
                <thead>
70
                  <tr>
71
                    <th>Name</th>
72
                    <th>Type</th>
73
                    <th>Issued</th>
74
                    <th>Expires</th>
75
                     
76
                    <th>Enrolled</th>
77
                   
78
                     
79
                    <th>Enrollment status</th>
80
                    <th>&nbsp;</th>
81
                  
82
                  </tr>
83
                </thead>
84
                <tbody>
85
                  {% for o in object_list %}
86
                    <tr class="{% cycle 'tr1' 'tr2' %}">
87
                    <td><a href="{% url group_detail o.id %}" title="visit group page">{{o.groupname|rcut:"/"}}</a></td>
88
                    <td>{{o.kindname|capfirst}}</td>
89
                    <td>{{o.issue_date|date:"d/m/Y"}}</td>
90
                    <td>{{o.expiration_date|date:"d/m/Y"}}</td>
91
                    <td>{{o.approved_members_num}}</td>
92
                    
93
                    <td>
94
                    {% if o.is_member %}
95
                        {% if o.membership_approval_date %}
96
    
97
                        Registered
98
                        {% if not o.is_owner %}
99
                            <form action="{% url group_leave o.id %}" method="post" class="link-like">{% csrf_token %}
100
                                 <input type="submit"  value="LEAVE GROUP" />
101
                            </form>
102
                        {% endif %}
103
                        
104
                            
105

    
106
                        {% else %}
107
                            Pending
108
                        {% endif %}
109
                    {% else %}
110
                            Not member 
111
                                <form action="{% url group_join o.id %}" method="post" class="link-like">{% csrf_token %}
112
                                    <input type="submit"   value="JOIN GROUP" />
113
                                </form>
114
                            
115
                    {% endif %}
116
                    </td>
117
                    <td><a href="#" class="more-info" title="more info">&nbsp;</a></td>
118
                  </tr>
119
                  <tr class="{% cycle 'tmore1' 'tmore2' %}" style="display:none">
120
                    <td colspan="7" class="info-td">
121
                        <div>
122
                            <p>{{o.desc}}</p>
123
                            <p>{% if o.homepage%}
124
                                Group's home page: <a target="_blank" href="{{ o.homepage }}">{{ o.homepage }}</a>
125
                            
126
                            {% endif %}
127
                            </p>
128
                        </div>        
129
                    </td>
130
                  </tr>
131
                  {% endfor %}
132
                </tbody>
133
            </table>
134
           
135
        </div>
136
        
137
     
138
    <div class="pagination">
139
                <p class="next-prev">
140
                {% if page_obj.has_previous %}
141
                <a href="?page={{ page_obj.previous_page_number }}{% if q %}&q={{q}}{% endif %}{% if sorting %}&sorting={{sorting}}{% endif %}">previous</a>
142
            {% endif %}
143
            {% if page_obj.has_next %}
144
                <a href="?page={{ page_obj.next_page_number }}{% if q %}&q={{q}}{% endif %}{% if sorting %}&sorting={{sorting}}{% endif %}">next</a>
145
            {% endif %}
146
            </p>
147
                <p class="nums">
148
                        <span class="current">
149
                Page {{ page_obj.number }} of {{ paginator.num_pages }}
150
            </span>
151
                </p>
152
   </div>
153
      <!-- Group listing -->
154
        {% else %}
155
            {% if mine %}
156
            {% with own_page|concat:own_sorting as args %}
157
            {% with mine|paginate:args as mine %}
158
                          <div class="full-dotted">
159
                                        <form method="GET" class="minimal" action="#myGroups">
160
                                                <div class="form-row">
161
                                                    <select name="own_sorting" onchange="this.form.submit();">
162
                                                            <option value="">Sort by</option>
163
                                                            <option value="groupname" {% if  == 'groupname' %}selected{% endif %}>Name</option>
164
                                                    <option value="kindname" {% if  == 'kindname' %}selected{% endif %}>Type</option>                        
165
                                                    <option value="issue_date" {% if  == 'issue_date' %}selected{% endif %}>Issue date</option>                        
166
                                                    <option value="expiration_date" {% if  == 'expiration_date' %}selected{% endif %}>Expiration Date</option>
167
                                                    <option value="approved_members_num" {% if  == 'approved_members_num' %}selected{% endif %}>Participants</option>
168
                                                    <option value="is_enabled" {% if  == 'is_enabled' %}selected{% endif %}>Status</option>
169
                                                    <option value="moderation_enabled" {% if  == 'moderation_enabled' %}selected{% endif %}>Moderation</option>                
170
                                                        </select>
171
                                                </div>
172
                                        </form>
173
                                        <table class="alt-style complex" id="myGroups">
174
                                    <caption>MY GROUPS</caption>
175
                                    <thead>
176
                                      <tr>
177
                                        <th>Name</th>
178
                                        <th>Type</th>
179
                                        <th>Issued</th>
180
                                        <th>Expires</th>
181
                                        <th>Enrolled</th>
182
                                        <th>Status</th>
183
                                        <th>Moderated</th>
184
                                        <th>&nbsp;</th>
185
                                        
186
                                      </tr>
187
                                    </thead>
188
                                    <tbody>
189
                                      {% for o in mine.object_list %}
190
                                      <tr class="{% cycle 'tr1' 'tr2' %}">
191
                                        <td><a  href="{% url group_detail o.id %}" title="visit group page">{{o.groupname|rcut:"/" }}</a></td>
192
                                        <td>{{o.kindname|capfirst}}</td>
193
                                        <td>{{o.issue_date|date:"d/m/Y"}}</td>
194
                                        <td>{{o.expiration_date|date:"d/m/Y"}}</td>
195
                                        <td>{{ o.approved_members_num }}</td>
196
                                        <td>{% if o.is_enabled %}Active{% else %}Pending{% endif %}</td>
197
                                        <td>{% if o.moderation_enabled%}Yes{% else %}No{% endif %}</td>
198
                                        <td><a href="#" class="more-info" title="more info">&nbsp;</a></td>
199
                                      </tr>
200
                                      <tr class="{% cycle 'tmore1' 'tmore2' %}" style="display:none">
201
                                        <td colspan="8" class="info-td">
202
                                                <div>
203
                                                        <p>{{o.desc}}</p>
204
                                                        <p>{% if o.homepage%}
205
                                                                                 Group's home page: <a href="{{ o.homepage }}">{{ o.homepage }}</a>
206
                                                                         {% endif %}
207
                                                                         </p>
208
                                                </div>        
209
                                        </td>
210
                                      </tr>
211
                                      {% endfor %}
212
                                    </tbody>
213
                                </table>
214
                                </div>
215
                                <div class="pagination">
216
                                        <p class="next-prev">
217
                                        {% if mine.has_previous %}
218
                            <a href="?own_page={{ mine.previous_page_number }}{% if own_sorting %}&own_sorting={{ own_sorting }}{% endif%}{% if other_sorting %}&other_sorting={{ other_sorting }}{% endif%}">previous</a>
219
                        {% endif %}
220
                                    {% if mine.has_next %}
221
                            <a href="?own_page={{ mine.next_page_number }}{% if own_sorting %}&own_sorting={{ own_sorting }}{% endif%}{% if other_sorting %}&other_sorting={{ other_sorting }}{% endif%}">next</a>
222
                        {% endif %}
223
                                    </p>
224
                                        <p class="nums">
225
                                                <span class="current">
226
                            Page {{ mine.number }} of {{ mine.paginator.num_pages }}
227
                        </span>
228
                                        </p>
229
                           </div>
230
                        
231
                      {% endwith %}
232
            {% endwith %}
233
                      {% endif %}
234
                      
235
                      {% if other %}
236
            {% with other_page|concat:other_sorting as args %}
237
            {% with other|paginate:args as other %}
238
                               <div class="full-dotted">
239
                                       <form method="GET" class="minimal" action="#iParticipateIn"> 
240
                                                <div class="form-row">
241
                                                        <select name="other_sorting" onchange="this.form.submit();">
242
                                                            <option value="">Sort by</option>
243
                                                            <option value="groupname" {% if  == 'groupname' %}selected{% endif %}>Name</option>
244
                                                    <option value="kindname" {% if  == 'kindname' %}selected{% endif %}>Type</option>                        
245
                                                    <option value="issue_date" {% if  == 'issue_date' %}selected{% endif %}>Issue date</option>                        
246
                                                    <option value="expiration_date" {% if  == 'expiration_date' %}selected{% endif %}>Expiration Date</option>
247
                                                    <option value="approved_members_num" {% if  == 'approved_members_num' %}selected{% endif %}>Participants</option>
248
                                                    <option value="membership_status" {% if  == 'membership_status' %}selected{% endif %}>Enrollment Status</option>
249
                                                     
250
                                                        </select>
251
                                                </div>
252
                                        </form>
253
                                        <table class="alt-style complex" id="iParticipateIn">
254
                                    <caption>
255
                                            I PARTICIPATE IN
256
                                    </caption>
257
                                    <thead>
258
                                      <tr>
259
                                        <th>Name</th>
260
                                        <th>Type</th>
261
                                        <th>Issued</th>
262
                                        <th>Expires</th>
263
                                        <th>Enrolled</th>
264
                                        <th>Enrollment status</th>
265
                                        <th>&nbsp;</th>
266
                                      
267
                                      </tr>
268
                                    </thead>
269
                                    <tbody>
270
                                      {% for o in other.object_list %}
271
                                      <tr class="{% cycle 'tr1' 'tr2' %}">
272
                                        <td><a href="{% url group_detail o.id %}" title="visit group page">{{o.groupname|rcut:"/"}}</a></td>
273
                                        <td>{{o.kindname|capfirst}}</td>
274
                                        <td>{{o.issue_date|date:"d/m/Y"}}</td>
275
                                        <td>{{o.expiration_date|date:"d/m/Y"}}</td>
276
                                        
277
                                        <td>{{ o.approved_members_num }}</td>
278
                                        
279
                                        <td>
280
                                        {% if o.membership_status %}
281
                                            Registered
282
                                            <form action="{% url group_leave o.id %}" method="post" class="link-like">{% csrf_token %}
283
                                             <input type="submit"  value="LEAVE GROUP" />
284
                                        </form>        
285
                                            
286
                                        {% else %}
287
                                            Pending
288
                                        {% endif %}
289
                                        </td>
290
                                        <td><a href="#" class="more-info" title="more info">&nbsp;</a></td>
291
                                      </tr>
292
                                      <tr class="{% cycle 'tmore1' 'tmore2' %}" style="display:none">
293
                                        <td colspan="7" class="info-td">
294
                                                <div>
295
                                                        <p>{{o.desc}}</p>
296
                                                        <p>{% if o.homepage%}
297
                                                                                 Visit it group's home page: <a href="{{ o.homepage }}">{{ o.homepage }}</a>
298
                                                                         {% else %}
299
                                                                                 There is no homepage for this group yet.
300
                                                                         {% endif %}
301
                                                                         </p>
302
                                                </div>        
303
                                        </td>
304
                                      </tr>
305
                                      {% endfor %}
306
                                    </tbody>
307
                                </table>
308
                               
309
                                </div>
310
                                <div class="pagination">
311
                                        <p class="next-prev">
312
                                        {% if other.has_previous %}
313
                            <a href="?other_page={{ other.previous_page_number }}{% if own_sorting %}&own_sorting={{ own_sorting }}{% endif%}{% if other_sorting %}&other_sorting={{ other_sorting }}{% endif%}">previous</a>
314
                        {% endif %}
315
                                    {% if other.has_next %}
316
                            <a href="?other_page={{ other.next_page_number }}{% if own_sorting %}&own_sorting={{ own_sorting }}{% endif%}{% if other_sorting %}&other_sorting={{ other_sorting }}{% endif%}">next</a>
317
                        {% endif %}
318
                                    </p>
319
                                        <p class="nums">
320
                                                <span class="current">
321
                            Page {{ other.number }} of {{ other.paginator.num_pages }}
322
                        </span>
323
                                        </p>
324
                           </div>
325
                    
326
                        {% endwith %}
327
            {% endwith %}
328
                        {% endif %}
329
                      
330
            {% if q %}
331
                <h2>No groups found!</h2>
332
            {% endif %}
333
      {% endif %}
334
    {% endwith %}
335
</div>
336
</div>
337
{% endblock %}