From cf485df89e3fa3011a86323ac1aa1f5dfc08010b Mon Sep 17 00:00:00 2001 From: Tyler McSilva Date: Wed, 13 Jun 2018 13:51:39 -0700 Subject: [PATCH 1/3] css: rework list view to be mobile responsive, break out list to own module (#483) --- app/assets/stylesheets/_mobile.scss | 54 --------- .../stylesheets/framework_and_overrides.scss | 6 + app/assets/stylesheets/restrooms/main.scss | 95 +--------------- .../stylesheets/restrooms/restroom-list.scss | 107 ++++++++++++++++++ .../stylesheets/sass/_screen_sizes.sass | 4 +- app/views/restrooms/_restroom.html.haml | 21 ++-- app/views/restrooms/index.html.haml | 2 +- 7 files changed, 128 insertions(+), 161 deletions(-) create mode 100644 app/assets/stylesheets/restrooms/restroom-list.scss diff --git a/app/assets/stylesheets/_mobile.scss b/app/assets/stylesheets/_mobile.scss index 7c63ccdc..2ee71851 100644 --- a/app/assets/stylesheets/_mobile.scss +++ b/app/assets/stylesheets/_mobile.scss @@ -30,26 +30,6 @@ left: 35%; } - // Restrooms List - .restrooms-list { - .listItemImage { - width: 95px; - height: 95px; - } - .listItemImage img { - width: 90%; - height: 90%; - } - .itemInfo { - position: absolute; - top: 10px; - bottom: 10px; - left: 130px; - right: 95px; - overflow: none; - } - } - // Show restroom page // Item .showPageItem { @@ -78,40 +58,6 @@ font-size: 0.7rem; } - // Restrooms List - .restrooms-list { - .listItemImage { - width: 60px; - height: 60px; - margin: 15px 10px; - margin-top: 20px; - } - .itemInfo { - left: 90px; - right: 85px; - } - .itemName a{ - position: relative; - font-size: 16px; - width: 100%; - } - .itemExtraInfo { - top: 0; - } - .itemDistance { - font-size: 12px; - padding-bottom: 0; - } - .itemRating { - font-size: 14px; - width: 120px; - } - .itemExtraInfo { - position: absolute; - top: 20px; - right: 15px; - } - } #mapArea { height: 200px; } diff --git a/app/assets/stylesheets/framework_and_overrides.scss b/app/assets/stylesheets/framework_and_overrides.scss index 0f5645d9..65ea8c4a 100644 --- a/app/assets/stylesheets/framework_and_overrides.scss +++ b/app/assets/stylesheets/framework_and_overrides.scss @@ -34,3 +34,9 @@ header { width: auto; display: inline; } + +// Removes the negative margin applied by Bootstrap +.row { + margin-left: auto; + margin-right: auto; +} diff --git a/app/assets/stylesheets/restrooms/main.scss b/app/assets/stylesheets/restrooms/main.scss index 214554a1..531d1dbe 100644 --- a/app/assets/stylesheets/restrooms/main.scss +++ b/app/assets/stylesheets/restrooms/main.scss @@ -1,100 +1,7 @@ -#mapContainer, #list { +#mapContainer{ overflow: hidden; } -// Restrooms List -.restrooms-list { - width: 100%; - - // List Item - .listItem { - position: relative; - width: 100%; - border-bottom: 1px solid #e1e1e1; - background: $secondary-background; - min-height: 13em; - float: none; - } - .listItemTemplate { - display: none; - } - // Image - .listItemImage { - position: relative; - width: 110px; - height: 110px; - margin: 15px 0 15px 9px; - border-radius: $rounded-corners; - background: #41326b asset-url("ToiletLogo.png") 50% 50% no-repeat; - display: inline-block; - } - .listItemImage img { - width: 90%; - height: 90%; - } - // Info - .itemInfo { - position: absolute; - top: 10px; - bottom: 10px; - left: 150px; - right: 95px; - overflow: none; - } - .itemName a{ - position: relative; - font-size: 24px; - width: 100%; - } - .itemStreet { - position: relative; - width: 100%; - font-size: 1.3rem; - } - .itemDistance { - position: relative; - color: #676767; - text-align: right; - font-size: 15px; - font-family: Arial; - padding: 5px 0; - } - .itemRating { - width: 150px; - background: #41326b; - border-radius: $rounded-corners; - color: #FFF; - text-align: center; - font-family: Arial; - font-size: 15px; - margin-top: 10px; - padding: 11px 0; - max-width: 100%; - } - - // ADA / Gender Neutral Filters - .itemExtraInfo { - position: absolute; - top: 20px; - right: 10px; - text-align: right; - } - .unisexRestroom { - width: 45px; - height: 43px; - display: inline-block; - } - .ADARestroom { - width: 44px; - height: 47px; - display: inline-block; - } - .unisexRestroom img, .ADARestroom img { - width: 100%; - height: 100%; - } -} - // Restroom Page // Item - Restroom header .showPageItem { diff --git a/app/assets/stylesheets/restrooms/restroom-list.scss b/app/assets/stylesheets/restrooms/restroom-list.scss new file mode 100644 index 00000000..2c0ee047 --- /dev/null +++ b/app/assets/stylesheets/restrooms/restroom-list.scss @@ -0,0 +1,107 @@ +// Restrooms List +.restrooms-list { + display: block; + padding: 0; + list-style: none; + + .listItem { + display: block; + width: 100%; + padding-bottom: 1em; + margin-bottom: 1em; + border-bottom: 1px solid $gray; + &:last-child { + border-bottom: none; + } + } + + .listItemImage { + display: inline-block; + vertical-align: top; + float: left; + margin: 0.25em 1%; + width: 8%; + height: 8vw; + background: #41326b asset-url("ToiletLogo.png") 50% 50% no-repeat; + background-size: 60%; + border-radius: $rounded-corners; + } + + .itemInfo { + display: inline-block; + vertical-align: top; + float: left; + width: 58%; + margin: 0 1%; + + a { + font-size: 15px; + } + + .itemStreet { + margin-bottom: 0.5em; + font-size: 14px; + } + + .itemRating { + width: 60%; + min-width: 105px; + max-width: 150px; + border-radius: $rounded-corners; + color: #FFF; + text-align: center; + font-family: $font-stack; + font-size: 14px; + padding: 0.5em; + margin: 0; + } + } + + .itemExtraInfo { + display: inline-block; + vertical-align: top; + float: right; + width: 27%; + margin: 0 0.5%; + + .itemDistance { + font-size: 12px; + padding-bottom: 1em; + text-align: right; + } + } + + .itemIcons { + text-align: right; + + > * { + display: inline-block; + } + } + + + @include tablet { + .listItemImage { + width: 55px; + height: 55px; + } + } + + @include desktop { + .listItemImage { + width: 55px; + height: 55px; + } + .itemInfo { + margin: 0 0.5%; + .itemName { + a { + font-size: 18px; + } + } + .itemStreet { + font-size: 15px; + } + } + } +} diff --git a/app/assets/stylesheets/sass/_screen_sizes.sass b/app/assets/stylesheets/sass/_screen_sizes.sass index 981f759e..48b5c391 100644 --- a/app/assets/stylesheets/sass/_screen_sizes.sass +++ b/app/assets/stylesheets/sass/_screen_sizes.sass @@ -2,9 +2,9 @@ $tablet-width: 768px $desktop-width: 1024px @mixin tablet - @media (min-width: #{$tablet-width}) and (max-width: #{$fa-desktop-width - 1px}) + @media (min-width: #{$tablet-width}) and (max-width: #{$desktop-width - 1px}) @content @mixin desktop @media (min-width: #{$desktop-width}) - @content \ No newline at end of file + @content diff --git a/app/views/restrooms/_restroom.html.haml b/app/views/restrooms/_restroom.html.haml index 1dc65996..0c697088 100644 --- a/app/views/restrooms/_restroom.html.haml +++ b/app/views/restrooms/_restroom.html.haml @@ -2,7 +2,7 @@ - accessible_class = restroom.accessible? ? '' : 'not_accessible' - changing_table_class = restroom.changing_table? ? '' : 'no_changing_table' -%div{ class: "listItem #{unisex_class} #{accessible_class} #{changing_table_class}", +%li{ class: "listItem clearfix #{unisex_class} #{accessible_class} #{changing_table_class}", data: { id: restroom.id} } .listItemImage / image tag goes here @@ -27,12 +27,13 @@ miles / = miles_to_kilometers(restroom.distance).round(2) kilometers - - if restroom.unisex? - .unisexRestroom{:title => t("restroom.type.unisex")} - %i.fa.fa-transgender-alt.fa-3x - - if restroom.accessible? - .ADARestroom{:title => t("restroom.accessible")} - %i.fa.fa-wheelchair.fa-3x - - if restroom.changing_table? - .changingTable{:title => t("restroom.changing_table")} - %i.fa.fa-child.fa-3x + .itemIcons + - if restroom.unisex? + .unisexRestroom{:title => t("restroom.type.unisex")} + %i.fa.fa-transgender-alt.fa-2x + - if restroom.accessible? + .ADARestroom{:title => t("restroom.accessible")} + %i.fa.fa-wheelchair.fa-2x + - if restroom.changing_table? + .changingTable{:title => t("restroom.changing_table")} + %i.fa.fa-child.fa-2x diff --git a/app/views/restrooms/index.html.haml b/app/views/restrooms/index.html.haml index 2b9dd57b..658fb541 100644 --- a/app/views/restrooms/index.html.haml +++ b/app/views/restrooms/index.html.haml @@ -23,7 +23,7 @@ #mapArea .row .col-sm-12.headroom - #list.restrooms-list + %ul{:class => "restrooms-list", :id => "list"} = render @restrooms = paginate @restrooms / .row From 3566c1aa39d0d7c4c0d03b6ec9a9535e47db36ea Mon Sep 17 00:00:00 2001 From: DeeDeeG Date: Thu, 14 Jun 2018 14:53:23 -0400 Subject: [PATCH 2/3] ruby: Upgrade to 2.3.7 (#485) Ruby 2.3.7 contains some bug fixes and security updates --- .ruby-version | 2 +- Dockerfile | 2 +- Gemfile | 2 +- Gemfile.lock | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.ruby-version b/.ruby-version index 2bf1c1cc..00355e29 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.3.1 +2.3.7 diff --git a/Dockerfile b/Dockerfile index a6834d32..1a06a983 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ruby:2.3.1 +FROM ruby:2.3.7 RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs ENV PHANTOM_JS=2.1.1 RUN apt-get update && \ diff --git a/Gemfile b/Gemfile index 52af7f4a..4f376892 100644 --- a/Gemfile +++ b/Gemfile @@ -1,5 +1,5 @@ source 'https://rubygems.org' -ruby '2.3.1' +ruby '2.3.7' gem 'rails', '5.1.4' gem 'pg' diff --git a/Gemfile.lock b/Gemfile.lock index d03c29b1..f42691e1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -407,7 +407,7 @@ DEPENDENCIES webmock (~> 1.18.0) RUBY VERSION - ruby 2.3.1p112 + ruby 2.3.7p456 BUNDLED WITH 1.15.3 From bd5ded8bdf0f3ac456c0506b7ca1ef49eb8ea97f Mon Sep 17 00:00:00 2001 From: DeeDeeG Date: Thu, 14 Jun 2018 14:56:28 -0400 Subject: [PATCH 3/3] Add Code Climate integration (#449) * README.md: Add Code Climate badges * .travis.yml: Add Code Climate test reporter see https://docs.codeclimate.com/docs/configuring-test-coverage and https://docs.codeclimate.com/docs/travis-ci-test-coverage * Fix Code Climate test coverage upload (#486) Adds "--prefix /refugerestrooms" to the cc-test-reporter command. --- .travis.yml | 9 +++++++++ README.md | 4 +++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index cdc2d81a..93c02b4a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,15 @@ +env: + global: + - CC_TEST_REPORTER_ID=c18df080592f9c99ca8080a6d5e052aa5fd3964044a0fe0b71e48f8e18998dc2 language: ruby services: docker before_install: - docker-compose build +before_script: + - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter + - chmod +x ./cc-test-reporter + - ./cc-test-reporter before-build script: - docker-compose run -e "RAILS_ENV=test" web rake db:test:prepare spec +after_script: + - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT --prefix /refugerestrooms diff --git a/README.md b/README.md index 9e8fc8f0..dc9a98da 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,10 @@ Production CI: [![Build Status](https://travis-ci.org/RefugeRestrooms/refugerest Develop CI: [![Build Status](https://travis-ci.org/RefugeRestrooms/refugerestrooms.svg?branch=develop)](https://travis-ci.org/RefugeRestrooms/refugerestrooms) +Code Climate: [![Maintainability](https://api.codeclimate.com/v1/badges/a641d46a4ad2c2f01932/maintainability)](https://codeclimate.com/github/RefugeRestrooms/refugerestrooms/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/a641d46a4ad2c2f01932/test_coverage)](https://codeclimate.com/github/RefugeRestrooms/refugerestrooms/test_coverage) -[![Stories in Ready](https://badge.waffle.io/RefugeRestrooms/refugerestrooms.png?label=ready)](https://waffle.io/RefugeRestrooms/refugerestrooms) + +Waffle.io: [![Stories in Ready](https://badge.waffle.io/RefugeRestrooms/refugerestrooms.png?label=ready)](https://waffle.io/RefugeRestrooms/refugerestrooms) # REFUGE restrooms Providing safe restroom access to transgender, intersex, and gender nonconforming individuals.