Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

seperate page for collection centers inside and outside kerala #896

Merged
merged 1 commit into from
Aug 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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