diff --git a/README.MD b/README.MD index 8acf4ab..78877d7 100644 --- a/README.MD +++ b/README.MD @@ -1,19 +1,17 @@ -# BioModelos v2.8.6 +# BioModelos v2.8.7 [BioModelos](http://biomodelos.humboldt.org.co) is a web app that facilitates the generation, validation and consultation of hypothesis of species distribution for the continental biodiversity of Colombia. As such, it provides tools to (1) improve existing species distribution models (SDMs) by integrating expert's opinion, (2) generate expert maps and (3) publish SDMs. Our objective is to provide freely and openly access to the most up to date information on species distributions, validated by a large network of researchers, to support national environmental decision making processes and research. - # Requirements - ## Services + Deploy these services before setting up the app: - MongoDB Database Service - BioModelos API Service [GitHub Repo](https://github.com/LBAB-Humboldt/biomodelos_db_api) - SQL Database Service - ## Software - Ruby version 2.5. It is advisable to use [rbenv](https://github.com/rbenv/rbenv#installation) to install and manage ruby local version. @@ -21,8 +19,6 @@ Deploy these services before setting up the app: - [Git](https://git-scm.com/) - [Bower](https://bower.io/) - - # Setup ## Download the source code @@ -37,19 +33,22 @@ $ git clone git://github.com/LBAB-Humboldt/BioModelos.v2.git To build the database according to the schema file using the SQL Service, you should follow the next steps: -1. Create a [database.yml](https://edgeguides.rubyonrails.org/configuring.html#configuring-a-database) file with the configuration of your SQL Service and add it to the */config/* path. Use *database_template.yml* as a template which is located at */config/* folder -2. Once you have the Docker container running, you may execute the **migrations** (*/db/migrate/*) following [this guide](https://edgeguides.rubyonrails.org/active_record_migrations.html#running-migrations). +1. Create a [database.yml](https://edgeguides.rubyonrails.org/configuring.html#configuring-a-database) file with the configuration of your SQL Service and add it to the _/config/_ path. Use _database_template.yml_ as a template which is located at _/config/_ folder +2. Once you have the Docker container running, you may execute the **migrations** (_/db/migrate/_) following [this guide](https://edgeguides.rubyonrails.org/active_record_migrations.html#running-migrations). ## Configuration + Some files and paths in BioModelos need to be configured in order for the app to work as intended. ### Files + - Models folder with raster files. - Thumbnails folder with thumbnails image files. - Zip folder with zip files of the models. ### Connection to other BioModelos services -You need to setup a path to the BioModelos API service URL and geoserver URL. Create a new file *url.rb* under the */config/initializers/* folder and setup the next env vars: + +You need to setup a path to the BioModelos API service URL and geoserver URL. Create a new file _url.rb_ under the _/config/initializers/_ folder and setup the next env vars: ```sh BASE_URI = "http://localhost:3000/v2"; @@ -57,7 +56,8 @@ GEOSERVER_URI = "http://localhost:8080/geoserver"; ``` ### Keys and credentials -The app needs the following keys which you can set up in a *local_env.yml* file under the *config* folder like this: + +The app needs the following keys which you can set up in a _local_env.yml_ file under the _config_ folder like this: ```sh SECRET_KEY_BASE: [secret key base] @@ -73,14 +73,18 @@ RECAPTCHA_SECRET_KEY: [secret key] GMAIL_USERNAME: [username] GMAIL_PASSWORD: [password] ``` + There, you should put information about: + - Rails Application key. - Google maps key. - Recaptcha key. - SMTP credentials. ## Run + Install dependencies + ```sh gem install bundler @@ -96,10 +100,13 @@ bundle exec rails s -b 0.0.0.0 ``` ### Dev env with docker + You can create a docker container for development purposes, just build the image with the dev file: + ```sh $ docker build -f Dockerfile.dev -t . ``` + And remember to mount the volumes (or link them) in your source code path ## Deploy @@ -109,6 +116,7 @@ And remember to mount the volumes (or link them) in your source code path First, there are some static .PDF, .PNG and .ZIP files you need to copy to the /public/ folder. Those files are part of the guides and graphic pieces to advertise BioModelos and are not part of our repo. ### Building the image + On the root path of the rails app you enter this command to build the image: ```sh @@ -117,7 +125,7 @@ $ docker build -t : . ### Starting the container - Once you have the image, it's recommended to use [docker-compose](https://docs.docker.com/compose/) to run the container. +Once you have the image, it's recommended to use [docker-compose](https://docs.docker.com/compose/) to run the container. You need to create a docker-compose.yml file and set the volumes according to the models, thumbnails, zip and uploads folders like this: @@ -136,12 +144,12 @@ services: - /path/to/host/uploads:/var/www/BioModelos/public/uploads ``` -Finally, you run the container with the next command: - ```sh - $ docker-compose -d up - ``` +Finally, you run the container with the next command: +```sh +$ docker-compose -d up +``` ## LICENSE diff --git a/app/views/species/_species_models.html.erb b/app/views/species/_species_models.html.erb index 2893fb6..9fd0199 100644 --- a/app/views/species/_species_models.html.erb +++ b/app/views/species/_species_models.html.erb @@ -1,11 +1,11 @@ <% if @models && !@models.blank? %>

<%= t('biomodelos.visor.hypotheses.text_1') %>

- + - +
@@ -172,7 +172,7 @@ $('.user_star').raty({ // init Isotope var $grid = $('.grid').isotope({ - filter: ".validados" + filter: $('.button-group .is-checked').attr('data-filter') }); $('.filter-button-group').on( 'click', 'button', function() {