Skip to content
This repository has been archived by the owner on Jan 26, 2023. It is now read-only.

Commit

Permalink
reverse side img #291
Browse files Browse the repository at this point in the history
  • Loading branch information
webmasterkai committed Jan 5, 2019
1 parent 11ff561 commit e08b8ef
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 8 deletions.
5 changes: 5 additions & 0 deletions app/models/item.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ module.exports = AmpersandModel.extend
price: 'number'
repeat: 'string'
related: 'array'
reverse: ['boolean', true, false]
ruler: ['string', true]
summerSale: ['boolean', true, false]

Expand Down Expand Up @@ -79,6 +80,10 @@ module.exports = AmpersandModel.extend
item._file.small.path_far = cdn + 'far/'+item.id+'.jpg?w=640'
item._file.large.path_far = cdn + 'far/'+item.id+'.jpg?w=1536'
item._file.large.path_far = cdn + 'far/'+item.id+'.jpg?w=2560'
if item.reverse
item._file.small.path_reverse = cdn + 'reverse/'+item.id+'.jpg?w=640'
item._file.large.path_reverse = cdn + 'reverse/'+item.id+'.jpg?w=1536'
item._file.large.path_reverse = cdn + 'reverse/'+item.id+'.jpg?w=2560'
unless item.contents
item.contents = ''

Expand Down
2 changes: 1 addition & 1 deletion app/models/me.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ module.exports = AmpersandModel.extend
type: 'string'
default: -> Cookies.get('token')
failedLogins: ['number', true, 0]
fetchingMe: ['bool', true, false]
fetchingMe: ['boolean', true, false]
getProjectsOnLogin: ['bool', true, true]
fetchedProjects: ['bool', true, false]
showroom: 'object'
Expand Down
2 changes: 1 addition & 1 deletion app/views/collection/related_trim.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ module.exports = React.createClass
model: item
initState: @props.initState
extraButtons: true
buttonTypes: ['fav', 'info']
buttonTypes: ['fav', 'info', 'admin']
infoBox
favAlert
projectBox
Expand Down
16 changes: 15 additions & 1 deletion app/views/detail/buttons.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ module.exports = React.createClass
loadedLarge: false
loadedXlarge: false
showNotes: false
reverseView: false

toggleColorBoxView: ->
@setState
Expand All @@ -40,6 +41,9 @@ module.exports = React.createClass
if @state.farView
imgPath = item._file[imgSize].path_far
imgClass = 'img-container pattern'
else if @state.reverseView
imgPath = item._file[imgSize].path_reverse
imgClass = 'img-container pattern'
else
if @state.isRelated and !@state.loadedLarge and !@state.loadedXlarge
mainImgSize = 'small'
Expand Down Expand Up @@ -87,6 +91,16 @@ module.exports = React.createClass
showNotes: @state.showNotes
hasColorButton: hasColorButton

if item.reverse
divs.push div
key: 'reverse-button'
className: 'toggle-reverse hidden-xs',
button
onClick: => @setState reverseView: !@state.reverseView
className: 'uppercase',
span
className: 'reverse',
'View Reverse'
if item.far
divs.push div
key: 'far-button'
Expand Down Expand Up @@ -116,7 +130,7 @@ module.exports = React.createClass
imgDiv

# Ruler
if @state.showRuler and not @state.farView and item.category != 'passementerie'
if @state.showRuler and not @state.farView and not @state.reverseView and item.category != 'passementerie'
divs.push Rulers
key: 'rulers'
model: item
Expand Down
9 changes: 4 additions & 5 deletions gulp/index.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ source = require('vinyl-source-stream')
jade = require 'gulp-jade'
less = require 'gulp-less'
clean = require 'gulp-clean'
zopfli = require 'gulp-zopfli'
rename = require 'gulp-rename'
runSequence = require 'run-sequence'

Expand Down Expand Up @@ -190,10 +189,10 @@ gulp.task 'copy_css', ['styles'], ->
gulp.task 'copy_data', ->
gulp.src('./app/models/*.json')
.pipe(gulp.dest('./prod'))
gulp.task 'compress', ->
gulp.src("./prod/*.{js,css,html,json}")
.pipe(zopfli())
.pipe(gulp.dest("./prod"))
# gulp.task 'compress', ->
# gulp.src("./prod/*.{js,css,html,json}")
# .pipe(zopfli())
# .pipe(gulp.dest("./prod"))

gulp.task 'deploy', (cb) ->
runSequence ['set_sha', 'data'],
Expand Down

0 comments on commit e08b8ef

Please sign in to comment.