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

b/snf-astakos-app/astakos/im/templates/im/astakosgroup_list.html
5 5
{% block page.body %}
6 6
<div class="maincol {% block innerpage.class %}{% endblock %}">
7 7
    {% if form %}
8
    <form action="{% url group_search %}" method="post" class="innerlabels signup">{% csrf_token %}
9
        <h2><span>Search group:</span></h2>
8
	<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. </p> 
9
	<p>You can use the following form to search for a project:</p>
10
    
11
    
12
    <form action="{% url group_search %}" method="post" class="withlabels">{% csrf_token %}
13
         
10 14
            {% include "im/form_render.html" %}
11 15
            <div class="form-row submit">
12 16
                <input type="submit" class="submit altcol" value="SEARCH" />
13 17
            </div>
14 18
    </form>
15 19
    {% else %}
16
        <p class="submit-rt">
17
            <a href="{% url group_add %}" class="submit">Create a group</a>
18
            <a href="{% url group_search %}" class="submit">Join a group</a>
19
        </p>
20
    <div class="projects">
21
		<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_add %}">create a new group</a> or <a href="{% url group_search %}">join</a> to an existing one.</p>
22
		 
23
		<ul class="widjets clearfix">	
24
			<li>
25
				<div>
26
					<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>
27
					<p class="btn"><a href="{% url group_add %}" class="submit">Create a group</a></p>
28
				</div>
29
			</li>
30
			<li>
31
				<div>
32
					<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>
33
					<p class="btn"><a href="{% url group_search %}" class="submit">Join a group</a></p>
34
				</div>
35
			</li>
36
		</ul>
37
        
20 38
    {% endif %}
21
      {% if object_list %}
22
      <h2>Groups:</h2>
23
      <table class="zebra-striped id-sorted">
24
            <thead>
25
              <tr>
26
                <th>Name</th>
27
                <th>Type</th>
28
                <th>Issue date</th>
29
                <th>Expiration date</th>
30
                <th>Owner?</th>
31
                <th>Participants</th>
32
                <th>Enabled?</th>
33
                <th>Moderation?</th>
34
                <th>Enrollment status</th>
35
              </tr>
36
            </thead>
37
            <tbody>
38
              {% for o in object_list %}
39
              <tr>
40
                <td><a class="extra-link" href="{% url group_detail o.id %}">{{o.name}}</a></td>
41
                <td>{{o.kind}}</td>
42
                <td>{{o.issue_date|date:"d/m/Y"}}</td>
43
                <td>{{o.expiration_date|date:"d/m/Y"}}</td>
44
                <td>{% if user in o.owner.all %}Yes{% else %}No{% endif %}</td>
45
                <td>{{ o.approved_members|length }}/{{ o.members|length }}</td>
46
                <td>{% if o.is_enabled %}Yes{% else %}No{% endif %}</td>
47
                <td>{% if o.moderation_enabled%}Yes{% else %}No{% endif %}</td>
48
                {% if user in o.approved_members %}
49
                    <td>Active</td>
50
                    {% if user not in o.owner.all %}
51
                    <td>
52
                        <form action="{% url group_leave o.id %}" method="post"class="login innerlabels">{% csrf_token %}
53
                            <div class="form-row submit clearfix">
54
                                <input type="submit" class="submit altcol" value="LEAVE" />
55
                            </div>
56
                        </form>
57
                    </td>
58
                    {% endif %}
59
                {% else %}
60
                    {% if user in o.members %}
61
                        <td>Pending</td>
62
                    {% else %}
63
                        <td>Not member</td>
64
                        {% if join_forms %}
65
                        <td>
66
                            <form action="{% url group_join o.id %}" method="post"class="login innerlabels">{% csrf_token %}
67
                                {% with join_forms|lookup:o.name as form %}
68
                                    {% include "im/form_render.html" %}
69
                                {% endwith %}
70
                                <div class="form-row submit clearfix">
71
                                    <input type="submit" class="submit altcol" value="JOIN" />
72
                                </div>
73
                            </form>
74
                        </td>
75
                        {% endif %}
76
                    {% endif %}
77
                {% endif %}
78
              </tr>
79
              {% endfor %}
80
            </tbody>
81
        </table>
82
        {% else %}
83
            <h2>No groups found!</h2>
84
        {% endif %}
39
      {% with object_list|filter_groups:user as d %}
40
      	{% with d|lookup:'mine' as mine %}
41
	      	{% if mine %}	
42
	      		<div class="full-dotted">
43
					<table class="alt-style table_sorting" id="">
44
			            <caption>MY GROUPS</caption>
45
			            <thead>
46
			              <tr>
47
			                <th>Name</th>
48
			                <th>Type</th>
49
			                <th>Issue date</th>
50
			                <th>Expiration date</th>
51
			                <th>Participants</th>
52
			                <th>Activation</th>
53
			                <th>Moderation</th>
54
			              </tr>
55
			            </thead>
56
			            <tbody>
57
			              {% for o in mine %}
58
			              <tr>
59
			                <td><a class="extra-link" href="{% url group_detail o.id %}">{{o.name}}</a></td>
60
			                <td>{{o.kind|capfirst}}</td>
61
			                <td>{{o.issue_date|date:"d/m/Y"}}</td>
62
			                <td>{{o.expiration_date|date:"d/m/Y"}}</td>
63
			                <td>{{ o.approved_members|length }}/{{ o.members|length }}</td>
64
			                <td>{% if o.is_enabled %}Active{% else %}Pending{% endif %}</td>
65
			                <td>{% if o.moderation_enabled%}Yes{% else %}No{% endif %}</td>
66
			                 
67
			              </tr>
68
			              {% endfor %}
69
			            </tbody>
70
			        </table>
71
			       
72
				</div>
73
      		{% endif %}
74
      	{% endwith %}
75
      	{% with d|lookup:'other' as other %}
76
	      	{% if other %}	
77
	      		<div class="full-dotted">
78
					<table class="alt-style table_sorting">
79
			            <caption>I PARTICIPATE IN</caption>
80
			            <thead>
81
			              <tr>
82
			                <th>Name</th>
83
			                <th>Type</th>
84
			                <th>Issue date</th>
85
			                <th>Expiration date</th>
86
			                 
87
			                <th>Participants</th>
88
			                <th>Activation</th>
89
			                 
90
			                <th>Enrollment status</th>
91
			                <th>&nbsp;</th>
92
			              </tr>
93
			            </thead>
94
			            <tbody>
95
			              {% for o in other %}
96
			              <tr>
97
			                <td><a class="extra-link" href="{% url group_detail o.id %}">{{o.name}}</a></td>
98
			                <td>{{o.kind|capfirst}}</td>
99
			                <td>{{o.issue_date|date:"d/m/Y"}}</td>
100
			                <td>{{o.expiration_date|date:"d/m/Y"}}</td>
101
			                
102
			                <td>{{ o.approved_members|length }}</td>
103
			                <td>{% if o.is_enabled %}Active{% else %}Pending{% endif %}</td>
104
			                
105
			                {% if user in o.approved_members %}
106
			                    <td>
107
			                    	Active
108
			                    	<form action="{% url group_leave o.id %}" method="post" class="link-like">{% csrf_token %}
109
			                             <input type="submit"  value="LEAVE GROUP" />
110
			                        </form>	
111
			                    
112
			                    </td>    
113
			                {% else %}
114
			                    {% if user in o.members %}
115
			                        <td>Pending</td>
116
			                    {% else %}
117
			                        <td>Not member 
118
			                        {% if join_forms %}
119
			                         
120
			                            <form action="{% url group_join o.id %}" method="post" class="link-like">{% csrf_token %}
121
			                                {% with join_forms|lookup:o.name as form %}
122
			                                    {% include "im/form_render.html" %}
123
			                                {% endwith %}
124
			                                
125
			                                <input type="submit"   value="JOIN GROUP" />
126
			                                 
127
			                            </form>
128
			                        </td>
129
			                        {% endif %}
130
			                    {% endif %}
131
			                {% endif %}
132
			              </tr>
133
			              {% endfor %}
134
			            </tbody>
135
			        </table>
136
			       
137
				</div>
138
			{% endif %}
139
      	{% endwith %}
140
      {% endwith %}
141
      {% if not object_list %}
142
      	<h2>No groups found!</h2>
143
	  {% endif %}
144
    </div>
85 145
</div>
86 146
{% endblock %}

Also available in: Unified diff