Skip to content

Commit

Permalink
Merge pull request #384 from sozialhelden/bugfix/apps-use-asset-manifest
Browse files Browse the repository at this point in the history
Use asset manifest
  • Loading branch information
Xylakant committed Sep 7, 2016
2 parents 2f4f6d8 + 82c4032 commit 807229b
Show file tree
Hide file tree
Showing 11 changed files with 48 additions and 43 deletions.
8 changes: 4 additions & 4 deletions app/assets/stylesheets/relaunch/_container.scss
@@ -1,5 +1,5 @@
#container {
background: url('container_bg.png') repeat-x 0 $headerHeight;
background: asset-url('container_bg.png') repeat-x 0 $headerHeight;
display: block;
padding-bottom: $footerHeight + 10px;
padding-top: $headerHeight;
Expand Down Expand Up @@ -45,10 +45,10 @@
padding-left: 80px;
}
p.osm {
background: url("/assets/openstreetmap_logo_small.jpg") no-repeat left center;
background: asset-url("/assets/openstreetmap_logo_small.jpg") no-repeat left center;
}
p.wheelmap {
background: url("/assets/markerhead.jpg") no-repeat 4px center;
background: asset-url("/assets/markerhead.jpg") no-repeat 4px center;
}

em {
Expand Down Expand Up @@ -113,4 +113,4 @@
text-shadow: rgba(255, 255, 255, 0.5), 0, 1px, 1px;
}
}
}
}
6 changes: 3 additions & 3 deletions app/assets/stylesheets/relaunch/_fonts.scss
Expand Up @@ -3,6 +3,6 @@ $helvetica_light: 'HelveticaNeue-Light','Helvetica Neue Light','Helvetica Neue',

@font-face {
font-family: 'EntypoRegular';
src: url('entypo.eot');
src: url('entypo.eot?#iefix') format("embedded-opentype"), url('entypo.woff') format("woff"), url('entypo.ttf') format("truetype"), url('entypo.svg#EntypoRegular') format("svg");
}
src: asset-url('entypo.eot');
src: asset-url('entypo.eot?#iefix') format("embedded-opentype"), asset-url('entypo.woff') format("woff"), asset-url('entypo.ttf') format("truetype"), asset-url('entypo.svg#EntypoRegular') format("svg");
}
4 changes: 2 additions & 2 deletions app/assets/stylesheets/relaunch/_footer.scss
Expand Up @@ -64,7 +64,7 @@
border-left: 0;
padding: 1px 4px;
margin-left: 5px;
background: url(/assets/bubble-left.png) no-repeat -5px center;
background: asset-url('/assets/bubble-left.png') no-repeat -5px center;
}
}

Expand All @@ -78,4 +78,4 @@
.credits span {
display: none;
}
}
}
14 changes: 7 additions & 7 deletions app/assets/stylesheets/relaunch/_header.scss
Expand Up @@ -8,10 +8,10 @@
left: 0;
z-index: 2;
float: left;
background: url('bg_header.png');
background: asset-url('bg_header.png');

@include if-min-resolution(1.3) {
background: url(bg_header@2x.png);
background: asset-url('bg_header@2x.png');
}

.navbar-inner {
Expand All @@ -31,10 +31,10 @@
margin: 7px 0 0 0;
float: left;
position: relative;
background: url(bg_logo.png) center left no-repeat;
background: asset-url('bg_logo.png') center left no-repeat;

@include if-min-resolution(1.3) {
background: url(bg_logo@2x.png) center left no-repeat;
background: asset-url('bg_logo@2x.png') center left no-repeat;
background-size: 150px 32px;
}

Expand All @@ -61,11 +61,11 @@
.christmas & {
width: 160px;
height: 42px;
background-image: url(bg_logo_christmas.png);
background-image: asset-url('bg_logo_christmas.png');
margin-top: 0;

@include if-min-resolution(1.3) {
background-image: url(bg_logo_christmas@2x.png);
background-image: asset-url('bg_logo_christmas@2x.png');
background-size: 150px 39px;
}

Expand Down Expand Up @@ -191,4 +191,4 @@ nav {
}
}
}
}
}
6 changes: 3 additions & 3 deletions app/assets/stylesheets/relaunch/_icons.scss
Expand Up @@ -8,14 +8,14 @@
}

.leaflet-marker-icon {
background: transparent url('marker-sprites.png') no-repeat;
background: transparent asset-url('marker-sprites.png') no-repeat;
width: 29px;
height: 32px;
margin-left: -15px;
margin-top: -30px;

@include if-min-resolution(1.3) {
background: transparent url('marker-sprites@2x.png') no-repeat;
background: transparent asset-url('marker-sprites@2x.png') no-repeat;
background-size: 29px 128px;
}

Expand Down Expand Up @@ -58,4 +58,4 @@ $icons: sprite-map("icons/*[^@2x].png");
max-width: 22px;
max-height: 22px;
}
}
}
12 changes: 6 additions & 6 deletions app/assets/stylesheets/relaunch/_leaflet_overrides.scss
Expand Up @@ -18,7 +18,7 @@

.leaflet-control-locate {
a {
background-image: url('locate_btn.png');
background-image: asset-url('locate_btn.png');
background-position: center center;
background-repeat: no-repeat;
background-color: rgba(255,255,255,0.8);
Expand All @@ -28,18 +28,18 @@
};

@include if-min-resolution(1.3) {
background-image: url('locate_btn@2x.png');
background-image: asset-url('locate_btn@2x.png');
}
}

&.requesting a {
background-image: url('spinner_locate.gif');
background-image: asset-url('spinner_locate.gif');
}

&.active a {
background-image: url(locate_btn_active.png);
background-image: asset-url('locate_btn_active.png');
@include if-min-resolution(1.3) {
background-image: url('locate_btn_active@2x.png');
background-image: asset-url('locate_btn_active@2x.png');
}
}
}
Expand All @@ -65,4 +65,4 @@
a {
white-space: nowrap;
}
}
}
4 changes: 2 additions & 2 deletions app/assets/stylesheets/relaunch/_map.scss
Expand Up @@ -36,9 +36,9 @@
text-indent:-9999px;
overflow:hidden;
background-repeat:no-repeat;
background-image:url('mapbox_logo.png');
background-image: asset-url('mapbox_logo.png');

@media screen and (max-width:$breakPhone) {
bottom: 13px
}
}
}
6 changes: 3 additions & 3 deletions app/assets/stylesheets/relaunch/_overlay.scss
Expand Up @@ -34,7 +34,7 @@
top: 50%;
margin: -325px 0 0 -350px;
padding: 0 0 20px 0;
background: url('bg-overlay.png') #FFF no-repeat;
background: asset-url('bg-overlay.png') #FFF no-repeat;
background-position: 0 219px;
@include box-shadow(0 0 10px #333);
@include border-radius(3px);
Expand Down Expand Up @@ -85,7 +85,7 @@
margin: 0 0 40px 0;
text-align: center;

background: url('logo-overlay.png') center top no-repeat;
background: asset-url('logo-overlay.png') center top no-repeat;

font-size: 16px;
line-height: 24px;
Expand Down Expand Up @@ -290,4 +290,4 @@
margin-top: 5px;
}
}
}
}
21 changes: 10 additions & 11 deletions app/assets/stylesheets/relaunch/_toolbar.scss
Expand Up @@ -133,31 +133,31 @@
}

&--yes {
background-image: url('toolbar_marker_yes.png');
background-image: asset-url('toolbar_marker_yes.png');

.popover-title {
background-color: $wheelchair-yes;
}
}

&--limited {
background-image: url('toolbar_marker_limited.png');
background-image: asset-url('toolbar_marker_limited.png');

.popover-title {
background-color: $wheelchair-limited;
}
}

&--no {
background-image: url('toolbar_marker_no.png');
background-image: asset-url('toolbar_marker_no.png');

.popover-title {
background-color: $wheelchair-limited;
}
}

&--unknown {
background-image: url('toolbar_marker_unknown.png');
background-image: asset-url('toolbar_marker_unknown.png');

.popover-title {
background-color: $wheelchair-unknown;
Expand All @@ -166,19 +166,19 @@

@include if-min-resolution(1.3) {
&--yes {
background-image: url(toolbar_marker_yes@2x.png);
background-image: asset-url('toolbar_marker_yes@2x.png');
}

&--limited {
background-image: url(toolbar_marker_limited@2x.png);
background-image: asset-url('toolbar_marker_limited@2x.png');
}

&--no {
background-image: url(toolbar_marker_no@2x.png);
background-image: asset-url('toolbar_marker_no@2x.png');
}

&--unknown {
background-image: url(toolbar_marker_unknown@2x.png);
background-image: asset-url('toolbar_marker_unknown@2x.png');
}
}
}
Expand All @@ -193,15 +193,15 @@
}

&-icon {
background: url('toolbar_marker_icon.png') no-repeat;
background: asset-url('toolbar_marker_icon.png') no-repeat;
background-size: 100%;
width: image_width('toolbar_marker_icon.png');
height: image_height('toolbar_marker_icon.png');
display: inline-block;
margin-top: 1px; // Cosmetic surgery

@include if-min-resolution(1.3) {
background-image: url('toolbar_marker_icon@2x.png');
background-image: asset-url('toolbar_marker_icon@2x.png');
}
}

Expand Down Expand Up @@ -616,4 +616,3 @@
}
}
}

8 changes: 7 additions & 1 deletion config/deploy.rb
Expand Up @@ -33,16 +33,22 @@

# Default value for linked_dirs is []
# set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system}
set :linked_dirs, %w{ log tmp vendor/bundle public/system public/assets node_modules }
set :linked_dirs, %w{ log tmp vendor/bundle public/system node_modules }

# Default value for keep_releases is 5
set :keep_releases, 5


# Clear existing task so we can replace it rather than "add" to it.
Rake::Task["deploy:compile_assets"].clear
Rake::Task["deploy:set_linked_dirs"].clear

namespace :deploy do

task :set_linked_dirs do
# noop due to cap/rails adding this to the run list
# Ref: https://github.com/capistrano/rails/blob/54da36a2dda5084a3cbe380b4a8f1ba282379f72/lib/capistrano/tasks/assets.rake#L121
end

desc 'Compile assets'
task :compile_assets => [:set_rails_env] do
Expand Down
2 changes: 1 addition & 1 deletion config/deploy/production.rb
Expand Up @@ -6,7 +6,7 @@
set :stage, :production
set :deploy_to, "/var/apps/#{fetch(:application)}/"

set :branch, :"feature/infrastructure-rebuild"
set :branch, :"feature/infra-rebuild"
set :rev, proc { `git rev-parse --short #{fetch(:branch)}`.chomp }

# Simple Role Syntax
Expand Down

0 comments on commit 807229b

Please sign in to comment.