Commit baa0607e authored by Sofia Papagiannaki's avatar Sofia Papagiannaki
Browse files

Add button show all in group search page

Refs: #2793
parent 140e2216
......@@ -14,7 +14,12 @@
</div>
</form>
<p><a href="">Show all groups</a></p>
<!-- <p><a href="">Show all groups</a></p> -->
<form action="{% url group_all %}" method="post" class="withlabels signup">{% csrf_token %}
<div class="form-row submit">
<input type="submit" class="submit altcol" value="Show all groups" />
</div>
</form>
{% else %}
<div class="projects">
<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>
......
......@@ -68,10 +68,10 @@ urlpatterns = patterns('astakos.im.views',
'group_update', {}, name='group_update'),
url(r'^group/search/?$',
'group_search', {}, name='group_search'),
url(
r'^group/(?P<group_id>\d+)/join/?$', 'group_join', {
},
name='group_join'),
url(r'^group/all/?$',
'group_all', {}, name='group_all'),
url(r'^group/(?P<group_id>\d+)/join/?$', 'group_join', {
},name='group_join'),
url(
r'^group/(?P<group_id>\d+)/leave/?$', 'group_leave', {},
name='group_leave'),
......
......@@ -769,11 +769,8 @@ def group_search(request, extra_context=None, **kwargs):
request,
queryset,
template_name='im/astakosgroup_list.html',
extra_context=dict(
form=form,
is_search=True
)
)
extra_context=dict(form=form,
is_search=True))
return render_response(
template='im/astakosgroup_list.html',
form=form,
......@@ -781,6 +778,18 @@ def group_search(request, extra_context=None, **kwargs):
is_search=False
)
@signed_terms_required
@login_required
def group_all(request, extra_context=None, **kwargs):
if request.method != 'POST':
return HttpResponseBadRequest(_('Bad method'))
return object_list(
request,
AstakosGroup.objects.select_related().all(),
template_name='im/astakosgroup_list.html',
extra_context=dict(form=AstakosGroupSearchForm(),
is_search=True))
@signed_terms_required
@login_required
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment