Statistics
| Branch: | Tag: | Revision:

root / snf-astakos-app / astakos / im / templates / im / astakosgroup_list.html @ 14805c8f

History | View | Annotate | Download (13.6 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>Okeanos grants resources according to activities organized by groups.
26
                   Join or create a group to get access to more resources.
27
                   <a href="{% url group_search %}">Join an existing one</a>
28
                   or
29
                   <!--<a href="{% url group_create_list %}">Create a new group</a>-->
30
                   <a href="{% url group_add 'course' %}">create a new group</a>.
31
                </p>
32
                
33
                <div class="widjets"> 
34
                        <!--<a href="#" class="widjet-x" title="remove boxes">X</a>-->
35
                        <ul class="clearfix">        
36
                                <li class="create">
37
                                        <div>
38
                                                <div class="wrap">
39
                                                        <h2>WELCOME!</h2>
40
                                                        <p><a href="{% url group_add 'course' %}"><img alt="THINK ABOUT IT" src="/static/im/images/create.png"></a></p>
41
                                                        <p class="txt">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>
42
                                                        <p><a href="{% url group_add 'course' %}">create a group ></a></p>
43
                                                        <!--<p class="btn"><a href="{% url group_create_list %}" class="submit">CREATE</a></p>-->
44
                                                </div>
45
                                        </div>
46
                                </li>
47
                                <li class="join">
48
                                        <div>
49
                                                <div class="wrap">
50
                                                        <h2>ALREADY AWARE?</h2>
51
                                                        <p><a href="{% url group_search %}"><img alt="THINK ABOUT IT" src="/static/im/images/join.png"></a></p>
52
                                                        <p class="txt">Well, this is the place to start!<br>sdofuisd ofuaofi usdiof uiofu osifuaoi ufisdfiousf oiusd<br></p>
53
                                                        
54
                                                        <p><a href="{% url group_search %}">join a group ></a></p>
55
                                                </div>
56
                                        </div>
57
                                </li>
58
                        </ul>
59
                </div>
60
        
61
    {% endif %}
62
    {% with page_obj.object_list as object_list %}
63
    <!-- Search group -->
64
    {% if object_list %}
65
        <div class="full-dotted">
66
                <form method="GET" class="minimal" action="#searchResults"> 
67
                                <div class="form-row">
68
                                        <select name="sorting" onchange="this.form.submit();">
69
                                            <option value="">Sort by</option>
70
                                            <option value="groupname" {% if  == 'groupname' %}selected{% endif %}>Name</option>
71
                                    <!--option value="kindname" {% if sorting == 'kindname' %}selected{% endif %}>Type</option-->                        
72
                                    <option value="issue_date" {% if  == 'issue_date' %}selected{% endif %}>Issue date</option>                        
73
                                    <option value="expiration_date" {% if  == 'expiration_date' %}selected{% endif %}>Expiration Date</option>
74
                                    <option value="approved_members_num" {% if  == 'approved_members_num' %}selected{% endif %}>Participants</option> 
75
                                        </select>
76
                                        <input type="hidden" name="q" value="{{q}}"/>
77
                                </div>
78
                        </form>
79
            <table class="alt-style complex" id="searchResults">
80
                <caption>
81
                    SEARCH RESULTS
82
                </caption>
83
                <thead>
84
                  <tr>
85
                    <th>Name</th>
86
                    <!--<th>Type</th>-->
87
                    <th>Issued</th>
88
                    <th>Expires</th>
89
                     
90
                    <th>Enrolled</th>
91
                   
92
                     
93
                    <th>Status</th>
94
                    <th>&nbsp;</th>
95
                  
96
                  </tr>
97
                </thead>
98
                <tbody>
99
                  {% for o in object_list %}
100
                   <tr class="{% cycle 'tr1' 'tr2' %}">
101
                            <td><a href="{% url group_detail o.id %}" title="visit group page">{{o.groupname|rcut:"/"}}</a></td>
102
                            <!--td>{{o.kindname|capfirst}}</td-->
103
                            <td>{{o.issue_date|date:"d/m/Y"}}</td>
104
                            <td>{{o.expiration_date|date:"d/m/Y"}}</td>
105
                            <td>{{o.approved_members_num}}</td>
106
                            
107
                            <td>
108
                                    <div class="msg-wrap">
109
                                             
110
                                    {% if o.is_member %}
111
                                        {% if o.membership_approval_date %}
112
                    
113
                                        
114
                                                       {% if not o.is_owner %}
115
                                                    Registered
116
                                                    <form action="{% url group_leave o.id %}" method="post" class="link-like">{% csrf_token %}
117
                                                         <input type="submit"  value="x leave group" class="leave"/>
118
                                                    </form>
119
                                                    <div class="dialog">
120
                                                                        Are you sure you what to leave this group?<br>
121
                                                                        Name: <a  href="{% url group_detail o.id %}" title="visit group page">{{o.groupname|rcut:"/" }}</a><br>
122
                                                                        {% if o.desc %}Description:{{o.desc|truncatewords:30}}{% endif %}<br><br>
123
                                                                        
124
                                                                        <a href="#" class="yes submit">Yes</a>&nbsp;&nbsp;&nbsp;<a href="#" class="no submit">No</a>
125
                                                                </div>
126
                                                {% else %}
127
                                                        Owner
128
                                                {% endif %}
129
                                        
130
                                            
131
                
132
                                        {% else %}
133
                                            Pending
134
                                        {% endif %}
135
                                    {% else %}
136
                                            Not member 
137
                                                <form action="{% url group_join o.id %}" method="post" class="link-like">{% csrf_token %}
138
                                                    <input type="submit"   value="+ join group" class="join_group join" />
139
                                                </form>
140
                                                <div class="dialog">
141
                                                                        Are you sure you what to join this group?<br>
142
                                                                        Name: <a  href="{% url group_detail o.id %}" title="visit group page">{{o.groupname|rcut:"/" }}</a><br>
143
                                                                        {% if o.desc %}Description:{{o.desc|truncatewords:30}}{% endif %}<br><br>
144
                                                                        
145
                                                                        <a href="#" class="yes submit">Yes</a>&nbsp;&nbsp;&nbsp;<a href="#" class="no submit">No</a>
146
                                                                </div>
147
                                            
148
                                    {% endif %}
149
                                    </div>
150
                            </td>
151
                            <td><a href="#" class="more-info" title="more info">+ more info</a></td>
152
                  </tr>
153
                  <tr class="{% cycle 'tmore1' 'tmore2' %}" style="display:none">
154
                    <td colspan="7" class="info-td">
155
                        <div>
156
                            <p>{{o.desc}}</p>
157
                            <p>{% if o.homepage%}
158
                                Group's home page: <a target="_blank" href="{{ o.homepage }}">{{ o.homepage }}</a>
159
                            
160
                            {% endif %}
161
                            </p>
162
                        </div>        
163
                    </td>
164
                  </tr>
165
                  {% endfor %}
166
                </tbody>
167
            </table>
168
           
169
        </div>
170
        
171
     
172
            <div class="pagination">
173
                        <p class="next-prev">
174
                        {% if page_obj.has_previous %}
175
                        <a href="?page={{ page_obj.previous_page_number }}{% if q %}&q={{q}}{% endif %}{% if sorting %}&sorting={{sorting}}{% endif %}">previous</a>
176
                    {% endif %}
177
                    {% if page_obj.has_next %}
178
                        <a href="?page={{ page_obj.next_page_number }}{% if q %}&q={{q}}{% endif %}{% if sorting %}&sorting={{sorting}}{% endif %}">next</a>
179
                    {% endif %}
180
                    </p>
181
                        <p class="nums">
182
                                <span class="current">
183
                        Page {{ page_obj.number }} of {{ paginator.num_pages }}
184
                    </span>
185
                        </p>
186
           </div>
187
      <!-- Group listing -->
188
       {% else %}
189
                       {% if not form %}
190
            {% with page|concat:sorting as args %}
191
            {% with q|paginate:args as page_obj %}
192
                 
193
                          <div >
194
                                        <form method="GET" class="minimal" action="#allGroups">
195
                                                <div class="form-row">
196
                                                    <select name="sorting" onchange="this.form.submit();">
197
                                                            <option value="">Sort by</option>
198
                                                            <option value="groupname" {% if  == 'groupname' %}selected{% endif %}>Name</option>
199
                                                    <!--<option value="kindname" {% if sorting == 'kindname' %}selected{% endif %}>Type</option>-->                        
200
                                                    <option value="issue_date" {% if  == 'issue_date' %}selected{% endif %}>Issue date</option>                        
201
                                                    <option value="expiration_date" {% if  == 'expiration_date' %}selected{% endif %}>Expiration Date</option>
202
                                                    <option value="approved_members_num" {% if  == 'approved_members_num' %}selected{% endif %}>Participants</option>
203
                                                    <option value="is_enabled" {% if  == 'is_enabled' %}selected{% endif %}>Status</option>
204
                                                    <option value="moderation_enabled" {% if  == 'moderation_enabled' %}selected{% endif %}>Moderation</option>                
205
                                                        </select>
206
                                                </div>
207
                                        </form>
208
                                        <table class="alt-style complex" id="allGroups">
209
                                    <caption>MY GROUPS</caption>
210
                                    <thead>
211
                                      <tr>
212
                                        <th>Name</th>
213
                                        <!--th>Type</th-->
214
                                        <th>Issued</th>
215
                                        <th>Expires</th>
216
                                        <th>Enrolled</th>
217
                                        <th>Status</th>
218
                                        <th class="centered">Moderated</th>
219
                                        <th>&nbsp;</th>
220
                                        
221
                                      </tr>
222
                                    </thead>
223
                                    <tbody>
224
                                      {% for o in page_obj.object_list %}
225
                                      <tr class="{% cycle 'tr1' 'tr2' %}">
226
                                        <td><a  href="{% url group_detail o.id %}" title="visit group page">{{o.groupname|rcut:"/" }}</a></td>
227
                                        <!--td>{{o.kindname|capfirst}}</td-->
228
                                        <td>{{o.issue_date|date:"d/m/Y"}}</td>
229
                                        <td>{{o.expiration_date|date:"d/m/Y"}}</td>
230
                                        <td>{{ o.approved_members_num }}</td>
231
                                        <td>
232
                                                <div class="msg-wrap">
233
                                                 {% if user.email = o.groupowner %}
234
                                                        {% if o.is_enabled %}
235
                                                                Owner
236
                                                        {% else %}
237
                                                                Pending
238
                                                        {% endif %}
239
                                                {% else %}
240
                                                        {% if o.is_enabled %}
241
                                                                {% if o.membership_status %}
242
                                                                    Registered
243
                                                                    <form action="{% url group_leave o.id %}" method="post" class="link-like">{% csrf_token %}
244
                                                                     <input type="submit"  value="x leave" class="leave" />
245
                                                                </form>        
246
                                                                <div class="dialog">
247
                                                                                Are you sure you what to leave this group?<br>
248
                                                                                Name: <a  href="{% url group_detail o.id %}" title="visit group page">{{o.groupname|rcut:"/" }}</a><br>
249
                                                                                {% if o.desc %}Description:{{o.desc|truncatewords:30}}{% endif %}<br><br>
250
                                                                                
251
                                                                                <a href="#" class="yes submit">Yes</a>&nbsp;&nbsp;&nbsp;<a href="#" class="no submit">No</a>
252
                                                                        </div>
253
                                                                {% else %}
254
                                                                    Pending
255
                                                                {% endif %}
256
                                                        {% else %}
257
                                                                -
258
                                                        {% endif %}
259
                                                {% endif %}
260
                                                
261
                                                </div>
262
                                        </td>
263
                                        <td class="centered">{% if o.moderation_enabled%}Yes{% else %}No{% endif %}</td>
264
                                        <td><a href="#" class="more-info" title="more info">+ more info </a></td>
265
                                      </tr>
266
                                      <tr class="{% cycle 'tmore1' 'tmore2' %}" style="display:none">
267
                                        <td colspan="8" class="info-td">
268
                                                <div>
269
                                                        <p>{{o.desc}}</p>
270
                                                        <p>{% if o.homepage%}
271
                                                                                 Group's home page: <a href="{{ o.homepage }}">{{ o.homepage }}</a>
272
                                                                         {% endif %}
273
                                                                         </p>
274
                                                </div>        
275
                                        </td>
276
                                      </tr>
277
                                      {% endfor %}
278
                                    </tbody>
279
                                </table>
280
                                </div>
281
                                <div class="pagination">
282
                                        <p class="next-prev">
283
                                        {% if page_obj.has_previous %}
284
                            <a href="?page={{ page_obj.previous_page_number }}{% if sorting %}&sorting={{ sorting }}{% endif%}#allGroups">previous</a>
285
                        {% endif %}
286
                                    {% if page_obj.has_next %}
287
                            <a href="?page={{ page_obj.next_page_number }}{% if sorting %}&sorting={{ sorting }}{% endif%}#allGroups">next</a>
288
                        {% endif %}
289
                                    </p>
290
                                        <p class="nums">
291
                                                <span class="current">
292
                            Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }}
293
                        </span>
294
                                        </p>
295
                           </div>
296
                 
297
                {% endwith %} 
298
                      {% endwith %} 
299
                      {% endif %}
300
                      {% if form %}
301
                    {% if q %}
302
                        <h2>No groups found!</h2>
303
                    {% endif %}
304
                {% endif %}
305
      {% endif %}
306
    {% endwith %}
307
</div>
308
</div>  
309
{% endblock %}