Skip to content

Commit

Permalink
Merge branch 'release-1.8.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiomarrocoli committed Sep 15, 2022
2 parents bbf2102 + 4e683d3 commit 7b2a087
Show file tree
Hide file tree
Showing 23 changed files with 21,109 additions and 45 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
### 1.8.1

* Updated CITES Trade Database user guidance
* CITES Wildlife TradeView links added to CITES Trade Database layout
* CITES Wildlife TradeView link added to Species+ 'Related Resources' drop down
* EU Analysis link updated in Species+ 'Related Resources' drop down
* Common names bulk upload:
* new data csv added
* import task modified to remove duplicates with different cases, e.g. Shark and shark
* Diactritics ignored during country filtering

### 1.8.0

**Intersessional decisions**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,17 @@ Species.GeoEntityAutoCompleteLookup = Ember.Mixin.create
selectedGeoEntitiesIds: []

geoEntityQueryObserver: ( ->
re = new RegExp("(^|\\(| )"+@get('geoEntityQuery'),"i")
@set 'autoCompleteCountries', @get('geoEntities.countries').filter (item, index, enumerable) =>
re.test item.get('name')
removeDiactritics = (string) -> string.normalize('NFD').replace(/[\u0300-\u036f]/g, '');

query = removeDiactritics(@get('geoEntityQuery'));

re = new RegExp("^[0-9]- "+@get('geoEntityQuery'),"i")
re = new RegExp("(^|\\(| )"+query,"i")
@set 'autoCompleteCountries', @get('geoEntities.countries').filter (item, index, enumerable) =>
re.test removeDiactritics(item.get('name'));

re = new RegExp("^[0-9]- "+query,"i")
@set 'autoCompleteRegions', @get('geoEntities.regions').filter (item, index, enumerable) =>
re.test item.get('name')
re.test removeDiactritics(item.get('name'));
).observes('geoEntityQuery')

geoEntitiesObserver: ( ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
<li><a href="http://api.speciesplus.net">Species+ / CITES Checklist API</a></li>
<li><a href="http://captivebreeding.unep-wcmc.org">EU Captive breeding database</a></li>
<li><a href="/eu_legislation">EU Wildlife Trade Legislation</a></li>
<li><a href="http://euanalysis.unep-wcmc.org/">EU analysis</a></li>
<li><a href="https://ec.europa.eu/environment/cites/reports_en.htm">EU analysis</a></li>
<li><a href="https://tradeview.cites.org/">TradeView</a></li>
</ul>
</div>
</li>
Expand Down
4 changes: 4 additions & 0 deletions app/assets/stylesheets/cites_trade/citestrade.css
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,7 @@ padding: 3px 3px;
.download-button p {
text-align: center;
}

.new {
color: #9C1452;
}
5 changes: 5 additions & 0 deletions app/assets/stylesheets/mobile.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/*
*= require_self
*= require_tree ./admin
*= require ./mobile/mobile
*/
94 changes: 94 additions & 0 deletions app/assets/stylesheets/mobile/mobile.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
// Settings (mobile-first)
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700&display=swap');

$navy: #253848;
$black: #2D2D2D;
$medium-grey: #dddddd;
$dark-grey: #747474;
$link-navy: #376382;
$link-blue: #0088cc;

$screen-sm: 768px;
$screen-md: 1024px;
$screen-lg: 1200px;
$screen-xl: 1600px;

.mobile {
font-family: 'Open Sans', sans-serif;
color: $dark-grey;
font-weight: 400;
font-size: 12px;
line-height: 1.75;
// get rid of the default margin on the body
margin-top: -40px;

h2 {
font-weight: 600;
font-size: 20px;
}

h3 {
font-weight: 400;
font-size: 18px;
}

h4 {
color: $black;
font-weight: 700;
font-size: 15px;
margin: 1rem 0;
padding-top: 1rem;
line-height: 1.5;
}

a {
color: $link-navy;
text-decoration: underline;
}

a:hover {
color: $link-blue;
}

&-header {
text-align: center;

&__hero {
background-color: $navy;
color: white;
padding: 6% 2%;
margin-bottom: 1rem;
}
}

&-body {
padding: 0 2rem 2rem;
}

// breakpoints
// @media screen and (min-width:$screen-sm){
// }

@media screen and (min-width:$screen-lg){
font-size: 15px;

&-body {
padding: 0 6rem 6rem;
}

h2 {
font-size: 1.75rem;
}

h3 {
font-size: 1.5rem;
}

h4 {
font-size: 1.25rem;
}
}

// @media screen and (min-width:$screen-xl){
// }
}
10 changes: 10 additions & 0 deletions app/controllers/mobile_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
class MobileController < ApplicationController
layout 'mobile'

def terms_and_conditions
end

# TODO: uncomment when privacy policy content is updated
# def privacy_policy
# end
end
6 changes: 4 additions & 2 deletions app/views/cites_trade/home/download.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,10 @@
<br />
<div align="left">
<strong><%= t('download') %>: </strong>
<a href="/cites_trade_guidelines/<%= I18n.locale %>-CITES_Trade_Database_Guide.pdf"><%= t('db_guide') %></a>

<a href="/cites_trade_guidelines/<%= I18n.locale %>-CITES_Trade_Database_Guide.pdf"><%= t('db_guide') %></a>
<% if I18n.locale == :en %>
<i class="new"><%= t('new') %><i>
<% end %>
</div>

</td></tr>
Expand Down
10 changes: 9 additions & 1 deletion app/views/cites_trade/home/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,18 @@
<strong><%= t('download') %>:</strong>
<a href=<%= cites_trade_download_db_path %> data-full-trade-db-download><%= t('full_db_download') %> (427MB)</a>
</p>
<p align="center">
<p align="center" class='no-margin'>
<strong><%= t('download') %>:</strong>
<a href="/cites_trade_guidelines/<%= I18n.locale %>-CITES_Trade_Database_Guide.pdf"><%= t('db_guide') %></a>
<% if I18n.locale == :en %>
<strong class="new">*<%= t('new') %>*</strong>
<% end %>
</p>
<% unless I18n.locale == :en %>
<p align="center">
<%= t('translation_in_progress_html') %>
</p>
<% end %>
</div>
</div>

Expand Down
22 changes: 10 additions & 12 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html>
<head>
<meta charset="utf-8">
<title>Species+ Admin Panel</title>
<title>Species+ website</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
Expand All @@ -12,27 +12,25 @@
<script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->

<%= stylesheet_link_tag "admin" %>
<%= stylesheet_link_tag "admin" %>
<%= javascript_include_tag "application" %>
<%= csrf_meta_tags %>
</head>
<body>
<div class="navbar navbar-fixed-top">
<%= render 'shared/topbar' %>
</div>

<div class="container">
<div class="row-fluid">
<div class="span12">
<%= render 'shared/alerts' %>
<%= yield %>
</div><!--/span-->
</div><!--/row-->
<div class="container">
<div class="row-fluid">
<div class="span12">
<%= render 'shared/alerts' %>
<%= yield %>
</div><!--/span-->
</div><!--/row-->
<hr>
<footer>
<p>&copy; UNEP-WCMC <%= Date.today.year %></p>
</footer>
</div><!--/.fluid-container-->

</div><!--/.fluid-container-->
</body>
</html>
1 change: 1 addition & 0 deletions app/views/layouts/cites_trade.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
<a href="http://www.cites.org">CITES</a> |
<a href="http://www.unep-wcmc.org">UNEP-WCMC</a> |
<a href="https://www.speciesplus.net">Species+</a> |
<a href="https://tradeview.cites.org/<%= I18n.locale.to_s %>">CITES Wildlife TradeView</a> |
<a href="mailto:species@unep-wcmc.org" target="_blank"> Contact Us </a>
</font>
</div>
Expand Down
20 changes: 20 additions & 0 deletions app/views/layouts/mobile.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Species+ mobile</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">

<%= stylesheet_link_tag "mobile" %>
<%= javascript_include_tag "application" %>
<%= csrf_meta_tags %>
</head>
<body>
<div class="mobile">
<%= render 'shared/alerts' %>
<%= yield %>
</div>
</body>
</html>
6 changes: 6 additions & 0 deletions app/views/mobile/privacy_policy.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<section class="mobile-header">
</section>
<section class="mobile-body">
</section>
<footer class="mobile-footer">
</footer>
9 changes: 9 additions & 0 deletions app/views/mobile/terms_and_conditions.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<section class="mobile-header">
<div class="mobile-header__hero">
<h3>Species+</h3>
<h2><%= t('mobile.terms.hero') %></h2>
</div>
</section>
<section class="mobile-body">
<%= t('mobile.terms.body').html_safe %>
</section>
2 changes: 1 addition & 1 deletion config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
config.assets.precompile += %w( vendor/* admin.js admin.css trade.js trade.css species.js species.css
pages.css pages.js cites_trade.js cites_trade.css
activities.css activities.js)
activities.css activities.js mobile.css)

# Disable delivery errors, bad email addresses will be ignored
# config.action_mailer.raise_delivery_errors = false
Expand Down
2 changes: 1 addition & 1 deletion config/environments/staging.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
config.assets.precompile += %w( vendor/* admin.js admin.css trade.js trade.css species.js species.css
pages.css pages.js cites_trade.js cites_trade.css
activities.css activities.js)
activities.css activities.js mobile.css)

# Disable delivery errors, bad email addresses will be ignored
# config.action_mailer.raise_delivery_errors = false
Expand Down
Loading

0 comments on commit 7b2a087

Please sign in to comment.