Skip to content

Commit

Permalink
Merge pull request #896 from namboodiri/master
Browse files Browse the repository at this point in the history
seperate page for collection centers inside and outside kerala
  • Loading branch information
biswaz authored Aug 23, 2018
2 parents 0e3d3d6 + 550e65c commit d2da77b
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 3 deletions.
36 changes: 36 additions & 0 deletions mainapp/templates/mainapp/collectioncenter_district_select.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{% extends 'base.html' %}
{% load static %}
{% block content %}

{% load bootstrap3 %}

<div class="container text-center">
<h1 class="main-logo">kerala<span style="font-weight: normal;">rescue</span></h1>
<p style="margin-bottom:20px;">
<i>An initiative by Govt. of Kerala, Kerala State IT Mission and IEEE Kerala Section<br>
For effective collaboration and communications between authorities, volunteers and public </i><br/>
<strong>ദുരിതാശ്വാസ പ്രവര്‍ത്തനങ്ങളും രക്ഷാ ദൗത്യങ്ങളും ഏകോപിപ്പിക്കാന്‍</strong><br/>
<b><a href="{% static 'images/msg_cm.jpg' %}">Message from Hon. Chief Minister of Kerala</a></b>
</p>
<a href="/collection_centers/inside_kerala/" class="home-button card" role="button">
{% bootstrap_icon "home" %}
<span class="text">
Inside Kerala<br/>
<span class="ml small"></span>
</span>
</a>
<a href="/collection_centers/outside_kerala/" class="home-button card" role="button">
{% bootstrap_icon "send" %}
<span class="text">
Outside Kerala<br/>
<span class="ml small"></span>
</span>
</a>
<p class="home-info">
Contact Control Room or Disaster Management Cell or District Administration for any support.<br>
Volunteers may contact District Project Managers for support related to volunteering and contributions<br>
<br/>
സഹായത്തിനായി വൊളന്‍റീയര്‍മാര്‍ തയ്യാറാണ്. സഹായം ആവശ്യമെങ്കില്‍ ഒരോ ജില്ലയിലെയും നിയോഗിക്കപെട്ട ഉദ്യോഗസ്ഥരുമായി ബന്ധപ്പെടാം
</p>
</div>
{% endblock %}
2 changes: 1 addition & 1 deletion mainapp/templates/mainapp/collectioncenter_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{% block content %}

<div class="text-center">
<h3>Collection Centers</h3>
<h3><a href="/collection_centers/">Collection Centers</a></h3>
</div>

<div>
Expand Down
4 changes: 3 additions & 1 deletion mainapp/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from django.contrib.auth import views as auth_views
from . import views
from . import api_views
from django.views.generic import TemplateView

urlpatterns = [
path('', views.HomePageView.as_view(), name='home'),
Expand All @@ -23,7 +24,8 @@
path('req_sucess/', views.ReqSuccess.as_view(), name='req_sucessview'),
path('district_needs/', views.DistNeeds.as_view(), name='distneedsview'),
path('collection_center/', views.CollectionCenterView.as_view(), name='collection_centers_view'),
path('collection_centers/', views.CollectionCenterListView.as_view(), name='collection_centers_list'),
url(r'collection_centers/(?P<location>\w+)/$', views.CollectionCenterListView.as_view(), name='collection_centers_list'),
path('collection_centers/', TemplateView.as_view(template_name='mainapp/collectioncenter_district_select.html'), name='collection_centers_district_select'),
path('reg_contrib/', views.RegisterContributor.as_view(), name='reg_contribview'),
path('contribview/', views.contributors, name='contribview'),
path('contrib_success/', views.ContribSuccess.as_view(), name='contribsucessview'),
Expand Down
4 changes: 3 additions & 1 deletion mainapp/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -853,9 +853,11 @@ class CollectionCenterListView(ListView):
ordering = ['-id']

def get_context_data(self, **kwargs):
location = self.kwargs['location']
inside_kerala = True if location == 'inside_kerala' else False
context = super().get_context_data(**kwargs)
context['filter'] = CollectionCenterFilter(
self.request.GET, queryset=CollectionCenter.objects.all().order_by('-id')
self.request.GET, queryset=CollectionCenter.objects.filter(is_inside_kerala=inside_kerala).order_by('-id')
)
return context

Expand Down

0 comments on commit d2da77b

Please sign in to comment.