Commit Graph

107 Commits

Author SHA1 Message Date
google-labs-jules[bot]
8564ec7a7c Add comments to photos (#4130)
* Add comments to photos

Extend the photo show page to support comments by logged in users.

- Make the Comment model polymorphic.
- Update the Photo and Post models to have comments.
- Update the comments controller to handle the polymorphic association.
- Update the photo show page to display comments and a comment form.
- Create a reusable comments partial.

* Add migration

* Fix tests

* Fix tests

* Slightly fix tests

* Fix variables

* Add field

* Refactor slightly

* Refactor slightly

* Refactor slightly

* Refactor

* Photos respond to this as well

* Refactor to polymorphic_url

* Rename

* Wrong relationship

* Refactor and fix tests

* Fix relationships

* Fix rendering

* Fix tests

* Fix model tests

* Fix test

* Fix test

* Fix test

* Fix test

* Fix controller spec

* Fix view tests

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: Daniel O'Connor <daniel.oconnor@gmail.com>
2025-08-24 21:10:16 +09:30
Daniel O'Connor
1f0cfa9b6c Add GBIF to our scientific names, so that our crops can associate creative commons photos (#3559)
* Add GBIF cient

* Add lookup

* Add autocomplete for GBIF lookup

* Add extra detail to scientific names

* Autocomplete

* Add routes

* Rmeove mapping

* Add autocomplete

* Update GBIF data on save

* db/schema

* Style

* Extract service

* Add concern

* Add concern

* Save photos

* Initial coverage

* Coverage

* Add coverage

* Shut up, codeclimate

* Shut up, codeclimate

* Unused

* Shut up, codeclimate

* Apply suggestions from code review

* Remove localhost

* Fix rubocop

* Fix rubocop

* Add UI links

* Add rake

* Indent

* Update Gemfile.lock

* Update lib/tasks/gbif.rake

* Update app/views/crops/_scientific_names.html.haml

* Rubocop

* Expand edit photo form

* Fix error

* Add model validations

* Skip photos without backlinks

* Fix tests

* Add photo words

* Allow blank

* Rubocop and handle invalid legacy data

* Apply suggestions from code review

* Update lib/tasks/gbif.rake
2024-01-21 13:22:25 +10:30
Daniel O'Connor
a8b8a58f33 Various rspec autocorrections 2022-11-08 00:09:50 +10:30
codefactor-io
84d02b169a [CodeFactor] Apply fixes 2021-01-05 19:46:07 +13:00
Brenda Wallace
60c74ddff3 Reconnecting stale flickr auth tokens 2021-01-05 19:46:07 +13:00
Brenda
ef37f74c0f Splitting up complex method in photos controller 2020-08-26 12:36:58 +12:00
codefactor-io
6c9a15f95e [CodeFactor] Apply fixes 2020-01-11 21:29:37 +00:00
codefactor-io
7e30b6b6e0 [CodeFactor] Apply fixes 2020-01-03 11:28:51 +00:00
Brenda Wallace
f76266a716 photos controller working with ES 2019-12-31 21:46:42 +13:00
Brenda Wallace
1c7816c951 fixing photos by crop query in photos controller 2019-12-27 17:20:28 +13:00
codefactor-io
950dd7f810 [CodeFactor] Apply fixes 2019-12-25 01:27:49 +00:00
Brenda Wallace
673f977efc Photos controller using elastic search 2019-12-25 14:27:13 +13:00
codefactor-io
f8916dfecb [CodeFactor] Apply fixes 2019-12-20 04:16:33 +00:00
Brenda Wallace
9d68ab0228 Rubocop fix of controller 2019-12-20 17:13:54 +13:00
Brenda Wallace
04fd1a343a Rubocop update (#2334)
* Update rubocop config

* Rubocop update - for rubocop 0.77

* [CodeFactor] Apply fixes

* rubocop fixes

* [CodeFactor] Apply fixes to commit 2826c2e
2019-12-16 22:35:33 +13:00
Brenda Wallace
b7321ed46f Add source to photos 2019-09-20 22:26:39 +12:00
Brenda Wallace
e0e10c29dc Renaming photographings to photo associations
now it matches the name of its controller, and it is clearer to understand
2019-07-13 16:13:37 +12:00
Brenda Wallace
e7b0b6f18e Remove table display on plantings#show, replace with boxes 2019-03-27 21:04:56 +13:00
Brenda Wallace
e446c14bd7 Use the new Photo.by_cropscope on photos controller 2019-02-05 12:44:34 +13:00
Brenda Wallace
f1ad9cc3c7 Rubocop fix up 2019-02-04 20:55:04 +13:00
Brenda Wallace
5822764c1d Fetch photos in the controller 2019-02-04 20:52:13 +13:00
Brenda Wallace
ab880514c2 Further tidy of photo display 2019-02-04 20:43:52 +13:00
Brenda Wallace
87d2c8b4c8 Fixed bug - look up photos by crop 2019-02-04 19:39:21 +13:00
Brenda Wallace
2faa2fd6f0 Content for other formats on photos#show 2018-12-30 15:42:51 +13:00
Brenda Wallace
7399346354 one line method 2018-12-30 15:18:11 +13:00
Brenda Wallace
914e9ef3be photos needs a show method 2018-12-30 15:05:10 +13:00
Brenda Wallace
8e160a4c93 Fixed another wrong method name 2018-12-30 15:05:00 +13:00
Brenda Wallace
3ad048b7e8 Fixed linter issue, empty line after guard clause 2018-09-13 23:10:43 +12:00
Brenda Wallace
a221f10113 Move photos owner validation to models 2018-06-04 12:03:11 +12:00
Brenda Wallace
65b4c7dbc1 Revert "Auto corrected by following Style/StringLiterals"
This reverts commit ab56a3c6b3.
2018-02-09 07:58:47 +13:00
Awesome Code
ab56a3c6b3 Auto corrected by following Style/StringLiterals 2018-02-07 10:20:26 +13:00
Brenda Wallace
88da0da616 Re-fetches from flickr 2018-02-05 12:52:59 +13:00
Brenda Wallace
14551b6ec8 Merge remote-tracking branch 'upstream/dev' into feature/photos-1457
Conflicts:
	spec/models/crop_spec.rb
2017-12-09 20:59:20 +13:00
Brenda Wallace
a6a7f789a3 Rubocop upgrade (and some style fixes) 2017-12-01 21:07:39 +13:00
Brenda Wallace
697779e67c Don't add item to photo is already there 2017-11-30 10:15:05 +13:00
Brenda Wallace
ff57176d60 Simplified the photos controller a bit 2017-11-29 22:13:03 +13:00
Brenda Wallace
594e466fd4 Fixed photos ordering 2017-11-29 20:59:37 +13:00
Brenda Wallace
0446c0a405 Add ordering back into controller #index 2017-11-29 20:59:37 +13:00
Brenda Wallace
229396d9e7 Add id and type back to photos#new 2017-11-22 22:06:41 +13:00
Brenda Wallace
7906d50d13 Shaved some yaks to remove a rescue from a controller 2017-11-18 22:25:58 +13:00
Brenda Wallace
faed8b019e Removed rescue in a controller 2017-11-18 22:25:58 +13:00
Brenda Wallace
c8974a869f Use the ||= operator 2017-11-18 22:25:58 +13:00
Brenda Wallace
3969f410f1 Tidy up photos logic, and test of signin/out on photos#new 2017-11-18 22:25:58 +13:00
Logan Gingerich
6304f230a5 Refactored and specs updated 2017-11-18 22:25:58 +13:00
Logan Gingerich
73524b8883 Now displays correctly for planting, harvest or garden 2017-11-18 22:25:58 +13:00
Logan Gingerich
fd9fc38def fixes #1433 Says what item you're adding a photo to on photos#new 2017-11-18 22:25:58 +13:00
Brenda Wallace
f3e88f5aae Include harvest photos on crop page 2017-10-24 09:34:10 +13:00
Brenda Wallace
1e81dac699 All crop photos; crops-> photos route 2017-10-24 09:34:03 +13:00
Brenda Wallace
9f9df07390 DRY photos controller more 2017-05-29 16:17:43 +12:00
Brenda Wallace
5d654175a9 A bunch of single line methods 2017-05-29 16:17:43 +12:00