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

Asset compression, image size optimizations, frontend bugfixes #219

Merged
merged 12 commits into from
Aug 1, 2014
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -3,6 +3,8 @@
*.svn-base
.picasa.ini
.ropeproject/
.DS_Store
CACHE

#sample data
media/data/*.json
8 changes: 6 additions & 2 deletions django_files/atlas/settings.py
Original file line number Diff line number Diff line change
@@ -73,6 +73,7 @@
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
'compressor.finders.CompressorFinder',
)
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
@@ -101,7 +102,8 @@
'django.contrib.humanize',
'django.contrib.sitemaps',
'observatory',
'blog'
'blog',
'compressor'
)


@@ -112,13 +114,15 @@
},
}

VERSION = '1.0.5'
VERSION = '1.0.6'

CACHE_VERY_SHORT = 60*10 # 10 minutes
CACHE_SHORT = 60*60 # 1 hour
CACHE_LONG = 60*60*24 # 1 day
CACHE_VERY_LONG = 60*60*24*7 # 1 week

COMPRESS_DEBUG_TOGGLE = "no_compress"

try:
from settings_local import *
except ImportError:
93 changes: 41 additions & 52 deletions html/explore/index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{% load i18n %}
{% load humanize %}
{% load compress %}
<!DOCTYPE html>
<html lang="en">
<head>
@@ -22,37 +23,34 @@
<meta name="twitter:domain" content="http://www.atlas.cid.harvard.edu/">
<link rel="search" type="application/opensearchdescription+xml" href="{{HTTP_HOST}}opensearch.xml" title="Atlas of Economic Complexity"/>
<base href="{{HTTP_HOST}}">
<title>The Atlas Of Economic Complexity{% if title %} | {{title}}{% else %}{% endif %}</title>
<meta name="description" content="Networks in Macro Economics with World Trade Data">
<!-- The Atlas Of Economic Complexity | ({% if year_start %}{{year_start}} - {{year_end}}{% else %}{{year}}{% endif %})
<title>{% if title %}{{title}} | {% else %}{% endif %}The Atlas Of Economic Complexity</title>
<meta name="description" content="{{title}} The Atlas of Economic Complexity lets you interactively visualize a country’s trade and explore growth opportunities for more than a hundred countries worldwide.">
<!-- Necessary for google to crawl the site, since it is purely ajax based.
When the crawler reaches the page it will request the current URL plus
the additional URL query parameter _escaped_fragment_= -->
<meta name="fragment" content="!">

<link rel="shortcut icon" type="image/x-icon" href="{{ STATIC_URL }}img/favicon.ico">
<!-- Load non-standard fonts -->
<link href='http://fonts.googleapis.com/css?family=PT+Sans+Narrow' rel='stylesheet' type='text/css' />

{% compress css %}
<link rel="stylesheet" href="{{ STATIC_URL }}js/libs/bootstrap/css/bootstrap.css"/>
<link rel="stylesheet" href="{{ STATIC_URL }}css/normalize.css">
<link rel="stylesheet" href="{{ STATIC_URL }}css/style.css?{{ VERSION }}">
<link rel="stylesheet" href="{{ STATIC_URL }}js/libs/toastr/toastr.min.css" />
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/select2/3.4.8/select2.css" />
<link rel="stylesheet" href="{{ STATIC_URL }}js/libs/vizwiz/src/utils.slider.css?{{ VERSION }}" />
<link rel="stylesheet" href="{{ STATIC_URL }}js/libs/bootstro/bootstro.min.css"/>
<link rel='stylesheet' type='text/css' href='../media/js/libs/tipsy/tipsy.css'>

<link rel="stylesheet" href="{{ STATIC_URL }}js/libs/jquery-ui/jquery-ui.css" />
<link rel="stylesheet" href="{{ STATIC_URL }}css/widgets.css?{{ VERSION }}">
<link href="{{ STATIC_URL }}js/libs/vizwiz/src/vizwhiz.d3.css" rel="stylesheet">
<link href="{{ STATIC_URL }}js/libs/d3plus/d3plus.css" rel="stylesheet">
<link rel="stylesheet" href="{{ STATIC_URL }}css/searchresults.css" />
{% endcompress %}

<link rel='stylesheet' type='text/css' href='{{ STATIC_URL }}/js/libs/tipsy/tipsy.css'>
<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/select2/3.4.8/select2.css" />
<link href='http://fonts.googleapis.com/css?family=PT+Sans+Narrow' rel='stylesheet' type='text/css' />

<link rel="stylesheet" href="{{ STATIC_URL }}js/libs/jquery-ui/jquery-ui.css" type="text/css" media="all" />
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/widgets.css?{{ VERSION }}">
<!-- VizWiz -->

<link href="{{ STATIC_URL }}js/libs/vizwiz/src/vizwhiz.d3.css" rel="stylesheet" type="text/css">

<link href="{{ STATIC_URL }}js/libs/d3plus/d3plus.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="{{ STATIC_URL }}css/searchresults.css" type="text/css" media="all" />

<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
@@ -229,18 +227,18 @@ <h2 style="margin-left:10px; width:700px;"><span id="text_title">{% if title %}{
<div id="tfViz" data-toggle="buttons" style="margin-left:5px;">

<label value="tree_map" class="btn btn-default {% if app_name == 'tree_map' %}active{% endif %} tooltipbs" data-placement="top" data-toggle="tooltip">
<input type="radio" style="background:url({{ STATIC_URL }}img/home/treeMap-thumb.png) no-repeat;">
<img src="{{ STATIC_URL }}img/home/treeMap-thumb.png" style="width:38px;"/>
<input type="radio" style="background:url({{ STATIC_URL }}img/common/treemap.png) no-repeat;">
<img src="{{ STATIC_URL }}img/common/treemap.png" style="width:38px;"/>
</label>

<label value="map" class="btn btn-default {% if app_name == 'map' %}active{% endif %}" data-placement="top" data-toggle="tooltip" title="Map" >
<input type="radio" style="background:url({{ STATIC_URL }}img/home/geo-thumb.png) no-repeat;">
<img src="{{ STATIC_URL }}img/home/geo-thumb.png" style="width:38px;"/>
<input type="radio" style="background:url({{ STATIC_URL }}img/common/geo.png) no-repeat;">
<img src="{{ STATIC_URL }}img/common/geo.png" style="width:38px;"/>
</label>

<label value="stacked" class="btn btn-default {% if app_name == 'stacked' %}active{%endif%} tooltipbs" data-placement="top" data-toggle="tooltip" title="Stacked Graph" >
<input type="radio" name="viz_apps">
<img src="{{ STATIC_URL }}img/home/stacked-thumb.png" style="width:38px;"/>
<img src="{{ STATIC_URL }}img/common/stackedgraph.png" style="width:38px;"/>
</label>

<div style="font-weight:bold; margin-top:0px; margin-left:5px">
@@ -249,13 +247,13 @@ <h2 style="margin-left:10px; width:700px;"><span id="text_title">{% if title %}{


<label value="product_space" class="btn btn-default {% if app_name == 'product_space' %}active{% endif %}" data-placement="top" data-toggle="tooltip" title="Product Space" >
<input type="radio" style="background:url({{ STATIC_URL }}img/home/productSpace-thumb.png) no-repeat;">
<img src="{{ STATIC_URL }}img/home/productSpace-thumb.png" style="width:38px;"/>
<input type="radio" style="background:url({{ STATIC_URL }}img/common/productspace.png) no-repeat;">
<img src="{{ STATIC_URL }}img/common/productspace.png" style="width:38px;"/>
</label>

<label value="pie_scatter" class="btn btn-default {% if app_name == 'pie_scatter' %}active{% endif %}" data-placement="top" data-toggle="tooltip" title="Product Feasibility" >
<input type="radio" style="background:url({{ STATIC_URL }}img/home/productFeas2-thumb.png) no-repeat;">
<img src="{{ STATIC_URL }}img/home/productFeas2-thumb.png" style="width:38px;"/>
<input type="radio" style="background:url({{ STATIC_URL }}img/common/feasibility.png) no-repeat;">
<img src="{{ STATIC_URL }}img/common/feasibility.png" style="width:38px;"/>
</label>

{% if app_name == "rings" %}
@@ -924,23 +922,27 @@ <h4 style="border-bottom: solid 1px #999; font-family:'PT Sans Narrow',Helvetica

</div> <!-- END #container -->

<!-- Glossary -->
<div id="glossary" style="display:none;">
{% include "about/glossary_text.html" %}
</div>



<!-- The JavaScript -->
<!-- Libraries -->
<script src="//code.jquery.com/jquery-1.10.2.min.js"></script>
<script src="//code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<script type="text/javascript" src="media/js/libs/helpbox.js"></script>
<script type="text/javascript" src="media/js/explore/dropdowns.js"></script>
<script type="text/javascript" src="media/js/searchresults.js"></script>
<script type="text/javascript" src="media/js/explore/download.js"></script>
<script src="//code.jquery.com/ui/1.10.3/jquery-ui.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/select2/3.4.8/select2.min.js" ></script>


{% compress js %}
<script type="text/javascript" src="{{ STATIC_URL }}js/libs/helpbox.js"></script>
<script type="text/javascript" src="{{ STATIC_URL }}js/explore/dropdowns.js"></script>
<script type="text/javascript" src="{{ STATIC_URL}}js/searchresults.js"></script>
<script type="text/javascript" src="{{ STATIC_URL}}js/explore/download.js"></script>
<script src="{{ STATIC_URL }}js/libs/d3/d3.v3.min.js" charset="utf-8"></script>

<script src="{{ STATIC_URL }}js/libs/bootstrap/js/bootstrap.js"></script>
<script src="{{ STATIC_URL }}js/libs/bootstrap/js/bootstrap.min.js"></script>
<script src="{{ STATIC_URL }}js/libs/bootstro/bootstro.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/select2/3.4.8/select2.min.js" ></script>
<script src="{{ STATIC_URL }}js/libs/typed.js"></script>
<script src="{{ STATIC_URL }}js/libs/typed.js"></script>

<!-- App -->
<script src="{{ STATIC_URL }}js/explore/general.js?{{ VERSION }}"></script>
@@ -950,18 +952,12 @@ <h4 style="border-bottom: solid 1px #999; font-family:'PT Sans Narrow',Helvetica
<script src="{{ STATIC_URL }}js/apps/related.js?{{ VERSION }}"></script>
<script src="{{ STATIC_URL }}js/libs/toastr/toastr.min.js"></script>

<!--
<script src="{{ STATIC_URL }}js/libs/vizwiz/lib/modernizr.custom.js"></script>
<script src="{{ STATIC_URL }}js/libs/vizwiz/src/general.js"></script>
<script src="{{ STATIC_URL }}js/libs/vizwiz/src/utils.js"></script>
<script src="{{ STATIC_URL }}js/libs/vizwiz/src/tooltip.js"></script>
<script src="{{ STATIC_URL }}js/libs/vizwiz/src/utils.slider.js"></script>
<script src="{{ STATIC_URL }}js/libs/vizwiz/src/viz/viz.js"></script>
-->
<script src="{{ STATIC_URL }}js/libs/d3plus/lib/modernizr.custom.js"></script>
<script src="{{ STATIC_URL }}js/libs/d3plus/src/general.js"></script>
<script src="{{ STATIC_URL }}js/libs/d3plus/src/utils.js"></script>
<script src="{{ STATIC_URL }}js/libs/d3plus/src/tooltip.js"></script>
<script src="{{ STATIC_URL }}js/explore/viz_general.js"></script>
{% endcompress %}

{% if app_name != "map" %}

@@ -979,7 +975,7 @@ <h4 style="border-bottom: solid 1px #999; font-family:'PT Sans Narrow',Helvetica

{% elif app_name == "scatterplot_new" %}

<script src="{{ STATIC_URL }}js/libs/d3plus/d3plus.v1.2.4.js"></script>
<script src="{{ STATIC_URL }}js/libs/d3plus/d3plus.v1.2.4.js"></script>

{% endif %}

@@ -1003,13 +999,6 @@ <h4 style="border-bottom: solid 1px #999; font-family:'PT Sans Narrow',Helvetica
{% endif %}


<script src="{{ STATIC_URL }}js/explore/viz_general.js"></script>

<!-- Glossary -->
<div id="glossary" style="display:none;">
{% include "about/glossary_text.html" %}
</div>

<script>
$("#glossary h4").each(function(index) {
if($("#glossary").length > 0) {
2 changes: 1 addition & 1 deletion html/template.html
Original file line number Diff line number Diff line change
@@ -64,7 +64,7 @@ <h2 style="font-size:18px; margin-top:-33px; text-align:center; margin-left:0px;
</div> <!-- END #container -->

<script src="media/js/libs/jquery/jquery-1.10.2.min.js"></script>
<script src="media/js/libs/bootstrap/js/bootstrap.js"></script>
<script src="media/js/libs/bootstrap/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/select2/3.4.8/select2.min.js" ></script>

<script>
File renamed without changes
File renamed without changes
Binary file added media/img/common/logo_cid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/img/common/logo_rainbow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
Binary file removed media/img/home/horses_export.png
Binary file not shown.
Binary file removed media/img/home/network_new.png
Binary file not shown.
Binary file removed media/img/home/pagination.png
Binary file not shown.
Binary file removed media/img/home/pie_new.png
Binary file not shown.
Binary file removed media/img/home/pie_new2.png
Binary file not shown.
Binary file removed media/img/home/stack_new.png
Binary file not shown.
Binary file removed media/img/home/teaser_earth.png
Binary file not shown.
Binary file removed media/img/home/teaser_earth_fade.png
Binary file not shown.
Binary file removed media/img/home/teaser_product_space.png
Binary file not shown.
Binary file removed media/img/home/teaser_products.png
Binary file not shown.
Binary file removed media/img/home/teaser_products_fade.png
Binary file not shown.
Binary file removed media/img/home/teaser_stacked.png
Binary file not shown.
Binary file removed media/img/home/teaser_tree_map.png
Binary file not shown.
Binary file modified media/img/home/teaser_video_obs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified media/img/home/us_exports.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed media/img/home/us_imports.png
Binary file not shown.
Binary file modified media/img/home/us_imports_ps.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed media/img/icons/filetype_csv.png
Binary file not shown.
Binary file removed media/img/icons/filetype_pdf.png
Diff not rendered.
Binary file removed media/img/icons/filetype_png.png
Diff not rendered.
Binary file removed media/img/icons/filetype_svg.png
Diff not rendered.
Binary file removed media/img/icons/filetype_xlsx.png
Diff not rendered.
2 changes: 1 addition & 1 deletion media/js/explore/dropdowns.js
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ $(document).ready(function(){
$.ajax({
dataType: "json",
data: {lang: lang},
url: "api/dropdowns/products/" + prod_class
url: "api/dropdowns/products/" + prod_class + "/"
})
.done(function( data ){

2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -8,3 +8,5 @@ redis
cairosvg
django-cache-utils
django-redis
django-compressor
html5lib