-
Notifications
You must be signed in to change notification settings - Fork 206
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Front Page UI: Add hero * Navbar tweaks and hardcoded about page * Tweak footer * Add aerial mapping section * CSS tweaks * Start integrating map * Add About MapKnitter link to footer + nav links * Update links for kits and about MapKnitter * Get user's location * Get user's location or location is set to default * Get city's name * showing city area * Start adding featured mappers section * Add how to section * Add CTA for add images * Use JS Promises for getting user location * better JS * some texting tweaks * Adding maps to front page * grouping authors nearby ordered by maps count * Showing featured mappers * showing users nearby if location shared * Some refactor + text tweaks * fixing codeclimate issues
- Loading branch information
Showing
36 changed files
with
747 additions
and
86 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,2 @@ | ||
// Place all the behaviors and hooks related to the matching controller here. | ||
// All this logic will automatically be available in application.js. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Shadow Controller for the new front page | ||
class FrontUiController < ApplicationController | ||
protect_from_forgery except: :save_location | ||
|
||
def index | ||
@mappers = Map.featured_authors.first(4) | ||
@maps = Map.new_maps.first(4) | ||
end | ||
|
||
def all_maps | ||
@maps = Map.new_maps | ||
end | ||
|
||
def nearby_mappers | ||
@nearby_maps = [] | ||
|
||
if current_location.present? | ||
lat = session[:lat] | ||
lon = session[:lon] | ||
@nearby_maps = Map.maps_nearby(lat: lat, lon: lon, dist: 10) | ||
end | ||
|
||
@all_mappers = Map.featured_authors | ||
end | ||
|
||
def save_location | ||
lat = params[:lat].to_f | ||
lon = params[:lon].to_f | ||
|
||
session[:lat] = lat | ||
session[:lon] = lon | ||
render nothing: true | ||
end | ||
|
||
def about; end | ||
end |
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.