Compare commits

..

35 Commits

Author SHA1 Message Date
Cesy
812a6f5ec2 Merge pull request #1328 from Growstuff/dev
release 24
2017-04-28 07:31:21 +01:00
Shiny
f1b42ec699 Merge branch 'master' into dev 2017-04-25 13:14:40 +12:00
Brenda Wallace
26c17ea19c Plantings Thumbnails, fit to box 2017-04-25 10:58:17 +12:00
Brenda Wallace
acc75f80bf include harvests when retrieving data for plantings#index 2017-04-25 10:58:17 +12:00
Daniel O'Connor
a79a65363f Merge pull request #1326 from Br3nda/plantings-validators
Plantings validators
2017-04-24 17:47:41 +09:30
Shiny
dfeb4804e7 Merge branch 'dev' into plantings-validators 2017-04-23 19:35:37 +12:00
deppbot
9d20fafd06 Bundle Update on 2017-04-23 2017-04-23 19:35:23 +12:00
Shiny
e9a5ef0058 Merge branch 'dev' into plantings-validators 2017-04-22 20:50:29 +12:00
Brenda Wallace
d2378376e4 Plantings validators
Adding garden presence true.
Checks crop presence before crop approved
2017-04-22 20:48:48 +12:00
Daniel O'Connor
4b1b5d8a18 Merge pull request #1323 from Growstuff/bundle-update-2017-04-20-122131
Bundle Update on 2017-04-20
2017-04-20 15:27:04 +09:30
deppbot
a0770e80e7 Bundle Update on 2017-04-20 2017-04-20 12:21:32 +08:00
Shiny
f39fe94173 Merge branch 'master' into dev 2017-04-18 18:27:43 +00:00
Brenda Wallace
976bdbbd96 Removed owner_matches?
it's not used anymore
2017-04-18 07:09:47 +00:00
Brenda Wallace
cff1d8bfb9 Photo#show for signed in and not signed in, and other members 2017-04-18 07:09:47 +00:00
Brenda Wallace
bbdc54cb69 Photos#show links to items 2017-04-18 07:09:47 +00:00
Brenda Wallace
36f1f7b71a updating view spec - link to delete photo has changed 2017-04-18 07:09:47 +00:00
Brenda Wallace
e1731793dd controller specs for PhotoAssociations 2017-04-18 07:09:47 +00:00
Brenda Wallace
8ea3b27612 Responsive image on photos#show 2017-04-18 07:09:47 +00:00
Brenda Wallace
9469a69078 Deleting photo's association with another item 2017-04-18 07:09:47 +00:00
Brenda Wallace
cc46fe3336 Only delete own associations 2017-04-18 07:09:47 +00:00
Brenda Wallace
52b4064a2d Don't overwrite edited photo titles 2017-04-18 07:09:47 +00:00
Brenda Wallace
d367b9ef21 UI for removing photos from plantings 2017-04-18 07:09:47 +00:00
Brenda Wallace
4711e4669f Layout change on photos 2017-04-18 07:09:47 +00:00
Brenda Wallace
3e55024f98 Editing title of photos 2017-04-18 07:09:47 +00:00
Daniel O'Connor
ccf56bf944 Merge pull request #1321 from Br3nda/harvests-display
bugfix: Only show harvests if we have some
2017-04-18 12:24:01 +09:30
Shiny
42e51a9cf6 Merge branch 'dev' into harvests-display 2017-04-17 10:00:20 +00:00
Brenda Wallace
667e0cc0e3 bugfix: Only show harvests if we have some 2017-04-17 21:59:31 +12:00
Brenda Wallace
339830b3bb gardens#show Include crop, owner, harvesss and garden in query 2017-04-17 08:59:34 +00:00
Brenda Wallace
7770164672 Include owner in query, because we need it later 2017-04-17 08:59:34 +00:00
Brenda Wallace
f333607572 Reduced query count by .includes() on plantings 2017-04-17 08:59:34 +00:00
Brenda Wallace
87d3764eeb Route for flickr auth callback -- Fixes #1106 2017-04-17 08:28:52 +00:00
Cesy
faf487b719 Merge pull request #1314 from Br3nda/members-controller
Rubocop compliance for members controller
2017-04-17 09:13:26 +01:00
Shiny
3dbf0df19e Merge branch 'dev' into members-controller 2017-04-17 03:49:54 +00:00
Shiny
cd272a6443 Merge branch 'dev' into members-controller 2017-04-16 09:44:32 +00:00
Brenda Wallace
936a8778ed Rubocop compliance for members controller 2017-04-16 12:03:48 +12:00
5 changed files with 46 additions and 43 deletions

View File

@@ -44,8 +44,6 @@ PreCommit:
command: ['npm', 'run', 'csslint']
HamlLint:
enabled: true
requires_files: true
on_warn: fail
command: ['bundle', 'exec', 'haml-lint', 'app/views']
JsonSyntax:
enabled: true

View File

@@ -25,7 +25,7 @@ GEM
addressable
active_merchant-paypal-bogus-gateway (0.1.0)
activemerchant
active_utils (3.3.3)
active_utils (3.3.4)
activesupport (>= 3.2, < 5.2.0)
i18n
activejob (4.2.8)
@@ -73,7 +73,7 @@ GEM
bootstrap-sass (3.3.7)
autoprefixer-rails (>= 5.2.1)
sass (>= 3.3.4)
bootstrap_form (2.6.0)
bootstrap_form (2.7.0)
builder (3.2.3)
bullet (5.5.1)
activesupport (>= 3.0.0)
@@ -266,7 +266,7 @@ GEM
js-routes (1.3.3)
railties (>= 3.2)
sprockets-rails
json (2.0.4)
json (2.1.0)
jwt (1.5.6)
kaminari (0.17.0)
actionpack (>= 3.0.0)
@@ -446,7 +446,7 @@ GEM
sprockets (>= 2.8, < 4.0)
sprockets-rails (>= 2.0, < 4.0)
tilt (>= 1.1, < 3)
selenium-webdriver (3.3.0)
selenium-webdriver (3.4.0)
childprocess (~> 0.5)
rubyzip (~> 1.0)
websocket (~> 1.0)

View File

@@ -108,8 +108,6 @@ p.stats
.planting
dl.planting-attributes
font-size: 85%
dt
text-align: left
dd
@@ -118,14 +116,13 @@ p.stats
@media (min-width: $screen-md-min)
.planting-thumbnail
dl.planting-attributes
font-size: 85%
width: 100%
dt
text-align: left
width: 80px
width: 120px
dd
padding-left: 80px
padding-left: 120px
margin-left: auto
.navbar .navbar-form
@@ -336,3 +333,7 @@ $state-success-bg: lighten($green, 50%)
ul.plantings
list-style-type: none
ul.thumbnail-buttons
list-style-type: none
text-align: right

View File

@@ -27,9 +27,9 @@ class Planting < ActiveRecord::Base
to: :crop,
prefix: true
validates :crop, approved: true
validates :crop, presence: { message: "must be present and exist in our database" }
validates :garden, presence: true
validates :crop, presence: true
validates :crop, approved: { message: "must be present and exist in our database" }
validates :quantity,
numericality: {

View File

@@ -7,7 +7,7 @@
= link_to image_tag((planting.default_photo ? planting.default_photo.thumbnail_url : 'placeholder_150.png'),
alt: planting.crop_id, class: 'img'),
planting
.col-xs-7.col-md-5
.col-xs-7.col-md-6
%dl.dl-horizontal.planting-attributes
%dt Owner:
%dd= link_to planting.owner.login_name, planting.owner
@@ -15,10 +15,12 @@
%dd= link_to planting.garden.name, planting.garden
%dt Planted on:
%dd= planting.planted_at
%dt Quantity:
%dd= display_planting_quantity(planting)
%dt Finished on:
%dd= display_finished(planting)
- if planting.quantity
%dt Quantity:
%dd= display_planting_quantity(planting)
- if planting.finished?
%dt Finished on:
%dd= display_finished(planting)
%dt Sun/shade?:
%dd
- sunniness = planting.sunniness.blank? ? "not specified" : planting.sunniness
@@ -26,32 +28,34 @@
= " (#{sunniness})"
%dt Planted from:
%dd= display_planted_from(planting)
.col-xs-1.col-md-3
%ul{ style: "list-style-type:none; text-align:right" }
%li= link_to 'Details', planting, class: 'btn btn-default btn-xs'
- if can? :edit, planting
%li= link_to 'Edit', edit_planting_path(planting), class: 'btn btn-default btn-xs'
- if can? :create, Harvest
%li= link_to 'Harvest', new_planting_harvest_path(planting), class: 'btn btn-default btn-xs'
- unless planting.finished
%li
= link_to "Mark as finished",
planting_path(planting, planting: { finished: 1 }),
method: :put,
class: 'btn btn-default btn-xs append-date'
- if can? :destroy, planting
%li
= link_to 'Delete',
planting, method: :delete,
data: { confirm: 'Are you sure?' },
class: 'btn btn-default btn-xs'
.row
.col-xs-12.col-md-4
%dl
%dt Days until maturity:
%dd= display_days_before_maturity(planting)
%dt Mature in:
%dd
= display_days_before_maturity(planting)
days
.col-xs-12.col-md-8
= render partial: 'plantings/planting_progress', locals: { planting: planting }
.col-xs-12.col-md-8
= render partial: 'plantings/planting_harvest', locals: { planting: planting }
= link_to 'Details', planting, class: 'btn btn-default btn-xs'
- if can? :edit, planting
= link_to edit_planting_path(planting), class: 'btn btn-default btn-xs' do
%span.glyphicon.glyphicon-pencil{ title: "Edit" }
- if can?(:edit, planting) && can?(:create, Harvest)
= link_to 'Harvest', new_planting_harvest_path(planting), class: 'btn btn-default btn-xs'
- if can?(:edit, planting) && !planting.finished
= link_to "Mark as finished",
planting_path(planting, planting: { finished: 1 }),
method: :put,
class: 'btn btn-default btn-xs append-date'
- if can? :destroy, planting
= link_to planting, method: :delete,
data: { confirm: 'Are you sure?' },
class: 'btn btn-default btn-xs' do
%span.glyphicon.glyphicon-trash{ title: "Delete" }
.row
.col-xs-12.col-md-12
%p= render partial: 'plantings/planting_progress', locals: { planting: planting }