Skip to content

Commit

Permalink
UI - Navbar for MapKnitter (#360)
Browse files Browse the repository at this point in the history
* Show only maps with at least one image in main listing

* Update Leaflet.DistortableImage version

* Create first timers issue template.md

* Create config.yml

* spam links in moderation feeds

* Add mapknitter to the help wanted link

Co-Authored-By: faithngetich <faithngetich188@gmail.com>

* Replace the community link with the code.public link

Co-Authored-By: faithngetich <faithngetich188@gmail.com>

* Update the first time only link to code.public

Co-Authored-By: faithngetich <faithngetich188@gmail.com>

* Use the correct link to indicate where the code will be published

Co-Authored-By: faithngetich <faithngetich188@gmail.com>

* Update index.html.erb

* Update bower.json

* Update bower.json

* Update bower.json

* Peg GoogleMutant layer to v0.7.0

see https://gitlab.com/IvanSanchez/Leaflet.GridLayer.GoogleMutant/issues/90 for the issue we encountered with `v0.7.1`

* [Security] Bump nokogiri from 1.8.1 to 1.9.1

Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.8.1 to 1.9.1. **This update includes security fixes.**
- [Release notes](https://github.com/sparklemotion/nokogiri/releases)
- [Changelog](https://github.com/sparklemotion/nokogiri/blob/master/CHANGELOG.md)
- [Commits](sparklemotion/nokogiri@v1.8.1...v1.9.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>

* Bump will_paginate from 3.0.7 to 3.1.6

Bumps [will_paginate](https://github.com/mislav/will_paginate) from 3.0.7 to 3.1.6.
- [Release notes](https://github.com/mislav/will_paginate/releases)
- [Commits](mislav/will_paginate@v3.0.7...v3.1.6)

Signed-off-by: dependabot[bot] <support@dependabot.com>

* Cleanup (#313)

* initial cleanup

* export unit tests, basic

* map tests

* basic comment tests

* cleanup

* export functional tests

* fixes

* Update export.rb

* test fixes and further cleanup

* extra test

* trying again

* another unit test

* output errors?

* Update map_test.rb

* Update maps.yml

* Update tag_test.rb

* Bump rake from 10.5.0 to 12.3.2 (#286)

Bumps [rake](https://github.com/ruby/rake) from 10.5.0 to 12.3.2.
- [Release notes](https://github.com/ruby/rake/releases)
- [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc)
- [Commits](ruby/rake@v10.5.0...v12.3.2)

Signed-off-by: dependabot[bot] <support@dependabot.com>

* [Security] Bump i18n from 0.7.0 to 0.9.5 (#289)

Bumps [i18n](https://github.com/svenfuchs/i18n) from 0.7.0 to 0.9.5. **This update includes security fixes.**
- [Release notes](https://github.com/svenfuchs/i18n/releases)
- [Changelog](https://github.com/ruby-i18n/i18n/blob/master/CHANGELOG.md)
- [Commits](ruby-i18n/i18n@v0.7.0...v0.9.5)

Signed-off-by: dependabot[bot] <support@dependabot.com>

* Bump rdiscount from 2.1.7.1 to 2.2.0.1 (#321)

Bumps [rdiscount](https://github.com/davidfstr/rdiscount) from 2.1.7.1 to 2.2.0.1.
- [Release notes](https://github.com/davidfstr/rdiscount/releases)
- [Changelog](https://github.com/davidfstr/rdiscount/blob/master/CHANGELOG.md)
- [Commits](davidfstr/rdiscount@2.1.7.1...2.2.0.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>

* Unit test warpable code (#331)

* tests for warpables, test to distort in ImageMagick

* file existence test

* make test folder

* demo file and copying

* delete demo image

* mkdir -p

* save_dimensions

* Bump recaptcha from 4.6.3 to 4.9.0 (#332)

Bumps [recaptcha](https://github.com/ambethia/recaptcha) from 4.6.3 to 4.9.0.
- [Release notes](https://github.com/ambethia/recaptcha/releases)
- [Changelog](https://github.com/ambethia/recaptcha/blob/master/CHANGELOG.md)
- [Commits](ambethia/recaptcha@v4.6.3...v4.9.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>

* basic map unit tests (#334)

* basic map unit tests

* try to run entire map.run_export

* parameter consolidation

* Updates to customize rails / ruby and mySQL version compatibility  (#323)

* update time fixtures and override sql primary default keys

* Reset HEAD to first commit and reapply changes

* Finalize comments for customizations

* Changed a word

* Change navbar to use the same layout as Public Lab
MapKnitter is currently using a totally diferent navbar from Public Lab. Making both using the same makes it easier to follow the pattern in future projects

* Add Bootstrap 4 to project

* Redo navbar for Bootstrap 3.2.0 version
  • Loading branch information
Stefanni authored and jywarren committed Mar 6, 2019
1 parent 9eecb4c commit 77ee135
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 212 deletions.
2 changes: 1 addition & 1 deletion app/assets/stylesheets/application.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
*= require leaflet-distortableimage/dist/leaflet.distortableimage.css
*= require style
*= require header
*= require maps
*= require header
*= require uploads
*= require_self
Expand Down
131 changes: 1 addition & 130 deletions app/assets/stylesheets/header.css.scss
Original file line number Diff line number Diff line change
@@ -1,130 +1 @@
.navbar-custom-knitter {
display: none;
}

@media (min-width: 768px) {
.navbar-header {
width:50%;
}
}

#header, .sidebar-header {
.nav > li > a { color: #444; }
.nav > li > a:hover { color: #222; }
.navbar-right { padding-right: 20px; }
}

#header {
background:#f8f8f8;
border-bottom:3px solid #eee;

.navbar-toggle {
border-color:#ccc;
.icon-bar {
background-color:#aaa;
}
}

.navbar-toggle:hover {
background-color:#eee;
}

.dropdown-menu {
padding:8px;
}

.brand {
float:left;
width:90%;
}

.brand .yarn {
display:none;
}

.brand img {
width:400px;
margin:20px 10px 15px;
float:left;
}

.brand span {
display:block;
float:left;
padding-top:65px;
font-size:20px;
font-family: 'Junction Light';
}

img.cat {
position:absolute;
top:20px;
left:3px;
width:80px;
pointer-events:none;
}
}

@media (max-width: 768px) {
#header {
.brand {
width:80%;
}
.brand img {
width:50%;
}
.cat {
display:none;
}
}
}

@media (max-width: 1252px) {
#header .brand span {
display:none;
}
}

.sidebar #header {
.navbar-header {

width:auto;

.navbar-nav {

padding-left:20px;

li {
padding-top:7px;
}

}
}

.cat {
display:none;
}

.brand {
float:left;
width:60px;
}

.brand .fullscreen {
display:none;
}

.brand .yarn {
display:block;
}

.brand img {
margin:10px;
width:70%;
}

.brand span {
display:none;
}
}

body { padding-top: 65px; }
26 changes: 1 addition & 25 deletions app/assets/stylesheets/maps.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -96,27 +96,6 @@ code {

h1, h2, h3, h4 { font-family: 'Junction Light'; }

.navbar { margin-bottom: -$bootstrap-navbar-height; }

#navbar-collapse {
clear: left;
}
/* Disable normal navbar collapse on map show page; it's running in the sidebar,
* so widths are not properly calculated. */
.navbar-toggle {
display: none !important;
}
.navbar-collapse {
display: none !important;
}
.navbar-custom-knitter {
display: table;
}
#brand { display:none; }
#header #brand-compact {
display:inline;
}

.dropdown-menu {
z-index:999;
}
Expand All @@ -134,9 +113,6 @@ code {

.sidebar-header {
@include sidebar-padding();
margin-top: $bootstrap-navbar-height;
padding-bottom: $sidebar-title-padding;
padding-top: $sidebar-title-padding;
h4 { margin: 3px 0 6px; }
}

Expand Down Expand Up @@ -169,7 +145,7 @@ code {
/* Styles for /maps/new */
.new-map .sidebar-content {
border-top: 1px solid $subtle-grey;
top: $sidebar-header-height + $bootstrap-navbar-height;
top: $sidebar-header-height - 80px + $bootstrap-navbar-height;
}

/* Ensure that horizontal nav elements are hidden in the sidebar (not enough room). */
Expand Down
59 changes: 18 additions & 41 deletions app/views/layouts/_header.html.erb
Original file line number Diff line number Diff line change
@@ -1,56 +1,33 @@
<div id="header" class="navbar navbar-static-top">
<div class="hidden-print container-fluid">
<nav class="navbar navbar-default navbar-inverse navbar-fixed-top" role="navigation">
<div class="container-fluid">
<div class="navbar-header">

<div class="brand">
<img class="cat fade" src="/images/mapknitter-cat.png" />
<a class="fullscreen" href="/"><img src="/images/mapknitter-yarn.png" /></a>
<a class="yarn" href="/"><img src="/images/yarn.png" /></a>
<span>by <a href="//publiclab.org">Public Lab</a></span>

<% if params[:cat] %>
<script>
(function(){
$('.brand').hover(function() {
$('.cat').toggleClass('in');
})
})()
</script>
<% end %>
</div>

<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>

<ul class="nav navbar-nav navbar-right navbar-custom-knitter">
<li class="dropdown hidden-xs">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Resources <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="//publiclab.org/wiki/mapknitter">Getting Started</a></li>
<li><a href="//publiclab.org/wiki/balloon-mapping">About Balloon Mapping</a></li>
<li><a href="//store.publiclab.org/products/balloon-mapping-kit">Balloon and Kite kits</a></li>
<li><a href="//publiclab.org/lists">Discussion lists</a></li>
</ul>
</li>
<%= render :partial => "layouts/login" %>
</ul>
<a class="navbar-brand" href="/">MapKnitter</a>
</div>


<div class="collapse navbar-collapse" id="navbar-collapse">
<ul class="nav navbar-nav fullscreen">
<li><a href="//publiclab.org/wiki/mapknitter">Getting Started</a></li>
<li><a href="//publiclab.org/wiki/balloon-mapping">About Balloon Mapping</a></li>
<li><a href="//store.publiclab.org/products/balloon-mapping-kit">Balloon and Kite kits</a></li>
<form action="/search" method='get' class="navbar-form navbar-left" id="nav_search_form">
<div class="input-group">
<input class="form-control mr-sm-2" style="min-width: 280px;" type="text" id="search-input" name="q" value='<%= params[:id] if params[:action] == "search" %>' placeholder="Search maps"/>
<span class="input-group-btn">
<button class="btn btn-default" type="submit"><i class="fa fa-search"></i></button>
</span>
</div>
</form>
<ul class="nav navbar-nav">
<li><a href="//publiclab.org/wiki/mapknitter" target="_blank">Getting Started</a></li>
<li><a href="//publiclab.org/wiki/balloon-mapping" target="_blank">Balloon Mapping</a></li>
<li><a href="//store.publiclab.org/products/balloon-mapping-kit" target="_blank">Aerial Mapping Kits</a></li>
<li><a href="//publiclab.org/lists" target="_blank">Mailing Lists</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<%= render :partial => "layouts/login" %>
</ul>
</div>

</div>
</div>
</nav>
12 changes: 7 additions & 5 deletions app/views/layouts/_login.html.erb
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
<% if logged_in? %>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" id="logout-menu"><i class="fa fa-user"></i> <%= current_user.login %> <span class="caret"></span></a>
<a href="#" class="dropdown-toggle" data-toggle="dropdown" id="logout-menu"><%= current_user.login %></a>
<ul class="dropdown-menu" role="menu" aria-labelled-by="logout-menu">
<div class="dropdown-header">
<% if current_user.role == 'admin'%>
- logged as Admin %>
<% end %>
</div>
<li><a href="//publiclab.org/profile/<%= current_user.login %>">Profile</a></li>
<li><a href="/logout">Log out</a></li>
<% if current_user.role == 'admin' %>
<li><a href="#">Role: <b>Admin</b></a></li>
<% end %>
</ul>
</li>
<% else %>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" id="login-menu">Log In <span class="caret"></span></a>
<a href="#" class="dropdown-toggle" data-toggle="dropdown" id="login-menu">Log In</a>
<div class="dropdown-menu login-form" role="menu" aria-labelled-by="login-menu">
<%= render :partial => "layouts/login_form" %>
</div>
Expand Down
17 changes: 9 additions & 8 deletions app/views/layouts/_login_form.html.erb
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
<form id="open_id_form" method="GET" action="/sessions/create">

<%= hidden_field_tag :authenticity_token, form_authenticity_token -%>
<%= hidden_field_tag :back_to, params[:back_to] || request.path -%>
<div class="form-group">
Log in using your Public Lab username, or <a href="//publiclab.org/signup">create a Public Lab account</a>.
<label style="display: block; text-align: center;">Log In using your Public Lab username</label>
<label style="display: block; text-align: center;">or</label>
<label style="display: block; text-align: center;">
create a
<a href="//publiclab.org/signup">Public Lab account</a>.
</label>
</div>

<div class="form-group">
<div class="form-group">
<%= text_field_tag 'open_id', @login, { :placeholder => "Username (not email)", :class => "form-control"} %>
<div class="checkbox">
<label for="remember_me">
<%= check_box_tag 'remember_me', '1', @remember_me %> Remember me
</label>
</label>
</div>
</div>

<div class="form-group">
<%= submit_tag 'Log in', {:class => "btn btn-primary btn-large"} %>
</div>

</form>
</form>
3 changes: 1 addition & 2 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@
<title>MapKnitter</title>
<meta name="author" content="MapKnitter contributors"/>
<meta name="description" content="Make maps from aerial photos with Public Lab's free and open source web toolkit"/>
<meta name="viewport" content="width=320, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

<link rel="apple-touch-icon" href="/images/mapknitter-255.png">
<link rel="apple-touch-icon-precomposed" href="/images/mapknitter-255.png">
<link rel="apple-touch-icon-precomposed apple-touch-icon" href="/images/mapknitter-255.png">
<link rel="shortcut icon" href="/images/mapknitter-255.png" />

<link rel="stylesheet" href="/lib/fontawesome/css/font-awesome.min.css"/>
<%= stylesheet_link_tag 'application' %>
<%= javascript_include_tag 'application' %>
Expand Down

0 comments on commit 77ee135

Please sign in to comment.