Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/publiclab/mapknitter into d…
Browse files Browse the repository at this point in the history
…evelopment
  • Loading branch information
alaxalves committed Jul 10, 2019
2 parents 553d8ea + 860d286 commit 426e072
Show file tree
Hide file tree
Showing 21 changed files with 76 additions and 95 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,4 @@ todo.txt
coverage_report/
test/reports/*
yarn-error.log
yarn.lock
14 changes: 3 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,12 @@ RUN apt-get update -qq && apt-get install -y \
# Configure ImageMagick
COPY ./nolimit.xml /etc/ImageMagick-6/policy.xml

RUN curl -sL https://deb.nodesource.com/setup_8.x | bash - && apt-get install -y npm
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash - && apt-get install -y npm
RUN npm install -g yarn

# Install bundle of gems
SHELL [ "/bin/bash", "-l", "-c" ]
WORKDIR /tmp
ADD Gemfile /tmp/Gemfile
ADD Gemfile.lock /tmp/Gemfile.lock
RUN bundle install

# Add the Rails app
COPY . /app/
WORKDIR /app
COPY Gemfile /app/Gemfile
COPY Gemfile.lock /app/Gemfile.lock
COPY start.sh /app/start.sh

CMD [ "bash", "-l", "start.sh" ]
CMD [ "sh", "/app/start.sh" ]
33 changes: 5 additions & 28 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ GEM
json (~> 1.4)
nokogiri (>= 1.4.4)
uuidtools (~> 2.1)
bindex (0.7.0)
bindex (0.8.1)
bootsnap (1.4.4)
msgpack (~> 1.0)
bootstrap-sass (3.4.1)
Expand All @@ -72,16 +72,10 @@ GEM
concurrent-ruby (1.1.5)
crass (1.0.4)
docile (1.3.2)
equatable (0.6.1)
erubi (1.8.0)
execjs (2.7.0)
faker (1.9.4)
faker (1.9.6)
i18n (>= 0.7)
pastel (~> 0.7.2)
thor (~> 0.20.0)
tty-pager (~> 0.12.0)
tty-screen (~> 0.6.5)
tty-tree (~> 0.3.0)
ffi (1.11.1)
friendly_id (5.2.5)
activerecord (>= 4.0.0)
Expand Down Expand Up @@ -126,7 +120,7 @@ GEM
mime-types-data (3.2019.0331)
mimemagic (0.3.3)
mini_magick (4.9.3)
mini_mime (1.0.1)
mini_mime (1.0.2)
mini_portile2 (2.4.0)
mini_racer (0.2.6)
libv8 (>= 6.9.411)
Expand All @@ -141,7 +135,7 @@ GEM
multi_xml (0.6.0)
mysql2 (0.5.2)
net-http-persistent (2.9.4)
nio4r (2.3.1)
nio4r (2.4.0)
nokogiri (1.10.3)
mini_portile2 (~> 2.4.0)
oa-core (0.3.2)
Expand All @@ -163,9 +157,6 @@ GEM
passenger (6.0.2)
rack
rake (>= 0.8.1)
pastel (0.7.3)
equatable (~> 0.6)
tty-color (~> 0.5)
popper_js (1.14.5)
pry (0.12.2)
coderay (~> 1.1.0)
Expand Down Expand Up @@ -275,35 +266,21 @@ GEM
activesupport (>= 4.0)
sprockets (>= 3.0.0)
sqlite3 (1.4.1)
strings (0.1.5)
strings-ansi (~> 0.1)
unicode-display_width (~> 1.5)
unicode_utils (~> 1.4)
strings-ansi (0.1.0)
terrapin (0.6.0)
climate_control (>= 0.0.3, < 1.0)
thor (0.20.3)
thread_safe (0.3.6)
tilt (2.0.9)
tty-color (0.5.0)
tty-pager (0.12.1)
strings (~> 0.1.4)
tty-screen (~> 0.6)
tty-which (~> 0.4)
tty-screen (0.6.5)
tty-tree (0.3.0)
tty-which (0.4.1)
turbolinks (5.2.0)
turbolinks-source (~> 5.2)
turbolinks-source (5.2.0)
tzinfo (1.2.5)
thread_safe (~> 0.1)
tzinfo-data (1.2019.1)
tzinfo-data (1.2019.2)
tzinfo (>= 1.0.0)
uglifier (4.1.20)
execjs (>= 0.3.0, < 3)
unicode-display_width (1.6.0)
unicode_utils (1.4.0)
url (0.3.2)
uuidtools (2.1.5)
web-console (3.7.0)
Expand Down
2 changes: 1 addition & 1 deletion app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ $icon-font-path: "bootstrap-sass/assets/fonts/bootstrap/";
@import "leaflet-illustrate/dist/Leaflet.Illustrate.css";
@import "leaflet-toolbar/dist/leaflet.toolbar.css";
@import "leaflet-distortableimage/dist/leaflet.distortableimage.css";
@import "fontawesome/css/font-awesome.min.css";
@import "@fortawesome/fontawesome-free/css/all.css";
// /*
// * This is a manifest file that'll be compiled into application.css, which will include all the files
// * listed below.
Expand Down
2 changes: 1 addition & 1 deletion app/views/comments/_comment.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<div class="col-6">
<% if current_user && current_user.can_edit?(comment) %>
<a class="btn btn-sm btn-outline-secondary float-right edit-comment-btn"><span class="fa fa-pencil" data-comment-id="<%= comment.id %>"></span></a>
<a class="btn btn-sm btn-outline-secondary float-right edit-comment-btn"><span class="fas fa-pencil-alt" data-comment-id="<%= comment.id %>"></span></a>
<% end %>

<% if current_user && current_user.can_delete?(comment) %>
Expand Down
5 changes: 3 additions & 2 deletions app/views/front_ui/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
Get a mapping kit <i class="fa fa-angle-double-right fa-fw" style="font-size:18px;color:white;"></i>
</a>
<a class="btn btn-primary btn-lg" href="<%= new_map_url %>">
Add your images <i class="fa fa-plus fa-fw" style="font-size:12px;color:white;"></i>
Make a map <i class="fa fa-plus fa-fw" style="font-size:12px;color:white;"></i>
</a>
</p>
</div>
Expand Down Expand Up @@ -83,8 +83,9 @@
<div class="section-header text-center">
<% if session[:lat].present? %>
<a href="/mappers" class="alert-link">Nearby people & maps</i></a>
&nbsp; | &nbsp;
<% end %>
&nbsp; | &nbsp; <a href="/gallery" class="alert-link">All maps</a>
<a href="/gallery" class="alert-link">All maps</a>
<hr style="max-width: 300px;">
</div>
<br>
Expand Down
4 changes: 2 additions & 2 deletions app/views/images/_index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
</td>
<td>
<% if logged_in? && current_user.can_delete?(warpable) %>
<%= link_to "<i class='fa fa-remove'></i>".html_safe, [@map, warpable],
<%= link_to "<i class='fas fa-times'></i>".html_safe, [@map, warpable],
method: "delete",
class: "btn btn-sm btn-danger",
title: "Delete",
Expand Down Expand Up @@ -87,4 +87,4 @@
</tr>
<% end %>
</tbody>
</table>
</table>
1 change: 0 additions & 1 deletion app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
<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">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.2/css/all.css" integrity="sha384-oS3vJWv+0UjzBfQzYUhtDYW+Pj2yciDJxpsK1OYPAYjqT085Qq/1cq5FLXAZQ7Ay" crossorigin="anonymous">
<%= stylesheet_link_tag 'application' %>
<%= javascript_include_tag 'application' %>
Expand Down
1 change: 0 additions & 1 deletion app/views/layouts/knitter2.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
<meta name="description" content="<%= @map.description.gsub('"',"'") if @map.description %>" />
<meta name="viewport" content="width=320, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>

<link rel="stylesheet" href="/lib/fontawesome/css/font-awesome.min.css"/>
<link rel="stylesheet" href="/lib/leaflet/dist/leaflet.css"/>
<link rel="shortcut icon" href="/images/mapknitter-255.png" />

Expand Down
2 changes: 1 addition & 1 deletion app/views/map/_annotations.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
&nbsp; <a href="/maps/<%= @map.slug %>">&laquo; Back to map</a> &nbsp;
<% if logged_in? || @map.anon_annotatable %>
<a class="btn btn-sm btn-success" data-toggle="modal" data-target="#pointmodal"><i class="fa fa-comment"></i> Add annotation</a>
<a class="btn btn-sm btn-success" data-toggle="modal" href="#polymodal"><i class="fa fa-pencil"></i> Add poly</a>
<a class="btn btn-sm btn-success" data-toggle="modal" href="#polymodal"><i class="fas fa-pencil-alt"></i> Add poly</a>
<% end %>
<a class="btn btn-sm btn-primary" data-toggle="modal" href="#sharemodal"><i class="fa fa-share"></i> Share</a>
<a class="btn btn-sm btn-success" href="javascript:void()" onClick="$A.toggle_fullscreen()"><i class="fa fa-fullscreen"></i> Fullscreen</a>
Expand Down
1 change: 0 additions & 1 deletion app/views/map/leaflet.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<script src="/lib/leaflet/dist/leaflet.js"></script>
<link href="/lib/fontawesome/css/font-awesome.min.css" rel="stylesheet"/>
<link href="/lib/leaflet/dist/leaflet.css" rel="stylesheet"/>
<script src="/lib/jquery/dist/jquery.min.js"></script>
<script src="/lib/leaflet-distortableimage/lib/easybutton.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion app/views/maps/_sidebar_exports.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<% if logged_in? || @map.anonymous? %>
<p>
<button id="begin-export" class="btn btn-lg btn-primary"<% if @map.export && @map.exporting? %> style="display:none;"<% end %>>Start export</button>
<button <% unless @map.export && @map.exporting? %>style="display:none;"<% end %> id="cancel-export" class="btn btn-lg btn-outline-secondary"><i class="fa fa-remove"></i> Cancel export</button>
<button <% unless @map.export && @map.exporting? %>style="display:none;"<% end %> id="cancel-export" class="btn btn-lg btn-outline-secondary"><i class="fas fa-times"></i> Cancel export</button>
</p>

<% if @map.exporting? && ((@map.export.updated_at-DateTime.now)/1.hours.to_i).abs > 4 %>
Expand Down
6 changes: 5 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
version: '3.3'
version: '3.5'
services:
db:
container_name: database
image: mysql:5.7
env_file:
- mapknitter.env
volumes:
- ../mysql:/var/lib/mysql
- ../dump:/docker-entrypoint-initdb.d
web:
container_name: mapknitter
build: .
env_file:
- mapknitter.env
volumes:
- .:/app
- bundle_cache:/usr/local/bundle
- yarn_cache:/app/public/lib
ports:
- $PORT:3000
depends_on:
- db

volumes:
bundle_cache:
yarn_cache:
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
"cartagen": "jywarren/cartagen#*",
"components-jqueryui": "components/jqueryui#^1.12.1",
"exif-js": "jseidelin/exif-js#*",
"font-awesome": "FortAwesome/Font-Awesome#~4.2.0",
"fontawesome": "FortAwesome/Font-Awesome#~4.2.0",
"glfx-js": "jywarren/glfx.js#*",
"image-sequencer": "publiclab/image-sequencer#~1.4.0",
"ion-rangeslider": "ionDen/ion.rangeslider#~2.3.0",
Expand Down Expand Up @@ -44,5 +42,8 @@
},
"engines": {
"yarn": ">= 1.0.0"
},
"devDependencies": {
"@fortawesome/fontawesome-free": "^5.9.0"
}
}
1 change: 0 additions & 1 deletion public/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<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"/>

<link rel="stylesheet" href="/lib/fontawesome/css/font-awesome.min.css"/>
<link href="/assets/bootstrap/dist/css/bootstrap.min.css?body=1" media="screen" rel="stylesheet" type="text/css" />
<link href="/assets/style.css?body=1" media="screen" rel="stylesheet" type="text/css" />
<link href="/assets/application.css?body=1" media="screen" rel="stylesheet" type="text/css" />
Expand Down
1 change: 0 additions & 1 deletion public/422.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<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"/>

<link rel="stylesheet" href="/lib/fontawesome/css/font-awesome.min.css"/>
<link href="/assets/bootstrap/dist/css/bootstrap.min.css?body=1" media="screen" rel="stylesheet" type="text/css" />
<link href="/assets/style.css?body=1" media="screen" rel="stylesheet" type="text/css" />
<link href="/assets/application.css?body=1" media="screen" rel="stylesheet" type="text/css" />
Expand Down
1 change: 0 additions & 1 deletion public/500.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<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"/>

<link rel="stylesheet" href="/lib/fontawesome/css/font-awesome.min.css"/>
<link href="/assets/style.css?body=1" media="screen" rel="stylesheet" type="text/css" />
<link href="/assets/application.css?body=1" media="screen" rel="stylesheet" type="text/css" />
<script src="/assets/jquery-ujs/src/rails.js?body=1" type="text/javascript"></script>
Expand Down
1 change: 0 additions & 1 deletion public/offline.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<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"/>

<link rel="stylesheet" href="/lib/fontawesome/css/font-awesome.min.css"/>
<link href="/assets/bootstrap/dist/css/bootstrap.min.css?body=1" media="screen" rel="stylesheet" type="text/css" />
<link href="/assets/style.css?body=1" media="screen" rel="stylesheet" type="text/css" />
<link href="/assets/application.css?body=1" media="screen" rel="stylesheet" type="text/css" />
Expand Down
2 changes: 1 addition & 1 deletion start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
pidfile=/app/tmp/pids/server.pid

bundle check || bundle install
yarn install
yarn check || yarn install

if [ -f $pidfile ] ; then
>&2 echo 'Server PID file already exists. Removing it...';
Expand Down
10 changes: 10 additions & 0 deletions test/integration/front_page_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
require 'test_helper'

class FrontPageTest < ActionDispatch::IntegrationTest

test 'new front page' do
get '/'
assert_select 'h1', 'MapKnitter'
end

end
Loading

0 comments on commit 426e072

Please sign in to comment.