Statistics
| Branch: | Tag: | Revision:

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

History | View | Annotate | Download (12.2 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
        
120
     
121
    <div class="pagination">
122
                <p class="next-prev">
123
                {% if page_obj.has_previous %}
124
                <a href="?page={{ page_obj.previous_page_number }}{% if q %}&q={{q}}{% endif %}">previous</a>
125
            {% endif %}
126
            {% if page_obj.has_next %}
127
                <a href="?page={{ page_obj.next_page_number }}{% if q %}&q={{q}}{% endif %}">next</a>
128
            {% endif %}
129
            </p>
130
                <p class="nums">
131
                        <span class="current">
132
                Page {{ page_obj.number }} of {{ paginator.num_pages }}
133
            </span>
134
                </p>
135
   </div>
136
      {% else %}
137
                      {% if mine %}
138
                          <div class="full-dotted">
139
                                        <form method="POST" class="minimal" action="/im/billing" 
140
                                                <div ="form-row">
141
                                                        <label for="month">Sort by</label>
142
                                                        <select name="sorting">
143
                                                            <option value="name">Name</option>
144
                                                    <option value="name">Type</option>                                
145
                                                        </select>
146
                                                </div>
147
                                        </form>
148
                                        <table class="alt-style complex" id="">
149
                                    <caption>MY GROUPS</caption>
150
                                    <thead>
151
                                      <tr>
152
                                        <th>Name</th>
153
                                        <th>Type</th>
154
                                        <th>Issued</th>
155
                                        <th>Expires</th>
156
                                        <th>Enrolled</th>
157
                                        <th>Status</th>
158
                                        <th>Moderated</th>
159
                                        <th>&nbsp;</th>
160
                                        
161
                                      </tr>
162
                                    </thead>
163
                                    <tbody>
164
                                      {% for o in mine.object_list %}
165
                                      <tr class="{% cycle 'tr1' 'tr2' %}">
166
                                        <td><a  href="{% url group_detail o.id %}" title="visit group page">{{o.name|cut:"http://"|cut:"/" }}</a></td>
167
                                        <td>{{o.kind|capfirst}}</td>
168
                                        <td>{{o.issue_date|date:"d/m/Y"}}</td>
169
                                        <td>{{o.expiration_date|date:"d/m/Y"}}</td>
170
                                        <td>{{ o.approved_members|length }}</td>
171
                                        <td>{% if o.is_enabled %}Active{% else %}Pending{% endif %}</td>
172
                                        <td>{% if o.moderation_enabled%}Yes{% else %}No{% endif %}</td>
173
                                        <td><a href="#" class="more-info" title="more info">&nbsp;</a></td>
174
                                      </tr>
175
                                      <tr class="{% cycle 'tmore1' 'tmore2' %}" style="display:none">
176
                                        <td colspan="8" class="info-td">
177
                                                <div>
178
                                                        <p>{{o.desc}}</p>
179
                                                        <p>{% if o.homepage%}
180
                                                                                 Visit it group's home page: <a href="{{ o.homepage }}">{{ o.homepage }}</a>
181
                                                                         {% else %}
182
                                                                                 There is no homepage for this group yet.
183
                                                                         {% endif %}
184
                                                                         </p>
185
                                                </div>        
186
                                        </td>
187
                                      </tr>
188
                                      {% endfor %}
189
                                    </tbody>
190
                                </table>
191
                                </div>
192
                                <div class="pagination">
193
                                        <p class="next-prev">
194
                                        {% if mine.has_previous %}
195
                            <a href="?own_page={{ mine.previous_page_number }}">previous</a>
196
                        {% endif %}
197
                                    {% if mine.has_next %}
198
                            <a href="?own_page={{ mine.next_page_number }}">next</a>
199
                        {% endif %}
200
                                    </p>
201
                                        <p class="nums">
202
                                                <span class="current">
203
                            Page {{ mine.number }} of {{ mine.paginator.num_pages }}
204
                        </span>
205
                                        </p>
206
                           </div>
207
                                 
208
                      {% endif %}
209
                      {% if other %}        
210
                               <div class="full-dotted">
211
                                        <table class="alt-style complex table_sorting">
212
                                    <caption>
213
                                            {% if is_search %}
214
                                                    SEARCH RESULTS
215
                                            {% else %}
216
                                                    I PARTICIPATE IN
217
                                            {% endif %}
218
                                    </caption>
219
                                    <thead>
220
                                      <tr>
221
                                        <th>Name</th>
222
                                        <th>Type</th>
223
                                        <th>Issued</th>
224
                                        <th>Expires</th>
225
                                         
226
                                        <th>Enrolled</th>
227
                                       
228
                                         
229
                                        <th>Enrollment status</th>
230
                                        <th>&nbsp;</th>
231
                                      
232
                                      </tr>
233
                                    </thead>
234
                                    <tbody>
235
                                      {% for o in other.object_list %}
236
                                      <tr class="{% cycle 'tr1' 'tr2' %}">
237
                                        <td><a href="{% url group_detail o.id %}" title="visit group page">{{o.name|cut:"http://"|cut:"/" }}</a></td>
238
                                        <td>{{o.kind|capfirst}}</td>
239
                                        <td>{{o.issue_date|date:"d/m/Y"}}</td>
240
                                        <td>{{o.expiration_date|date:"d/m/Y"}}</td>
241
                                        
242
                                        <td>{{ o.approved_members|length }}</td>
243
                                        
244
                                        <td>
245
                                        {% if user in o.approved_members %}
246
                        
247
                                            Registered
248
                                            <form action="{% url group_leave o.id %}" method="post" class="link-like">{% csrf_token %}
249
                                             <input type="submit"  value="LEAVE GROUP" />
250
                                        </form>        
251
                                            
252
                                                
253
                                        {% else %}
254
                                            {% if user in o.members %}
255
                                                Pending
256
                                            {% else %}
257
                                                Not member 
258
                                                    <form action="{% url group_join o.id %}" method="post" class="link-like">{% csrf_token %}
259
                                                        <input type="submit"   value="JOIN GROUP" />
260
                                                    </form>
261
                                                
262
                                            {% endif %}
263
                                        {% endif %}
264
                                        </td>
265
                                        <td><a href="#" class="more-info" title="more info">&nbsp;</a></td>
266
                                      </tr>
267
                                      <tr class="{% cycle 'tmore1' 'tmore2' %}" style="display:none">
268
                                        <td colspan="8" class="info-td">
269
                                                <div>
270
                                                        <p>{{o.desc}}</p>
271
                                                        <p>{% if o.homepage%}
272
                                                                                 Visit it group's home page: <a href="{{ o.homepage }}">{{ o.homepage }}</a>
273
                                                                         {% else %}
274
                                                                                 There is no homepage for this group yet.
275
                                                                         {% endif %}
276
                                                                         </p>
277
                                                </div>        
278
                                        </td>
279
                                      </tr>
280
                                      {% endfor %}
281
                                    </tbody>
282
                                </table>
283
                               
284
                                </div>
285
                                <div class="pagination">
286
                                        <p class="next-prev">
287
                                        {% if other.has_previous %}
288
                            <a href="?other_page={{ other.previous_page_number }}">previous</a>
289
                        {% endif %}
290
                                    {% if other.has_previous %}
291
                            <a href="?other_page={{ other.previous_page_number }}">previous</a>
292
                        {% endif %}
293
                                    </p>
294
                                        <p class="nums">
295
                                                <span class="current">
296
                            Page {{ other.number }} of {{ other.paginator.num_pages }}
297
                        </span>
298
                                        </p>
299
                           </div>
300
                                 
301
                        {% endif %}
302
            {% if q %}
303
                <h2>No groups found!</h2>
304
            {% endif %}
305
      {% endif %}
306
    {% endwith %}
307
</div>
308
</div>
309
{% endblock %}