diff --git a/apps/civic_pulse/static/styles.css b/apps/civic_pulse/static/styles.css index 738c86c..c990622 100644 --- a/apps/civic_pulse/static/styles.css +++ b/apps/civic_pulse/static/styles.css @@ -1,17 +1,17 @@ .primary-color { - color: #2E2757; + color: #2e2757; } .primary-background { - background-color: #2E2757; + background-color: #2e2757; } .secondary-color { - color: #0F8EC5; + color: #0f8ec5; } .secondary-background { - background-color: #0F8EC5; + background-color: #0f8ec5; } body { @@ -44,7 +44,7 @@ h4 { .jumbotron { background-color: #ff0000; - background-image: url('images/map_boston.png'); + background-image: url("images/map_boston.png"); background-position: center center; background-size: cover; background-repeat: no-repeat; @@ -141,13 +141,12 @@ h4 { /* total height minus navbar */ .homebody { height: calc(100vh - 120px); - background: url('images/civicSquare.png') no-repeat fixed; + background: url("images/civicSquare.png") no-repeat fixed; background-position: center center; -webkit-background-size: cover; -moz-background-size: cover; background-size: cover; -o-background-size: cover; - } .navbar { @@ -254,6 +253,7 @@ footer .glyphicon { user-select: none; box-shadow: 1px 1px 2px #0000000f; line-height: 1.2; + overflow: hidden; } .agency-list a { @@ -278,10 +278,10 @@ body { @keyframes fadein { 0% { - opacity: 0; + opacity: 0; } 100% { - opacity: 1; + opacity: 1; } } @@ -295,24 +295,24 @@ body { stroke-width: 6; animation: donut2 3s; stroke-dasharray: 80, 20; - filter:url(#shadow); + filter: url(#shadow); } @keyframes donut2 { 0% { - stroke-dasharray: 0, 100; + stroke-dasharray: 0, 100; } 100% { - stroke-dasharray: 80, 20; + stroke-dasharray: 80, 20; } } .our-card { - background-color: rgba(255,255,255,0.8); + background-color: rgba(255, 255, 255, 0.8); } .card-header { - color: #2E2757; + color: #2e2757; font-size: 1.4em; font-style: bold; } diff --git a/apps/civic_pulse/templates/agency-list-all.html b/apps/civic_pulse/templates/agency-list-all.html new file mode 100644 index 0000000..191fceb --- /dev/null +++ b/apps/civic_pulse/templates/agency-list-all.html @@ -0,0 +1,20 @@ +{% extends 'base.html' %} {% load static %} {% block css %} {% endblock css %} +{% block content %} +
+ {% if agencies %} +
+ + +{% endblock content %} diff --git a/apps/civic_pulse/templates/agency-list.html b/apps/civic_pulse/templates/agency-list.html index 9e1b315..bf37ff1 100644 --- a/apps/civic_pulse/templates/agency-list.html +++ b/apps/civic_pulse/templates/agency-list.html @@ -1,84 +1,38 @@ -{% extends 'base.html' %} -{% load static %} -{% block css %} - -{% endblock css %} +{% extends 'base.html' %} {% load static %} {% block css %} {% endblock css %} {% block content %} - -
+
{% if agencies %} - -
- - - {% for agency in agencies %} -
- -
-
{{ agency.name }}
-

-
- -
- +
- + {% else %} -

No agencies available.

- {% endif %} +

No agencies available.

+ {% endif %} {% if is_paginated %} + {% endif %}
-{% endblock content %} \ No newline at end of file +{% endblock content %} diff --git a/apps/civic_pulse/templates/base.html b/apps/civic_pulse/templates/base.html index 1d600c3..e667e88 100644 --- a/apps/civic_pulse/templates/base.html +++ b/apps/civic_pulse/templates/base.html @@ -1,49 +1,64 @@ {% load static %} - - - GovLens - - - - - - - - - - - - {% block css %} - {% endblock css %} + + + GovLens + + + + + + + + + + + + {% block css %} {% endblock css %} + + + - - - - - -{% block content %} - -{% endblock content %} - - \ No newline at end of file + {% block content %} {% endblock content %} + + diff --git a/apps/civic_pulse/views.py b/apps/civic_pulse/views.py index 9a11504..edc9a70 100644 --- a/apps/civic_pulse/views.py +++ b/apps/civic_pulse/views.py @@ -1,17 +1,25 @@ -from django.views import generic +from django.views.generic import ListView, DetailView from .models import Agency -class AgencyListView(generic.ListView): +class AgencyListView(ListView): template_name = "agency-list.html" context_object_name = "agencies" - paginate_by = 25 + paginate_by = 50 def get_queryset(self): return Agency.objects.order_by("created_date") -class AgencyView(generic.DetailView): +class AgencyListViewAll(ListView): + template_name = "agency-list-all.html" + context_object_name = "agencies" + + def get_queryset(self): + return Agency.objects.order_by("created_date") + + +class AgencyView(DetailView): model = Agency template_name = "agency-detail.html" @@ -22,7 +30,7 @@ def get_context_data(self, **kwargs): return context -class HomeView(generic.ListView): +class HomeView(ListView): template_name = "home.html" model = Agency diff --git a/config/urls.py b/config/urls.py index 1f0cbd8..a07a5b1 100644 --- a/config/urls.py +++ b/config/urls.py @@ -27,7 +27,8 @@ urlpatterns = [ url(r"^admin/", admin.site.urls), url(r"^api/", include(router.urls)), - # url(r'^$', AgencyListView.as_view(), name='index'), + url(r"^agency-list/$", AgencyListView.as_view(), name="index"), + url(r"^agency-list/all", AgencyListViewAll.as_view(), name="agency-list-all"), url(r"^$", HomeView.as_view(), name="index"), url(r"^agency/(?P[0-9]+)/$", AgencyView.as_view(), name="agency-detail"), ]