diff --git a/.gitignore b/.gitignore
index 6c092987..d2b8b614 100644
--- a/.gitignore
+++ b/.gitignore
@@ -32,7 +32,6 @@ config/amazon_s3.yml
config/initializers/recaptcha.rb
config/config.yml
config/initializers/site_keys.rb
-Gemfile.lock
vendor/bundle
app/assets/bower_components
app/assets/node_modules
@@ -43,6 +42,6 @@ todo.txt
.sass-cache
.byebug_history
coverage_report/
-test/reports/
+test/reports/*
yarn-error.log
diff --git a/vendor/assets/images/image.png b/app/assets/images/image.png
similarity index 100%
rename from vendor/assets/images/image.png
rename to app/assets/images/image.png
diff --git a/app/assets/stylesheets/style.scss b/app/assets/stylesheets/style.scss
index c5d05b8b..5d131e17 100644
--- a/app/assets/stylesheets/style.scss
+++ b/app/assets/stylesheets/style.scss
@@ -30,14 +30,18 @@ It was originally created by Caroline Hadilaksono: http://www.hadilaksono.com
background-attachment: fixed;
background-repeat: no-repeat;
background-size: cover;
+}
.text-block {
- height: 350px;
- width: 500px;
+ margin-bottom: 5px;
+ padding-top:30px;
+ padding-bottom:50px;
background-color: white;
display: inline-block;
- // font-family: Verdana; //Nunito; // 'Ubuntu', 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif;
+ .btn {
+ width: 45%;
+ font-size: 1em;
+ }
}
-}
.jumbotron {
margin-bottom: 1rem;
@@ -45,7 +49,6 @@ It was originally created by Caroline Hadilaksono: http://www.hadilaksono.com
.jumbotron-text {
text-shadow: 1px 1px 2px #080707;
- // color: white;
}
.map-list .map-img {
@@ -232,11 +235,6 @@ label small {
letter-spacing: -0.2px;
}
-.icon-landing {
- width: 120px;
- height: 120px;
- object-fit: contain;
-}
.item-description {
font-size: 18px;
@@ -247,42 +245,6 @@ label small {
color: #a2aaad;
}
-.blue-background {
- background-color: #17a2b8;
- width: 1000px;
-}
-
-.section-blue-background {
- max-height: 100px;
- background-color: #17a2b8;
- margin: 20px 0;
- color: white;
-}
-
-.section-blue-background a {
- display: flex;
- justify-content: center;
- font-size: 26px;
- font-weight: 500;
- font-style: normal;
- font-stretch: normal;
- line-height: 1.17;
- letter-spacing: -0.5px;
- color: #ffffff;
- padding: 30px 0 40px 0;
- justify-content: center !important;
-}
-
-.section-blue-background a:hover {
- color: #ffffff;
- text-decoration: none;
-}
-
-@media(max-width: 360px) {
- #get-started-button {
- margin-bottom: 10px;
- }
-}
#info {
.fa-stack {
@@ -294,3 +256,10 @@ label small {
padding-bottom: 20px;
}
}
+#all-maps {
+ img {
+ display: block;
+ width: 200px;
+ height: 200px;
+ }
+}
diff --git a/app/controllers/front_ui_controller.rb b/app/controllers/front_ui_controller.rb
index 1fbda548..60b1f210 100644
--- a/app/controllers/front_ui_controller.rb
+++ b/app/controllers/front_ui_controller.rb
@@ -1,4 +1,6 @@
# Shadow Controller for the new front page
+require 'will_paginate/array'
+
class FrontUiController < ApplicationController
protect_from_forgery except: :save_location
@@ -18,9 +20,11 @@ class FrontUiController < ApplicationController
lat = session[:lat]
lon = session[:lon]
@nearby_maps = Map.maps_nearby(lat: lat, lon: lon, dist: 10)
+ .page(params[:page])
+ .per_page(12)
end
- @all_mappers = Map.featured_authors
+ @all_mappers = Map.featured_authors.paginate(page: params[:page], per_page: 12)
end
def save_location
@@ -33,4 +37,13 @@ class FrontUiController < ApplicationController
end
def about; end
+
+ def gallery
+ @maps = Map.page(params[:page])
+ .per_page(20)
+ .where(archived: false, password: '')
+ .order('updated_at DESC')
+ .group('maps.id')
+ @authors = Map.featured_authors.paginate(page: params[:page], per_page: 20)
+ end
end
diff --git a/app/helpers/front_ui_helper.rb b/app/helpers/front_ui_helper.rb
index 84928372..271b272a 100644
--- a/app/helpers/front_ui_helper.rb
+++ b/app/helpers/front_ui_helper.rb
@@ -1,5 +1,13 @@
module FrontUiHelper
def profile_image(author)
- author.maps.last.warpables.last.image.url
+ author.warpables.last.image.url
+ end
+
+ def anonymous(maps)
+ maps.anonymous
+ end
+
+ def featured(maps)
+ maps.featured
end
end
diff --git a/app/models/map.rb b/app/models/map.rb
index dd560eea..861d7e2d 100755
--- a/app/models/map.rb
+++ b/app/models/map.rb
@@ -47,6 +47,10 @@ class Map < ActiveRecord::Base
author == "" || user_id.zero?
end
+ def self.anonymous
+ Map.where(user_id: 0)
+ end
+
def self.bbox(minlat, minlon, maxlat, maxlon)
Map.where(['lat > ? AND lat < ? AND lon > ? AND lon < ?',
minlat, maxlat, minlon, maxlon])
diff --git a/app/models/user.rb b/app/models/user.rb
index 55e03666..0274d6bd 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -5,6 +5,7 @@ class User < ActiveRecord::Base
has_many :tags
has_many :comments
has_many :exports
+ has_many :warpables, through: :maps
validates_presence_of :login
validates_length_of :login, within: 3..40
diff --git a/app/views/front_ui/_featured_mappers.html.erb b/app/views/front_ui/_featured_mappers.html.erb
index f0a72122..1c99d96f 100644
--- a/app/views/front_ui/_featured_mappers.html.erb
+++ b/app/views/front_ui/_featured_mappers.html.erb
@@ -14,3 +14,5 @@
<% end %>
+
+<%= will_paginate mappers, list_classes: %w(pagination justify-content-center), previous_label: 'Prev', next_label: 'Next', renderer: WillPaginate::ActionView::BootstrapLinkRenderer unless @unpaginated %>
diff --git a/app/views/front_ui/_maps.html.erb b/app/views/front_ui/_maps.html.erb
index 545e47d8..6e399591 100644
--- a/app/views/front_ui/_maps.html.erb
+++ b/app/views/front_ui/_maps.html.erb
@@ -1,30 +1,32 @@
- <% end %>
-
- - <% if map.user %> - by <%= map.user.login %> - <% else %> - by anonymous - <% end %> -
-
+ <% end %>
+
+ + <% if map.user %> + by <%= map.user.login %> + <% else %> + by anonymous + <% end %> +
+A Community Atlas hosted by PublicLab
+A Community Atlas hosted by PublicLab
Use a kite, balloon, pole, or drone to take an aerial photo and tell your own visual story of the place. Learn more
- <%#%>
- Get a mapping kit + Get a mapping kit - Add your images + Add your images