Skip to content

Commit

Permalink
Merge branch 'release-1.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
simaob committed Aug 4, 2014
2 parents 52ad6d3 + 68c2078 commit fcca31b
Show file tree
Hide file tree
Showing 72 changed files with 1,992 additions and 1,210 deletions.
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.0.0
1 change: 0 additions & 1 deletion .rvmrc

This file was deleted.

12 changes: 6 additions & 6 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
GIT
remote: https://github.com/livingsocial/rake-pipeline.git
revision: ee992cbcda5172075062be035bcbef2cf1b0ff5d
revision: a75d96fbadcc659a35a0ae59212e0bc60b58cc54
specs:
rake-pipeline (0.8.0)
json
rake (~> 10.0.0)
rake (~> 10.1.0)
thor

GIT
remote: https://github.com/wycats/rake-pipeline-web-filters.git
revision: d83f54cc0d4e53f9833c31851964e3d8ba00f66a
revision: de71c66b5a92e304c244ab35d351d9b8eea002df
specs:
rake-pipeline-web-filters (0.6.0)
rack
Expand All @@ -36,7 +36,7 @@ GEM
fssm (0.2.10)
highline (1.6.19)
jslint_on_rails (1.1.1)
json (1.7.7)
json (1.8.1)
libv8 (3.11.8.13)
multi_json (1.5.1)
net-scp (1.1.2)
Expand All @@ -47,13 +47,13 @@ GEM
net-ssh-gateway (1.2.0)
net-ssh (>= 2.6.5)
rack (1.5.2)
rake (10.0.3)
rake (10.1.1)
ref (1.0.2)
sass (3.2.5)
therubyracer (0.11.3)
libv8 (~> 3.11.8.12)
ref
thor (0.17.0)
thor (0.18.1)
uglifier (1.3.0)
execjs (>= 0.3.0)
multi_json (~> 1.0, >= 1.0.2)
Expand Down
2 changes: 1 addition & 1 deletion app/javascripts/adapters/sapi_adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Checklist.DownloadAdapter = {
var store = Checklist.LocalStorageAdapter;
var ids = store.getAll(Checklist.Download).map(
function(item, index) {
return item["id"];
return item.id;
});

var content = Checklist.store.findQuery(Checklist.Download, {ids: ids});
Expand Down
16 changes: 14 additions & 2 deletions app/javascripts/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,19 @@ require('checklist/vendor/spin.min');
require('checklist/vendor/ember');
require('checklist/vendor/ember-data');

require('checklist/vendor/plurals');
require('checklist/vendor/ember-i18n');
// rather than include CLDR here, just a simple plural form implementation
// EN, ES, FR only ever have 'one' or 'other'
// 'zero' is for convenience

CLDR = {
pluralForm: function myCustomInflector(n) {
return n === 0 ? 'zero' : n === 1 ? 'one' : 'other';
}
};

require('checklist/vendor/i18n');

Em.I18n.locales = {};

minispade.requireAll(/locales/);
minispade.requireAll(/templates/);
Expand Down Expand Up @@ -58,6 +69,7 @@ Checklist.download_store = DS.Store.create({
})
});

require('checklist/static_page');
require('checklist/routers/router');

Checklist.initialize();
1 change: 0 additions & 1 deletion app/javascripts/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,3 @@ Checklist.CONFIG = {

Em.I18n.translations = Em.I18n.locales[Checklist.CONFIG.default_locale];
Em.I18n.currentLocale = Checklist.CONFIG.default_locale;
CLDR.defaultLanguage = Checklist.CONFIG.default_locale;
8 changes: 4 additions & 4 deletions app/javascripts/controllers/download_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Checklist.DownloadController = Ember.ArrayController.extend({
content: Checklist.store.findQuery(Checklist.Download, {ids: (function() {
var store = Checklist.LocalStorageAdapter;
return store.getAll(Checklist.Download).map(function(item, index) {
return item["id"];
return item.id;
});
})()}),

Expand All @@ -52,7 +52,7 @@ Checklist.DownloadController = Ember.ArrayController.extend({
var store = Checklist.LocalStorageAdapter;
var ids = store.getAll(Checklist.Download).map(
function(item, index) {
return item["id"];
return item.id;
});

// Query the server to return the current state of the objects for
Expand Down Expand Up @@ -102,7 +102,7 @@ Checklist.DownloadController = Ember.ArrayController.extend({

_interval: null,
startPolling: function() {
if (this.get('_interval') == null) {
if (this.get('_interval') === null) {
var that = this;
var id = setInterval(function() {
that.refresh();
Expand All @@ -112,7 +112,7 @@ Checklist.DownloadController = Ember.ArrayController.extend({
}
},
stopPolling: function() {
if (this.get('_interval') != null) {
if (this.get('_interval') !== null) {
clearInterval(this.get('_interval'));
}
}
Expand Down
32 changes: 8 additions & 24 deletions app/javascripts/controllers/filters_controller.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
Checklist.FiltersController = Ember.Object.extend({
/*
* In the current version of Ember (0.9.8.1) findAll does not fire
* loading events properly, so we use findQuery with an empty query
* string.
*/
countriesContent : Checklist.store.findQuery(Checklist.Country, {}),
countries : [],
countriesIds : [],
regionsContent : Checklist.store.findQuery(Checklist.Region, {}),
regions : [],
regionsIds: [],
appendicesContent : Checklist.store.findQuery(Checklist.Appendix, {}),
appendices : [],
appendicesIds : [],
appendicesContent: [
Ember.Object.create({abbreviation: 'I'}),
Ember.Object.create({abbreviation: 'II'}),
Ember.Object.create({abbreviation: 'III'})
],
taxonomicLayout : false,
levelOfListing : false,
showSynonyms : true,
Expand All @@ -22,7 +19,6 @@ Checklist.FiltersController = Ember.Object.extend({
showFrench : true,
scientificName : "",
geoEntityName : "",
locale: Em.I18n.currentLocale,
autoCompleteCountriesContent : [],
autoCompleteRegionsContent : [],
searches : [],
Expand Down Expand Up @@ -72,19 +68,10 @@ Checklist.FiltersController = Ember.Object.extend({
return that.get('appendicesIds').contains(item.get('abbreviation'));
}
)
);
);
}
}.observes('appendicesContent.isLoaded','appendicesIds'),

localeDidChange: function() {
var locale = this.get('locale');

if (Em.I18n.locales[locale]) {
Em.I18n.currentLocale = locale;
CLDR.defaultLanguage = locale;
}
}.observes('locale'),

resetParams: function() {
this.set('countries',[]);
this.set('countriesIds',[]);
Expand All @@ -109,8 +96,7 @@ Checklist.FiltersController = Ember.Object.extend({
show_french : this.get('showFrench') === true ? 1 : 0,
scientific_name : this.get('scientificName'),
page : this.get('page'),
per_page : this.get('per_page'),
locale : Em.I18n.currentLocale
per_page : this.get('per_page')
};
},

Expand All @@ -121,7 +107,7 @@ Checklist.FiltersController = Ember.Object.extend({
show_english : 1,
show_spanish : 1,
show_french : 1,
locale : Em.I18n.currentLocale
intro : 1
};
},

Expand Down Expand Up @@ -161,7 +147,5 @@ Checklist.FiltersController = Ember.Object.extend({
this.set('scientificName', params.scientific_name || "");
this.set('page', parseInt(params.page, 10) || 1);
this.set('perPage', parseInt(params.perPage, 10) || 20);

this.set('locale', params.locale);
}
});
45 changes: 24 additions & 21 deletions app/javascripts/controllers/taxon_concept_controller.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
Checklist.TaxonConceptController = Ember.ArrayController.extend({
content: [],

taxaCount: 0,

contentIds: function(){
return this.get('content').objectAt(0).get('contentIds');
}.property('content'),
contentHistory: null,
contentDidChange: function(){
if (this.get('content.isLoaded')){
this.set('taxaCount', this.get('content').objectAt(0).get('total_cnt'));
this.set('contentHistory',
Checklist.store.findMany(Checklist.TimelinesForTaxonConcept, this.get('contentIds'))
);
}
}.observes('content.isLoaded','contentIds'),

refresh: function(params) {
this.set('content', Checklist.store.find(
refresh: function(params){
var that = this;
var promise = new RSVP.Promise();
var res = Checklist.store.find(
Checklist.Index,
params
));
$.extend({locale: Em.I18n.currentLocale}, params)
);
res.addObserver(
'@each.didLoad',
function(){
Ember.run.once(
this,
function() { promise.resolve(res); }
);
}
);
promise.then(function(taxon_concepts_index_ary){
that.set('content', taxon_concepts_index_ary);
var contentIds = taxon_concepts_index_ary.objectAt(0).get('contentIds');
Checklist.store.find(
Checklist.TimelinesForTaxonConcept, {
taxon_concept_ids: contentIds, locale: Em.I18n.currentLocale
}
);
});
}
});
92 changes: 85 additions & 7 deletions app/javascripts/locales/en.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,113 @@
Em.I18n.locales = {};

Em.I18n.locales.en = {
'title': 'Checklist of CITES Species',
'about.title': 'About the CITES Checklist',
'terms.title': 'Terms of Use',
'toplink.about': 'About',
'toplink.terms': 'Terms of Use',
'powered.by': 'Powered By',

'search.by_taxon.button': 'SEARCH',
'search.by_taxon.placeholder': 'Species, higher taxon, synonym or common name...',
'search.by_appendix.all': 'All',
'search.by_appendix.appxs': 'Appxs.',

'search.by_location.placeholder': 'Type to filter countries or regions',
'search.by_location.selected': 'Selected Locations',
'search.by_location.regions': 'Regions',
'search.by_location.countries': 'Countries and territories',
'search.by_location.no_matches': 'No matches',

'search.clear': 'Clear Search',
'search.no_results': 'Your search did not match any taxa.',
'search.results.page': 'Page',

'search.result.show_history': 'Show History',
'search.result.hide_history': 'Hide History',
'distribution.more': 'and {{count}} more.',
'distribution.see_all': 'See all...',

'timeline.party': 'See reservations to CITES listings',
'timeline.split': 'NB: this taxon is split-listed. See also timeline(s) ' +
'for lower taxa.',
'timeline.nohistory': 'No history information is available for this taxon.',
'timeline.reservations': 'Appendix-{{appendix}} reservations:',
'timeline.event.appendix': 'CITES Appendix {{appendix}}',
'timeline.event.symbol.amendment': 'A',
'timeline.event.symbol.reservation': 'R',
'timeline.event.symbol.reservation_withdrawal': 'W',
'timeline.event.description.addition': 'APPENDIX',
'timeline.event.description.reservation': 'RESERVATION',
'timeline.event.description.reservation_withdrawal': 'RESERVATION WITHDRAWAL',

'advanced.title': 'Advanced Options',
'advanced.common_names': 'COMMON NAMES',
'advanced.common_names.en': 'EN',
'advanced.common_names.es': 'ES',
'advanced.common_names.fr': 'FR',
'advanced.online_view': 'Online view',
'advanced.online_view.alphabetical': 'Alphabetical',
'advanced.online_view.taxonomic': 'Taxonomic',
'advanced.online_view.appendix': 'Appendix',
'advanced.display': 'DISPLAY',
'advanced.display.synonyms': 'Synonyms',
'advanced.display.author_name': 'Author\'s name',
'advanced.display.unfold_history': 'History of listing',
'advanced.downloads': 'Downloads',
'advanced.downloads.include_intro': 'Include introduction in PDF',
'advanced.downloads.separator': 'CSV separator',
'advanced.downloads.separator.comma': 'comma',
'advanced.downloads.separator.semicolon': 'semicolon',

'downloads.button': 'Download',
'downloads.popup.title': 'Download Taxa',
'downloads.popup.info': 'Please select the format of your choice',

'download.button': 'Download',
'download.failed': 'Failed.',
'download.remove': 'Remove?',
'download.spinner': 'Downloading...',

'saved_search.button': 'SAVE THIS',
'saved_search.count.zero': '',
'saved_search.count.one': '1 saved search',
'saved_search.count.other': '{{count}} saved searches',

'featured.title': 'Featured',
'featured.index': 'Full species list',
'featured.history': 'History of listings',
'featured.format': 'Format',

'locations.count.zero': 'All Locations',
'locations.count.one': '1 Location',
'locations.count.other': '{{count}} Locations',

'reports.count.zero': '',
'reports.count.one': 'Generating 1 report',
'reports.count.other': 'Generating {{count}} reports',

'reports.ready.count.zero': '',
'reports.ready.count.one': '1 report ready',
'reports.ready.count.other': '{{count}} reports ready',

'reports.failed.count.zero': '',
'reports.failed.count.one': '1 report failed',
'reports.failed.count.other': '{{count}} reports failed',

'reports.failed.description': 'You can restart a download, or remove it from the list.',
'reports.generating.description': 'It can take some time, but you can close this window and continue working in other CITES Checklist reports.',
'reports.failed.description': 'You can restart a download, or remove it ' +
'from the list.',
'reports.generating.description': 'It can take some time, but you can ' +
'close this window and continue working in other CITES Checklist reports.',

'reports.ready.title': 'Your Reports',
'reports.generating.title': 'Currently Generating Reportings',
'reports.latest.title': 'Your report is being generated',

'results.count.zero': 'taxa',
'results.count.one': 'taxon',
'results.count.other': 'taxa'
'splash.p1': 'CITES (the Convention on International Trade in Endangered ' +
'Species of Wild Fauna and Flora) is an international agreement between ' +
'governments that aims to ensure that international trade in specimens ' +
'of wild animals and plants does not threaten their survival.',
'splash.p2': 'The Checklist of CITES Species allows the exploration of ' +
'more than 35,000 species of animals and plants and their degree of ' +
'protection.',
'splash.button': 'Start Exploring'
};
Loading

0 comments on commit fcca31b

Please sign in to comment.