Statistics
| Branch: | Tag: | Revision:

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

History | View | Annotate | Download (12 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
    <h2>GROUPS</h2>
8
    {% if form %}
9
    <p>You can search for a group by name</p>
10
    <form action="{% url group_search %}" method="post" class="withlabels signup">{% csrf_token %}
11
            {% include "im/form_render.html" %}
12
            <div class="form-row submit">
13
                <input type="submit" class="submit altcol" value="SEARCH" />
14
            </div>
15
    </form>
16
     
17
    <form action="{% url group_all %}" method="post" class="link-like">{% csrf_token %}
18
            <div class="form-row submit">
19
                <input type="submit" class="submit altcol" value="Show all groups" />
20
            </div>
21
    </form>
22
    {% else %}
23
    <div class="projects">
24
                <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. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. <br />You can <a href="{% url group_create_list %}">create a new group</a> or <a href="{% url group_search %}">join</a> to an existing one.</p>
25
                 
26
                <ul class="widjets clearfix">        
27
                        <li>
28
                                <div>
29
                                        <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>
30
                                        <p class="btn"><a href="{% url group_create_list %}" class="submit">CREATE</a></p>
31
                                </div>
32
                        </li>
33
                        <li>
34
                                <div>
35
                                        <p>LOOKING FOR A GROUP?</p><p>Well, this is the place to start!</br>sdofuisd ofuaofi usdiof uiofu osifuaoi ufisdfiousf oiusd<br /><img alt="THINK ABOUT IT" src="/static/medialibrary/2012/06/behind_okeanos.png"></p>
36
                                        <p class="btn"><a href="{% url group_search %}" class="submit">JOIN</a></p>
37
                                </div>
38
                        </li>
39
                </ul>
40
        
41
    {% endif %}
42
    {% with page_obj.object_list|enabled:is_search as object_list %}
43
    {% if object_list %}
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">
137
                                        <table class="alt-style complex" id="">
138
                                    <caption>MY GROUPS</caption>
139
                                    <thead>
140
                                      <tr>
141
                                        <th>Name</th>
142
                                        <th>Type</th>
143
                                        <th>Issued</th>
144
                                        <th>Expires</th>
145
                                        <th>Enrolled</th>
146
                                        <th>Status</th>
147
                                        <th>Moderated</th>
148
                                        <th>&nbsp;</th>
149
                                        
150
                                      </tr>
151
                                    </thead>
152
                                    <tbody>
153
                                      {% for o in mine.object_list %}
154
                                      <tr class="{% cycle 'tr1' 'tr2' %}">
155
                                        <td><a  href="{% url group_detail o.id %}" title="visit group page">{{o.name|cut:"http://"|cut:"/" }}</a></td>
156
                                        <td>{{o.kind|capfirst}}</td>
157
                                        <td>{{o.issue_date|date:"d/m/Y"}}</td>
158
                                        <td>{{o.expiration_date|date:"d/m/Y"}}</td>
159
                                        <td>{{ o.approved_members|length }}</td>
160
                                        <td>{% if o.is_enabled %}Active{% else %}Pending{% endif %}</td>
161
                                        <td>{% if o.moderation_enabled%}Yes{% else %}No{% endif %}</td>
162
                                        <td><a href="#" class="more-info" title="more info">&nbsp;</a></td>
163
                                      </tr>
164
                                      <tr class="{% cycle 'tmore1' 'tmore2' %}" style="display:none">
165
                                        <td colspan="8" class="info-td">
166
                                                <div>
167
                                                        <p>{{o.desc}}</p>
168
                                                        <p>{% if o.homepage%}
169
                                                                                 Visit it group's home page: <a href="{{ o.homepage }}">{{ o.homepage }}</a>
170
                                                                         {% else %}
171
                                                                                 There is no homepage for this group yet.
172
                                                                         {% endif %}
173
                                                                         </p>
174
                                                </div>        
175
                                        </td>
176
                                      </tr>
177
                                      {% endfor %}
178
                                    </tbody>
179
                                </table>
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>
196
                      {% endif %}
197
                      {% if other %}        
198
                               <div class="full-dotted">
199
                                        <table class="alt-style complex">
200
                                    <caption>
201
                                            {% if is_search %}
202
                                                    SEARCH RESULTS
203
                                            {% else %}
204
                                                    I PARTICIPATE IN
205
                                            {% endif %}
206
                                    </caption>
207
                                    <thead>
208
                                      <tr>
209
                                        <th>Name</th>
210
                                        <th>Type</th>
211
                                        <th>Issued</th>
212
                                        <th>Expires</th>
213
                                         
214
                                        <th>Enrolled</th>
215
                                       
216
                                         
217
                                        <th>Enrollment status</th>
218
                                        <th>&nbsp;</th>
219
                                      
220
                                      </tr>
221
                                    </thead>
222
                                    <tbody>
223
                                      {% for o in other.object_list %}
224
                                      <tr class="{% cycle 'tr1' 'tr2' %}">
225
                                        <td><a href="{% url group_detail o.id %}" title="visit group page">{{o.name|cut:"http://"|cut:"/" }}</a></td>
226
                                        <td>{{o.kind|capfirst}}</td>
227
                                        <td>{{o.issue_date|date:"d/m/Y"}}</td>
228
                                        <td>{{o.expiration_date|date:"d/m/Y"}}</td>
229
                                        
230
                                        <td>{{ o.approved_members|length }}</td>
231
                                        
232
                                        <td>
233
                                        {% if user in o.approved_members %}
234
                        
235
                                            Registered
236
                                            <form action="{% url group_leave o.id %}" method="post" class="link-like">{% csrf_token %}
237
                                             <input type="submit"  value="LEAVE GROUP" />
238
                                        </form>        
239
                                            
240
                                                
241
                                        {% else %}
242
                                            {% if user in o.members %}
243
                                                Pending
244
                                            {% else %}
245
                                                Not member 
246
                                                    <form action="{% url group_join o.id %}" method="post" class="link-like">{% csrf_token %}
247
                                                        <input type="submit"   value="JOIN GROUP" />
248
                                                    </form>
249
                                                
250
                                            {% endif %}
251
                                        {% endif %}
252
                                        </td>
253
                                        <td><a href="#" class="more-info" title="more info">&nbsp;</a></td>
254
                                      </tr>
255
                                      <tr class="{% cycle 'tmore1' 'tmore2' %}" style="display:none">
256
                                        <td colspan="8" class="info-td">
257
                                                <div>
258
                                                        <p>{{o.desc}}</p>
259
                                                        <p>{% if o.homepage%}
260
                                                                                 Visit it group's home page: <a href="{{ o.homepage }}">{{ o.homepage }}</a>
261
                                                                         {% else %}
262
                                                                                 There is no homepage for this group yet.
263
                                                                         {% endif %}
264
                                                                         </p>
265
                                                </div>        
266
                                        </td>
267
                                      </tr>
268
                                      {% endfor %}
269
                                    </tbody>
270
                                </table>
271
                               
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>
288
                        {% endif %}
289
            {% if q %}
290
                <h2>No groups found!</h2>
291
            {% endif %}
292
      {% endif %}
293
    {% endwith %}
294
</div>
295
</div>
296
{% endblock %}