-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/release-1.13.0'
- Loading branch information
Showing
45 changed files
with
2,627 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# See https://docs.docker.com/engine/reference/builder/#dockerignore-file for more about ignoring files. | ||
|
||
# Ignore git directory. | ||
/.git/ | ||
|
||
# Ignore bundler config. | ||
/.bundle | ||
|
||
# Ignore all environment files (except templates). | ||
/.env* | ||
!/.env*.erb | ||
|
||
# Ignore all default key files. | ||
/config/master.key | ||
/config/credentials/*.key | ||
|
||
# Ignore all logfiles and tempfiles. | ||
/log/* | ||
/tmp/* | ||
!/log/.keep | ||
!/tmp/.keep | ||
|
||
# Ignore pidfiles, but keep the directory. | ||
/tmp/pids/* | ||
!/tmp/pids/.keep | ||
|
||
# Ignore storage (uploaded files in development and any SQLite databases). | ||
/storage/* | ||
!/storage/.keep | ||
/tmp/storage/* | ||
!/tmp/storage/.keep |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Dockerfile | ||
FROM ruby:2.3.1 | ||
|
||
# The ruby:2.3.1 image is ancient, based of debian jessie which no longer | ||
# receives active security updates. Therefore we must declare the debian | ||
# archive as a source instead. | ||
RUN rm /etc/apt/sources.list && \ | ||
echo "deb http://archive.debian.org/debian-security jessie/updates main" \ | ||
>> /etc/apt/sources.list.d/jessie.list && \ | ||
echo "deb http://archive.debian.org/debian jessie main" \ | ||
>> /etc/apt/sources.list.d/jessie.list \ | ||
; | ||
|
||
# Rails and SAPI has some additional dependencies, e.g. rake requires a JS | ||
# runtime, so attempt to get these from apt, where possible | ||
RUN apt-get update && apt-get install -y --force-yes \ | ||
libsodium-dev libgmp3-dev libssl-dev \ | ||
libpq-dev postgresql-client \ | ||
nodejs \ | ||
texlive-latex-base texlive-fonts-recommended texlive-fonts-extra texlive-latex-extra \ | ||
; | ||
# NB: Postgres client from Debian is 9.4 - not sure if this is acceptable | ||
|
||
RUN mkdir /SAPI | ||
WORKDIR /SAPI | ||
|
||
COPY Gemfile /SAPI/Gemfile | ||
COPY Gemfile.lock /SAPI/Gemfile.lock | ||
RUN gem install bundler -v 1.17.3 | ||
RUN bundle install | ||
|
||
COPY . /SAPI | ||
|
||
EXPOSE 3000 | ||
CMD ["rails", "server", "-b", "0.0.0.0"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
123 changes: 123 additions & 0 deletions
123
...assets/javascripts/species/controllers/downloads_for_cites_processes_controller.js.coffee
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
Species.DownloadsForCitesProcessesController = Ember.Controller.extend | ||
designation: 'cites' | ||
|
||
needs: ['geoEntities','higherTaxaCitesEu', 'downloads'] | ||
|
||
higherTaxaController: ( -> | ||
@get('controllers.higherTaxaCitesEu') | ||
).property() | ||
|
||
geoEntityQuery: null | ||
taxonConceptQuery: null | ||
selectedGeoEntities: [] | ||
selectedTaxonConcepts: [] | ||
timeScope: 'current' | ||
timeScopeIsCurrent: ( -> | ||
@get('timeScope') == 'current' | ||
).property('timeScope') | ||
years: [1975..new Date().getFullYear()] | ||
selectedYears: [] | ||
processType: 'Both' | ||
documentTypeIsCitesSuspensions: ( -> | ||
@get('documentType') == 'CitesSuspensions' | ||
).property('documentType') | ||
|
||
autoCompleteTaxonConcepts: ( -> | ||
if @get('taxonConceptQuery') && @get('taxonConceptQuery').length > 0 | ||
re = new RegExp("^"+@get('taxonConceptQuery'),"i") | ||
@get('higherTaxaController.contentByRank') | ||
.map((e) => | ||
{ | ||
rankName: e.rankName | ||
taxonConcepts: e.taxonConcepts.filter((item) => | ||
re.test item.get('fullName') | ||
) | ||
} | ||
).filter((e) -> | ||
e.taxonConcepts.length > 0 | ||
) | ||
else | ||
@get('higherTaxaController.contentByRank') | ||
).property('higherTaxaController.contentByRank.@each', 'taxonConceptQuery') | ||
|
||
autoCompleteRegions: ( -> | ||
if @get('geoEntityQuery') && @get('geoEntityQuery').length > 0 | ||
re = new RegExp("(^|\\(| )"+@get('geoEntityQuery'),"i") | ||
@get('controllers.geoEntities.regions') | ||
.filter (item, index, enumerable) => | ||
re.test item.get('name') | ||
else | ||
@get('controllers.geoEntities.regions') | ||
).property('controllers.geoEntities.regions.@each', 'geoEntityQuery') | ||
|
||
autoCompleteCountries: ( -> | ||
if @get('geoEntityQuery') && @get('geoEntityQuery').length > 0 | ||
re = new RegExp("(^|\\(| )"+@get('geoEntityQuery'),"i") | ||
@get('controllers.geoEntities.countries') | ||
.filter (item, index, enumerable) => | ||
re.test item.get('name') | ||
else | ||
@get('controllers.geoEntities.countries') | ||
).property('controllers.geoEntities.countries.@each', 'geoEntityQuery') | ||
|
||
selectedGeoEntitiesIds: ( -> | ||
@get('selectedGeoEntities').mapProperty('id') | ||
).property('selectedGeoEntities.@each') | ||
|
||
selectedTaxonConceptsIds: ( -> | ||
@get('selectedTaxonConcepts').mapProperty('id') | ||
).property('selectedTaxonConcepts.@each') | ||
|
||
toParams: ( -> | ||
{ | ||
data_type: 'Processes' | ||
filters: | ||
process_type: @get('processType') | ||
designation: @get('designation') | ||
geo_entities_ids: @get('selectedGeoEntitiesIds') | ||
taxon_concepts_ids: @get('selectedTaxonConceptsIds') | ||
set: @get('timeScope') | ||
years: @get('selectedYears') | ||
csv_separator: @get('controllers.downloads.csvSeparator') | ||
} | ||
).property( | ||
'selectedGeoEntitiesIds.@each', 'selectedTaxonConceptsIds.@each', | ||
'timeScope', 'selectedYears.@each', 'processType', 'controllers.downloads.csvSeparator' | ||
) | ||
|
||
downloadUrl: ( -> | ||
'/species/exports/download?' + $.param(@get('toParams')) | ||
).property('toParams') | ||
|
||
actions: | ||
startDownload: () -> | ||
@set('downloadInProgress', true) | ||
@set('downloadMessage', 'Downloading...') | ||
$.ajax({ | ||
type: 'GET' | ||
dataType: 'json' | ||
url: @get('downloadUrl') | ||
}).done((data) => | ||
@set('downloadInProgress', false) | ||
if data.total > 0 | ||
@set('downloadMessage', null) | ||
ga('send', { | ||
hitType: 'event', | ||
eventCategory: 'Downloads: ' + @get('processType'), | ||
eventAction: 'Format: CSV', | ||
eventLabel: @get('controllers.downloads.csvSeparator') | ||
}) | ||
window.location = @get('downloadUrl') | ||
return | ||
else | ||
@set('downloadMessage', 'No results') | ||
) | ||
|
||
deleteTaxonConceptSelection: (context) -> | ||
@set('selectedTaxonConcepts', []) | ||
|
||
deleteGeoEntitySelection: (context) -> | ||
@get('selectedGeoEntities').removeObject(context) | ||
|
||
deleteYearSelection: (context) -> | ||
@get('selectedYears').removeObject(Number(context)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.