Commit cf6a0ff7602718941edbc85fa26e975cba5038f0
Exists in
spb-stable
and in
3 other branches
Merge branch 'assets-css-helpers' into 'master'
Use rails helper image-url for reference images in css Fixes #1001
Showing
8 changed files
with
14 additions
and
14 deletions
Show diff stats
app/assets/stylesheets/generic/forms.scss
| 1 | input[type='search'].search-text-input { | 1 | input[type='search'].search-text-input { |
| 2 | - background-image: url("icon-search.png"); | 2 | + background-image: image-url("icon-search.png"); |
| 3 | background-repeat: no-repeat; | 3 | background-repeat: no-repeat; |
| 4 | background-position: 10px; | 4 | background-position: 10px; |
| 5 | padding-left: 25px; | 5 | padding-left: 25px; |
app/assets/stylesheets/generic/typography.scss
| @@ -105,7 +105,7 @@ a:focus { | @@ -105,7 +105,7 @@ a:focus { | ||
| 105 | display: inline-block; | 105 | display: inline-block; |
| 106 | width: $size; | 106 | width: $size; |
| 107 | height: $size; | 107 | height: $size; |
| 108 | - background-image: url("icon-link.png"); | 108 | + background-image: image-url("icon-link.png"); |
| 109 | background-size: contain; | 109 | background-size: contain; |
| 110 | background-repeat: no-repeat; | 110 | background-repeat: no-repeat; |
| 111 | } | 111 | } |
app/assets/stylesheets/sections/commits.scss
| @@ -73,7 +73,7 @@ | @@ -73,7 +73,7 @@ | ||
| 73 | 73 | ||
| 74 | 74 | ||
| 75 | .commits-compare-switch{ | 75 | .commits-compare-switch{ |
| 76 | - background: url("switch_icon.png") no-repeat center center; | 76 | + background: image-url("switch_icon.png") no-repeat center center; |
| 77 | width: 32px; | 77 | width: 32px; |
| 78 | height: 32px; | 78 | height: 32px; |
| 79 | text-indent: -9999px; | 79 | text-indent: -9999px; |
app/assets/stylesheets/sections/diff.scss
| @@ -144,7 +144,7 @@ | @@ -144,7 +144,7 @@ | ||
| 144 | line-height: 0; | 144 | line-height: 0; |
| 145 | img{ | 145 | img{ |
| 146 | border: 1px solid #FFF; | 146 | border: 1px solid #FFF; |
| 147 | - background: url('trans_bg.gif'); | 147 | + background: image-url('trans_bg.gif'); |
| 148 | max-width: 100%; | 148 | max-width: 100%; |
| 149 | } | 149 | } |
| 150 | &.deleted { | 150 | &.deleted { |
| @@ -209,7 +209,7 @@ | @@ -209,7 +209,7 @@ | ||
| 209 | width: 15px; | 209 | width: 15px; |
| 210 | position: absolute; | 210 | position: absolute; |
| 211 | top: 0px; | 211 | top: 0px; |
| 212 | - background: url('swipemode_sprites.gif') 0 3px no-repeat; | 212 | + background: image-url('swipemode_sprites.gif') 0 3px no-repeat; |
| 213 | } | 213 | } |
| 214 | .bottom-handle{ | 214 | .bottom-handle{ |
| 215 | display: block; | 215 | display: block; |
| @@ -217,7 +217,7 @@ | @@ -217,7 +217,7 @@ | ||
| 217 | width: 15px; | 217 | width: 15px; |
| 218 | position: absolute; | 218 | position: absolute; |
| 219 | bottom: 0px; | 219 | bottom: 0px; |
| 220 | - background: url('swipemode_sprites.gif') 0 -11px no-repeat; | 220 | + background: image-url('swipemode_sprites.gif') 0 -11px no-repeat; |
| 221 | } | 221 | } |
| 222 | } | 222 | } |
| 223 | } //.view.swipe | 223 | } //.view.swipe |
| @@ -249,7 +249,7 @@ | @@ -249,7 +249,7 @@ | ||
| 249 | left: 12px; | 249 | left: 12px; |
| 250 | height: 10px; | 250 | height: 10px; |
| 251 | width: 276px; | 251 | width: 276px; |
| 252 | - background: url('onion_skin_sprites.gif') -4px -20px repeat-x; | 252 | + background: image-url('onion_skin_sprites.gif') -4px -20px repeat-x; |
| 253 | } | 253 | } |
| 254 | 254 | ||
| 255 | .dragger { | 255 | .dragger { |
| @@ -259,7 +259,7 @@ | @@ -259,7 +259,7 @@ | ||
| 259 | top: 0px; | 259 | top: 0px; |
| 260 | height: 14px; | 260 | height: 14px; |
| 261 | width: 14px; | 261 | width: 14px; |
| 262 | - background: url('onion_skin_sprites.gif') 0px -34px repeat-x; | 262 | + background: image-url('onion_skin_sprites.gif') 0px -34px repeat-x; |
| 263 | cursor: pointer; | 263 | cursor: pointer; |
| 264 | } | 264 | } |
| 265 | 265 | ||
| @@ -270,7 +270,7 @@ | @@ -270,7 +270,7 @@ | ||
| 270 | right: 0px; | 270 | right: 0px; |
| 271 | height: 10px; | 271 | height: 10px; |
| 272 | width: 10px; | 272 | width: 10px; |
| 273 | - background: url('onion_skin_sprites.gif') -2px 0px no-repeat; | 273 | + background: image-url('onion_skin_sprites.gif') -2px 0px no-repeat; |
| 274 | } | 274 | } |
| 275 | 275 | ||
| 276 | .opaque { | 276 | .opaque { |
| @@ -280,7 +280,7 @@ | @@ -280,7 +280,7 @@ | ||
| 280 | left: 0px; | 280 | left: 0px; |
| 281 | height: 10px; | 281 | height: 10px; |
| 282 | width: 10px; | 282 | width: 10px; |
| 283 | - background: url('onion_skin_sprites.gif') -2px -10px no-repeat; | 283 | + background: image-url('onion_skin_sprites.gif') -2px -10px no-repeat; |
| 284 | } | 284 | } |
| 285 | } | 285 | } |
| 286 | } //.view.onion-skin | 286 | } //.view.onion-skin |
app/assets/stylesheets/sections/header.scss
| @@ -161,7 +161,7 @@ header { | @@ -161,7 +161,7 @@ header { | ||
| 161 | } | 161 | } |
| 162 | 162 | ||
| 163 | .search-input { | 163 | .search-input { |
| 164 | - background-image: url("icon-search.png"); | 164 | + background-image: image-url("icon-search.png"); |
| 165 | background-repeat: no-repeat; | 165 | background-repeat: no-repeat; |
| 166 | background-position: 10px; | 166 | background-position: 10px; |
| 167 | height: inherit; | 167 | height: inherit; |
app/assets/stylesheets/sections/notes.scss
| @@ -196,7 +196,7 @@ ul.notes { | @@ -196,7 +196,7 @@ ul.notes { | ||
| 196 | 196 | ||
| 197 | .diff-file tr.line_holder { | 197 | .diff-file tr.line_holder { |
| 198 | .add-diff-note { | 198 | .add-diff-note { |
| 199 | - background: url("diff_note_add.png") no-repeat left 0; | 199 | + background: image-url("diff_note_add.png") no-repeat left 0; |
| 200 | height: 22px; | 200 | height: 22px; |
| 201 | margin-left: -65px; | 201 | margin-left: -65px; |
| 202 | position: absolute; | 202 | position: absolute; |
app/helpers/application_helper.rb
| @@ -54,7 +54,7 @@ module ApplicationHelper | @@ -54,7 +54,7 @@ module ApplicationHelper | ||
| 54 | if group && group.avatar.present? | 54 | if group && group.avatar.present? |
| 55 | group.avatar.url | 55 | group.avatar.url |
| 56 | else | 56 | else |
| 57 | - '/assets/no_group_avatar.png' | 57 | + image_path('no_group_avatar.png') |
| 58 | end | 58 | end |
| 59 | end | 59 | end |
| 60 | 60 |
spec/helpers/application_helper_spec.rb
| @@ -52,7 +52,7 @@ describe ApplicationHelper do | @@ -52,7 +52,7 @@ describe ApplicationHelper do | ||
| 52 | it "should give default avatar_icon when no avatar is present" do | 52 | it "should give default avatar_icon when no avatar is present" do |
| 53 | group = create(:group) | 53 | group = create(:group) |
| 54 | group.save! | 54 | group.save! |
| 55 | - group_icon(group.path).to_s.should == "/assets/no_group_avatar.png" | 55 | + group_icon(group.path).should match("group_avatar.png") |
| 56 | end | 56 | end |
| 57 | end | 57 | end |
| 58 | 58 |