Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
308 changes: 223 additions & 85 deletions .idea/workspace.xml

Large diffs are not rendered by default.

13 changes: 3 additions & 10 deletions app/assets/javascripts/map/geocode.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,13 @@ function initialize() {

var marker = new google.maps.Marker({
map: map,
position: pos,
});

map.setCenter(pos);
position: pos

google.maps.event.addListener(marker, 'click', function(event) {

var lat = marker.getPosition().lat();
var lng = marker.getPosition().lng();

$('#lat').val(lat);
$('#lng').val(lng);
});

map.setCenter(pos);


}, function() {
handleNoGeolocation(true);
Expand Down
12 changes: 2 additions & 10 deletions app/assets/javascripts/map/gmap.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
var huggles = huggles || {}

function loadScript() {
//var script = document.createElement('script');
//script.type = 'text/javascript';
//script.src = 'https://maps.googleapis.com/maps/api/js?v=3.exp' +
// '&signed_in=false&callback=initialize';
//document.body.appendChild(script);
//$.getScript('https://maps.googleapis.com/maps/api/js?v=3.exp')
// .done(function() {
$(huggles.after_google).each(function(i, f) {
f()
$(huggles.after_google).each(function(i, f) {
f()
})
//})
}

window.onload = loadScript;
3 changes: 2 additions & 1 deletion app/assets/javascripts/map/marker_location.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ huggles.after_google = huggles.after_google || []

huggles.after_google.push(
function () {
google.maps.event.addListener(map, "rightclick", function(event) {

google.maps.event.addListener(map, 'click', function(event) {
var lat = event.latLng.lat();
var lng = event.latLng.lng();
// populate yor box/field with lat, lng
Expand Down
13 changes: 13 additions & 0 deletions app/assets/stylesheets/_google_maps.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#map-container {
height: 400px;
border-radius: 16px 16px;
border-color: #fff;
border-style: solid;
box-shadow: 2px 2px 10px #B1B1B1;
margin-top: 25px;
border-width: 7px;
}
#map-canvas {
height: 384px;
width: 100%;
}
3 changes: 2 additions & 1 deletion app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
@import "bootstrap-sprockets";
@import "bootstrap";
@import "bootstrap";
@import "google_maps";
1 change: 1 addition & 0 deletions app/controllers/profile_controller.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
class ProfileController < ApplicationController

def new

end

def index
Expand Down
2 changes: 0 additions & 2 deletions app/views/devise/sessions/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,3 @@
<%= f.submit "Log in" %>
</div>
<% end %>

<%= render "devise/shared/links" %>
5 changes: 4 additions & 1 deletion app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@
<html>
<head>
<title>Huggles</title>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&signed_in=false&callback=initialize" ></script>
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
<%= csrf_meta_tags %>
</head>
<body>

<%= render "shared/navbar" %>

<%= yield %>

<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&signed_in=false&callback=initialize" ></script>

</body>
</html>
8 changes: 8 additions & 0 deletions app/views/profile/_index.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<h1>Profile</h1>

<h1>Potential Huggles</h1>

<div id="map-container">
<div id="map-canvas">
</div>
</div>
14 changes: 1 addition & 13 deletions app/views/profile/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,13 +1 @@
<h1>Profile</h1>

<h1>Potential Huggles</h1>

<form action="">
<input type="hidden" name="lat" id="lat"/>
<input type="hidden" name="lng" id="lng"/>
</form>

<div id="map-container">
<div id="map-canvas">
</div>
</div>
<%= render 'index' %>
41 changes: 41 additions & 0 deletions app/views/shared/_navbar.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<nav class="navbar navbar-default">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Huggles</a>
</div>

<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav navbar-right">
<li class="active"><%= link_to "Home", authenticated_root_path %></li>
<li class="active">
<% if user_signed_in? %>
<li>
<%= link_to 'Logout', destroy_user_session_path, method: :delete %>
</li>
<% else %>
<li>
<%= link_to 'Login', new_user_session_path %>
</li>
<% end %>
<li class="active">
<% if user_signed_in? %>
<li>
<%= link_to 'Edit User', edit_user_registration_path %>
</li>
<% else %>
<li>
<%= link_to 'Sign Up', new_user_registration_path %>
</li>
<% end %></li>
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>