Skip to content

Commit

Permalink
Merge branch 'release-0.8.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
agnessa committed Sep 24, 2014
2 parents 2724be0 + f1a19da commit 37ba952
Show file tree
Hide file tree
Showing 190 changed files with 2,775 additions and 1,183 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ bundler_args: --without development production staging
rvm:
- 2.0.0
addons:
postgresql: 9.2
postgresql: 9.3
code_climate:
repo_token: dd9c26c5738d807099d3f35926ddb76902d4e2a7b899a8fe3b866152ffe8bbf1
# uncomment this line if your project needs to run something other than `rake`:
Expand Down
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,32 @@
### 0.8.3 (2014-09-24)
**Species+:**
* choice of csv separator
* EU Legislation page
* fix to randomly appearing French country names
* activity page

**Species+ Admin:**
* documents management for elibrary
* documents search for elibrary
* changes to event management for purposes of the EU Legislation page

**CITES Trade:**
* choice of csv separator

**CITES Trade Admin:**
* fixes to batch update
* fixes to search by taxa with cascading
* automatic resolution of reported -> accepted taxon concept

### 0.8.2 (unreleased)

### 0.8.1 (unreleased)
**Trade Admin**
* ability to update shipments in batch

**Species+ Admin**
* new event types in preparation for e-library integration

**General**
* Rails upgrade to 3.2.19

Expand Down
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ gem 'strong_parameters'
gem 'devise'
gem 'cancan'
gem 'ahoy_matey'
gem 'gon'

gem 'sidekiq'
gem 'sidekiq-status'
Expand All @@ -30,6 +31,7 @@ gem 'ember-rails'
gem 'ember-source', '1.1.2'
gem 'jquery-rails', '2.1.4' #do not upgrade until https://github.com/jquery/jquery/pull/1142 isd pulled into jquery-rails
gem 'jquery-mousewheel-rails'
gem 'jquery-cookie-rails'
gem 'bootstrap-sass', '~> 2.3.1.0'
gem 'kaminari'
gem 'select2-rails'
Expand Down
9 changes: 9 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,11 @@ GEM
git_pretty_accept (0.3.1)
git
methadone (~> 1.3.1)
gon (5.2.0)
actionpack (>= 2.3.0)
json
multi_json
request_store (>= 1.0.5)
guard (1.6.2)
listen (>= 0.6.0)
lumberjack (>= 1.0.2)
Expand All @@ -204,6 +209,8 @@ GEM
has_scope (~> 0.5.0)
responders (~> 0.6)
journey (1.0.4)
jquery-cookie-rails (1.3.1.1)
railties (>= 3.2.0, < 5.0)
jquery-mousewheel-rails (0.0.2)
railties (>= 3.1)
jquery-rails (2.1.4)
Expand Down Expand Up @@ -423,10 +430,12 @@ DEPENDENCIES
foreigner
geoip
git_pretty_accept
gon
guard-bundler
guard-livereload
immigrant
inherited_resources
jquery-cookie-rails
jquery-mousewheel-rails
jquery-rails (= 2.1.4)
jquery-ui-rails
Expand Down
3 changes: 3 additions & 0 deletions app/assets/javascripts/activities.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
//= require jquery
//= require d3.min
//= require c3.min
44 changes: 33 additions & 11 deletions app/assets/javascripts/admin/documents.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ $(document).ready ->

$('#event-type-search').change( (e) ->
documentType = $('#document-type')
# if no event type selected
unless e.target.value
# enable all document types
documentType.prop('disabled', false)
documentType.html(documentTypeChildren)
)
Expand All @@ -22,27 +24,40 @@ $(document).ready ->
$(e.target).attr('href', 'document_batch/new')
)

$('#event-type').change( (e) ->
newEventLink = $('#new-event-link')
# if no event type selected
unless e.target.value
# disable new event link
newEventLink.hide()
else
newEventLink.attr('href', $(this).find('option:selected').data('path'))
newEventLink.show()
)

citationTaxonSelect2Options = {
placeholder: 'Start typing scientific name'
multiple: true
width: '300px'
minimumInputLength: 3
quietMillis: 500
allowClear: true
initSelection: (element, callback) =>
initSelection: (element, callback) ->
callback($(element).data('init-selection'))
ajax:
url: '/admin/taxon_concepts/autocomplete'
dataType: 'json'
data: (query, page) ->
search_params:
scientific_name: query
name_status: $(@).data('name-status-filter')
taxonomy:
id: $(@).data('taxonomy-id')
per_page: 25
page: 1
results: (data, page) => # parse the results into the format expected by Select2.
{
search_params:
scientific_name: query
name_status: $(@).data('name-status-filter')
taxonomy:
id: $(@).data('taxonomy-id')
per_page: 25
page: page
}
results: (data, page) ->
formatted_taxon_concepts = data.map (tc) =>
id: tc.id
text: tc.full_name
Expand All @@ -51,15 +66,22 @@ $(document).ready ->

citationGeoEntitySelect2Options = {
placeholder: 'Start typing country or territory'
width: '300px'
allowClear: true
}

documentTagSelect2Options = {
placeholder: 'Start typing a document tag'
width: '300px'
allowClear: true
}

$('.citation-taxon-concept').select2(citationTaxonSelect2Options)
$('.citation-geo-entity').select2(citationGeoEntitySelect2Options)
$('.document-tag').select2(documentTagSelect2Options)

$(document).on('nested:fieldAdded', (event) ->
# this field was just inserted into your form
field = event.field
# it's a jQuery object already
citationTaxonField = field.find('.citation-taxon-concept')
citationGeoEntityField = field.find('.citation-geo-entity')
# and activate select2
Expand Down
1 change: 1 addition & 0 deletions app/assets/javascripts/cites_trade.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
//= require jquery_ujs
//= require jquery.ui.all
//= require jquery-deparam
//= require jquery.cookie
//= require cites_trade/jquery.jgrowl_minimized
//= require cites_trade/jquery.multi-select
//= require cites_trade/select2
Expand Down
27 changes: 5 additions & 22 deletions app/assets/javascripts/cites_trade/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ $(document).ready(function(){
countries = {}, units = {}, terms = {}, purposes = {}, sources = {},
selected_taxa = '',
is_search_page = $('#form_expert').length > 0,
is_download_page = $('#net_gross_options').length > 0;
is_download_page = $('#net_gross_options').length > 0,
is_view_results_page = $('#query_results_table').length > 0;

ajaxFail = function (xhr, ajaxOptions, thrownError) {
Expand All @@ -15,27 +15,6 @@ $(document).ready(function(){
// Your code here
$(".tipify").tipTip();

$('.show_search').qtip({
content: {
text: 'If there any problems, contact blah-blah',
title: {
text: 'Please make your selection in the tabs on the left',
button: true
}
},
position: {
my: 'top left', at: 'bottom left'
},
show: {
event: false, // Don't specify a show event...
ready: true // ... but show the tooltip when ready
},
hide: false, // Don't specify a hide event either!
style: {
classes: 'ui-tooltip-shadow ui-tooltip-jtools'
}
})

function growlMe(text){
$.jGrowl(text);
};
Expand Down Expand Up @@ -737,6 +716,7 @@ $(document).ready(function(){
$('input[value=web]').attr("disabled",true);
$('span#web-option').css('color', 'LightGray');
}
$('select[name=csvSeparator]').val($.cookie('cites_trade.csv_separator') || 'comma')
}

function displayResults (q) {
Expand Down Expand Up @@ -787,6 +767,7 @@ $(document).ready(function(){
function handleDownloadRequest (ignoreWarning) {
var output_type = $( "input[name='outputType']:checked" ).val(),
report_type = $( "input[name='report']:checked" ).val(),
csv_separator = $( "select[name='csvSeparator']" ).val(),
query = location.search.substr(1);
if (report_type === 'comparative') {
report_type = 'comptab';
Expand All @@ -805,6 +786,8 @@ $(document).ready(function(){
goToResults(query);
return;
} else {
$.cookie('cites_trade.csv_separator', csv_separator)
query += '&filters[csv_separator]=' + csv_separator;
downloadResults( decodeURIComponent( query ) );
return
}
Expand Down
17 changes: 17 additions & 0 deletions app/assets/javascripts/pages.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
// GO AFTER THE REQUIRES BELOW.
//
//= require underscore
//= require jquery
//= require jquery_ujs
//= require_self
//= require_tree ./pages
10 changes: 10 additions & 0 deletions app/assets/javascripts/pages/eu_legislation.js.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
$(document).ready ->
$('.show_more a.link').click( (e) ->
historicRows = $(e.target).parent().prev('table').find('tr')
if historicRows.hasClass('hidden')
historicRows.removeClass('hidden')
$(e.target).html('HIDE HISTORY')
else
historicRows.addClass('hidden')
$(e.target).html('SHOW HISTORY')
)
1 change: 1 addition & 0 deletions app/assets/javascripts/species.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
//= require jquery
//= require jquery_ujs
//= require jquery-deparam
//= require jquery.cookie
//= require bootstrap-scrollspy
//= require handlebars
//= require ember
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,26 @@ Species.DownloadsController = Ember.Controller.extend Species.Spinner,
legislationIsEuDecisions: ( ->
@get('euLegislation') == 'decisions'
).property('euLegislation')
csvSeparator: $.cookie('speciesplus.csv_separator') || 'comma'

showCsvOptions: () ->
$('#csv_options').show()
$('.csv_options_holder > a').html('Try changing the option below for .csv outputs:')

hideCsvOptions: () ->
$('#csv_options').hide()
$('.csv_options_holder > a').html('Trouble viewing outputs?')

actions:
close: () ->
@set('downloadsPopupVisible', false)
@hideCsvOptions()
# Closing the spinner cover and resetting the spinner image.
$(@spinnerSelector).css("visibility", "hidden").find('img').show()

showHideCsvOptions: () ->
csvOptions = $('.csv_options')
if $('#csv_options').is(':visible')
@hideCsvOptions()
else
@showCsvOptions()
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Species.DownloadsForCitesListingsController = Ember.Controller.extend
designation: 'cites'
appendices: ['I', 'II', 'III']
needs: ['geoEntities', 'higherTaxaCitesEu']
needs: ['geoEntities', 'higherTaxaCitesEu', 'downloads']
higherTaxaController: ( ->
@get('controllers.higherTaxaCitesEu')
).property()
Expand Down Expand Up @@ -66,8 +66,10 @@ Species.DownloadsForCitesListingsController = Ember.Controller.extend
appendices: @get('selectedAppendices')
geo_entities_ids: @get('selectedGeoEntitiesIds')
taxon_concepts_ids: @get('selectedTaxonConceptsIds')
csv_separator: @get('controllers.downloads.csvSeparator')
}
).property('selectedAppendices.@each', 'selectedGeoEntitiesIds.@each', 'selectedTaxonConceptsIds.@each')
).property('selectedAppendices.@each', 'selectedGeoEntitiesIds.@each', 'selectedTaxonConceptsIds.@each',
'controllers.downloads.csvSeparator')

downloadUrl: ( ->
'/species/exports/download?' + $.param(@get('toParams'))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Species.DownloadsForCitesRestrictionsController = Ember.Controller.extend
designation: 'cites'

needs: ['geoEntities','higherTaxaCitesEu']
needs: ['geoEntities','higherTaxaCitesEu', 'downloads']

higherTaxaController: ( ->
@get('controllers.higherTaxaCitesEu')
Expand Down Expand Up @@ -77,10 +77,11 @@ Species.DownloadsForCitesRestrictionsController = Ember.Controller.extend
taxon_concepts_ids: @get('selectedTaxonConceptsIds')
set: @get('timeScope')
years: @get('selectedYears')
csv_separator: @get('controllers.downloads.csvSeparator')
}
).property(
'selectedGeoEntitiesIds.@each', 'selectedTaxonConceptsIds.@each',
'timeScope', 'years.@each', 'documentType'
'timeScope', 'years.@each', 'documentType', 'controllers.downloads.csvSeparator'
)

downloadUrl: ( ->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Species.DownloadsForCmsListingsController = Ember.Controller.extend
designation: 'cms'
appendices: ['I', 'II']
needs: ['geoEntities', 'higherTaxaCms']
needs: ['geoEntities', 'higherTaxaCms', 'downloads']
higherTaxaController: ( ->
@get('controllers.higherTaxaCms')
).property()
Expand Down Expand Up @@ -66,8 +66,10 @@ Species.DownloadsForCmsListingsController = Ember.Controller.extend
appendices: @get('selectedAppendices')
geo_entities_ids: @get('selectedGeoEntitiesIds')
taxon_concepts_ids: @get('selectedTaxonConceptsIds')
csv_separator: @get('controllers.downloads.csvSeparator')
}
).property('selectedAppendices.@each', 'selectedGeoEntitiesIds.@each', 'selectedTaxonConceptsIds.@each')
).property('selectedAppendices.@each', 'selectedGeoEntitiesIds.@each', 'selectedTaxonConceptsIds.@each',
'controllers.downloads.csvSeparator')

downloadUrl: ( ->
'/species/exports/download?' + $.param(@get('toParams'))
Expand Down
Loading

0 comments on commit 37ba952

Please sign in to comment.