mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-05-25 09:19:15 -04:00
Compare commits
310 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d57ca1b4bb | ||
|
|
d03f1e171d | ||
|
|
ef9fd8c82b | ||
|
|
cb9afd00c6 | ||
|
|
946b780b4e | ||
|
|
82be16b8f8 | ||
|
|
becd846022 | ||
|
|
dc4133abd2 | ||
|
|
e7a0d0276f | ||
|
|
7b5d8c0236 | ||
|
|
d45b51f85c | ||
|
|
d041382195 | ||
|
|
8f0dff1e96 | ||
|
|
5b42174baf | ||
|
|
8ba7eef6be | ||
|
|
0b4bdc6946 | ||
|
|
3d308db0d9 | ||
|
|
bfa1ae3ae2 | ||
|
|
71ef2c058b | ||
|
|
b42385be14 | ||
|
|
aba09679e0 | ||
|
|
9eff9150f6 | ||
|
|
10a32686c6 | ||
|
|
8fe65768d0 | ||
|
|
470e2d554e | ||
|
|
e952ca6c4c | ||
|
|
ee1c4fc79c | ||
|
|
c80c1c4758 | ||
|
|
3d3f97f0bf | ||
|
|
961d36c57d | ||
|
|
6a2d21d80b | ||
|
|
93b63284b7 | ||
|
|
7cd1f503f2 | ||
|
|
25f63a7708 | ||
|
|
e46b3f8d19 | ||
|
|
f04f8a9201 | ||
|
|
10e456a18d | ||
|
|
7e2be8efd9 | ||
|
|
5ba25b8e76 | ||
|
|
826f92691a | ||
|
|
81060cccf7 | ||
|
|
8b4f0771c5 | ||
|
|
4f5c47ba58 | ||
|
|
d542326047 | ||
|
|
e69467f056 | ||
|
|
1176d18918 | ||
|
|
78fee52f17 | ||
|
|
000f4979db | ||
|
|
f76258dcab | ||
|
|
c3b79d1d3f | ||
|
|
fa78997d8c | ||
|
|
b05efe8e8f | ||
|
|
8906454323 | ||
|
|
dfa81aeaf2 | ||
|
|
436c2305b3 | ||
|
|
57f1fd34c9 | ||
|
|
c1dc3cc4c0 | ||
|
|
067fb1671b | ||
|
|
fa6df64221 | ||
|
|
dc473108d0 | ||
|
|
adef9f9622 | ||
|
|
b908777a86 | ||
|
|
fda04a6367 | ||
|
|
3d524bb105 | ||
|
|
92cb0c32ab | ||
|
|
6bde403f17 | ||
|
|
ff2f2014fc | ||
|
|
8e5d8002ff | ||
|
|
a8954d2e12 | ||
|
|
892d850f6a | ||
|
|
b5b5222960 | ||
|
|
a6821d689d | ||
|
|
6ac5dc5ac9 | ||
|
|
82855883ca | ||
|
|
c7b0e036c4 | ||
|
|
ec3a9ab32f | ||
|
|
6f22a7ffb7 | ||
|
|
3246773cd8 | ||
|
|
1270dc91f6 | ||
|
|
c9f3105e89 | ||
|
|
54f340380d | ||
|
|
661930f99e | ||
|
|
b29f2cabe6 | ||
|
|
88a60ca3cf | ||
|
|
4f7098c0f6 | ||
|
|
9de957f39b | ||
|
|
480430af37 | ||
|
|
1c66b8b554 | ||
|
|
405946370b | ||
|
|
f04ad801ba | ||
|
|
08efbb5a54 | ||
|
|
619022c61a | ||
|
|
2528ed3e8b | ||
|
|
b88290c953 | ||
|
|
4f12d6af17 | ||
|
|
b92170ec24 | ||
|
|
e854442563 | ||
|
|
411152bc31 | ||
|
|
e73bb02559 | ||
|
|
7eb1265251 | ||
|
|
9f003ac225 | ||
|
|
a751633132 | ||
|
|
b6d77c3737 | ||
|
|
1b07c364f1 | ||
|
|
abd29abd74 | ||
|
|
dbdebf5acb | ||
|
|
e403d6c0c5 | ||
|
|
5577b3a55d | ||
|
|
66f78347e6 | ||
|
|
198a4b1d27 | ||
|
|
d7e5da9577 | ||
|
|
e044a883d2 | ||
|
|
d5028d5ac3 | ||
|
|
4e8b877176 | ||
|
|
b06607c1cf | ||
|
|
929987eb06 | ||
|
|
008854bf56 | ||
|
|
fb311300e7 | ||
|
|
4233dc7c7c | ||
|
|
70d678ebbf | ||
|
|
381ccfb830 | ||
|
|
96018f8671 | ||
|
|
c257bcb564 | ||
|
|
98584d2fa9 | ||
|
|
b197077c40 | ||
|
|
00a36fd747 | ||
|
|
af14088c13 | ||
|
|
a0c12b9e02 | ||
|
|
2a900d6263 | ||
|
|
a41cb404f2 | ||
|
|
2936bc06b9 | ||
|
|
ffb573b1dc | ||
|
|
7cce6cc1c4 | ||
|
|
93e0123bea | ||
|
|
31cc28a34c | ||
|
|
298f02a3a4 | ||
|
|
985d15b117 | ||
|
|
c7a90bdb7e | ||
|
|
1723f3cad9 | ||
|
|
3c6ee787fd | ||
|
|
ed645f2566 | ||
|
|
7faae41c14 | ||
|
|
f9c1741290 | ||
|
|
88ad6d8de9 | ||
|
|
c5df760ce4 | ||
|
|
d9500eff16 | ||
|
|
31fafe6a74 | ||
|
|
f87b83bdd1 | ||
|
|
88e458077b | ||
|
|
a7cc576ef2 | ||
|
|
a713d2936c | ||
|
|
751c2e1a89 | ||
|
|
9fd7e145b5 | ||
|
|
728aa51c2f | ||
|
|
d6799da48d | ||
|
|
df01e0d1aa | ||
|
|
666e2cf13f | ||
|
|
00f7931ee6 | ||
|
|
7aed900e79 | ||
|
|
02137acda2 | ||
|
|
7325f22c02 | ||
|
|
f45a37fece | ||
|
|
f276b19613 | ||
|
|
2ead00eb0c | ||
|
|
bdd403daff | ||
|
|
3027cb155f | ||
|
|
e435d21bd9 | ||
|
|
3347519593 | ||
|
|
559e272347 | ||
|
|
e334fc449e | ||
|
|
f9ce3044ec | ||
|
|
9ec2d9d639 | ||
|
|
00b20e6643 | ||
|
|
6970f4c915 | ||
|
|
ed21fbb1ee | ||
|
|
64d046c2fe | ||
|
|
9a0a5935d2 | ||
|
|
41446f281e | ||
|
|
d149e25aec | ||
|
|
637aba85bf | ||
|
|
b213647a43 | ||
|
|
ded6aca4b1 | ||
|
|
26189855cc | ||
|
|
7f16f51a47 | ||
|
|
f23289ec6e | ||
|
|
725c146e2d | ||
|
|
e3bb749e6d | ||
|
|
dea254c658 | ||
|
|
659c38eea3 | ||
|
|
c408687e36 | ||
|
|
c37c1c9f38 | ||
|
|
5f44dd7ab0 | ||
|
|
09b3654395 | ||
|
|
10335d51db | ||
|
|
c2e46d93fc | ||
|
|
5c67006cb8 | ||
|
|
47c6937db2 | ||
|
|
b5bab8bd0b | ||
|
|
1699d7f57a | ||
|
|
bbc9f3b1cc | ||
|
|
6d294823d1 | ||
|
|
2680d028ca | ||
|
|
6d057204e9 | ||
|
|
c568345307 | ||
|
|
c8eedb49fa | ||
|
|
41d3de7374 | ||
|
|
3fc72bd9db | ||
|
|
65d0d0893b | ||
|
|
2a421cf882 | ||
|
|
47ef858cdf | ||
|
|
627e6d0267 | ||
|
|
785129e113 | ||
|
|
f7d6438e0a | ||
|
|
9a6b0745b7 | ||
|
|
844bfb3e1a | ||
|
|
3f936b2269 | ||
|
|
b218886069 | ||
|
|
f8764f4953 | ||
|
|
5d09a8271c | ||
|
|
c9261b1c6a | ||
|
|
719644c8a5 | ||
|
|
803a00f1c4 | ||
|
|
bfae190608 | ||
|
|
bcc818c23b | ||
|
|
c853e08b2c | ||
|
|
c9c4df39ed | ||
|
|
ab32e251b9 | ||
|
|
226b1c7ab1 | ||
|
|
ccb7dbc17c | ||
|
|
2f5d397f25 | ||
|
|
eb6f032272 | ||
|
|
bac825fe65 | ||
|
|
c7de9a4d91 | ||
|
|
7c6508e387 | ||
|
|
84809d0490 | ||
|
|
da37fd854d | ||
|
|
d282cadd91 | ||
|
|
890f3d042a | ||
|
|
29b10c18d7 | ||
|
|
47ad915ab3 | ||
|
|
ecfb402266 | ||
|
|
48b3b53f2e | ||
|
|
d30854dd51 | ||
|
|
514b90c93a | ||
|
|
938084612e | ||
|
|
0713244116 | ||
|
|
4d25de4663 | ||
|
|
7d63234841 | ||
|
|
5be0153c74 | ||
|
|
80ee85f41a | ||
|
|
f31ce97759 | ||
|
|
42921e2df2 | ||
|
|
b1d6297ccd | ||
|
|
eb721d1c13 | ||
|
|
9a6c1237f8 | ||
|
|
2b168dca6a | ||
|
|
2bcf036c39 | ||
|
|
97afe86705 | ||
|
|
43ea14e400 | ||
|
|
6bc5393fc2 | ||
|
|
139f975788 | ||
|
|
0a7d4fbb9f | ||
|
|
9541d143db | ||
|
|
cb670191d6 | ||
|
|
9765ea16d0 | ||
|
|
f9d87e5e2c | ||
|
|
128db15e79 | ||
|
|
38073295f6 | ||
|
|
f6ac14ac0f | ||
|
|
d3421cde34 | ||
|
|
cf26b16579 | ||
|
|
87f5115748 | ||
|
|
025abde6cc | ||
|
|
b3293fddfd | ||
|
|
60bec845c3 | ||
|
|
66745b327d | ||
|
|
8bd0c5c369 | ||
|
|
0e398be4bf | ||
|
|
5e4702c205 | ||
|
|
c4788e1774 | ||
|
|
1a95a46df5 | ||
|
|
261f2fb758 | ||
|
|
ee4b2e1699 | ||
|
|
8593d2dfd9 | ||
|
|
e486db26db | ||
|
|
c0bcafdf51 | ||
|
|
db71544a76 | ||
|
|
f010320e51 | ||
|
|
7b68e51328 | ||
|
|
42e1dbb4da | ||
|
|
18ddcf9a33 | ||
|
|
a4797c3f67 | ||
|
|
fe4a64d16a | ||
|
|
63e542a5f9 | ||
|
|
3b2ef62e75 | ||
|
|
343384cf6f | ||
|
|
7829040d59 | ||
|
|
5f3ce28a53 | ||
|
|
ba0211ac5b | ||
|
|
84254aee67 | ||
|
|
5740b80093 | ||
|
|
e703cbcb81 | ||
|
|
4b9d52d936 | ||
|
|
a2a4dee126 | ||
|
|
07658adb42 | ||
|
|
8ccba6ba74 | ||
|
|
bd32c012dd | ||
|
|
7738014481 | ||
|
|
c49ac079aa | ||
|
|
42c39a1c98 |
@@ -1,2 +1,2 @@
|
||||
# Ruby version
|
||||
VARIANT=3.1.4
|
||||
VARIANT=3.3.4
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM mcr.microsoft.com/devcontainers/ruby:0-3.1-bullseye
|
||||
FROM mcr.microsoft.com/devcontainers/ruby:1-3.3-bullseye
|
||||
|
||||
# Install Rails
|
||||
RUN gem install rails:7.0.8
|
||||
@@ -24,3 +24,10 @@ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
|
||||
|
||||
# [Optional] Uncomment this line to install global node packages.
|
||||
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1
|
||||
|
||||
# We run as the vscode user.
|
||||
# Make sure this is writable as https://github.com/rubygems/rubygems/issues/6272 was removed
|
||||
RUN su root -c "mkdir -p /usr/local/rvm/gems/default/cache/bundler/"
|
||||
RUN su root -c "mkdir -p /usr/local/rvm/gems/default/bundler/gems/"
|
||||
RUN su root -c "chown -R vscode:rvm /usr/local/rvm/gems/"
|
||||
RUN su root -c "chmod -R 0755 /usr/local/rvm/gems/"
|
||||
|
||||
44
.github/dependabot.yml
vendored
44
.github/dependabot.yml
vendored
@@ -7,50 +7,6 @@ updates:
|
||||
time: "07:00"
|
||||
open-pull-requests-limit: 20
|
||||
versioning-strategy: lockfile-only
|
||||
ignore:
|
||||
- dependency-name: active_median
|
||||
versions:
|
||||
- "< 0.2.2, >= 0.2.1.a"
|
||||
- dependency-name: rubocop
|
||||
versions:
|
||||
- "< 0.63, >= 0.62.a"
|
||||
- dependency-name: rubocop
|
||||
versions:
|
||||
- "< 0.64, >= 0.63.a"
|
||||
- dependency-name: sidekiq
|
||||
versions:
|
||||
- 5.2.4
|
||||
- dependency-name: oj
|
||||
versions:
|
||||
- 3.11.4
|
||||
- dependency-name: listen
|
||||
versions:
|
||||
- 3.5.0
|
||||
- dependency-name: rspec-rails
|
||||
versions:
|
||||
- 4.1.0
|
||||
- 5.0.0
|
||||
- dependency-name: searchkick
|
||||
versions:
|
||||
- 4.4.3
|
||||
- dependency-name: rswag-api
|
||||
versions:
|
||||
- 2.3.3
|
||||
- dependency-name: rswag-specs
|
||||
versions:
|
||||
- 2.3.3
|
||||
- dependency-name: rswag-ui
|
||||
versions:
|
||||
- 2.3.3
|
||||
- dependency-name: timecop
|
||||
versions:
|
||||
- 0.9.3
|
||||
- dependency-name: puma
|
||||
versions:
|
||||
- 5.2.0
|
||||
- dependency-name: capybara
|
||||
versions:
|
||||
- 3.35.1
|
||||
- package-ecosystem: github-actions
|
||||
directory: "/"
|
||||
schedule:
|
||||
|
||||
@@ -1,13 +1,17 @@
|
||||
inherit_from: .rubocop_todo.yml
|
||||
require:
|
||||
- rubocop-factory_bot
|
||||
- rubocop-capybara
|
||||
- rubocop-rails
|
||||
- rubocop-rspec
|
||||
- rubocop-rspec_rails
|
||||
- rubocop-rake
|
||||
AllCops:
|
||||
NewCops: enable
|
||||
Exclude:
|
||||
- 'db/schema.rb'
|
||||
- 'vendor/**/*'
|
||||
TargetRailsVersion: 7.0
|
||||
TargetRailsVersion: 7.1
|
||||
|
||||
Rails:
|
||||
Enabled: true
|
||||
|
||||
@@ -1,15 +1,37 @@
|
||||
# This configuration was generated by
|
||||
# `rubocop --auto-gen-config`
|
||||
# on 2023-09-16 07:51:19 UTC using RuboCop version 1.56.3.
|
||||
# on 2024-07-13 05:47:38 UTC using RuboCop version 1.65.0.
|
||||
# The point is for the user to remove these configuration records
|
||||
# one by one as the offenses are removed from the code base.
|
||||
# Note that changes in the inspected code, or installation of new
|
||||
# versions of RuboCop, may require this file to be generated again.
|
||||
|
||||
# Offense count: 15
|
||||
# Offense count: 231
|
||||
# Configuration parameters: EnforcedStyle.
|
||||
# SupportedStyles: link_or_button, strict
|
||||
Capybara/ClickLinkOrButtonStyle:
|
||||
Enabled: false
|
||||
|
||||
# Offense count: 39
|
||||
# This cop supports safe autocorrection (--autocorrect).
|
||||
# Configuration parameters: DefaultSelector.
|
||||
Capybara/RSpec/HaveSelector:
|
||||
Exclude:
|
||||
- 'spec/features/conversations/index_spec.rb'
|
||||
- 'spec/features/footer_spec.rb'
|
||||
- 'spec/features/gardens/adding_gardens_spec.rb'
|
||||
- 'spec/features/harvests/harvesting_a_crop_spec.rb'
|
||||
- 'spec/features/members/list_spec.rb'
|
||||
- 'spec/features/plantings/planting_a_crop_spec.rb'
|
||||
- 'spec/features/seeds/adding_seeds_spec.rb'
|
||||
- 'spec/features/shared_examples/crop_suggest.rb'
|
||||
- 'spec/helpers/application_helper_spec.rb'
|
||||
- 'spec/support/feature_helpers.rb'
|
||||
- 'spec/views/posts/show.html.haml_spec.rb'
|
||||
|
||||
# Offense count: 14
|
||||
Capybara/SpecificMatcher:
|
||||
Exclude:
|
||||
- 'spec/features/crops/browse_crops_spec.rb'
|
||||
- 'spec/features/footer_spec.rb'
|
||||
- 'spec/features/gardens/adding_gardens_spec.rb'
|
||||
- 'spec/features/harvests/harvesting_a_crop_spec.rb'
|
||||
@@ -23,8 +45,7 @@ Capybara/VisibilityMatcher:
|
||||
|
||||
# Offense count: 6
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all).
|
||||
# Configuration parameters: Include, EnforcedStyle, NonImplicitAssociationMethodNames.
|
||||
# Include: spec/factories.rb, spec/factories/**/*.rb, features/support/factories/**/*.rb
|
||||
# Configuration parameters: EnforcedStyle, NonImplicitAssociationMethodNames.
|
||||
# SupportedStyles: explicit, implicit
|
||||
FactoryBot/AssociationStyle:
|
||||
Exclude:
|
||||
@@ -33,81 +54,48 @@ FactoryBot/AssociationStyle:
|
||||
- 'spec/factories/like.rb'
|
||||
- 'spec/factories/scientific_name.rb'
|
||||
|
||||
# Offense count: 8
|
||||
# Offense count: 3
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all).
|
||||
# Configuration parameters: Include, EnforcedStyle, ExplicitOnly.
|
||||
# Include: **/*_spec.rb, **/spec/**/*, spec/factories.rb, spec/factories/**/*.rb, features/support/factories/**/*.rb
|
||||
# Configuration parameters: AutoCorrect, Include, EnforcedStyle, ExplicitOnly.
|
||||
# Include: **/*_spec.rb, **/spec/**/*, **/test/**/*, **/features/support/factories/**/*.rb
|
||||
# SupportedStyles: create_list, n_times
|
||||
FactoryBot/CreateList:
|
||||
Exclude:
|
||||
- 'spec/factories/member.rb'
|
||||
- 'spec/helpers/gardens_helper_spec.rb'
|
||||
- 'spec/views/comments/index.rss.haml_spec.rb'
|
||||
- 'spec/views/home/index_spec.rb'
|
||||
- 'spec/views/photos/index.html.haml_spec.rb'
|
||||
- 'spec/views/places/show.html.haml_spec.rb'
|
||||
- 'spec/views/posts/index.html.haml_spec.rb'
|
||||
|
||||
# Offense count: 1135
|
||||
# Offense count: 4
|
||||
# Configuration parameters: Include, MaxAmount.
|
||||
# Include: **/*_spec.rb, **/spec/**/*, **/test/**/*, **/features/support/factories/**/*.rb
|
||||
FactoryBot/ExcessiveCreateList:
|
||||
Exclude:
|
||||
- 'spec/controllers/posts_controller_spec.rb'
|
||||
- 'spec/features/crops/show_spec.rb'
|
||||
- 'spec/features/percy/percy_spec.rb'
|
||||
|
||||
# Offense count: 1127
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all).
|
||||
# Configuration parameters: Include.
|
||||
# Include: **/*_spec.rb, **/spec/**/*, **/test/**/*, **/features/support/factories/**/*.rb
|
||||
FactoryBot/SyntaxMethods:
|
||||
Enabled: false
|
||||
|
||||
# Offense count: 5
|
||||
# Offense count: 2
|
||||
# This cop supports safe autocorrection (--autocorrect).
|
||||
# Configuration parameters: EmptyLineBetweenMethodDefs, EmptyLineBetweenClassDefs, EmptyLineBetweenModuleDefs, DefLikeMacros, AllowAdjacentOneLineDefs, NumberOfEmptyLines.
|
||||
Layout/EmptyLineBetweenDefs:
|
||||
Exclude:
|
||||
- 'db/migrate/20171129041341_create_photographings.rb'
|
||||
- 'db/migrate/20190130090437_add_crop_to_photographings.rb'
|
||||
|
||||
# Offense count: 10
|
||||
# This cop supports safe autocorrection (--autocorrect).
|
||||
# Configuration parameters: EnforcedStyle.
|
||||
# SupportedStyles: space, no_space
|
||||
Layout/LineContinuationSpacing:
|
||||
Exclude:
|
||||
- 'app/mailers/notifier_mailer.rb'
|
||||
- 'app/models/seed.rb'
|
||||
- 'lib/tasks/growstuff.rake'
|
||||
- 'spec/features/rss/plantings_spec.rb'
|
||||
- 'spec/features/rss/posts_spec.rb'
|
||||
- 'spec/features/rss/seeds_spec.rb'
|
||||
- 'spec/models/seed_spec.rb'
|
||||
|
||||
# Offense count: 9
|
||||
# This cop supports safe autocorrection (--autocorrect).
|
||||
# Configuration parameters: EnforcedStyle, IndentationWidth.
|
||||
# SupportedStyles: aligned, indented
|
||||
Layout/LineEndStringConcatenationIndentation:
|
||||
Exclude:
|
||||
- 'app/mailers/notifier_mailer.rb'
|
||||
- 'app/models/seed.rb'
|
||||
- 'lib/tasks/growstuff.rake'
|
||||
- 'spec/features/rss/plantings_spec.rb'
|
||||
- 'spec/features/rss/posts_spec.rb'
|
||||
- 'spec/features/rss/seeds_spec.rb'
|
||||
|
||||
# Offense count: 1
|
||||
# This cop supports safe autocorrection (--autocorrect).
|
||||
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
|
||||
# Configuration parameters: Max, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
|
||||
# URISchemes: http, https
|
||||
Layout/LineLength:
|
||||
Max: 304
|
||||
Exclude:
|
||||
- 'app/helpers/crops_helper.rb'
|
||||
- 'db/seeds.rb'
|
||||
|
||||
# Offense count: 3
|
||||
# This cop supports safe autocorrection (--autocorrect).
|
||||
Lint/AmbiguousOperatorPrecedence:
|
||||
Exclude:
|
||||
- 'db/seeds.rb'
|
||||
- 'spec/helpers/gardens_helper_spec.rb'
|
||||
- 'spec/helpers/seeds_helper_spec.rb'
|
||||
|
||||
# Offense count: 2
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all).
|
||||
# Configuration parameters: RequireParenthesesForMethodChains.
|
||||
Lint/AmbiguousRange:
|
||||
Exclude:
|
||||
- 'app/models/concerns/search_activities.rb'
|
||||
- 'app/models/concerns/search_harvests.rb'
|
||||
- 'app/models/concerns/search_plantings.rb'
|
||||
|
||||
@@ -130,6 +118,12 @@ Lint/EmptyBlock:
|
||||
- 'spec/features/crops/crop_detail_page_spec.rb'
|
||||
- 'spec/requests/authentications_spec.rb'
|
||||
|
||||
# Offense count: 1
|
||||
# This cop supports safe autocorrection (--autocorrect).
|
||||
Lint/RedundantCopDisableDirective:
|
||||
Exclude:
|
||||
- 'db/migrate/20230313015323_create_active_storage_tables.active_storage.rb'
|
||||
|
||||
# Offense count: 2
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all).
|
||||
Lint/RedundantDirGlobSort:
|
||||
@@ -142,48 +136,46 @@ Lint/SuppressedException:
|
||||
Exclude:
|
||||
- 'lib/tasks/testing.rake'
|
||||
|
||||
# Offense count: 1
|
||||
# This cop supports safe autocorrection (--autocorrect).
|
||||
# Configuration parameters: EnforcedStyle.
|
||||
# SupportedStyles: strict, consistent
|
||||
Lint/SymbolConversion:
|
||||
Exclude:
|
||||
- 'app/controllers/likes_controller.rb'
|
||||
|
||||
# Offense count: 7
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all).
|
||||
# Configuration parameters: AutoCorrect.
|
||||
Lint/UselessAssignment:
|
||||
Exclude:
|
||||
- 'config.rb'
|
||||
- 'config/compass.rb'
|
||||
|
||||
# Offense count: 45
|
||||
# Offense count: 52
|
||||
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
|
||||
Metrics/AbcSize:
|
||||
Max: 151
|
||||
|
||||
# Offense count: 10
|
||||
# Offense count: 14
|
||||
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns, inherit_mode.
|
||||
# AllowedMethods: refine
|
||||
Metrics/BlockLength:
|
||||
Max: 61
|
||||
Max: 115
|
||||
|
||||
# Offense count: 6
|
||||
# Offense count: 7
|
||||
# Configuration parameters: CountComments, CountAsOne.
|
||||
Metrics/ClassLength:
|
||||
Max: 171
|
||||
Max: 183
|
||||
|
||||
# Offense count: 4
|
||||
# Offense count: 6
|
||||
# Configuration parameters: AllowedMethods, AllowedPatterns.
|
||||
Metrics/CyclomaticComplexity:
|
||||
Max: 32
|
||||
|
||||
# Offense count: 61
|
||||
# Offense count: 71
|
||||
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
|
||||
Metrics/MethodLength:
|
||||
Max: 59
|
||||
Max: 127
|
||||
|
||||
# Offense count: 3
|
||||
# Offense count: 2
|
||||
# Configuration parameters: CountComments, CountAsOne.
|
||||
Metrics/ModuleLength:
|
||||
Max: 125
|
||||
|
||||
# Offense count: 5
|
||||
# Configuration parameters: AllowedMethods, AllowedPatterns.
|
||||
Metrics/PerceivedComplexity:
|
||||
Max: 32
|
||||
@@ -202,7 +194,7 @@ RSpec/ContextWording:
|
||||
|
||||
# Offense count: 36
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all).
|
||||
# Configuration parameters: SkipBlocks, EnforcedStyle.
|
||||
# Configuration parameters: SkipBlocks, EnforcedStyle, OnlyStaticConstants.
|
||||
# SupportedStyles: described_class, explicit
|
||||
RSpec/DescribedClass:
|
||||
Exclude:
|
||||
@@ -212,6 +204,7 @@ RSpec/DescribedClass:
|
||||
|
||||
# Offense count: 13
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all).
|
||||
# Configuration parameters: AutoCorrect.
|
||||
RSpec/EmptyExampleGroup:
|
||||
Exclude:
|
||||
- 'spec/controllers/authentications_controller_spec.rb'
|
||||
@@ -227,24 +220,26 @@ RSpec/EmptyExampleGroup:
|
||||
- 'spec/views/photos/edit.html.haml_spec.rb'
|
||||
- 'spec/views/posts/_single.html.haml_spec.rb'
|
||||
|
||||
# Offense count: 134
|
||||
# Offense count: 1
|
||||
# This cop supports safe autocorrection (--autocorrect).
|
||||
# Configuration parameters: AllowConsecutiveOneLiners.
|
||||
RSpec/EmptyLineAfterExample:
|
||||
Exclude:
|
||||
- 'spec/models/ability_spec.rb'
|
||||
|
||||
# Offense count: 140
|
||||
# Configuration parameters: CountAsOne.
|
||||
RSpec/ExampleLength:
|
||||
Max: 25
|
||||
|
||||
# Offense count: 2
|
||||
# This cop supports safe autocorrection (--autocorrect).
|
||||
RSpec/ExcessiveDocstringSpacing:
|
||||
Exclude:
|
||||
- 'spec/controllers/crops_controller_spec.rb'
|
||||
- 'spec/features/crops/crop_photos_spec.rb'
|
||||
|
||||
# Offense count: 30
|
||||
# Offense count: 32
|
||||
RSpec/ExpectInHook:
|
||||
Exclude:
|
||||
- 'spec/controllers/garden_types_controller_spec.rb'
|
||||
- 'spec/controllers/gardens_controller_spec.rb'
|
||||
- 'spec/features/admin/forums_spec.rb'
|
||||
- 'spec/features/admin/plant_parts_spec.rb'
|
||||
- 'spec/features/admin/roles_spec.rb'
|
||||
- 'spec/features/crops/crop_photos_spec.rb'
|
||||
- 'spec/features/members/list_spec.rb'
|
||||
- 'spec/features/plantings/planting_a_crop_spec.rb'
|
||||
@@ -260,11 +255,12 @@ RSpec/HookArgument:
|
||||
|
||||
# Offense count: 2
|
||||
# This cop supports safe autocorrection (--autocorrect).
|
||||
# Configuration parameters: AutoCorrect.
|
||||
RSpec/HooksBeforeExamples:
|
||||
Exclude:
|
||||
- 'spec/features/crops/creating_a_crop_spec.rb'
|
||||
|
||||
# Offense count: 35
|
||||
# Offense count: 37
|
||||
# Configuration parameters: Max, AllowedIdentifiers, AllowedPatterns.
|
||||
RSpec/IndexedLet:
|
||||
Exclude:
|
||||
@@ -272,6 +268,7 @@ RSpec/IndexedLet:
|
||||
- 'spec/controllers/plantings_controller_spec.rb'
|
||||
- 'spec/features/crops/crop_photos_spec.rb'
|
||||
- 'spec/features/members/list_spec.rb'
|
||||
- 'spec/features/members/profile_spec.rb'
|
||||
- 'spec/features/percy/percy_spec.rb'
|
||||
- 'spec/features/planting_reminder_spec.rb'
|
||||
- 'spec/features/timeline/index_spec.rb'
|
||||
@@ -279,7 +276,7 @@ RSpec/IndexedLet:
|
||||
- 'spec/models/member_spec.rb'
|
||||
- 'spec/views/forums/index.html.haml_spec.rb'
|
||||
|
||||
# Offense count: 710
|
||||
# Offense count: 720
|
||||
# Configuration parameters: AssignmentOnly.
|
||||
RSpec/InstanceVariable:
|
||||
Enabled: false
|
||||
@@ -288,6 +285,12 @@ RSpec/InstanceVariable:
|
||||
RSpec/LetSetup:
|
||||
Enabled: false
|
||||
|
||||
# Offense count: 1
|
||||
# This cop supports safe autocorrection (--autocorrect).
|
||||
RSpec/MatchArray:
|
||||
Exclude:
|
||||
- 'spec/models/post_spec.rb'
|
||||
|
||||
# Offense count: 2
|
||||
RSpec/MessageChain:
|
||||
Exclude:
|
||||
@@ -304,16 +307,16 @@ RSpec/MultipleDescribes:
|
||||
Exclude:
|
||||
- 'spec/features/crops/crop_wranglers_spec.rb'
|
||||
|
||||
# Offense count: 147
|
||||
# Offense count: 152
|
||||
RSpec/MultipleExpectations:
|
||||
Max: 19
|
||||
|
||||
# Offense count: 137
|
||||
# Offense count: 138
|
||||
# Configuration parameters: AllowSubject.
|
||||
RSpec/MultipleMemoizedHelpers:
|
||||
Max: 14
|
||||
|
||||
# Offense count: 132
|
||||
# Offense count: 133
|
||||
# Configuration parameters: EnforcedStyle, IgnoreSharedExamples.
|
||||
# SupportedStyles: always, named_only
|
||||
RSpec/NamedSubject:
|
||||
@@ -324,7 +327,7 @@ RSpec/NamedSubject:
|
||||
RSpec/NestedGroups:
|
||||
Max: 6
|
||||
|
||||
# Offense count: 407
|
||||
# Offense count: 403
|
||||
# Configuration parameters: AllowedPatterns.
|
||||
# AllowedPatterns: ^expect_, ^assert_
|
||||
RSpec/NoExpectationExample:
|
||||
@@ -336,21 +339,6 @@ RSpec/PendingWithoutReason:
|
||||
- 'spec/features/seeds/misc_seeds_spec.rb'
|
||||
- 'spec/features/unsubscribing_spec.rb'
|
||||
|
||||
# Offense count: 7
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all).
|
||||
RSpec/Rails/HaveHttpStatus:
|
||||
Exclude:
|
||||
- 'spec/controllers/api/v1/plantings_controller_spec.rb'
|
||||
- 'spec/controllers/harvests_controller_spec.rb'
|
||||
- 'spec/controllers/likes_controller_spec.rb'
|
||||
- 'spec/requests/harvests_spec.rb'
|
||||
|
||||
# Offense count: 16
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all).
|
||||
# Configuration parameters: Inferences.
|
||||
RSpec/Rails/InferredSpecType:
|
||||
Enabled: false
|
||||
|
||||
# Offense count: 2
|
||||
RSpec/RepeatedDescription:
|
||||
Exclude:
|
||||
@@ -370,6 +358,7 @@ RSpec/RepeatedExampleGroupBody:
|
||||
|
||||
# Offense count: 6
|
||||
# This cop supports safe autocorrection (--autocorrect).
|
||||
# Configuration parameters: AutoCorrect.
|
||||
RSpec/ScatteredSetup:
|
||||
Exclude:
|
||||
- 'spec/features/percy/percy_spec.rb'
|
||||
@@ -382,14 +371,6 @@ RSpec/SpecFilePathFormat:
|
||||
Exclude:
|
||||
- 'spec/controllers/member_controller_spec.rb'
|
||||
|
||||
# Offense count: 2
|
||||
# Configuration parameters: Include.
|
||||
# Include: **/*_spec*rb*, **/spec/**/*
|
||||
RSpec/SpecFilePathSuffix:
|
||||
Exclude:
|
||||
- 'spec/features/seeds/seed_photos.rb'
|
||||
- 'spec/models/garden_type.rb'
|
||||
|
||||
# Offense count: 3
|
||||
RSpec/StubbedMock:
|
||||
Exclude:
|
||||
@@ -413,7 +394,24 @@ RSpec/VerifiedDoubles:
|
||||
- 'spec/controllers/gardens_controller_spec.rb'
|
||||
- 'spec/views/devise/shared/_links_spec.rb'
|
||||
|
||||
# Offense count: 26
|
||||
# Offense count: 7
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all).
|
||||
# Configuration parameters: ResponseMethods.
|
||||
# ResponseMethods: response, last_response
|
||||
RSpecRails/HaveHttpStatus:
|
||||
Exclude:
|
||||
- 'spec/controllers/api/v1/plantings_controller_spec.rb'
|
||||
- 'spec/controllers/harvests_controller_spec.rb'
|
||||
- 'spec/controllers/likes_controller_spec.rb'
|
||||
- 'spec/requests/harvests_spec.rb'
|
||||
|
||||
# Offense count: 16
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all).
|
||||
# Configuration parameters: Inferences.
|
||||
RSpecRails/InferredSpecType:
|
||||
Enabled: false
|
||||
|
||||
# Offense count: 28
|
||||
# Configuration parameters: Database, Include.
|
||||
# SupportedDatabases: mysql, postgresql
|
||||
# Include: db/**/*.rb
|
||||
@@ -436,17 +434,6 @@ Rails/Date:
|
||||
Exclude:
|
||||
- 'app/mailers/notifier_mailer.rb'
|
||||
|
||||
# Offense count: 5
|
||||
# This cop supports safe autocorrection (--autocorrect).
|
||||
# Configuration parameters: EnforcedStyle.
|
||||
# SupportedStyles: slashes, arguments
|
||||
Rails/FilePath:
|
||||
Exclude:
|
||||
- 'app/controllers/crops_controller.rb'
|
||||
- 'config/application.rb'
|
||||
- 'config/environments/development.rb'
|
||||
- 'db/seeds.rb'
|
||||
|
||||
# Offense count: 11
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all).
|
||||
# Configuration parameters: AllowedMethods, AllowedPatterns.
|
||||
@@ -485,12 +472,13 @@ Rails/I18nLocaleAssignment:
|
||||
Rails/I18nLocaleTexts:
|
||||
Enabled: false
|
||||
|
||||
# Offense count: 2
|
||||
# Offense count: 3
|
||||
# Configuration parameters: Include.
|
||||
# Include: app/controllers/**/*.rb, app/mailers/**/*.rb
|
||||
Rails/LexicallyScopedActionFilter:
|
||||
Exclude:
|
||||
- 'app/controllers/data_controller.rb'
|
||||
- 'app/controllers/registrations_controller.rb'
|
||||
|
||||
# Offense count: 2
|
||||
Rails/OutputSafety:
|
||||
@@ -498,6 +486,12 @@ Rails/OutputSafety:
|
||||
- 'app/helpers/auto_suggest_helper.rb'
|
||||
- 'app/helpers/gardens_helper.rb'
|
||||
|
||||
# Offense count: 1
|
||||
# This cop supports safe autocorrection (--autocorrect).
|
||||
Rails/PluralizationGrammar:
|
||||
Exclude:
|
||||
- 'spec/requests/plantings_spec.rb'
|
||||
|
||||
# Offense count: 4
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all).
|
||||
# Configuration parameters: Include.
|
||||
@@ -508,8 +502,10 @@ Rails/RakeEnvironment:
|
||||
- 'lib/tasks/i18n.rake'
|
||||
- 'lib/tasks/testing.rake'
|
||||
|
||||
# Offense count: 10
|
||||
# Offense count: 9
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all).
|
||||
# Configuration parameters: AllowedReceivers.
|
||||
# AllowedReceivers: ActionMailer::Preview, ActiveSupport::TimeZone
|
||||
Rails/RedundantActiveRecordAllMethod:
|
||||
Exclude:
|
||||
- 'app/controllers/admin/roles_controller.rb'
|
||||
@@ -518,7 +514,6 @@ Rails/RedundantActiveRecordAllMethod:
|
||||
- 'app/controllers/plant_parts_controller.rb'
|
||||
- 'app/controllers/scientific_names_controller.rb'
|
||||
- 'app/services/openfarm_service.rb'
|
||||
- 'spec/features/members/deletion_spec.rb'
|
||||
- 'spec/features/percy/percy_spec.rb'
|
||||
- 'spec/models/harvest_spec.rb'
|
||||
|
||||
@@ -541,8 +536,8 @@ Rails/ResponseParsedBody:
|
||||
- 'spec/controllers/likes_controller_spec.rb'
|
||||
- 'spec/requests/api/v1/crop_request_spec.rb'
|
||||
- 'spec/requests/api/v1/gardens_request_spec.rb'
|
||||
- 'spec/requests/api/v1/harvest_request_spec.rb'
|
||||
- 'spec/requests/api/v1/member_request_spec.rb'
|
||||
- 'spec/requests/api/v1/harvests_request_spec.rb'
|
||||
- 'spec/requests/api/v1/members_request_spec.rb'
|
||||
- 'spec/requests/api/v1/photos_request_spec.rb'
|
||||
- 'spec/requests/api/v1/plantings_request_spec.rb'
|
||||
- 'spec/requests/api/v1/seeds_request_spec.rb'
|
||||
@@ -562,26 +557,11 @@ Rails/RootPathnameMethods:
|
||||
- 'app/controllers/crops_controller.rb'
|
||||
- 'app/helpers/icons_helper.rb'
|
||||
|
||||
# Offense count: 20
|
||||
# Offense count: 21
|
||||
# Configuration parameters: Include.
|
||||
# Include: db/**/*.rb
|
||||
Rails/ThreeStateBooleanColumn:
|
||||
Exclude:
|
||||
- 'db/migrate/20121203034745_add_tos_agreement_to_users.rb'
|
||||
- 'db/migrate/20130206051328_add_show_email_to_member.rb'
|
||||
- 'db/migrate/20130212123628_create_notifications.rb'
|
||||
- 'db/migrate/20130327120024_add_send_email_to_member.rb'
|
||||
- 'db/migrate/20130517051922_create_account_types.rb'
|
||||
- 'db/migrate/20130718011247_add_trading_to_seeds.rb'
|
||||
- 'db/migrate/20130722050836_remove_tradable_from_seeds.rb'
|
||||
- 'db/migrate/20130827105823_add_newsletter_to_member.rb'
|
||||
- 'db/migrate/20131025104228_add_fields_to_gardens.rb'
|
||||
- 'db/migrate/20140829230600_add_finished_to_planting.rb'
|
||||
- 'db/migrate/20140928085713_add_send_planting_reminder_to_member.rb'
|
||||
- 'db/migrate/20171022032108_all_the_predictions.rb'
|
||||
- 'db/migrate/20180213005731_seed_usage.rb'
|
||||
- 'db/migrate/20190720000555_create_mailboxer.mailboxer_engine.rb'
|
||||
- 'db/migrate/20190720000558_add_delivery_tracking_info_to_mailboxer_receipts.mailboxer_engine.rb'
|
||||
Enabled: false
|
||||
|
||||
# Offense count: 6
|
||||
# Configuration parameters: Include.
|
||||
@@ -603,6 +583,18 @@ Rails/WhereEquals:
|
||||
- 'app/models/harvest.rb'
|
||||
- 'app/models/planting.rb'
|
||||
|
||||
# Offense count: 2
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all).
|
||||
Rails/WhereRange:
|
||||
Exclude:
|
||||
- 'app/models/concerns/predict_planting.rb'
|
||||
- 'app/models/garden.rb'
|
||||
|
||||
# Offense count: 1
|
||||
Rake/MethodDefinitionInTask:
|
||||
Exclude:
|
||||
- 'lib/tasks/growstuff.rake'
|
||||
|
||||
# Offense count: 3
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all).
|
||||
# Configuration parameters: EnforcedStyle.
|
||||
@@ -622,13 +614,7 @@ Style/CommentedKeyword:
|
||||
- 'spec/models/photo_spec.rb'
|
||||
- 'spec/models/planting_spec.rb'
|
||||
|
||||
# Offense count: 37
|
||||
# This cop supports safe autocorrection (--autocorrect).
|
||||
# Configuration parameters: AllowedVars.
|
||||
Style/FetchEnvVar:
|
||||
Enabled: false
|
||||
|
||||
# Offense count: 4
|
||||
# Offense count: 3
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all).
|
||||
# Configuration parameters: EnforcedStyle.
|
||||
# SupportedStyles: always, always_true, never
|
||||
@@ -636,33 +622,16 @@ Style/FrozenStringLiteralComment:
|
||||
Exclude:
|
||||
- 'config/initializers/new_framework_defaults_6_0.rb'
|
||||
- 'db/migrate/20200801084007_add_foreign_key_constraint_to_active_storage_attachments_for_blob_id.active_storage.rb'
|
||||
- 'db/migrate/20200815012538_remove_median_function.rb'
|
||||
- 'spec/lib/haml/filters/growstuff_markdown_spec.rb'
|
||||
|
||||
# Offense count: 2
|
||||
# Offense count: 3
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all).
|
||||
Style/GlobalStdStream:
|
||||
Exclude:
|
||||
- 'config/environments/production.rb'
|
||||
- 'lib/tasks/gbif.rake'
|
||||
- 'lib/tasks/openfarm.rake'
|
||||
|
||||
# Offense count: 5
|
||||
# This cop supports safe autocorrection (--autocorrect).
|
||||
# Configuration parameters: EnforcedStyle, EnforcedShorthandSyntax, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols.
|
||||
# SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys
|
||||
# SupportedShorthandSyntax: always, never, either, consistent
|
||||
Style/HashSyntax:
|
||||
Exclude:
|
||||
- 'app/models/csv_importer.rb'
|
||||
- 'spec/requests/api/v1/gardens_request_spec.rb'
|
||||
- 'spec/requests/api/v1/plantings_request_spec.rb'
|
||||
|
||||
# Offense count: 2
|
||||
# This cop supports safe autocorrection (--autocorrect).
|
||||
Style/IfUnlessModifier:
|
||||
Exclude:
|
||||
- 'bin/setup'
|
||||
|
||||
# Offense count: 1
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all).
|
||||
# Configuration parameters: AllowedMethods.
|
||||
@@ -684,19 +653,23 @@ Style/MixinUsage:
|
||||
- 'spec/rails_helper.rb'
|
||||
|
||||
# Offense count: 1
|
||||
# This cop supports safe autocorrection (--autocorrect).
|
||||
Style/NegatedIfElseCondition:
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all).
|
||||
# Configuration parameters: EnforcedStyle.
|
||||
# SupportedStyles: literals, strict
|
||||
Style/MutableConstant:
|
||||
Exclude:
|
||||
- 'app/helpers/crops_helper.rb'
|
||||
- 'app/models/activity.rb'
|
||||
|
||||
# Offense count: 3
|
||||
# Offense count: 5
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all).
|
||||
# Configuration parameters: EnforcedStyle, AllowedMethods, AllowedPatterns.
|
||||
# SupportedStyles: predicate, comparison
|
||||
Style/NumericPredicate:
|
||||
Exclude:
|
||||
- 'app/helpers/crops_helper.rb'
|
||||
- 'app/helpers/harvests_helper.rb'
|
||||
- 'app/helpers/plantings_helper.rb'
|
||||
- 'app/models/concerns/predict_planting.rb'
|
||||
|
||||
# Offense count: 6
|
||||
Style/OpenStructUse:
|
||||
@@ -710,15 +683,6 @@ Style/OptionalBooleanParameter:
|
||||
Exclude:
|
||||
- 'app/models/concerns/member_newsletter.rb'
|
||||
|
||||
# Offense count: 5
|
||||
# This cop supports safe autocorrection (--autocorrect).
|
||||
# Configuration parameters: EnforcedStyle.
|
||||
# SupportedStyles: same_as_string_literals, single_quotes, double_quotes
|
||||
Style/QuotedSymbols:
|
||||
Exclude:
|
||||
- 'app/models/seed.rb'
|
||||
- 'spec/controllers/crops_controller_spec.rb'
|
||||
|
||||
# Offense count: 1
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all).
|
||||
# Configuration parameters: Methods.
|
||||
@@ -726,12 +690,6 @@ Style/RedundantArgument:
|
||||
Exclude:
|
||||
- 'app/helpers/application_helper.rb'
|
||||
|
||||
# Offense count: 1
|
||||
# This cop supports safe autocorrection (--autocorrect).
|
||||
Style/RedundantConstantBase:
|
||||
Exclude:
|
||||
- 'config.ru'
|
||||
|
||||
# Offense count: 4
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all).
|
||||
# Configuration parameters: SafeForConstants.
|
||||
@@ -739,19 +697,6 @@ Style/RedundantFetchBlock:
|
||||
Exclude:
|
||||
- 'config/puma.rb'
|
||||
|
||||
# Offense count: 3
|
||||
# This cop supports safe autocorrection (--autocorrect).
|
||||
Style/RedundantRegexpArgument:
|
||||
Exclude:
|
||||
- 'db/migrate/20191119030244_cms_tags.rb'
|
||||
|
||||
# Offense count: 1
|
||||
# This cop supports safe autocorrection (--autocorrect).
|
||||
# Configuration parameters: AllowMultipleReturnValues.
|
||||
Style/RedundantReturn:
|
||||
Exclude:
|
||||
- 'app/controllers/messages_controller.rb'
|
||||
|
||||
# Offense count: 2
|
||||
# This cop supports safe autocorrection (--autocorrect).
|
||||
# Configuration parameters: AllowModifier.
|
||||
@@ -760,7 +705,7 @@ Style/SoleNestedConditional:
|
||||
- 'app/controllers/application_controller.rb'
|
||||
- 'app/controllers/messages_controller.rb'
|
||||
|
||||
# Offense count: 20
|
||||
# Offense count: 24
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all).
|
||||
# Configuration parameters: Mode.
|
||||
Style/StringConcatenation:
|
||||
|
||||
@@ -1 +1 @@
|
||||
3.1.4
|
||||
3.3.4
|
||||
|
||||
@@ -93,6 +93,8 @@ submit the change with your pull request.
|
||||
- Martina Simicic / [simicic](https://github.com/simicic)
|
||||
- Rowan Crawford / [wombleton](https://github.com/wombleton)
|
||||
- Ítalo Pires / [italopires](https://github.com/italopires)
|
||||
- Bennett Zink / [bennett-zink](https://github.com/bennett-zink)
|
||||
- Dominick Thornton / [domthor](https://github.com/domthor)
|
||||
|
||||
## Bots
|
||||
|
||||
|
||||
6
Gemfile
6
Gemfile
@@ -24,7 +24,7 @@ gem 'rswag-api'
|
||||
gem 'rswag-ui'
|
||||
|
||||
# CSS framework
|
||||
gem "bootstrap", ">= 4.6.2"
|
||||
gem "bootstrap", ">= 5.0.0"
|
||||
gem 'material-sass', '4.1.1'
|
||||
|
||||
# Icons used by bootstrap/material-sass
|
||||
@@ -167,8 +167,12 @@ group :development, :test do
|
||||
gem 'rspec-activemodel-mocks'
|
||||
gem 'rspec-rails' # unit testing framework
|
||||
gem 'rswag-specs'
|
||||
gem 'rubocop-capybara'
|
||||
gem 'rubocop-factory_bot'
|
||||
gem 'rubocop-rails'
|
||||
gem 'rubocop-rake'
|
||||
gem 'rubocop-rspec'
|
||||
gem 'rubocop-rspec_rails'
|
||||
gem 'webrat' # provides HTML matchers for view tests
|
||||
|
||||
gem 'dotenv-rails'
|
||||
|
||||
396
Gemfile.lock
396
Gemfile.lock
@@ -33,35 +33,35 @@ GEM
|
||||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
actioncable (7.1.3)
|
||||
actionpack (= 7.1.3)
|
||||
activesupport (= 7.1.3)
|
||||
actioncable (7.1.3.4)
|
||||
actionpack (= 7.1.3.4)
|
||||
activesupport (= 7.1.3.4)
|
||||
nio4r (~> 2.0)
|
||||
websocket-driver (>= 0.6.1)
|
||||
zeitwerk (~> 2.6)
|
||||
actionmailbox (7.1.3)
|
||||
actionpack (= 7.1.3)
|
||||
activejob (= 7.1.3)
|
||||
activerecord (= 7.1.3)
|
||||
activestorage (= 7.1.3)
|
||||
activesupport (= 7.1.3)
|
||||
actionmailbox (7.1.3.4)
|
||||
actionpack (= 7.1.3.4)
|
||||
activejob (= 7.1.3.4)
|
||||
activerecord (= 7.1.3.4)
|
||||
activestorage (= 7.1.3.4)
|
||||
activesupport (= 7.1.3.4)
|
||||
mail (>= 2.7.1)
|
||||
net-imap
|
||||
net-pop
|
||||
net-smtp
|
||||
actionmailer (7.1.3)
|
||||
actionpack (= 7.1.3)
|
||||
actionview (= 7.1.3)
|
||||
activejob (= 7.1.3)
|
||||
activesupport (= 7.1.3)
|
||||
actionmailer (7.1.3.4)
|
||||
actionpack (= 7.1.3.4)
|
||||
actionview (= 7.1.3.4)
|
||||
activejob (= 7.1.3.4)
|
||||
activesupport (= 7.1.3.4)
|
||||
mail (~> 2.5, >= 2.5.4)
|
||||
net-imap
|
||||
net-pop
|
||||
net-smtp
|
||||
rails-dom-testing (~> 2.2)
|
||||
actionpack (7.1.3)
|
||||
actionview (= 7.1.3)
|
||||
activesupport (= 7.1.3)
|
||||
actionpack (7.1.3.4)
|
||||
actionview (= 7.1.3.4)
|
||||
activesupport (= 7.1.3.4)
|
||||
nokogiri (>= 1.8.5)
|
||||
racc
|
||||
rack (>= 2.2.4)
|
||||
@@ -69,15 +69,15 @@ GEM
|
||||
rack-test (>= 0.6.3)
|
||||
rails-dom-testing (~> 2.2)
|
||||
rails-html-sanitizer (~> 1.6)
|
||||
actiontext (7.1.3)
|
||||
actionpack (= 7.1.3)
|
||||
activerecord (= 7.1.3)
|
||||
activestorage (= 7.1.3)
|
||||
activesupport (= 7.1.3)
|
||||
actiontext (7.1.3.4)
|
||||
actionpack (= 7.1.3.4)
|
||||
activerecord (= 7.1.3.4)
|
||||
activestorage (= 7.1.3.4)
|
||||
activesupport (= 7.1.3.4)
|
||||
globalid (>= 0.6.0)
|
||||
nokogiri (>= 1.8.5)
|
||||
actionview (7.1.3)
|
||||
activesupport (= 7.1.3)
|
||||
actionview (7.1.3.4)
|
||||
activesupport (= 7.1.3.4)
|
||||
builder (~> 3.1)
|
||||
erubi (~> 1.11)
|
||||
rails-dom-testing (~> 2.2)
|
||||
@@ -92,22 +92,22 @@ GEM
|
||||
active_utils (3.4.1)
|
||||
activesupport (>= 4.2)
|
||||
i18n
|
||||
activejob (7.1.3)
|
||||
activesupport (= 7.1.3)
|
||||
activejob (7.1.3.4)
|
||||
activesupport (= 7.1.3.4)
|
||||
globalid (>= 0.3.6)
|
||||
activemodel (7.1.3)
|
||||
activesupport (= 7.1.3)
|
||||
activerecord (7.1.3)
|
||||
activemodel (= 7.1.3)
|
||||
activesupport (= 7.1.3)
|
||||
activemodel (7.1.3.4)
|
||||
activesupport (= 7.1.3.4)
|
||||
activerecord (7.1.3.4)
|
||||
activemodel (= 7.1.3.4)
|
||||
activesupport (= 7.1.3.4)
|
||||
timeout (>= 0.4.0)
|
||||
activestorage (7.1.3)
|
||||
actionpack (= 7.1.3)
|
||||
activejob (= 7.1.3)
|
||||
activerecord (= 7.1.3)
|
||||
activesupport (= 7.1.3)
|
||||
activestorage (7.1.3.4)
|
||||
actionpack (= 7.1.3.4)
|
||||
activejob (= 7.1.3.4)
|
||||
activerecord (= 7.1.3.4)
|
||||
activesupport (= 7.1.3.4)
|
||||
marcel (~> 1.0)
|
||||
activesupport (7.1.3)
|
||||
activesupport (7.1.3.4)
|
||||
base64
|
||||
bigdecimal
|
||||
concurrent-ruby (~> 1.0, >= 1.0.2)
|
||||
@@ -117,19 +117,19 @@ GEM
|
||||
minitest (>= 5.1)
|
||||
mutex_m
|
||||
tzinfo (~> 2.0)
|
||||
addressable (2.8.6)
|
||||
public_suffix (>= 2.0.2, < 6.0)
|
||||
addressable (2.8.7)
|
||||
public_suffix (>= 2.0.2, < 7.0)
|
||||
ast (2.4.2)
|
||||
autoprefixer-rails (10.4.7.0)
|
||||
autoprefixer-rails (10.4.16.0)
|
||||
execjs (~> 2)
|
||||
axe-core-api (4.8.1)
|
||||
axe-core-api (4.9.1)
|
||||
dumb_delegator
|
||||
virtus
|
||||
axe-core-capybara (4.8.1)
|
||||
axe-core-api
|
||||
axe-core-capybara (4.9.1)
|
||||
axe-core-api (= 4.9.1)
|
||||
dumb_delegator
|
||||
axe-core-rspec (4.8.1)
|
||||
axe-core-api
|
||||
axe-core-rspec (4.9.1)
|
||||
axe-core-api (= 4.9.1)
|
||||
dumb_delegator
|
||||
virtus
|
||||
axiom-types (0.1.1)
|
||||
@@ -137,38 +137,30 @@ GEM
|
||||
ice_nine (~> 0.11.0)
|
||||
thread_safe (~> 0.3, >= 0.3.1)
|
||||
base64 (0.2.0)
|
||||
bcrypt (3.1.19)
|
||||
bcrypt (3.1.20)
|
||||
better_errors (2.10.1)
|
||||
erubi (>= 1.0.0)
|
||||
rack (>= 0.9.0)
|
||||
rouge (>= 1.0.0)
|
||||
better_html (2.0.2)
|
||||
actionview (>= 6.0)
|
||||
activesupport (>= 6.0)
|
||||
ast (~> 2.0)
|
||||
erubi (~> 1.4)
|
||||
parser (>= 2.4)
|
||||
smart_properties
|
||||
bigdecimal (3.1.6)
|
||||
bigdecimal (3.1.8)
|
||||
bluecloth (2.2.0)
|
||||
bonsai-elasticsearch-rails (7.0.1)
|
||||
elasticsearch-model (< 8)
|
||||
elasticsearch-rails (< 8)
|
||||
bootstrap (4.6.2)
|
||||
bootstrap (5.3.2)
|
||||
autoprefixer-rails (>= 9.1.0)
|
||||
popper_js (>= 1.16.1, < 2)
|
||||
sassc-rails (>= 2.0.0)
|
||||
popper_js (>= 2.11.8, < 3)
|
||||
bootstrap-datepicker-rails (1.9.0.1)
|
||||
railties (>= 3.0)
|
||||
bootstrap_form (4.5.0)
|
||||
actionpack (>= 5.2)
|
||||
activemodel (>= 5.2)
|
||||
builder (3.2.4)
|
||||
bullet (7.1.6)
|
||||
bootstrap_form (5.4.0)
|
||||
actionpack (>= 6.1)
|
||||
activemodel (>= 6.1)
|
||||
builder (3.3.0)
|
||||
bullet (7.2.0)
|
||||
activesupport (>= 3.0.0)
|
||||
uniform_notifier (~> 1.11)
|
||||
byebug (11.1.3)
|
||||
cancancan (3.5.0)
|
||||
cancancan (3.6.1)
|
||||
capybara (3.40.0)
|
||||
addressable
|
||||
matrix
|
||||
@@ -184,14 +176,15 @@ GEM
|
||||
capybara-screenshot (1.0.26)
|
||||
capybara (>= 1.0, < 4)
|
||||
launchy
|
||||
carrierwave (3.0.5)
|
||||
carrierwave (3.0.7)
|
||||
activemodel (>= 6.0.0)
|
||||
activesupport (>= 6.0.0)
|
||||
addressable (~> 2.6)
|
||||
image_processing (~> 1.1)
|
||||
marcel (~> 1.0.0)
|
||||
ssrf_filter (~> 1.0)
|
||||
chartkick (5.0.5)
|
||||
chartkick (5.0.7)
|
||||
childprocess (5.0.0)
|
||||
codeclimate-test-reporter (1.0.9)
|
||||
simplecov (<= 0.13)
|
||||
coderay (1.1.3)
|
||||
@@ -206,13 +199,13 @@ GEM
|
||||
coffee-script-source (1.12.2)
|
||||
comfy_bootstrap_form (4.0.9)
|
||||
rails (>= 5.0.0)
|
||||
concurrent-ruby (1.2.3)
|
||||
concurrent-ruby (1.3.3)
|
||||
connection_pool (2.4.1)
|
||||
crass (1.0.6)
|
||||
csv (3.3.0)
|
||||
csv_shaper (1.3.2)
|
||||
activesupport (>= 3.0.0)
|
||||
dalli (3.2.7)
|
||||
base64
|
||||
dalli (3.2.8)
|
||||
database_cleaner (2.0.2)
|
||||
database_cleaner-active_record (>= 2, < 3)
|
||||
database_cleaner-active_record (2.1.0)
|
||||
@@ -222,22 +215,21 @@ GEM
|
||||
date (3.3.4)
|
||||
descendants_tracker (0.0.4)
|
||||
thread_safe (~> 0.3, >= 0.3.1)
|
||||
devise (4.9.3)
|
||||
devise (4.9.4)
|
||||
bcrypt (~> 3.0)
|
||||
orm_adapter (~> 0.1)
|
||||
railties (>= 4.1.0)
|
||||
responders
|
||||
warden (~> 1.2.3)
|
||||
diff-lcs (1.5.0)
|
||||
diff-lcs (1.5.1)
|
||||
discard (1.3.0)
|
||||
activerecord (>= 4.2, < 8)
|
||||
docile (1.1.5)
|
||||
dotenv (2.8.1)
|
||||
dotenv-rails (2.8.1)
|
||||
dotenv (= 2.8.1)
|
||||
railties (>= 3.2)
|
||||
drb (2.2.0)
|
||||
ruby2_keywords
|
||||
dotenv (3.1.2)
|
||||
dotenv-rails (3.1.2)
|
||||
dotenv (= 3.1.2)
|
||||
railties (>= 6.1)
|
||||
drb (2.2.1)
|
||||
dumb_delegator (1.0.0)
|
||||
elasticsearch (7.0.0)
|
||||
elasticsearch-api (= 7.0.0)
|
||||
@@ -252,19 +244,20 @@ GEM
|
||||
elasticsearch-transport (7.0.0)
|
||||
faraday
|
||||
multi_json
|
||||
erubi (1.12.0)
|
||||
erubi (1.13.0)
|
||||
erubis (2.7.0)
|
||||
excon (0.109.0)
|
||||
execjs (2.8.1)
|
||||
factory_bot (6.4.5)
|
||||
excon (0.110.0)
|
||||
execjs (2.9.1)
|
||||
factory_bot (6.4.6)
|
||||
activesupport (>= 5.0.0)
|
||||
factory_bot_rails (6.4.3)
|
||||
factory_bot (~> 6.4)
|
||||
railties (>= 5.0.0)
|
||||
faker (3.2.3)
|
||||
faker (3.4.2)
|
||||
i18n (>= 1.8.11, < 2)
|
||||
faraday (2.9.0)
|
||||
faraday (2.10.0)
|
||||
faraday-net_http (>= 2.0, < 3.2)
|
||||
logger
|
||||
faraday-net_http (3.1.0)
|
||||
net-http
|
||||
ffi (1.16.3)
|
||||
@@ -274,7 +267,9 @@ GEM
|
||||
friendly_id (5.5.1)
|
||||
activerecord (>= 4.0.0)
|
||||
gbifrb (0.2.0)
|
||||
geocoder (1.8.2)
|
||||
geocoder (1.8.3)
|
||||
base64 (>= 0.1.0)
|
||||
csv (>= 3.0.0)
|
||||
gibbon (1.2.1)
|
||||
httparty
|
||||
multi_json (>= 1.9.0)
|
||||
@@ -298,7 +293,7 @@ GEM
|
||||
activesupport (>= 5.1)
|
||||
haml (>= 4.0.6)
|
||||
railties (>= 5.1)
|
||||
haml_lint (0.55.0)
|
||||
haml_lint (0.58.0)
|
||||
haml (>= 5.0)
|
||||
parallel (~> 1.10)
|
||||
rainbow
|
||||
@@ -311,16 +306,16 @@ GEM
|
||||
moneta
|
||||
multi_json (>= 1.9.2)
|
||||
webrick
|
||||
highline (2.1.0)
|
||||
httparty (0.21.0)
|
||||
highline (3.0.1)
|
||||
httparty (0.22.0)
|
||||
csv
|
||||
mini_mime (>= 1.0.0)
|
||||
multi_xml (>= 0.5.2)
|
||||
i18n (1.14.1)
|
||||
i18n (1.14.5)
|
||||
concurrent-ruby (~> 1.0)
|
||||
i18n-tasks (1.0.13)
|
||||
i18n-tasks (1.0.14)
|
||||
activesupport (>= 4.0.2)
|
||||
ast (>= 2.1.0)
|
||||
better_html (>= 1.0, < 3.0)
|
||||
erubi
|
||||
highline (>= 2.0.0)
|
||||
i18n
|
||||
@@ -328,22 +323,22 @@ GEM
|
||||
rails-i18n
|
||||
rainbow (>= 2.2.2, < 4.0)
|
||||
terminal-table (>= 1.5.1)
|
||||
icalendar (2.10.1)
|
||||
icalendar (2.10.2)
|
||||
ice_cube (~> 0.16)
|
||||
ice_cube (0.16.4)
|
||||
ice_cube (0.17.0)
|
||||
ice_nine (0.11.2)
|
||||
image_processing (1.12.2)
|
||||
mini_magick (>= 4.9.5, < 5)
|
||||
ruby-vips (>= 2.0.17, < 3)
|
||||
io-console (0.7.2)
|
||||
irb (1.11.1)
|
||||
rdoc
|
||||
irb (1.14.0)
|
||||
rdoc (>= 4.0.0)
|
||||
reline (>= 0.4.2)
|
||||
jquery-rails (4.6.0)
|
||||
rails-dom-testing (>= 1, < 3)
|
||||
railties (>= 4.2.0)
|
||||
thor (>= 0.14, < 2.0)
|
||||
json (2.7.1)
|
||||
json (2.7.2)
|
||||
json-schema (4.1.1)
|
||||
addressable (>= 2.8)
|
||||
jsonapi-resources (0.10.7)
|
||||
@@ -355,16 +350,18 @@ GEM
|
||||
kramdown (2.4.0)
|
||||
rexml
|
||||
language_server-protocol (3.17.0.3)
|
||||
launchy (2.5.0)
|
||||
addressable (~> 2.7)
|
||||
leaflet-rails (1.9.4)
|
||||
launchy (3.0.1)
|
||||
addressable (~> 2.8)
|
||||
childprocess (~> 5.0)
|
||||
leaflet-rails (1.9.5)
|
||||
actionpack (>= 4.2.0)
|
||||
railties (>= 4.2.0)
|
||||
letter_opener (1.8.1)
|
||||
launchy (>= 2.2, < 3)
|
||||
listen (3.8.0)
|
||||
letter_opener (1.10.0)
|
||||
launchy (>= 2.2, < 4)
|
||||
listen (3.9.0)
|
||||
rb-fsevent (~> 0.10, >= 0.10.3)
|
||||
rb-inotify (~> 0.9, >= 0.9.10)
|
||||
logger (1.6.0)
|
||||
loofah (2.22.0)
|
||||
crass (~> 1.0.2)
|
||||
nokogiri (>= 1.12.0)
|
||||
@@ -376,7 +373,7 @@ GEM
|
||||
mailboxer (0.15.1)
|
||||
carrierwave (>= 0.5.8)
|
||||
rails (>= 5.0.0)
|
||||
marcel (1.0.2)
|
||||
marcel (1.0.4)
|
||||
material-sass (4.1.1)
|
||||
autoprefixer-rails (>= 6.0.3)
|
||||
sass (>= 3.5.2)
|
||||
@@ -390,32 +387,33 @@ GEM
|
||||
rake
|
||||
mini_magick (4.12.0)
|
||||
mini_mime (1.1.5)
|
||||
mini_portile2 (2.8.5)
|
||||
minitest (5.21.2)
|
||||
mini_portile2 (2.8.7)
|
||||
minitest (5.24.1)
|
||||
moneta (1.0.0)
|
||||
msgpack (1.7.2)
|
||||
multi_json (1.15.0)
|
||||
multi_xml (0.6.0)
|
||||
multi_xml (0.7.1)
|
||||
bigdecimal (~> 3.1)
|
||||
mutex_m (0.2.0)
|
||||
net-http (0.4.1)
|
||||
uri
|
||||
net-imap (0.4.9.1)
|
||||
net-imap (0.4.11)
|
||||
date
|
||||
net-protocol
|
||||
net-pop (0.1.2)
|
||||
net-protocol
|
||||
net-protocol (0.2.2)
|
||||
timeout
|
||||
net-smtp (0.4.0.1)
|
||||
net-smtp (0.5.0)
|
||||
net-protocol
|
||||
nio4r (2.7.0)
|
||||
nokogiri (1.16.0)
|
||||
nio4r (2.7.3)
|
||||
nokogiri (1.16.6)
|
||||
mini_portile2 (~> 2.8.2)
|
||||
racc (~> 1.4)
|
||||
nokogiri (1.16.0-x86_64-linux)
|
||||
nokogiri (1.16.6-x86_64-linux)
|
||||
racc (~> 1.4)
|
||||
oauth (0.5.6)
|
||||
oj (3.16.3)
|
||||
oj (3.16.4)
|
||||
bigdecimal (>= 3.0)
|
||||
omniauth (1.9.2)
|
||||
hashie (>= 3.4.6)
|
||||
@@ -430,30 +428,30 @@ GEM
|
||||
omniauth-oauth (~> 1.1)
|
||||
rack
|
||||
orm_adapter (0.5.0)
|
||||
parallel (1.24.0)
|
||||
parser (3.3.0.5)
|
||||
parallel (1.25.1)
|
||||
parser (3.3.4.0)
|
||||
ast (~> 2.4.1)
|
||||
racc
|
||||
percy-capybara (5.0.0)
|
||||
capybara (>= 3)
|
||||
pg (1.5.4)
|
||||
platform-api (3.6.0)
|
||||
pg (1.5.6)
|
||||
platform-api (3.7.0)
|
||||
heroics (~> 0.1.1)
|
||||
moneta (~> 1.0.0)
|
||||
rate_throttle_client (~> 0.1.0)
|
||||
popper_js (1.16.1)
|
||||
popper_js (2.11.8)
|
||||
pry (0.14.2)
|
||||
coderay (~> 1.1)
|
||||
method_source (~> 1.0)
|
||||
psych (5.1.2)
|
||||
stringio
|
||||
public_suffix (5.0.4)
|
||||
public_suffix (6.0.0)
|
||||
puma (6.4.2)
|
||||
nio4r (~> 2.0)
|
||||
query_diet (0.7.1)
|
||||
racc (1.7.3)
|
||||
rack (2.2.8)
|
||||
rack-cors (2.0.1)
|
||||
racc (1.8.0)
|
||||
rack (2.2.9)
|
||||
rack-cors (2.0.2)
|
||||
rack (>= 2.0.0)
|
||||
rack-protection (3.2.0)
|
||||
base64 (>= 0.1.0)
|
||||
@@ -465,20 +463,20 @@ GEM
|
||||
rackup (1.0.0)
|
||||
rack (< 3)
|
||||
webrick
|
||||
rails (7.1.3)
|
||||
actioncable (= 7.1.3)
|
||||
actionmailbox (= 7.1.3)
|
||||
actionmailer (= 7.1.3)
|
||||
actionpack (= 7.1.3)
|
||||
actiontext (= 7.1.3)
|
||||
actionview (= 7.1.3)
|
||||
activejob (= 7.1.3)
|
||||
activemodel (= 7.1.3)
|
||||
activerecord (= 7.1.3)
|
||||
activestorage (= 7.1.3)
|
||||
activesupport (= 7.1.3)
|
||||
rails (7.1.3.4)
|
||||
actioncable (= 7.1.3.4)
|
||||
actionmailbox (= 7.1.3.4)
|
||||
actionmailer (= 7.1.3.4)
|
||||
actionpack (= 7.1.3.4)
|
||||
actiontext (= 7.1.3.4)
|
||||
actionview (= 7.1.3.4)
|
||||
activejob (= 7.1.3.4)
|
||||
activemodel (= 7.1.3.4)
|
||||
activerecord (= 7.1.3.4)
|
||||
activestorage (= 7.1.3.4)
|
||||
activesupport (= 7.1.3.4)
|
||||
bundler (>= 1.15.0)
|
||||
railties (= 7.1.3)
|
||||
railties (= 7.1.3.4)
|
||||
rails-controller-testing (1.0.5)
|
||||
actionpack (>= 5.0.1.rc1)
|
||||
actionview (>= 5.0.1.rc1)
|
||||
@@ -490,7 +488,7 @@ GEM
|
||||
rails-html-sanitizer (1.6.0)
|
||||
loofah (~> 2.21)
|
||||
nokogiri (~> 1.14)
|
||||
rails-i18n (7.0.8)
|
||||
rails-i18n (7.0.9)
|
||||
i18n (>= 0.7, < 2)
|
||||
railties (>= 6.0.0, < 8)
|
||||
rails_12factor (0.0.3)
|
||||
@@ -498,59 +496,60 @@ GEM
|
||||
rails_stdout_logging
|
||||
rails_serve_static_assets (0.0.5)
|
||||
rails_stdout_logging (0.0.5)
|
||||
railties (7.1.3)
|
||||
actionpack (= 7.1.3)
|
||||
activesupport (= 7.1.3)
|
||||
railties (7.1.3.4)
|
||||
actionpack (= 7.1.3.4)
|
||||
activesupport (= 7.1.3.4)
|
||||
irb
|
||||
rackup (>= 1.0.0)
|
||||
rake (>= 12.2)
|
||||
thor (~> 1.0, >= 1.2.2)
|
||||
zeitwerk (~> 2.6)
|
||||
rainbow (3.1.1)
|
||||
raindrops (0.20.0)
|
||||
rake (13.1.0)
|
||||
raindrops (0.20.1)
|
||||
rake (13.2.1)
|
||||
rate_throttle_client (0.1.2)
|
||||
rb-fsevent (0.11.2)
|
||||
rb-inotify (0.10.1)
|
||||
ffi (~> 1.0)
|
||||
rdoc (6.6.2)
|
||||
rdoc (6.7.0)
|
||||
psych (>= 4.0.0)
|
||||
recaptcha (5.16.0)
|
||||
redis-client (0.19.1)
|
||||
recaptcha (5.17.0)
|
||||
redis-client (0.22.2)
|
||||
connection_pool
|
||||
regexp_parser (2.9.0)
|
||||
reline (0.4.2)
|
||||
regexp_parser (2.9.2)
|
||||
reline (0.5.9)
|
||||
io-console (~> 0.5)
|
||||
responders (3.1.1)
|
||||
actionpack (>= 5.2)
|
||||
railties (>= 5.2)
|
||||
rexml (3.2.6)
|
||||
rexml (3.3.2)
|
||||
strscan
|
||||
rouge (4.1.2)
|
||||
rspec (3.12.0)
|
||||
rspec-core (~> 3.12.0)
|
||||
rspec-expectations (~> 3.12.0)
|
||||
rspec-mocks (~> 3.12.0)
|
||||
rspec (3.13.0)
|
||||
rspec-core (~> 3.13.0)
|
||||
rspec-expectations (~> 3.13.0)
|
||||
rspec-mocks (~> 3.13.0)
|
||||
rspec-activemodel-mocks (1.2.0)
|
||||
activemodel (>= 3.0)
|
||||
activesupport (>= 3.0)
|
||||
rspec-mocks (>= 2.99, < 4.0)
|
||||
rspec-core (3.12.2)
|
||||
rspec-support (~> 3.12.0)
|
||||
rspec-expectations (3.12.3)
|
||||
rspec-core (3.13.0)
|
||||
rspec-support (~> 3.13.0)
|
||||
rspec-expectations (3.13.1)
|
||||
diff-lcs (>= 1.2.0, < 2.0)
|
||||
rspec-support (~> 3.12.0)
|
||||
rspec-mocks (3.12.6)
|
||||
rspec-support (~> 3.13.0)
|
||||
rspec-mocks (3.13.1)
|
||||
diff-lcs (>= 1.2.0, < 2.0)
|
||||
rspec-support (~> 3.12.0)
|
||||
rspec-rails (6.1.1)
|
||||
rspec-support (~> 3.13.0)
|
||||
rspec-rails (6.1.3)
|
||||
actionpack (>= 6.1)
|
||||
activesupport (>= 6.1)
|
||||
railties (>= 6.1)
|
||||
rspec-core (~> 3.12)
|
||||
rspec-expectations (~> 3.12)
|
||||
rspec-mocks (~> 3.12)
|
||||
rspec-support (~> 3.12)
|
||||
rspec-support (3.12.1)
|
||||
rspec-core (~> 3.13)
|
||||
rspec-expectations (~> 3.13)
|
||||
rspec-mocks (~> 3.13)
|
||||
rspec-support (~> 3.13)
|
||||
rspec-support (3.13.1)
|
||||
rspectre (0.1.0)
|
||||
parser (>= 3.2.2.1)
|
||||
rspec (~> 3.9)
|
||||
@@ -565,37 +564,39 @@ GEM
|
||||
rswag-ui (2.13.0)
|
||||
actionpack (>= 3.1, < 7.2)
|
||||
railties (>= 3.1, < 7.2)
|
||||
rubocop (1.60.2)
|
||||
rubocop (1.65.0)
|
||||
json (~> 2.3)
|
||||
language_server-protocol (>= 3.17.0)
|
||||
parallel (~> 1.10)
|
||||
parser (>= 3.3.0.2)
|
||||
rainbow (>= 2.2.2, < 4.0)
|
||||
regexp_parser (>= 1.8, < 3.0)
|
||||
regexp_parser (>= 2.4, < 3.0)
|
||||
rexml (>= 3.2.5, < 4.0)
|
||||
rubocop-ast (>= 1.30.0, < 2.0)
|
||||
rubocop-ast (>= 1.31.1, < 2.0)
|
||||
ruby-progressbar (~> 1.7)
|
||||
unicode-display_width (>= 2.4.0, < 3.0)
|
||||
rubocop-ast (1.30.0)
|
||||
parser (>= 3.2.1.0)
|
||||
rubocop-capybara (2.20.0)
|
||||
rubocop-ast (1.31.3)
|
||||
parser (>= 3.3.1.0)
|
||||
rubocop-capybara (2.21.0)
|
||||
rubocop (~> 1.41)
|
||||
rubocop-factory_bot (2.25.1)
|
||||
rubocop (~> 1.41)
|
||||
rubocop-rails (2.23.1)
|
||||
rubocop-factory_bot (2.26.1)
|
||||
rubocop (~> 1.61)
|
||||
rubocop-rails (2.25.1)
|
||||
activesupport (>= 4.2.0)
|
||||
rack (>= 1.1)
|
||||
rubocop (>= 1.33.0, < 2.0)
|
||||
rubocop-ast (>= 1.30.0, < 2.0)
|
||||
rubocop-rspec (2.26.1)
|
||||
rubocop (~> 1.40)
|
||||
rubocop-capybara (~> 2.17)
|
||||
rubocop-factory_bot (~> 2.22)
|
||||
rubocop-ast (>= 1.31.1, < 2.0)
|
||||
rubocop-rake (0.6.0)
|
||||
rubocop (~> 1.0)
|
||||
rubocop-rspec (3.0.3)
|
||||
rubocop (~> 1.61)
|
||||
rubocop-rspec_rails (2.30.0)
|
||||
rubocop (~> 1.61)
|
||||
rubocop-rspec (~> 3, >= 3.0.1)
|
||||
ruby-progressbar (1.13.0)
|
||||
ruby-units (4.0.1)
|
||||
ruby-vips (2.2.0)
|
||||
ruby-units (4.0.3)
|
||||
ruby-vips (2.2.1)
|
||||
ffi (~> 1.12)
|
||||
ruby2_keywords (0.0.5)
|
||||
rubyzip (2.3.2)
|
||||
sass (3.7.4)
|
||||
sass-listen (~> 4.0.0)
|
||||
@@ -610,28 +611,30 @@ GEM
|
||||
sprockets (> 3.0)
|
||||
sprockets-rails
|
||||
tilt
|
||||
scout_apm (5.3.5)
|
||||
scout_apm (5.3.8)
|
||||
parser
|
||||
searchkick (5.3.1)
|
||||
activemodel (>= 6.1)
|
||||
hashie
|
||||
selenium-webdriver (4.17.0)
|
||||
selenium-webdriver (4.23.0)
|
||||
base64 (~> 0.2)
|
||||
logger (~> 1.4)
|
||||
rexml (~> 3.2, >= 3.2.5)
|
||||
rubyzip (>= 1.2.2, < 3.0)
|
||||
websocket (~> 1.0)
|
||||
sidekiq (7.2.1)
|
||||
sidekiq (7.3.0)
|
||||
concurrent-ruby (< 2)
|
||||
connection_pool (>= 2.3.0)
|
||||
logger
|
||||
rack (>= 2.2.4)
|
||||
redis-client (>= 0.19.0)
|
||||
redis-client (>= 0.22.2)
|
||||
simplecov (0.13.0)
|
||||
docile (~> 1.1.0)
|
||||
json (>= 1.8, < 3)
|
||||
simplecov-html (~> 0.10.0)
|
||||
simplecov-html (0.10.2)
|
||||
smart_properties (1.17.0)
|
||||
sprockets (3.7.2)
|
||||
sprockets (3.7.3)
|
||||
base64
|
||||
concurrent-ruby (~> 1.0)
|
||||
rack (> 1, < 3)
|
||||
sprockets-rails (3.4.2)
|
||||
@@ -639,17 +642,18 @@ GEM
|
||||
activesupport (>= 5.2)
|
||||
sprockets (>= 3.0.0)
|
||||
ssrf_filter (1.1.2)
|
||||
stringio (3.1.0)
|
||||
stringio (3.1.1)
|
||||
strscan (3.1.0)
|
||||
sysexits (1.2.0)
|
||||
temple (0.10.3)
|
||||
terminal-table (3.0.2)
|
||||
unicode-display_width (>= 1.1.1, < 3)
|
||||
terser (1.2.0)
|
||||
terser (1.2.3)
|
||||
execjs (>= 0.3.0, < 3)
|
||||
thor (1.3.0)
|
||||
thor (1.3.1)
|
||||
thread_safe (0.3.6)
|
||||
tilt (2.3.0)
|
||||
timecop (0.9.8)
|
||||
tilt (2.4.0)
|
||||
timecop (0.9.10)
|
||||
timeout (0.4.1)
|
||||
trollop (1.16.2)
|
||||
tzinfo (2.0.6)
|
||||
@@ -675,18 +679,18 @@ GEM
|
||||
rack (>= 1.0)
|
||||
rack-test (>= 0.5.3)
|
||||
webrick (1.8.1)
|
||||
websocket (1.2.10)
|
||||
websocket (1.2.11)
|
||||
websocket-driver (0.7.6)
|
||||
websocket-extensions (>= 0.1.0)
|
||||
websocket-extensions (0.1.5)
|
||||
will_paginate (4.0.0)
|
||||
will_paginate (4.0.1)
|
||||
will_paginate-bootstrap-style (0.3.0)
|
||||
will_paginate (~> 4.0, >= 4.0.0)
|
||||
xmlrpc (0.3.3)
|
||||
webrick
|
||||
xpath (3.2.0)
|
||||
nokogiri (~> 1.8)
|
||||
zeitwerk (2.6.12)
|
||||
zeitwerk (2.6.16)
|
||||
|
||||
PLATFORMS
|
||||
ruby
|
||||
@@ -701,7 +705,7 @@ DEPENDENCIES
|
||||
better_errors
|
||||
bluecloth
|
||||
bonsai-elasticsearch-rails
|
||||
bootstrap (>= 4.6.2)
|
||||
bootstrap (>= 5.0.0)
|
||||
bootstrap-datepicker-rails
|
||||
bootstrap_form (>= 4.5.0)
|
||||
bullet
|
||||
@@ -778,8 +782,12 @@ DEPENDENCIES
|
||||
rswag-specs
|
||||
rswag-ui
|
||||
rubocop
|
||||
rubocop-capybara
|
||||
rubocop-factory_bot
|
||||
rubocop-rails
|
||||
rubocop-rake
|
||||
rubocop-rspec
|
||||
rubocop-rspec_rails
|
||||
ruby-units
|
||||
sassc-rails
|
||||
scout_apm
|
||||
@@ -798,7 +806,7 @@ DEPENDENCIES
|
||||
xmlrpc
|
||||
|
||||
RUBY VERSION
|
||||
ruby 3.1.4p223
|
||||
ruby 3.3.4p94
|
||||
|
||||
BUNDLED WITH
|
||||
2.3.11
|
||||
2.4.22
|
||||
|
||||
@@ -15,6 +15,11 @@ Growstuff was founded in 2012 and has been built by dozens of
|
||||
[contributors](CONTRIBUTORS.md). We are an inclusive, welcoming project, and
|
||||
encourage participation from people of all backgrounds and skill levels.
|
||||
|
||||
## Want to contribute?
|
||||
|
||||
Don't ask to ask, the best way to get started is to fork the project, start a codespace and get hacking.
|
||||
Dive on in and submit your PRs.
|
||||
|
||||
## Important links
|
||||
|
||||
* [Issues](https://github.com/orgs/Growstuff/projects/1) (features we're
|
||||
|
||||
10
app/assets/images/icons/activity-add.svg
Normal file
10
app/assets/images/icons/activity-add.svg
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
|
||||
<!-- MIT Licenced, https://www.svgrepo.com/svg/336823/plan -->
|
||||
<svg width="800px" height="800px" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect width="48" height="48" fill="white" fill-opacity="0.01"/>
|
||||
<path d="M5 19H43V41C43 42.1046 42.1046 43 41 43H7C5.89543 43 5 42.1046 5 41V19Z" fill="#2F88FF" stroke="#000000" stroke-width="4" stroke-linejoin="round"/>
|
||||
<path d="M5 10C5 8.89543 5.89543 8 7 8H41C42.1046 8 43 8.89543 43 10V19H5V10Z" stroke="#000000" stroke-width="4" stroke-linejoin="round"/>
|
||||
<path d="M16 31L22 37L34 25" stroke="white" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M16 5V13" stroke="#000000" stroke-width="4" stroke-linecap="round"/>
|
||||
<path d="M32 5V13" stroke="#000000" stroke-width="4" stroke-linecap="round"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 916 B |
@@ -18,6 +18,17 @@
|
||||
// = require jquery-ui/widgets/autocomplete
|
||||
// = require bootstrap-sprockets
|
||||
// = require bootstrap-datepicker
|
||||
// = require bootstrap
|
||||
// = require material
|
||||
// = require_tree .
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function(event) {
|
||||
var popoverTrigger = Array.prototype.slice.call(document.querySelectorAll('[data-bs-toggle="popover"]'));
|
||||
popoverTrigger.map(function(popoverTrigger2) {
|
||||
return new bootstrap.Popover(popoverTrigger2);
|
||||
});
|
||||
|
||||
var tooltipTrigger = Array.prototype.slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'));
|
||||
tooltipTrigger.map(function(tooltipTrigger2) {
|
||||
return new bootstrap.Tooltip(tooltipTrigger2);
|
||||
});
|
||||
});
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,4 +0,0 @@
|
||||
jQuery ->
|
||||
$("a[rel=popover]").popover()
|
||||
$(".tooltip").tooltip()
|
||||
$("a[rel=tooltip]").tooltip()
|
||||
@@ -1 +0,0 @@
|
||||
$('.dropdown-toggle').dropdown();
|
||||
22
app/assets/javascripts/tab_navigation.js
Normal file
22
app/assets/javascripts/tab_navigation.js
Normal file
@@ -0,0 +1,22 @@
|
||||
$(document).ready(function() {
|
||||
var url = location.href.replace(/\/$/, '');
|
||||
|
||||
if (location.hash) {
|
||||
var hash = url.split('#');
|
||||
var triggerEl = document.querySelector('#myTab a[href="#' + hash[1] + '"]');
|
||||
var tab = new bootstrap.Tab(triggerEl);
|
||||
tab.show();
|
||||
url = location.href.replace(/\/#/, '#');
|
||||
history.replaceState(null, null, url);
|
||||
setTimeout(function() {
|
||||
$(window).scrollTop(0);
|
||||
}, 20);
|
||||
}
|
||||
|
||||
$('a[data-bs-toggle="tab"]').on('click', function() {
|
||||
var newUrl;
|
||||
var hash = $(this).attr('href');
|
||||
newUrl = url.split('#')[0] + hash;
|
||||
history.replaceState(null, null, newUrl);
|
||||
});
|
||||
});
|
||||
@@ -1,3 +0,0 @@
|
||||
$(function() {
|
||||
$('[data-toggle="tooltip"]').tooltip();
|
||||
});
|
||||
|
||||
@@ -40,9 +40,22 @@
|
||||
height: 250px;
|
||||
width: 100%;
|
||||
}
|
||||
.card {
|
||||
.badge-location {
|
||||
background-color: darken($blue, 10%);
|
||||
border-radius: 5%;
|
||||
color: $white;
|
||||
|
||||
.badge-location {
|
||||
background-color: darken($blue, 10%);
|
||||
border-radius: 5%;
|
||||
color: $white;
|
||||
}
|
||||
.fa-map-marker {
|
||||
padding-right: 0.5em;
|
||||
}
|
||||
}
|
||||
|
||||
.badge {
|
||||
text-overflow: ellipsis;
|
||||
white-space: normal;
|
||||
align-items: end;
|
||||
max-height: 1rlh;
|
||||
-webkit-line-clamp: 1;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
.seed-card {
|
||||
.text {
|
||||
opacity: 0.8;
|
||||
opacity: 0.95;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
position: absolute;
|
||||
|
||||
@@ -102,16 +102,14 @@ section {
|
||||
box-shadow: 1px 3px 3px 1px darken($beige, 20%);
|
||||
cursor: pointer;
|
||||
transition:
|
||||
0.3s transform cubic-bezier(0.155, 1.105, 0.295, 1.12),
|
||||
0.3s box-shadow,
|
||||
0.3s -webkit-transform cubic-bezier(0.155, 1.105, 0.295, 1.12);
|
||||
0.1s transform cubic-bezier(0.155, 1.105, 0.295, 1.12),
|
||||
0.1s box-shadow,
|
||||
0.1s -webkit-transform cubic-bezier(0.155, 1.105, 0.295, 1.12);
|
||||
}
|
||||
|
||||
.card:hover {
|
||||
box-shadow:
|
||||
0 10px 20px darken($beige, 30%),
|
||||
0 4px 8px darken($beige, 40%);
|
||||
transform: scale(1.1);
|
||||
1px 3px 3px 1px darken($beige, 30%);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -148,10 +146,6 @@ section {
|
||||
color: $brown;
|
||||
}
|
||||
}
|
||||
|
||||
.card:hover {
|
||||
background-color: $beige;
|
||||
}
|
||||
}
|
||||
|
||||
.img-cover,
|
||||
|
||||
88
app/controllers/activities_controller.rb
Normal file
88
app/controllers/activities_controller.rb
Normal file
@@ -0,0 +1,88 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class ActivitiesController < DataController
|
||||
def index
|
||||
@show_all = params[:all] == '1'
|
||||
|
||||
where = {}
|
||||
where['active'] = true unless @show_all
|
||||
|
||||
if params[:member_slug]
|
||||
@owner = Member.find_by(slug: params[:member_slug])
|
||||
where['owner_id'] = @owner.id unless @owner.nil?
|
||||
end
|
||||
|
||||
@activities = Activity.search(
|
||||
where:,
|
||||
page: params[:page],
|
||||
limit: 30,
|
||||
boost_by: [:created_at],
|
||||
load: false
|
||||
)
|
||||
@filename = "Growstuff-#{specifics}Activities-#{Time.zone.now.to_fs(:number)}.csv"
|
||||
respond_with(@activities)
|
||||
end
|
||||
|
||||
def show
|
||||
respond_with @activity
|
||||
end
|
||||
|
||||
def new
|
||||
@activity = Activity.new(
|
||||
owner: current_member
|
||||
)
|
||||
if params[:garden_id]
|
||||
@activity.garden = Garden.find_by(
|
||||
owner: current_member,
|
||||
id: params[:garden_id]
|
||||
)
|
||||
end
|
||||
|
||||
if params[:planting_id]
|
||||
@activity.planting = Planting.find_by(
|
||||
owner: current_member,
|
||||
id: params[:planting_id]
|
||||
)
|
||||
end
|
||||
|
||||
respond_with @activity
|
||||
end
|
||||
|
||||
def edit
|
||||
# the following are needed to display the form but aren't used
|
||||
@gardens = @activity.owner.gardens.active.order_by_name
|
||||
@plantings = @activity.owner.plantings.active
|
||||
end
|
||||
|
||||
def create
|
||||
@activity = Activity.new(activity_params)
|
||||
@activity.owner = current_member
|
||||
@activity.save
|
||||
respond_with @activity
|
||||
end
|
||||
|
||||
def update
|
||||
@activity.update(activity_params)
|
||||
respond_with @activity
|
||||
end
|
||||
|
||||
def destroy
|
||||
@activity.destroy
|
||||
respond_with @activity, location: @activity.garden
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def activity_params
|
||||
params.require(:activity).permit(
|
||||
:name, :description, :category, :finished,
|
||||
:garden_id, :planting_id, :due_date
|
||||
)
|
||||
end
|
||||
|
||||
def specifics
|
||||
return if @owner.blank?
|
||||
|
||||
"#{@owner.to_param}-"
|
||||
end
|
||||
end
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
class ApplicationController < ActionController::Base
|
||||
protect_from_forgery
|
||||
# Working from codespaces, we want to turn off validation
|
||||
skip_before_action :verify_authenticity_token if Rails.env.development? && ENV['CODESPACE_NAME']
|
||||
|
||||
include ApplicationHelper
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ class CropsController < ApplicationController
|
||||
responders :flash
|
||||
|
||||
def index
|
||||
@sort = params[:sort]
|
||||
@crops = Crop.search('*', boost_by: %i(plantings_count harvests_count),
|
||||
limit: 100,
|
||||
page: params[:page],
|
||||
@@ -82,7 +81,7 @@ class CropsController < ApplicationController
|
||||
@companions = @crop.companions.approved
|
||||
end
|
||||
format.svg do
|
||||
icon_data = @crop.svg_icon.presence || File.read(Rails.root.join('app', 'assets', 'images', 'icons', 'sprout.svg'))
|
||||
icon_data = @crop.svg_icon.presence || File.read(Rails.root.join("app/assets/images/icons/sprout.svg"))
|
||||
send_data(icon_data, type: "image/svg+xml", disposition: "inline")
|
||||
end
|
||||
format.json do
|
||||
@@ -114,7 +113,12 @@ class CropsController < ApplicationController
|
||||
@crop.approval_status = "pending"
|
||||
end
|
||||
|
||||
notify_wranglers if Crop.transaction { @crop.save && save_crop_names }
|
||||
if Crop.transaction { @crop.save && save_crop_names }
|
||||
notify_wranglers
|
||||
else
|
||||
@crop.alternate_names.build
|
||||
@crop.scientific_names.build
|
||||
end
|
||||
|
||||
respond_with @crop
|
||||
end
|
||||
|
||||
@@ -16,6 +16,7 @@ class GardensController < DataController
|
||||
|
||||
def show
|
||||
@current_plantings = @garden.plantings.current.includes(:crop, :owner).order(planted_at: :desc)
|
||||
@current_activities = @garden.activities.current.includes(:owner).order(created_at: :desc)
|
||||
@finished_plantings = @garden.plantings.finished.includes(:crop)
|
||||
@suggested_companions = Crop.approved.where(
|
||||
id: CropCompanion.where(crop_a_id: @current_plantings.select(:crop_id)).select(:crop_b_id)
|
||||
|
||||
@@ -58,7 +58,7 @@ class LikesController < ApplicationController
|
||||
|
||||
def failed(like, message)
|
||||
respond_to do |format|
|
||||
format.json { render(json: { 'error': message }, status: :forbidden) }
|
||||
format.json { render(json: { error: message }, status: :forbidden) }
|
||||
format.html do
|
||||
flash[:error] = message
|
||||
if like&.likeable
|
||||
|
||||
@@ -61,7 +61,7 @@ class MembersController < ApplicationController
|
||||
end
|
||||
|
||||
def unsubscribe
|
||||
verifier = ActiveSupport::MessageVerifier.new(ENV['RAILS_SECRET_TOKEN'])
|
||||
verifier = ActiveSupport::MessageVerifier.new(ENV.fetch('RAILS_SECRET_TOKEN', nil))
|
||||
decrypted_message = verifier.verify(params[:message])
|
||||
|
||||
@member = Member.find(decrypted_message[:member_id])
|
||||
|
||||
@@ -21,7 +21,7 @@ class MessagesController < ApplicationController
|
||||
return if params[:recipient_id].blank?
|
||||
|
||||
@recipient = Member.find_by(id: params[:recipient_id])
|
||||
return if @recipient.nil?
|
||||
nil if @recipient.nil?
|
||||
end
|
||||
|
||||
def create
|
||||
|
||||
@@ -41,7 +41,7 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController
|
||||
|
||||
def after_sign_in_path_for(resource)
|
||||
if resource.tos_agreement
|
||||
super(resource)
|
||||
super
|
||||
else
|
||||
finish_signup_path(resource)
|
||||
end
|
||||
|
||||
@@ -36,6 +36,7 @@ class PlantingsController < DataController
|
||||
def show
|
||||
@photos = @planting.photos.includes(:owner).order(date_taken: :desc)
|
||||
@harvests = Harvest.search(where: { planting_id: @planting.id })
|
||||
@current_activities = @planting.activities.current.includes(:owner).order(created_at: :desc)
|
||||
@matching_seeds = matching_seeds
|
||||
@crop = @planting.crop
|
||||
|
||||
|
||||
@@ -18,6 +18,30 @@ module ButtonsHelper
|
||||
end
|
||||
end
|
||||
|
||||
def garden_plan_something_button(garden, classes: "btn btn-default")
|
||||
return unless can? :edit, garden
|
||||
|
||||
link_to new_activity_path(garden_id: garden.id), class: classes do
|
||||
activity_icon + ' ' + t('buttons.new_activity')
|
||||
end
|
||||
end
|
||||
|
||||
def plan_something_button
|
||||
return unless can? :create, Activity
|
||||
|
||||
link_to new_activity_path, class: "btn btn-default" do
|
||||
activity_icon + ' ' + t('buttons.new_activity')
|
||||
end
|
||||
end
|
||||
|
||||
def planting_plan_something_button(planting, classes: "btn btn-default")
|
||||
return unless can? :edit, planting
|
||||
|
||||
link_to new_activity_path(planting_id: planting.id), class: classes do
|
||||
activity_icon + ' ' + t('buttons.new_activity')
|
||||
end
|
||||
end
|
||||
|
||||
def garden_mark_active_button(garden, classes: 'btn')
|
||||
link_to t('buttons.mark_as_active'),
|
||||
garden_path(garden, garden: { active: 1 }),
|
||||
@@ -59,6 +83,19 @@ module ButtonsHelper
|
||||
edit_button(edit_planting_path(planting), classes:)
|
||||
end
|
||||
|
||||
def activity_edit_button(activity, classes: "btn btn-raised btn-info")
|
||||
edit_button(edit_activity_path(activity), classes:)
|
||||
end
|
||||
|
||||
def activity_finish_button(activity, classes: 'btn btn-default btn-secondary')
|
||||
return unless can?(:edit, activity) || activity.finished
|
||||
|
||||
link_to activity_path(slug: activity.slug, activity: { finished: 1 }),
|
||||
method: :put, class: "#{classes} append-date" do
|
||||
finished_icon + ' ' + t('buttons.mark_as_finished')
|
||||
end
|
||||
end
|
||||
|
||||
def planting_finish_button(planting, classes: 'btn btn-default btn-secondary')
|
||||
return unless can?(:edit, planting) || planting.finished
|
||||
|
||||
|
||||
@@ -7,14 +7,14 @@ module CropsHelper
|
||||
|
||||
return "You don't have any seeds of this crop." if seeds.none?
|
||||
|
||||
if total_quantity != 0
|
||||
"You have #{total_quantity} #{Seed.model_name.human(count: total_quantity)} of this crop."
|
||||
else
|
||||
if total_quantity == 0
|
||||
"You have an unknown quantity of seeds of this crop."
|
||||
else
|
||||
"You have #{total_quantity} #{Seed.model_name.human(count: total_quantity)} of this crop."
|
||||
end
|
||||
end
|
||||
|
||||
def crop_ebay_seeds_url(crop)
|
||||
"https://rover.ebay.com/rover/1/705-53470-19255-0/1?icep_ff3=9&pub=5575213277&toolid=10001&campid=5337940151&customid=&icep_uq=#{CGI.escape crop.name}&icep_sellerId=&icep_ex_kw=&icep_sortBy=12&icep_catId=181003&icep_minPrice=&icep_maxPrice=&ipn=psmain&icep_vectorid=229515&kwid=902099&mtid=824&kw=lg"
|
||||
"https://www.ebay.com/sch/i.html?_nkw=#{CGI.escape crop.name}"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -11,10 +11,12 @@ module GardensHelper
|
||||
end
|
||||
end
|
||||
|
||||
# TODO: Not used?
|
||||
def display_garden_name(garden)
|
||||
truncate(garden.name, length: 50, separator: ' ', omission: '... ')
|
||||
end
|
||||
|
||||
# TODO: Only used by specs?
|
||||
def display_garden_plantings(plantings)
|
||||
if plantings.blank?
|
||||
"None"
|
||||
|
||||
@@ -71,6 +71,10 @@ module IconsHelper
|
||||
icon('fas', 'seedling')
|
||||
end
|
||||
|
||||
def activity_icon
|
||||
icon('fas', 'fa-truck-pickup')
|
||||
end
|
||||
|
||||
def post_icon
|
||||
image_icon 'post'
|
||||
end
|
||||
|
||||
@@ -2,15 +2,15 @@
|
||||
|
||||
class NotifierMailer < ApplicationMailer
|
||||
# include NotificationsHelper
|
||||
default from: "Growstuff <#{ENV['GROWSTUFF_EMAIL']}>"
|
||||
default from: "Growstuff <#{ENV.fetch('GROWSTUFF_EMAIL', nil)}>"
|
||||
|
||||
def verifier
|
||||
unless ENV['RAILS_SECRET_TOKEN']
|
||||
raise "RAILS_SECRET_TOKEN environment variable"\
|
||||
"not set - have you created config/application.yml?"
|
||||
raise "RAILS_SECRET_TOKEN environment variable" \
|
||||
"not set - have you created config/application.yml?"
|
||||
end
|
||||
|
||||
ActiveSupport::MessageVerifier.new(ENV['RAILS_SECRET_TOKEN'])
|
||||
ActiveSupport::MessageVerifier.new(ENV.fetch('RAILS_SECRET_TOKEN', nil))
|
||||
end
|
||||
|
||||
def notify(notification)
|
||||
@@ -27,7 +27,7 @@ class NotifierMailer < ApplicationMailer
|
||||
|
||||
def planting_reminder(member)
|
||||
@member = member
|
||||
@sitename = ENV['GROWSTUFF_SITE_NAME']
|
||||
@sitename = ENV.fetch('GROWSTUFF_SITE_NAME', nil)
|
||||
|
||||
@late = []
|
||||
@super_late = []
|
||||
|
||||
@@ -109,6 +109,10 @@ class Ability
|
||||
can :update, Planting, garden: { owner_id: member.id }, crop: { approval_status: 'approved' }
|
||||
can :destroy, Planting, garden: { owner_id: member.id }, crop: { approval_status: 'approved' }
|
||||
|
||||
can :create, Activity
|
||||
can :update, Activity, owner_id: member.id
|
||||
can :destroy, Activity, owner_id: member.id
|
||||
|
||||
can :create, Harvest
|
||||
can :update, Harvest, owner_id: member.id
|
||||
can :destroy, Harvest, owner_id: member.id
|
||||
@@ -149,5 +153,10 @@ class Ability
|
||||
can :destroy, PlantPart do |pp|
|
||||
pp.harvests.empty?
|
||||
end
|
||||
# Admins can't delete themselves
|
||||
cannot :destroy, Member
|
||||
can :destroy, Member do |other_member|
|
||||
other_member&.id != member.id
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
32
app/models/activity.rb
Normal file
32
app/models/activity.rb
Normal file
@@ -0,0 +1,32 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class Activity < ApplicationRecord
|
||||
extend FriendlyId
|
||||
include Ownable
|
||||
include Finishable
|
||||
include SearchActivities
|
||||
|
||||
belongs_to :garden, optional: true
|
||||
belongs_to :planting, optional: true
|
||||
|
||||
friendly_id :activity_slug, use: %i(slugged finders)
|
||||
|
||||
CATEGORIES = ["General", "Weeding", "Soil Cultivation", "Fertilizing", "Pruning", "Topical Application/Treating", "Watering"]
|
||||
|
||||
validates :name, presence: true
|
||||
validates :category, inclusion: { in: CATEGORIES }, presence: true
|
||||
validates :owner, presence: true
|
||||
|
||||
validates :slug, uniqueness: true
|
||||
|
||||
delegate :location, :latitude, :longitude, to: :owner
|
||||
delegate :login_name, :slug, :location, to: :owner, prefix: true
|
||||
|
||||
def activity_slug
|
||||
"#{owner.login_name}-#{name}-#{id}".downcase.tr(' ', '-')
|
||||
end
|
||||
|
||||
def to_s
|
||||
name
|
||||
end
|
||||
end
|
||||
@@ -9,8 +9,8 @@ module MemberFlickr
|
||||
if @flickr.nil?
|
||||
flickr_auth = auth('flickr')
|
||||
if flickr_auth
|
||||
FlickRaw.api_key = ENV['GROWSTUFF_FLICKR_KEY']
|
||||
FlickRaw.shared_secret = ENV['GROWSTUFF_FLICKR_SECRET']
|
||||
FlickRaw.api_key = ENV.fetch('GROWSTUFF_FLICKR_KEY', nil)
|
||||
FlickRaw.shared_secret = ENV.fetch('GROWSTUFF_FLICKR_SECRET', nil)
|
||||
@flickr = FlickRaw::Flickr.new
|
||||
@flickr.access_token = flickr_auth.token
|
||||
@flickr.access_secret = flickr_auth.secret
|
||||
|
||||
@@ -77,9 +77,22 @@ module PredictPlanting
|
||||
finish_predicted_at <= Time.zone.today
|
||||
end
|
||||
|
||||
# Deactivate any plantings over time_limit that are super late in small batches.
|
||||
def self.archive!(time_limit: 3.years.ago, limit: 1000)
|
||||
active_plantings = Planting.annual.active.where("planted_at < ?", time_limit).order(planted_at: :asc).limit(limit)
|
||||
active_plantings.each do |planting|
|
||||
if planting.finish_is_predicatable? && planting.super_late?
|
||||
planting.finished = true
|
||||
planting.save
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def calculate_percentage_grown
|
||||
return 0 if age_in_days < 0
|
||||
|
||||
percent = (age_in_days / expected_lifespan.to_f) * 100
|
||||
(percent > 100 ? 100 : percent)
|
||||
end
|
||||
|
||||
62
app/models/concerns/search_activities.rb
Normal file
62
app/models/concerns/search_activities.rb
Normal file
@@ -0,0 +1,62 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module SearchActivities
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
included do
|
||||
searchkick merge_mappings: true,
|
||||
settings: { number_of_shards: 1, number_of_replicas: 0 },
|
||||
mappings: {
|
||||
properties: {
|
||||
active: { type: :boolean },
|
||||
created_at: { type: :integer }
|
||||
}
|
||||
}
|
||||
|
||||
def search_data
|
||||
{
|
||||
slug:,
|
||||
active:,
|
||||
finished: finished?,
|
||||
name:,
|
||||
due_date:,
|
||||
category:,
|
||||
garden_id:,
|
||||
garden_name: garden&.name,
|
||||
planting_id:,
|
||||
planting_name: planting&.crop&.name,
|
||||
description:,
|
||||
|
||||
# owner
|
||||
owner_id:,
|
||||
owner_login_name:,
|
||||
owner_slug:,
|
||||
|
||||
# timestamps
|
||||
created_at: created_at.to_i,
|
||||
updated_at: updated_at.to_i
|
||||
}
|
||||
end
|
||||
|
||||
def self.homepage_records(limit)
|
||||
records = []
|
||||
owners = []
|
||||
1..limit.times do
|
||||
where = {
|
||||
# photos_count: { gt: 0 },
|
||||
owner_id: { not: owners }
|
||||
}
|
||||
one_record = search('*',
|
||||
limit: 1,
|
||||
where:,
|
||||
boost_by: [:created_at],
|
||||
load: false).first
|
||||
return records if one_record.nil?
|
||||
|
||||
owners << one_record.owner_id
|
||||
records << one_record
|
||||
end
|
||||
records
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -30,7 +30,7 @@ module SearchPlantings
|
||||
quantity:,
|
||||
sunniness:,
|
||||
garden_id:,
|
||||
garden_name: garden&.name,
|
||||
garden_name: garden&.name,
|
||||
description:,
|
||||
|
||||
first_harvest_predicted_at:,
|
||||
|
||||
@@ -59,7 +59,7 @@ class CsvImporter
|
||||
|
||||
alternate_names.split(/,\s*/).each do |name|
|
||||
altname = AlternateName.find_by(name:, crop: @crop)
|
||||
altname ||= AlternateName.create! name: name, crop: @crop, creator: cropbot
|
||||
altname ||= AlternateName.create! name:, crop: @crop, creator: cropbot
|
||||
@crop.alternate_names << altname
|
||||
end
|
||||
end
|
||||
|
||||
@@ -10,7 +10,7 @@ class Follow < ApplicationRecord
|
||||
recipient_id: followed_id,
|
||||
sender_id: follower_id,
|
||||
subject: "#{follower.login_name} is now following you",
|
||||
body: "#{follower.login_name} just followed you on #{ENV['GROWSTUFF_SITE_NAME']}. "
|
||||
body: "#{follower.login_name} just followed you on #{ENV.fetch('GROWSTUFF_SITE_NAME', nil)}. "
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -9,6 +9,7 @@ class Garden < ApplicationRecord
|
||||
|
||||
has_many :plantings, dependent: :destroy
|
||||
has_many :crops, through: :plantings
|
||||
has_many :activities, dependent: :destroy
|
||||
|
||||
belongs_to :garden_type, optional: true
|
||||
|
||||
@@ -78,6 +79,16 @@ class Garden < ApplicationRecord
|
||||
|
||||
def reindex(refresh: false); end
|
||||
|
||||
# Deactivate any gardens with no active plantings
|
||||
def self.archive!(time_limit: 3.years.ago, limit: 1000)
|
||||
Garden.active.where("gardens.updated_at < ?", time_limit).order(updated_at: :asc).limit(limit).each do |active_garden|
|
||||
unless active_garden.plantings.active.any?
|
||||
active_garden.active = false
|
||||
active_garden.save
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def strip_blanks
|
||||
|
||||
@@ -19,6 +19,7 @@ class Member < ApplicationRecord
|
||||
has_many :plantings, foreign_key: 'owner_id', dependent: :destroy, inverse_of: :owner
|
||||
has_many :seeds, foreign_key: 'owner_id', dependent: :destroy, inverse_of: :owner
|
||||
has_many :harvests, foreign_key: 'owner_id', dependent: :destroy, inverse_of: :owner
|
||||
has_many :activities, foreign_key: 'owner_id', dependent: :destroy, inverse_of: :owner
|
||||
has_and_belongs_to_many :roles
|
||||
has_many :notifications, foreign_key: 'recipient_id', inverse_of: :recipient
|
||||
has_many :sent_notifications, foreign_key: 'sender_id', inverse_of: :sender, class_name: "Notification"
|
||||
|
||||
@@ -9,7 +9,7 @@ class Photo < ApplicationRecord
|
||||
|
||||
has_many :photo_associations, dependent: :delete_all, inverse_of: :photo
|
||||
|
||||
# This doesn't work, ActiveRecord tries to use the polymoriphinc photographable
|
||||
# This doesn't work, ActiveRecord tries to use the polymoriphic photographable
|
||||
# relationship instead.
|
||||
# has_many :crops, through: :photo_associations, counter_cache: true
|
||||
def crops
|
||||
|
||||
@@ -22,6 +22,7 @@ class Planting < ApplicationRecord
|
||||
belongs_to :garden
|
||||
belongs_to :crop, counter_cache: true
|
||||
has_many :harvests, dependent: :destroy
|
||||
has_many :activities, dependent: :destroy
|
||||
|
||||
#
|
||||
# Ancestry of food
|
||||
|
||||
@@ -33,17 +33,17 @@ class Seed < ApplicationRecord
|
||||
validates :days_until_maturity_max, allow_nil: true,
|
||||
numericality: { only_integer: true, greater_than_or_equal_to: 0 }
|
||||
validates :tradable_to, allow_blank: false,
|
||||
inclusion: { in: TRADABLE_TO_VALUES, message: "You may only trade seed nowhere, "\
|
||||
"locally, nationally, or internationally" }
|
||||
inclusion: { in: TRADABLE_TO_VALUES, message: "You may only trade seed nowhere, " \
|
||||
"locally, nationally, or internationally" }
|
||||
validates :organic, allow_blank: false,
|
||||
inclusion: { in: ORGANIC_VALUES, message: "You must say whether the seeds "\
|
||||
"are organic or not, or that you don't know" }
|
||||
inclusion: { in: ORGANIC_VALUES, message: "You must say whether the seeds " \
|
||||
"are organic or not, or that you don't know" }
|
||||
validates :gmo, allow_blank: false,
|
||||
inclusion: { in: GMO_VALUES, message: "You must say whether the seeds are "\
|
||||
"genetically modified or not, or that you don't know" }
|
||||
inclusion: { in: GMO_VALUES, message: "You must say whether the seeds are " \
|
||||
"genetically modified or not, or that you don't know" }
|
||||
validates :heirloom, allow_blank: false,
|
||||
inclusion: { in: HEIRLOOM_VALUES, message: "You must say whether the seeds"\
|
||||
"are heirloom, hybrid, or unknown" }
|
||||
inclusion: { in: HEIRLOOM_VALUES, message: "You must say whether the seeds" \
|
||||
"are heirloom, hybrid, or unknown" }
|
||||
|
||||
#
|
||||
# Delegations
|
||||
@@ -56,7 +56,7 @@ class Seed < ApplicationRecord
|
||||
default_scope { joins(:owner).merge(Member.kept) } # Ensure owner exists
|
||||
scope :tradable, -> { where.not(tradable_to: 'nowhere') }
|
||||
scope :interesting, -> { tradable.has_location }
|
||||
scope :has_location, -> { joins(:owner).where.not("members.location": nil) }
|
||||
scope :has_location, -> { joins(:owner).where.not('members.location': nil) }
|
||||
scope :recent, -> { order(created_at: :desc) }
|
||||
scope :active, -> { where('finished <> true').where('finished_at IS NULL OR finished_at < ?', Time.zone.now) }
|
||||
|
||||
|
||||
@@ -17,10 +17,21 @@ class TimelineService
|
||||
.union_all(comments_query)
|
||||
.union_all(photos_query)
|
||||
.union_all(seeds_query)
|
||||
.union_all(activities_query)
|
||||
.where.not(event_at: nil)
|
||||
.order(event_at: :desc)
|
||||
end
|
||||
|
||||
def self.activities_query
|
||||
Activity.select(
|
||||
:id,
|
||||
"'activity' as event_type",
|
||||
'COALESCE(activities.due_date, activities.created_at) as event_at',
|
||||
:owner_id,
|
||||
'null as crop_id'
|
||||
)
|
||||
end
|
||||
|
||||
def self.plantings_query
|
||||
Planting.select(
|
||||
:id,
|
||||
|
||||
9
app/views/activities/_actions.haml
Normal file
9
app/views/activities/_actions.haml
Normal file
@@ -0,0 +1,9 @@
|
||||
- if can?(:edit, activity)
|
||||
.dropdown.activity-actions
|
||||
%a#activity-actions-button.btn.btn-info.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-bs-toggle" => "dropdown", type: "button", href: '#'} Actions
|
||||
.dropdown-menu.dropdown-menu-xs{"aria-labelledby" => "planting-actions-button"}
|
||||
= activity_edit_button(activity, classes: 'dropdown-item')
|
||||
- if activity.active
|
||||
= activity_finish_button(activity, classes: 'dropdown-item')
|
||||
.dropdown-divider
|
||||
= delete_button(activity, classes: 'dropdown-item text-danger')
|
||||
35
app/views/activities/_card.html.haml
Normal file
35
app/views/activities/_card.html.haml
Normal file
@@ -0,0 +1,35 @@
|
||||
- cache activity do
|
||||
.card.activity{class: activity.active ? '' : 'card-finished'}
|
||||
= link_to activity_path(slug: activity.slug) do
|
||||
-# = image_tag activity.thumbnail_url ? activity.thumbnail_url : placeholder_image, class: 'img-card', alt: planting.crop_name
|
||||
|
||||
- if member_signed_in? && current_member.id == activity.owner_id
|
||||
= link_to activity_path(slug: activity.slug) do
|
||||
.activity-quick-actions
|
||||
.dropdown
|
||||
%a.activity-menu.btn.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-bs-toggle" => "dropdown", type: "button", href: '#'}
|
||||
|
||||
.dropdown-menu{"aria-labelledby" => "activity-menu"}
|
||||
= link_to edit_activity_path(slug: activity.slug), class: 'dropdown-item' do
|
||||
= edit_icon
|
||||
= t('buttons.edit')
|
||||
|
||||
- if activity.active
|
||||
= activity_finish_button(activity, classes: 'dropdown-item')
|
||||
|
||||
- if can? :destroy, activity
|
||||
.dropdown-divider
|
||||
= delete_button(activity, classes: 'dropdown-item text-danger')
|
||||
= link_to activity_path(slug: activity.slug) do
|
||||
.card-body.text-center
|
||||
%h4= activity.name
|
||||
.text-center= activity.description
|
||||
- if activity.garden
|
||||
.text-center= activity.garden
|
||||
- if activity.planting
|
||||
.text-center= activity.planting
|
||||
.card-footer
|
||||
.float-right
|
||||
%span.chip.member-chip
|
||||
= link_to member_path(slug: activity.owner_slug) do
|
||||
= activity.owner_login_name
|
||||
7
app/views/activities/_description.haml
Normal file
7
app/views/activities/_description.haml
Normal file
@@ -0,0 +1,7 @@
|
||||
#{link_to event_model.category, event_model} - #{event_model.name}
|
||||
|
||||
- if event_model.planting
|
||||
%span on #{link_to event_model.planting, event_model.planting}
|
||||
|
||||
- if event_model.garden
|
||||
%span in #{link_to event_model.garden, event_model.garden}
|
||||
55
app/views/activities/_form.html.haml
Normal file
55
app/views/activities/_form.html.haml
Normal file
@@ -0,0 +1,55 @@
|
||||
.card.col-md-8.col-lg-7.mx-auto.float-none.white.z-depth-1.py-2.px-2
|
||||
.card-header
|
||||
- if content_for? :title
|
||||
%h1.h2-responsive.text-center
|
||||
= planting_icon
|
||||
%strong=yield :title
|
||||
= bootstrap_form_for(@activity) do |f|
|
||||
.card-body
|
||||
= required_field_help_text
|
||||
- if @activity.errors.any?
|
||||
#error_explanation
|
||||
%h2
|
||||
= pluralize(@activity.errors.size, "error")
|
||||
prohibited this activity from being saved:
|
||||
%ul
|
||||
- @activity.errors.full_messages.each do |msg|
|
||||
%li= msg
|
||||
|
||||
.row
|
||||
.col-md-12
|
||||
= f.text_field :name, required: true, label: 'What needs to be done?'
|
||||
.row
|
||||
.col-md-4
|
||||
= f.select(:category, Activity::CATEGORIES, include_blank: true)
|
||||
.row
|
||||
.col-md-12
|
||||
= f.text_area :description, rows: 6, label: 'Tell us more about it'
|
||||
|
||||
.row
|
||||
.col-md-4
|
||||
= f.collection_radio_buttons(:garden_id, @activity.owner.gardens.active,
|
||||
:id, :name,
|
||||
label: 'Is this for a specific garden?')
|
||||
= link_to "Add a garden.", new_garden_path
|
||||
|
||||
.col-md-4
|
||||
= f.collection_radio_buttons(:planting_id, @activity.owner.plantings.active,
|
||||
:id, :crop_name,
|
||||
label: 'Is this for a specific planting?')
|
||||
= link_to "Add a planting.", new_planting_path
|
||||
|
||||
.col-md-4
|
||||
= f.text_field :due_date,
|
||||
value: @activity.due_date ? @activity.due_date.to_fs(:ymd) : '',
|
||||
class: 'add-datepicker', label: 'When?'
|
||||
|
||||
%hr
|
||||
|
||||
.row
|
||||
.col-md-6
|
||||
= f.check_box :finished, label: 'Mark as finished'
|
||||
%span.help-block= t('.finish_helper')
|
||||
|
||||
.card-footer
|
||||
.text-right= f.submit 'Save'
|
||||
20
app/views/activities/_owner.haml
Normal file
20
app/views/activities/_owner.haml
Normal file
@@ -0,0 +1,20 @@
|
||||
.card
|
||||
.card-body
|
||||
.row
|
||||
.col
|
||||
%h4
|
||||
Planned by
|
||||
= link_to @activity.owner, @activity.owner
|
||||
= link_to "view all #{@activity.owner}'s activities", member_activities_path(@activity.owner)
|
||||
|
||||
- if @activity.garden
|
||||
%p
|
||||
Planned in
|
||||
= link_to @activity.garden, @activity.garden
|
||||
|
||||
- if @activity.planting
|
||||
%p
|
||||
Planned for
|
||||
= link_to @activity.planting, @activity.planting
|
||||
|
||||
.col= render "members/avatar", member: @activity.owner
|
||||
3
app/views/activities/edit.html.haml
Normal file
3
app/views/activities/edit.html.haml
Normal file
@@ -0,0 +1,3 @@
|
||||
= content_for :title, "Editing activity"
|
||||
|
||||
= render 'form'
|
||||
47
app/views/activities/index.csv.shaper
Normal file
47
app/views/activities/index.csv.shaper
Normal file
@@ -0,0 +1,47 @@
|
||||
csv.headers :id,
|
||||
:growstuff_url,
|
||||
:name,
|
||||
:category,
|
||||
:description,
|
||||
:owner_id,
|
||||
:owner_name,
|
||||
:garden_id,
|
||||
:garden_name,
|
||||
:planting_id,
|
||||
:planting_name,
|
||||
:due_date,
|
||||
:finished,
|
||||
:date_added,
|
||||
:last_modified,
|
||||
:license
|
||||
|
||||
@activities.each do |a|
|
||||
csv.row a do |csv, activity|
|
||||
|
||||
csv.cell :id
|
||||
csv.cell :growstuff_url, activity_url(a.slug)
|
||||
|
||||
csv.cell :name, a.description
|
||||
csv.cell :category, a.description
|
||||
csv.cell :description, a.description
|
||||
|
||||
csv.cell :owner_id, a.owner_id
|
||||
csv.cell :owner_name, a.owner_login_name
|
||||
|
||||
csv.cell :garden_id, a.garden_id
|
||||
csv.cell :garden_name, a.garden_name
|
||||
|
||||
csv.cell :planting_id, a.planting_id
|
||||
csv.cell :planting_name, a.planting_name
|
||||
|
||||
csv.cell :due_date, a.due_date ? a.due_date : ''
|
||||
|
||||
csv.cell :finished
|
||||
|
||||
csv.cell :date_added, Time.at(a.created_at).to_fs(:db)
|
||||
csv.cell :last_modified, Time.at(a.updated_at).to_fs(:db)
|
||||
|
||||
csv.cell :license, "CC-BY-SA Growstuff http://growstuff.org/"
|
||||
|
||||
end
|
||||
end
|
||||
43
app/views/activities/index.html.haml
Normal file
43
app/views/activities/index.html.haml
Normal file
@@ -0,0 +1,43 @@
|
||||
- content_for :title, title('activities', @owner, nil, @planting)
|
||||
|
||||
- content_for :breadcrumbs do
|
||||
- if @owner
|
||||
%li.breadcrumb-item= link_to 'Activities', activities_path
|
||||
%li.breadcrumb-item.active= link_to "#{@owner}'s activities", activities_path(owner: @owner)
|
||||
- else
|
||||
%li.breadcrumb-item.active= link_to 'Activities', activities_path
|
||||
|
||||
.row
|
||||
.col-md-2
|
||||
%h1
|
||||
= activity_icon
|
||||
= title('activities', @owner, nil, @planting)
|
||||
= render 'layouts/nav', model: Activity
|
||||
= link_to show_inactive_tickbox_path('activities', owner: @owner, crop: nil, show_all: @show_all) do
|
||||
= check_box_tag 'active', 'all', @show_all
|
||||
include finished activities
|
||||
%hr
|
||||
- if @owner.present?
|
||||
= render @owner, cached: true
|
||||
|
||||
%section.open-data
|
||||
%h2 Open Data
|
||||
%p= t('label.data')
|
||||
- ['csv', 'json', 'rss'].each do |format|
|
||||
.badge.badge-info
|
||||
= link_to (@owner ? member_activities_path(@owner, format: format) : activities_path(format: format)) do
|
||||
= icon 'fas', format.to_s
|
||||
= format.upcase
|
||||
- if @owner
|
||||
.badge.badge-info= link_to "iCal", member_activities_path(@owner, format: 'ics', protocol: 'webcal', only_path: false)
|
||||
.badge.badge-success= link_to 'API Methods', '/api-docs'
|
||||
|
||||
.col-md-10
|
||||
|
||||
%section
|
||||
%h2= title('activities', @owner, nil, @planting)
|
||||
= will_paginate @activities
|
||||
.index-cards
|
||||
- @activities.each do |a|
|
||||
= render 'activities/card', activity: a
|
||||
= will_paginate @activities
|
||||
37
app/views/activities/index.ics.erb
Normal file
37
app/views/activities/index.ics.erb
Normal file
@@ -0,0 +1,37 @@
|
||||
<%
|
||||
# TODO Refactor to a Activity <-> Ical view class?
|
||||
cal = Icalendar::Calendar.new
|
||||
cal.description = "Activities by #{@owner.login_name}"
|
||||
@activities.each do |activity|
|
||||
|
||||
event = Icalendar::Event.new
|
||||
|
||||
lines = []
|
||||
lines << "Garden: #{activity['garden_name'] ? activity['garden_name'] : 'N/A' }"
|
||||
lines << "Planting: #{activity['planting_name'] ? activity['planting_name'] : 'N/A' }"
|
||||
|
||||
lines << activity.description
|
||||
finish_date = Date.parse(activity['due_date']) rescue nil
|
||||
|
||||
event.dtstart = Time.at(activity['created_at'])
|
||||
event.dtend = finish_date || 1.day.from_now
|
||||
event.summary = "#{activity['name']} - #{activity['category']}"
|
||||
event.description = lines.join("\n")
|
||||
event.ip_class = "PUBLIC"
|
||||
event.url = activity_url(slug: activity['slug'])
|
||||
|
||||
cal.add_event(event)
|
||||
|
||||
if finish_date && finish_date > Date.today
|
||||
todo = Icalendar::Todo.new
|
||||
todo.dtstart = finish_date || Date.today
|
||||
todo.due = finish_date
|
||||
todo.summary = "#{activity['name']} - #{activity['category']}"
|
||||
todo.description = lines.join("\n")
|
||||
|
||||
cal.add_todo(todo)
|
||||
end
|
||||
end
|
||||
cal.publish
|
||||
%>
|
||||
<%= cal.to_ical %>
|
||||
20
app/views/activities/index.rss.haml
Normal file
20
app/views/activities/index.rss.haml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
%rss{ version: 2.0 }
|
||||
%channel
|
||||
%title
|
||||
Recent activities from #{@owner ? @owner : 'all members'} (#{ENV['GROWSTUFF_SITE_NAME']})
|
||||
%link= activities_url
|
||||
- @activities.each do |activity|
|
||||
%item
|
||||
%title #{activity['name']}
|
||||
%pubdate= activity['created_at'].to_fs(:rfc822)
|
||||
%description
|
||||
:escaped
|
||||
<p>Category: #{activity['category']}</p>
|
||||
<p>Due Date: #{activity['due_date'] ? activity['due_date'] : 'unknown' }</p>
|
||||
<p>Garden: #{activity['garden_name'] ? activity['garden_name'] : 'N/A' }</p>
|
||||
<p>Planting: #{activity['planting_name'] ? activity['planting_name'] : 'N/A' }</p>
|
||||
:escaped_markdown
|
||||
#{ strip_tags markdownify(activity['description']) }
|
||||
%link= activity_url(slug: activity['slug'])
|
||||
%guid= activity_url(slug: activity['slug'])
|
||||
3
app/views/activities/new.html.haml
Normal file
3
app/views/activities/new.html.haml
Normal file
@@ -0,0 +1,3 @@
|
||||
= content_for :title, t('activities.plan_something')
|
||||
|
||||
= render 'form'
|
||||
51
app/views/activities/show.html.haml
Normal file
51
app/views/activities/show.html.haml
Normal file
@@ -0,0 +1,51 @@
|
||||
= content_for :title, @activity.name
|
||||
- content_for :opengraph do
|
||||
= tag("meta", property: "og:title", content: @activity.name)
|
||||
- if @activity.description
|
||||
= tag("meta", property: "og:description", content: og_description(@activity.description))
|
||||
= tag("meta", property: "og:type", content: "website")
|
||||
= tag("meta", property: "og:url", content: request.original_url)
|
||||
= tag("meta", property: "og:site_name", content: ENV['GROWSTUFF_SITE_NAME'])
|
||||
|
||||
- content_for :breadcrumbs do
|
||||
%li.breadcrumb-item= link_to 'Activities', activities_path
|
||||
%li.breadcrumb-item= link_to @activity.owner, member_activities_path(@activity.owner)
|
||||
%li.breadcrumb-item.active= link_to @activity.name, @activity
|
||||
|
||||
.activity
|
||||
.row
|
||||
.col-md-8.col-xs-12
|
||||
.jumbotron
|
||||
.d-flex.justify-content-between
|
||||
%h1.display-3
|
||||
%strong= @activity.name.titleize
|
||||
%small.text-muted= @activity.category
|
||||
%tt
|
||||
= @activity.due_date
|
||||
|
||||
.col-md-4.col-xs-12
|
||||
= render 'activities/owner', planting: @activity
|
||||
|
||||
.col-md-8.col-xs-12
|
||||
- if @activity.description.present?
|
||||
= cute_icon
|
||||
.card
|
||||
.card-header
|
||||
%h2 Description
|
||||
.card-body
|
||||
:markdown
|
||||
#{strip_tags markdownify(@activity.description)}
|
||||
|
||||
- if @activity.garden
|
||||
%section.gardens
|
||||
%a{name: 'gardens'}
|
||||
= render 'gardens/card', garden: @activity.garden
|
||||
|
||||
- if @activity.planting
|
||||
%section.plantings
|
||||
%a{name: 'plantings'}
|
||||
= render 'plantings/card', planting: @activity.planting
|
||||
|
||||
|
||||
.col-md-4.col-xs-12
|
||||
= render 'activities/actions', activity: @activity
|
||||
@@ -6,7 +6,7 @@
|
||||
- if can?(:edit, comment) || can?(:destroy, comment)
|
||||
%hr/
|
||||
.dropdown
|
||||
%button#comment-edit-button.btn.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-toggle" => "dropdown", type: "button"} Actions
|
||||
%button#comment-edit-button.btn.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-bs-toggle" => "dropdown", type: "button"} Actions
|
||||
.dropdown-menu.dropdown-menu-xs{"aria-labelledby" => "comment-edit-button"}
|
||||
- if can? :edit, comment
|
||||
= link_to edit_comment_path(comment), class: 'dropdown-item' do
|
||||
|
||||
@@ -8,33 +8,27 @@
|
||||
.col-2.offset-md-2
|
||||
%h1= @box
|
||||
.col-8
|
||||
= button_tag(type: 'submit', class: 'btn btn-default') do
|
||||
= icon 'fas', 'trash-alt'
|
||||
= 'Delete Selected'
|
||||
|
||||
.row
|
||||
.col-md-2.py-4
|
||||
- @boxes.each do |box_name, counts|
|
||||
= link_to conversations_path(box: box_name), class: "nav-link list-group-item d-flex justify-content-between #{box_name == @box ? 'active' : ''} #{box_name}" do
|
||||
%span
|
||||
= box_name
|
||||
- if counts['unread'].positive?
|
||||
%span.badge.badge-info=counts['unread']
|
||||
- else
|
||||
%span
|
||||
%span
|
||||
= icon 'fas', box_name
|
||||
= box_name
|
||||
|
||||
.col-md-10
|
||||
.list-group
|
||||
- @conversations.each do |conversation|
|
||||
.list-group-item
|
||||
.row
|
||||
.col-md-1
|
||||
.col-1
|
||||
- if conversation.receipts_for(current_member).last.is_unread?
|
||||
%h1= icon 'far', 'envelope'
|
||||
- else
|
||||
%h1.text-muted= icon 'far', 'envelope-open'
|
||||
.col-md-10
|
||||
.col-9
|
||||
.text-right.float-right
|
||||
- conversation.recipients.each do |member|
|
||||
- if member != current_member
|
||||
@@ -50,11 +44,15 @@
|
||||
#{time_ago_in_words conversation.messages.last.created_at} ago
|
||||
%span.text-muted= conversation.messages.last.created_at
|
||||
= truncate(strip_tags(conversation.messages.last.body), length: 150, separator: ' ', omission: '... ')
|
||||
.col-md-1
|
||||
.col-1
|
||||
- if @box == 'trash'
|
||||
= link_to conversation_path(conversation, box: @box), method: :put, class: 'restore', title: "Restore" do
|
||||
= icon 'fas', 'trash-restore'
|
||||
- else
|
||||
= check_box_tag 'conversation_ids[]', conversation.id, false, class: 'selectable', "aria-label": "Select for deletion"
|
||||
.offset-9.col-3
|
||||
= button_tag(type: 'submit', class: 'btn btn-default') do
|
||||
= icon 'fas', 'trash-alt'
|
||||
= 'Delete'
|
||||
- unless @conversations.empty?
|
||||
= will_paginate @conversations
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
- crop.alternate_names.each do |an|
|
||||
- if can? :edit, an
|
||||
.dropdown.planting-actions
|
||||
%a#crop-actions-altnames.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-toggle" => "dropdown", :type => "button", :href => '#'}
|
||||
%a#crop-actions-altnames.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-bs-toggle" => "dropdown", :type => "button", :href => '#'}
|
||||
= an.name
|
||||
.dropdown-menu.dropdown-menu-xs{"aria-labelledby" => "crop-actions-altnames"}
|
||||
- if can? :edit, an
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
%h2 Basic information
|
||||
|
||||
.form-group#new_crop
|
||||
= f.text_field :name
|
||||
= f.text_field :name, required: true
|
||||
%span.help-block
|
||||
The common name for the crop, in English (required).
|
||||
- if can? :wrangle, @crop
|
||||
@@ -43,7 +43,7 @@
|
||||
|
||||
- unless @crop.approved?
|
||||
= link_to 'Search wikipedia', "https://en.wikipedia.org/w/index.php?search=#{@crop.name}", target: '_blank'
|
||||
= f.text_field :en_wikipedia_url, id: "en_wikipedia_url", label: 'Wikipedia URL'
|
||||
= f.url_field :en_wikipedia_url, id: "en_wikipedia_url", label: 'Wikipedia URL'
|
||||
%span.help-block
|
||||
Link to the crop's page on the English language Wikipedia (required).
|
||||
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
alt: "Image of #{crop.name}", class: 'image-responsive crop-image'),
|
||||
crop.name,
|
||||
rel: "popover",
|
||||
'data-trigger': 'hover',
|
||||
'data-title': crop.name,
|
||||
'data-content': render(partial: 'crops/popover', locals: { crop: crop }),
|
||||
'data-html': true
|
||||
'data-bs-toggle': 'popover',
|
||||
'data-bs-trigger': 'hover',
|
||||
'data-bs-title': crop.name,
|
||||
'data-bs-content': render(partial: 'crops/popover', locals: { crop: crop }),
|
||||
'data-bs-html': true
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
- crop.scientific_names.each do |sn|
|
||||
- if can? :edit, sn
|
||||
.dropdown.planting-actions
|
||||
%a#planting-actions-scinames.dropdown-toggle.card-link{"aria-expanded" => "false", "aria-haspopup" => "true", "data-toggle" => "dropdown", :type => "button", :href => '#'}= sn.name
|
||||
%a#planting-actions-scinames.dropdown-toggle.card-link{"aria-expanded" => "false", "aria-haspopup" => "true", "data-bs-toggle" => "dropdown", :type => "button", :href => '#'}= sn.name
|
||||
.dropdown-menu.dropdown-menu-xs{"aria-labelledby" => "planting-actions-button"}
|
||||
= link_to edit_scientific_name_path(sn), class: 'dropdown-item' do
|
||||
= edit_icon
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
You are a
|
||||
%strong CROP WRANGLER
|
||||
.dropdown.crop-actions
|
||||
%a#crop-actions-button.btn.btn-info.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-toggle" => "dropdown", :type => "button", href: '#'} Actions
|
||||
%a#crop-actions-button.btn.btn-info.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-bs-toggle" => "dropdown", :type => "button", href: '#'} Actions
|
||||
.dropdown-menu.dropdown-menu-xs{"aria-labelledby" => "crop-actions-button"}
|
||||
= link_to edit_crop_path(crop), class: 'dropdown-item' do
|
||||
= edit_icon
|
||||
|
||||
@@ -9,15 +9,6 @@
|
||||
- content_for :breadcrumbs do
|
||||
%li.breadcrumb-item.active= link_to 'Crops', crops_path
|
||||
|
||||
= bootstrap_form_tag(url: crops_path, method: :get, layout: :inline) do |f|
|
||||
.input-group
|
||||
= f.select "sort",
|
||||
options_for_select({ "popularity": 'popular',
|
||||
"alphabetically": 'alpha' },
|
||||
@sort || 'popular'),
|
||||
label: 'Sort by'
|
||||
= f.submit "Show"
|
||||
|
||||
%section.crops
|
||||
%h2= t('.title')
|
||||
= will_paginate @crops
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :delete, class: 'form-horizontal' }) do |f|
|
||||
= form_for(resource, as: resource_name,
|
||||
url: registration_path(resource_name) + '#delete',
|
||||
html: { method: :delete, class: 'form-horizontal' }) do |f|
|
||||
%br/
|
||||
= render 'devise/shared/error_messages', resource: resource
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
= form_for(resource, as: resource_name,
|
||||
url: registration_path(resource_name),
|
||||
url: registration_path(resource_name) + '#apps',
|
||||
html: { method: :put, class: 'form-horizontal' }) do |_f|
|
||||
%br/
|
||||
= render 'devise/shared/error_messages', resource: resource
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
= form_for(resource, as: resource_name,
|
||||
url: registration_path(resource_name),
|
||||
url: registration_path(resource_name) + '#email',
|
||||
html: { method: :put, class: 'form-horizontal' }) do |f|
|
||||
%br/
|
||||
= render 'devise/shared/error_messages', resource: resource
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
= form_for(resource, as: resource_name,
|
||||
url: registration_path(resource_name),
|
||||
url: registration_path(resource_name) + '#password',
|
||||
html: { method: :put, class: 'form-horizontal' }) do |f|
|
||||
%br/
|
||||
= render 'devise/shared/error_messages', resource: resource
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
= form_for(resource, as: resource_name,
|
||||
url: registration_path(resource_name),
|
||||
url: registration_path(resource_name) + '#profile',
|
||||
html: { method: :put, class: 'form-horizontal' }) do |f|
|
||||
%br/
|
||||
= render 'devise/shared/error_messages', resource: resource
|
||||
|
||||
@@ -10,15 +10,15 @@
|
||||
.card
|
||||
%ul#myTab.nav.nav-tabs{role: "tablist"}
|
||||
%li.nav-item
|
||||
%a#profile-tab.nav-link.active{"aria-controls" => "profile", "aria-selected" => "true", "data-toggle" => "tab", href: "#profile", role: "tab"} Profile
|
||||
%a#profile-tab.nav-link.active{"aria-controls" => "profile", "aria-selected" => "true", "data-bs-toggle" => "tab", href: "#profile", role: "tab"} Profile
|
||||
%li.nav-item
|
||||
%a#email-tab.nav-link{"aria-controls" => "email", "aria-selected" => "false", "data-toggle" => "tab", href: "#email", role: "tab"} Email
|
||||
%a#email-tab.nav-link{"aria-controls" => "email", "aria-selected" => "false", "data-bs-toggle" => "tab", href: "#email", role: "tab"} Email
|
||||
%li.nav-item
|
||||
%a#apps-tab.nav-link{"aria-controls" => "apps", "aria-selected" => "false", "data-toggle" => "tab", href: "#apps", role: "tab"} Apps
|
||||
%a#apps-tab.nav-link{"aria-controls" => "apps", "aria-selected" => "false", "data-bs-toggle" => "tab", href: "#apps", role: "tab"} Apps
|
||||
%li.nav-item
|
||||
%a#password-tab.nav-link{"aria-controls" => "password", "aria-selected" => "false", "data-toggle" => "tab", href: "#password", role: "tab"} Password
|
||||
%a#password-tab.nav-link{"aria-controls" => "password", "aria-selected" => "false", "data-bs-toggle" => "tab", href: "#password", role: "tab"} Password
|
||||
%li.nav-item
|
||||
%a#delete-tab.nav-link.text-danger{"aria-controls" => "delete", "aria-selected" => "false", "data-toggle" => "tab", href: "#delete", role: "tab"} Delete Account
|
||||
%a#delete-tab.nav-link.text-danger{"aria-controls" => "delete", "aria-selected" => "false", "data-bs-toggle" => "tab", href: "#delete", role: "tab"} Delete Account
|
||||
.card-body
|
||||
#myTabContent.tab-content
|
||||
#profile.tab-pane.fade.show.active{"aria-labelledby" => "profile-tab", role: "tabpanel"}
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
- @forum.errors.full_messages.each do |msg|
|
||||
%li= msg
|
||||
|
||||
= f.text_field :name
|
||||
= f.text_area :description, rows: 6
|
||||
= f.select(:owner_id, Member.all.order(:login_name).pluck(:login_name, :id))
|
||||
= f.text_field :name, required: true
|
||||
= f.text_area :description, rows: 6, required: true
|
||||
= f.select(:owner_id, Member.all.order(:login_name).pluck(:login_name, :id), required: true)
|
||||
.card-footer
|
||||
.text-right= f.submit 'Save'
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
- if can?(:edit, garden)
|
||||
.dropdown.garden-actions
|
||||
%a#garden-actions-button.btn.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-toggle" => "dropdown", type: "button", href: '#'} Actions
|
||||
%a#garden-actions-button.btn.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-bs-toggle" => "dropdown", type: "button", href: '#'} Actions
|
||||
.dropdown-menu.dropdown-menu-xs{"aria-labelledby" => "garden-actions-button"}
|
||||
- if can?(:edit, garden)
|
||||
= garden_plant_something_button(garden, classes: 'dropdown-item') if garden.active
|
||||
- if garden.active
|
||||
= garden_plant_something_button(garden, classes: 'dropdown-item')
|
||||
= garden_plan_something_button(garden, classes: 'dropdown-item')
|
||||
= garden_mark_inactive_button(garden, classes: 'dropdown-item')
|
||||
- else
|
||||
= garden_mark_active_button(garden, classes: 'dropdown-item')
|
||||
|
||||
37
app/views/gardens/_card.html.haml
Normal file
37
app/views/gardens/_card.html.haml
Normal file
@@ -0,0 +1,37 @@
|
||||
.card
|
||||
.card-header
|
||||
.row
|
||||
.col-12.col-md-3
|
||||
%h2= link_to garden.name, garden, name: "garden-#{garden.id}"
|
||||
.row
|
||||
.col-md-3
|
||||
- if @owner.blank?
|
||||
owner:
|
||||
= render 'members/tiny', member: garden.owner
|
||||
|
||||
|
||||
= image_tag garden_image_path(garden), alt: garden.name, class: 'img-card'
|
||||
|
||||
.col-md-9
|
||||
%section
|
||||
= render 'gardens/actions', garden: garden
|
||||
|
||||
- active_plantings = garden.plantings.active
|
||||
|
||||
%section
|
||||
- if active_plantings.perennial.any?
|
||||
%strong Perennials:
|
||||
- active_plantings.perennial.each do |planting|
|
||||
= link_to planting do
|
||||
= crop_icon planting.crop
|
||||
= planting.crop
|
||||
- else
|
||||
%p No perennial plantings
|
||||
|
||||
%hr
|
||||
|
||||
%section
|
||||
- if active_plantings.annual.any?
|
||||
= render 'plantings/progress_list', plantings: garden.plantings.active.annual
|
||||
- else
|
||||
%p No annual plantings
|
||||
@@ -17,4 +17,4 @@
|
||||
.col-lg-2.col-sm-4.col-xs-6
|
||||
= render "plantings/thumbnail", planting: planting
|
||||
- else
|
||||
no plantings
|
||||
no plantings
|
||||
@@ -42,43 +42,7 @@
|
||||
- else
|
||||
= link_to garden.name, gardens_path(anchor: "garden-#{garden.id}")
|
||||
- @gardens.each do |garden|
|
||||
.card
|
||||
.card-header
|
||||
.row
|
||||
.col-12.col-md-3
|
||||
%h2= link_to garden.name, garden, name: "garden-#{garden.id}"
|
||||
.row
|
||||
.col-md-3
|
||||
- if @owner.blank?
|
||||
owner:
|
||||
= render 'members/tiny', member: garden.owner
|
||||
|
||||
|
||||
= image_tag garden_image_path(garden), alt: garden.name, class: 'img-card'
|
||||
|
||||
.col-md-9
|
||||
%section
|
||||
= render 'gardens/actions', garden: garden
|
||||
|
||||
- active_plantings = garden.plantings.active
|
||||
|
||||
%section
|
||||
- if active_plantings.perennial.any?
|
||||
%strong Perennials:
|
||||
- active_plantings.perennial.each do |planting|
|
||||
= link_to planting do
|
||||
= crop_icon planting.crop
|
||||
= planting.crop
|
||||
- else
|
||||
%p No perennial plantings
|
||||
|
||||
%hr
|
||||
|
||||
%section
|
||||
- if active_plantings.annual.any?
|
||||
= render 'plantings/progress_list', plantings: garden.plantings.active.annual
|
||||
- else
|
||||
%p No annual plantings
|
||||
= render 'gardens/card', garden: garden
|
||||
|
||||
.row
|
||||
.col-12= page_entries_info @gardens
|
||||
|
||||
@@ -56,10 +56,21 @@
|
||||
.col-md-12
|
||||
%p Nothing is currently planted here.
|
||||
|
||||
%section.companions
|
||||
%h2 Suggestioned companions
|
||||
- @suggested_companions.each do |companion|
|
||||
= render 'crops/tiny', crop: companion
|
||||
%section
|
||||
%h2 Current activities in garden
|
||||
.index-cards
|
||||
- if @current_activities&.size&.positive?
|
||||
- @current_activities.each do |activity|
|
||||
= render "activities/card", activity: activity
|
||||
- else
|
||||
.col-md-12
|
||||
%p Nothing is currently planned here.
|
||||
|
||||
- if @suggested_companions.any?
|
||||
%section.companions
|
||||
%h2 Suggestioned companions
|
||||
- @suggested_companions.each do |companion|
|
||||
= render 'crops/tiny', crop: companion
|
||||
|
||||
%section= render 'previously'
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
- if can?(:edit, harvest)
|
||||
.dropdown.harvest-actions
|
||||
%a#harvest-actions-button.btn.btn-info.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-toggle" => "dropdown", type: "button", href: '#'} Actions
|
||||
%a#harvest-actions-button.btn.btn-info.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-bs-toggle" => "dropdown", type: "button", href: '#'} Actions
|
||||
.dropdown-menu.dropdown-menu-xs{"aria-labelledby" => "harvest-actions-button"}
|
||||
= harvest_edit_button(harvest, classes: 'dropdown-item')
|
||||
= add_photo_button(harvest, classes: 'dropdown-item')
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
class: 'image-responsive crop-image'),
|
||||
harvest,
|
||||
rel: "popover",
|
||||
'data-trigger': 'hover',
|
||||
'data-title': harvest.to_s,
|
||||
'data-content': render('harvests/popover', harvest: harvest),
|
||||
'data-html': true
|
||||
'data-bs-toggle': 'popover',
|
||||
'data-bs-trigger': 'hover',
|
||||
'data-bs-title': harvest.to_s,
|
||||
'data-bs-content': render('harvests/popover', harvest: harvest),
|
||||
'data-bs-html': true
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
.modal-content
|
||||
.modal-header.text-center
|
||||
%h4.modal-title.w-100.font-weight-bold Record #{harvest.crop.name} harvest
|
||||
%button.close{"aria-label" => "Close", "data-dismiss" => "modal", type: "button"}
|
||||
%button.close{"aria-label" => "Close", "data-bs-dismiss" => "modal", type: "button"}
|
||||
%span{"aria-hidden" => "true"} ×
|
||||
.modal-body
|
||||
%p Select which plant part you have havested
|
||||
@@ -26,6 +26,6 @@
|
||||
= plant_part_icon(plant_part.name)
|
||||
= plant_part
|
||||
|
||||
%a.btn#modalHarvestButton{"data-target" => "#modelHarvestForm", "data-toggle" => "modal", href: ""}
|
||||
%a.btn#modalHarvestButton{"data-bs-target" => "#modelHarvestForm", "data-bs-toggle" => "modal", href: ""}
|
||||
= harvest_icon
|
||||
Record harvest
|
||||
|
||||
@@ -28,6 +28,8 @@
|
||||
%section
|
||||
%h2= title('harvests', @owner, @crop, @planting)
|
||||
= will_paginate @harvests
|
||||
- if @harvests.blank?
|
||||
%p No harvests recorded yet
|
||||
.index-cards
|
||||
- @harvests.each do |h|
|
||||
= render 'harvests/card', harvest: h
|
||||
|
||||
10
app/views/home/_activities.html.haml
Normal file
10
app/views/home/_activities.html.haml
Normal file
@@ -0,0 +1,10 @@
|
||||
%h2= t('.recent_activities')
|
||||
- Activity.homepage_records(6).each do |activity|
|
||||
- cache activity do
|
||||
= link_to activity_path(slug: activity.slug), class: 'list-group-item list-group-item-action flex-column align-items-start' do
|
||||
.d-flex.w-100.justify-content-between.homepage--list-item
|
||||
%div
|
||||
%h4= activity.name
|
||||
%span.badge.badge-success= activity.category
|
||||
%small.text-muted
|
||||
by #{activity.owner_login_name}
|
||||
@@ -8,9 +8,14 @@
|
||||
|
||||
%p= render 'stats', cached: true
|
||||
.col
|
||||
%p
|
||||
- if current_member.plantings.active.any?
|
||||
= link_to member_path(current_member, anchor: "#content"), class: 'btn btn-dark' do
|
||||
= planting_icon
|
||||
Track my plantings
|
||||
%p
|
||||
= link_to member_gardens_path(current_member), class: 'btn btn-dark' do
|
||||
= image_icon 'gardens'
|
||||
= garden_icon
|
||||
Show me my garden
|
||||
- else
|
||||
.hidden-xs
|
||||
@@ -27,16 +32,21 @@
|
||||
%h2= t('.recently_added')
|
||||
%p.card-body
|
||||
!= CropSearchService.recent(30).map { |c| link_to(c['name'], crop_path(slug: c['slug'])) }.join(", ")
|
||||
.col-xl-3.col
|
||||
.col-xl-4.col
|
||||
%section.plantings
|
||||
= cute_icon
|
||||
=render 'plantings'
|
||||
%p.text-right= link_to "#{t('home.plantings.view_all')} »", plantings_path, class: 'btn btn-block'
|
||||
.col-xl-3.col
|
||||
.col-xl-4.col
|
||||
%section.harvests
|
||||
= cute_icon
|
||||
= render 'harvests'
|
||||
%p.text-right= link_to "#{t('home.harvests.view_all')} »", harvests_path, class: 'btn btn-block'
|
||||
.col-xl-4.col
|
||||
%section.activities
|
||||
= cute_icon
|
||||
= render 'activities'
|
||||
%p.text-right= link_to "#{t('home.activities.view_all')} »", activities_path, class: 'btn btn-block'
|
||||
.col-12.col-md-6
|
||||
%section.seeds
|
||||
= cute_icon
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
%nav.navbar.navbar-expand-lg.navbar-dark.bg-dark.justify-content-between
|
||||
%nav.navbar.navbar-expand-lg.navbar-dark.bg-dark.justify-content-between.sticky-top
|
||||
.nav
|
||||
%a.navbar-brand{ href: root_path }
|
||||
= image_tag("pear.png", class: 'logo', alt: 'Growstuff brand logo (drawing of a pear)')
|
||||
@@ -6,6 +6,6 @@
|
||||
%span.site-name Growstuff
|
||||
.nav= render 'crops/search_bar'
|
||||
.nav
|
||||
%button.navbar-toggler{ "aria-controls" => "navbarSupportedContent", "aria-expanded" => "false", "aria-label" => "Toggle navigation", "data-target" => "#navbarSupportedContent", "data-toggle" => "collapse", type: "button" }
|
||||
%button.navbar-toggler{ "aria-controls" => "navbarSupportedContent", "aria-expanded" => "false", "aria-label" => "Toggle navigation", "data-bs-target" => "#navbarSupportedContent", "data-bs-toggle" => "collapse", type: "button" }
|
||||
%i.fas.fa-ellipsis-v.navbar-toggler-icon
|
||||
= render 'layouts/menu'
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
= link_to member_gardens_path(current_member), class: 'nav-link text-white', title: "My gardens" do
|
||||
= image_icon 'gardens'
|
||||
%li.nav-item.dropdown
|
||||
%a.nav-link.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-toggle" => "dropdown", href: "#", role: "button"}
|
||||
%a.nav-link.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-bs-toggle" => "dropdown", href: "#", role: "button"}
|
||||
= image_tag "icons/gardener.svg", class: 'img img-icon', alt: t('.record'), aria: { hidden: "true" }
|
||||
= t('.record')
|
||||
.dropdown-menu
|
||||
@@ -18,6 +18,9 @@
|
||||
= link_to new_harvest_path, class: 'dropdown-item' do
|
||||
= image_icon('harvest-add')
|
||||
= t('buttons.new_harvest')
|
||||
= link_to new_activity_path, class: 'dropdown-item' do
|
||||
= image_icon('activity-add')
|
||||
= t('buttons.new_activity')
|
||||
= link_to new_seed_path, class: 'dropdown-item' do
|
||||
= image_icon('seed-add')
|
||||
= t('buttons.new_seeds')
|
||||
@@ -27,7 +30,7 @@
|
||||
|
||||
- cache("everyone-menu", expires_in: 1.week) do
|
||||
%li.nav-item.dropdown
|
||||
%a.nav-link.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-toggle" => "dropdown", href: "#", role: "button"}= t('.crops')
|
||||
%a.nav-link.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-bs-toggle" => "dropdown", href: "#", role: "button"}= t('.crops')
|
||||
.dropdown-menu
|
||||
= link_to crops_path, class: 'dropdown-item' do
|
||||
= t('.browse_crops')
|
||||
@@ -41,7 +44,7 @@
|
||||
= harvest_icon
|
||||
= t('.harvests')
|
||||
%li.nav-item.dropdown
|
||||
%a.nav-link.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-toggle" => "dropdown", href: "#", role: "button"}= t('.community')
|
||||
%a.nav-link.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-bs-toggle" => "dropdown", href: "#", role: "button"}= t('.community')
|
||||
.dropdown-menu{"aria-labelledby" => "navbarDropdown"}
|
||||
= link_to t('.community_map'), places_path, class: 'dropdown-item'
|
||||
= link_to t('.browse_members'), members_path, class: 'dropdown-item'
|
||||
@@ -51,7 +54,7 @@
|
||||
- if member_signed_in?
|
||||
- if current_member.role?(:crop_wrangler) || current_member.role?(:admin)
|
||||
%li.nav-item.dropdown
|
||||
%a.nav-link.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-toggle" => "dropdown", href: "#", role: "button"}= t('.admin')
|
||||
%a.nav-link.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-bs-toggle" => "dropdown", href: "#", role: "button"}= t('.admin')
|
||||
.dropdown-menu{"aria-labelledby" => "navbarDropdown"}
|
||||
- if current_member.role?(:crop_wrangler)
|
||||
= link_to t('.crop_wrangling'), wrangle_crops_path, class: 'dropdown-item'
|
||||
@@ -59,7 +62,7 @@
|
||||
= link_to t('.admin'), admin_path, class: 'dropdown-item'
|
||||
|
||||
%li.nav-item.dropdown
|
||||
%a.nav-link.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-toggle" => "dropdown", href: "#", role: "button"}
|
||||
%a.nav-link.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-bs-toggle" => "dropdown", href: "#", role: "button"}
|
||||
= image_tag(avatar_uri(current_member, 50), alt: 'Avatar of current member', height: 25, width: 25, aria: { hidden: "true" })
|
||||
= current_member.login_name
|
||||
- if current_member.unread_count.positive?
|
||||
@@ -67,6 +70,8 @@
|
||||
.dropdown-menu{"aria-labelledby" => "navbarDropdown"}
|
||||
= link_to member_path(current_member), class: 'dropdown-item' do
|
||||
= t('.profile')
|
||||
= link_to member_activities_path(current_member), class: 'dropdown-item' do
|
||||
= t('.activities')
|
||||
= link_to member_gardens_path(current_member), class: 'dropdown-item' do
|
||||
= t('.gardens')
|
||||
= link_to member_plantings_path(current_member), class: 'dropdown-item' do
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
%html{ lang: "en", prefix: "og: https://ogp.me/ns#" }
|
||||
= yield :scripts
|
||||
= render "layouts/head"
|
||||
%body
|
||||
%body.d-flex.flex-column.vh-100
|
||||
= query_diet_widget if Rails.env.development?
|
||||
.sr-only= link_to t(".skip"), "#skipnav"
|
||||
= render "layouts/header"
|
||||
@@ -25,7 +25,7 @@
|
||||
= render "shared/flash_messages", flash: flash
|
||||
%main= yield
|
||||
|
||||
%footer.page-footer.font-small.bg-dark.pt-4= render "layouts/footer"
|
||||
%footer.page-footer.font-small.bg-dark.pt-4.mt-auto= render "layouts/footer"
|
||||
/
|
||||
Javascripts
|
||||
\==================================================
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
.modal-dialog
|
||||
.modal-content
|
||||
.modal-header
|
||||
%button.close{"data-dismiss" => "modal", type: "button"}
|
||||
%button.close{"data-bs-dismiss" => "modal", type: "button"}
|
||||
%span{"aria-hidden" => "true"} ×
|
||||
%span.sr-only Close
|
||||
%h4#mainModalLabel.modal-title
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
%h2 All about #{member.login_name}
|
||||
%p
|
||||
%small
|
||||
%a{href: "#content"}
|
||||
Skip to main content
|
||||
- if member.bio.blank?
|
||||
- if can? :edit, member
|
||||
= link_to "Add a bio to complete your profile.", edit_member_path(member)
|
||||
= link_to "Add a bio to complete your profile.", edit_member_registration_path
|
||||
- else
|
||||
#{member.login_name} hasn't written a bio yet.
|
||||
- else
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
- if @harvesting.size.positive?
|
||||
%section.harvests
|
||||
%h2 Ready to harvest
|
||||
.index-cards
|
||||
- @harvesting.each do |planting|
|
||||
= render 'plantings/thumbnail', planting: planting
|
||||
|
||||
- if @harvests.any?
|
||||
%section.havests
|
||||
%h2 Recent Harvests
|
||||
.index-cards
|
||||
- @harvests.each do |harvest|
|
||||
= render 'harvests/thumbnail', harvest: harvest
|
||||
|
||||
- if @others.size.positive?
|
||||
%section.planting-progress
|
||||
%h2 Progress report
|
||||
%p Still growing and not ready for harvesting.
|
||||
.list-group
|
||||
- @others.each do |planting|
|
||||
.list-group-item
|
||||
%span= render 'plantings/tiny', planting: planting
|
||||
%span= render 'plantings/progress', planting: planting
|
||||
- if @late.size.positive?
|
||||
%section.late
|
||||
%h2 Late
|
||||
%p
|
||||
These plantings are at the end of their lifecycle.
|
||||
- if member_signed_in? && @member == current_member
|
||||
%strong When you have removed the planting from your garden, mark the planting as finished in Growstuff.
|
||||
.index-cards
|
||||
- @late.each do |planting|
|
||||
= render 'plantings/thumbnail', planting: planting
|
||||
- if @super_late.any?
|
||||
%section.superlate
|
||||
%h2 Super late
|
||||
%p
|
||||
We suspect the following plantings finished long ago and no longer need tracking.
|
||||
- if member_signed_in? && current_member == @member
|
||||
%strong You can mark these plantings as finished to stop tracking.
|
||||
%ul
|
||||
- @super_late.each do |planting|
|
||||
%li
|
||||
= link_to planting.crop_name, planting_url(slug: planting.slug)
|
||||
planted on #{planting.planted_at.to_date}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
- if member.location.present?
|
||||
= link_to place_path(member.location) do
|
||||
%span.badge.badge-location
|
||||
%span.badge.badge-location{ title: member.location }
|
||||
= icon 'fas', 'map-marker'
|
||||
= truncate(member.location, length: 15, separator: ' ', omission: '... ')
|
||||
- else
|
||||
|
||||
@@ -1,40 +1,33 @@
|
||||
.card-body
|
||||
%h3 Activity
|
||||
%ul.list-group.list-group-flush
|
||||
%li.list-group-item
|
||||
%h3
|
||||
Stats
|
||||
.label.d-md-none{type: "button", :data => { :bs_toggle => "collapse", :bs_target => "#stats-collapse"}}
|
||||
%a
|
||||
Show/Hide
|
||||
|
||||
.collapse.d-md-block#stats-collapse
|
||||
%ul.list-group.list-group-flush
|
||||
- if member.gardens.present?
|
||||
= link_to localize_plural(member.gardens, Garden), member_gardens_path(member)
|
||||
- else
|
||||
0 gardens
|
||||
%li.list-group-item
|
||||
%li.list-group-item
|
||||
= link_to localize_plural(member.gardens, Garden), member_gardens_path(member)
|
||||
- if member.plantings.present?
|
||||
= link_to localize_plural(member.plantings, Planting), member_plantings_path(member)
|
||||
- else
|
||||
0 plantings
|
||||
%li.list-group-item
|
||||
%li.list-group-item
|
||||
= link_to localize_plural(member.plantings, Planting), member_plantings_path(member)
|
||||
- if member.harvests.present?
|
||||
= link_to localize_plural(member.harvests, Harvest), member_harvests_path(member)
|
||||
- else
|
||||
0 harvests
|
||||
%li.list-group-item
|
||||
%li.list-group-item
|
||||
= link_to localize_plural(member.harvests, Harvest), member_harvests_path(member)
|
||||
- if member.seeds.present?
|
||||
= link_to localize_plural(member.seeds, Seed), member_seeds_path(member)
|
||||
- else
|
||||
0 seeds
|
||||
%li.list-group-item
|
||||
%li.list-group-item
|
||||
= link_to localize_plural(member.seeds, Seed), member_seeds_path(member)
|
||||
- if member.posts.present?
|
||||
= link_to localize_plural(member.posts, Post), member_posts_path(member)
|
||||
- else
|
||||
0 posts
|
||||
|
||||
%li.list-group-item
|
||||
%li.list-group-item
|
||||
= link_to localize_plural(member.posts, Post), member_posts_path(member)
|
||||
- if member.activities.present?
|
||||
%li.list-group-item
|
||||
= link_to localize_plural(member.plantings, Activity), member_activities_path(member)
|
||||
- if member.followed.present?
|
||||
= link_to localize_plural(member.followed, Follow), member_follows_path(member)
|
||||
- else
|
||||
0 following
|
||||
|
||||
%li.list-group-item
|
||||
%li.list-group-item
|
||||
= link_to localize_plural(member.followed, Follow), member_follows_path(member)
|
||||
- if member.followers.present?
|
||||
= link_to pluralize(member.followers.size, "follower"), member_followers_path(member)
|
||||
- else
|
||||
0 followers
|
||||
%li.list-group-item
|
||||
= link_to pluralize(member.followers.size, "follower"), member_followers_path(member)
|
||||
|
||||
@@ -21,19 +21,21 @@
|
||||
.row
|
||||
.col= render "bio", member: @member
|
||||
.col= render "avatar", member: @member
|
||||
%p
|
||||
- @member.roles.each do |role|
|
||||
%span.badge.badge-info= role.name.titleize
|
||||
- if @member.roles.any?
|
||||
%p
|
||||
- @member.roles.each do |role|
|
||||
%span.badge.badge-info= role.name.titleize
|
||||
- if @member.location.present?
|
||||
%p.badge.badge-location
|
||||
%p.badge.badge-location{ title: @member.location }
|
||||
= icon 'fas', 'map-marker'
|
||||
= truncate(@member.location, length: 25, separator: ' ', omission: '... ')
|
||||
= truncate(@member.location, length: 15, separator: ' ', omission: '... ')
|
||||
%p
|
||||
%strong Member since
|
||||
= @member.created_at.to_fs(:date)
|
||||
%p
|
||||
%strong Last Login
|
||||
= @member.last_sign_in_at
|
||||
- if @member.last_sign_in_at
|
||||
%p
|
||||
%strong Last Login
|
||||
= @member.last_sign_in_at&.to_fs(:default)
|
||||
|
||||
- if can? :update, @member
|
||||
= link_to edit_member_registration_path, class: 'btn btn-block' do
|
||||
@@ -59,24 +61,71 @@
|
||||
= render "contact", member: @member, twitter_auth: @twitter_auth,
|
||||
flickr_auth: @flickr_auth
|
||||
|
||||
.col-md-10
|
||||
%section= render "map", member: @member
|
||||
= render 'members/full_summary', member: @member
|
||||
%section.activity
|
||||
%h2 Activity
|
||||
.list-group
|
||||
- @activity.each do |event|
|
||||
.list-group-item.list-group-item-action.flex-column.align-items-start{:href => "#!"}
|
||||
.d-flex.w-100.justify-content-between
|
||||
%h5
|
||||
= icon_for_model(event.event_type)
|
||||
= event_description(event)
|
||||
= render 'timeline/photos', photo: resolve_model(event) if event.event_type == 'photo'
|
||||
%small
|
||||
- if event.event_at.present?
|
||||
- if event.event_at.kind_of?(Date)
|
||||
#{distance_of_time_in_words(event.event_at, Time.zone.now.to_date)} ago
|
||||
- else
|
||||
#{time_ago_in_words(event.event_at)} ago
|
||||
- else
|
||||
unknown date
|
||||
.col-md-10#content
|
||||
.row
|
||||
%section.order-3.order-md-1.col-12= render "map", member: @member
|
||||
- if @harvesting.size.positive?
|
||||
%section.harvests.order-2.order-md-1
|
||||
%h2 Ready to harvest
|
||||
.index-cards
|
||||
- @harvesting.each do |planting|
|
||||
= render 'plantings/thumbnail', planting: planting
|
||||
|
||||
- if @others.size.positive?
|
||||
%section.planting-progress.order-2.order-md-1.col-12
|
||||
%h2 Progress report
|
||||
%p Still growing and not ready for harvesting.
|
||||
.list-group
|
||||
- @others.each do |planting|
|
||||
.list-group-item
|
||||
%span= render 'plantings/tiny', planting: planting
|
||||
%span= render 'plantings/progress', planting: planting
|
||||
- if @late.size.positive?
|
||||
%section.late.order-2.order-md-1.col-12
|
||||
%h2 Late
|
||||
%p
|
||||
These plantings are at the end of their lifecycle.
|
||||
- if member_signed_in? && @member == current_member
|
||||
%strong When you have removed the planting from your garden, mark the planting as finished in Growstuff.
|
||||
.index-cards
|
||||
- @late.each do |planting|
|
||||
= render 'plantings/thumbnail', planting: planting
|
||||
- if @super_late.any?
|
||||
%section.superlate.order-2.order-md-1.col-12
|
||||
%h2 Super late
|
||||
%p
|
||||
We suspect the following plantings finished long ago and no longer need tracking.
|
||||
- if member_signed_in? && current_member == @member
|
||||
%strong You can mark these plantings as finished to stop tracking.
|
||||
%ul
|
||||
- @super_late.each do |planting|
|
||||
%li
|
||||
= link_to planting.crop_name, planting_url(slug: planting.slug)
|
||||
planted on #{planting.planted_at.to_date}
|
||||
|
||||
- if @harvests.any?
|
||||
%section.havests.order-2.order-md-1.col-12
|
||||
%h2 Recent Harvests
|
||||
.index-cards
|
||||
- @harvests.each do |harvest|
|
||||
= render 'harvests/thumbnail', harvest: harvest
|
||||
|
||||
- if @activity.any?
|
||||
%section.activity.order-2.order-md-1.col-12
|
||||
%h2 Activity
|
||||
.list-group
|
||||
- @activity.each do |event|
|
||||
.list-group-item.list-group-item-action.flex-column.align-items-start{:href => "#!"}
|
||||
.d-flex.w-100.justify-content-between
|
||||
%h5.col-md-11.col-xs-10.text-truncate
|
||||
= icon_for_model(event.event_type)
|
||||
= event_description(event)
|
||||
= render 'timeline/photos', photo: resolve_model(event) if event.event_type == 'photo'
|
||||
%small.col-md-1.col-xs-2.text-right
|
||||
- if event.event_at.present?
|
||||
- if event.event_at.kind_of?(Date)
|
||||
#{distance_of_time_in_words(event.event_at, Time.zone.now.to_date)} ago
|
||||
- else
|
||||
#{time_ago_in_words(event.event_at)} ago
|
||||
- else
|
||||
unknown date
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
- if can?(:edit, @photo) && can?(:destroy, @photo)
|
||||
.dropdown.float-right.photo-actions
|
||||
%a#harvest-actions-button.btn.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-toggle" => "dropdown", type: "button", href: '#'} Actions
|
||||
%a#harvest-actions-button.btn.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-bs-toggle" => "dropdown", type: "button", href: '#'} Actions
|
||||
.dropdown-menu.dropdown-menu-xs{"aria-labelledby" => "harvest-actions-button"}
|
||||
= edit_button(edit_photo_path(@photo), classes: 'dropdown-item')
|
||||
.dropdown-divider
|
||||
|
||||
@@ -30,3 +30,9 @@
|
||||
= seed_icon
|
||||
= link_to t('photos.show.seed', seed: seed.to_s, owner: seed.owner.to_s), seed_path(seed)
|
||||
= render "association_delete_button", photo: @photo, type: 'seed', thing: seed
|
||||
|
||||
- @photo.crops.each do |crop|
|
||||
%li
|
||||
= crop_icon(crop)
|
||||
= link_to t('photos.show.crop', crop: crop.to_s), crop_path(crop)
|
||||
= render "association_delete_button", photo: @photo, type: 'crop', thing: crop
|
||||
@@ -1,10 +1,11 @@
|
||||
- if can?(:edit, planting)
|
||||
.dropdown.planting-actions
|
||||
%a#planting-actions-button.btn.btn-info.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-toggle" => "dropdown", type: "button", href: '#'} Actions
|
||||
%a#planting-actions-button.btn.btn-info.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-bs-toggle" => "dropdown", type: "button", href: '#'} Actions
|
||||
.dropdown-menu.dropdown-menu-xs{"aria-labelledby" => "planting-actions-button"}
|
||||
= planting_edit_button(planting, classes: 'dropdown-item')
|
||||
= add_photo_button(planting, classes: 'dropdown-item')
|
||||
- if planting.active
|
||||
= planting_plan_something_button(planting, classes: 'dropdown-item')
|
||||
= planting_finish_button(planting, classes: 'dropdown-item')
|
||||
= planting_harvest_button(planting, classes: 'dropdown-item')
|
||||
= planting_save_seeds_button(planting, classes: 'dropdown-item')
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
// Harvest times
|
||||
- unless planting.super_late?
|
||||
- if planting.harvest_time?
|
||||
%span.badge.badge-info.badge-harvest{'data-toggle': "tooltip", 'data-placement': "top", title: 'Planting is ready for harvesting now'}
|
||||
%span.badge.badge-info.badge-harvest{'data-bs-toggle': "tooltip", 'data-bs-placement': "top", title: 'Planting is ready for harvesting now'}
|
||||
= t('label.harvesting_now')
|
||||
- elsif planting.before_harvest_time?
|
||||
%span.badge.badge-info{'data-toggle': "tooltip", 'data-placement': "top", title: 'Predicted weeks until harvest'}
|
||||
%span.badge.badge-info{'data-bs-toggle': "tooltip", 'data-bs-placement': "top", title: 'Predicted weeks until harvest'}
|
||||
= t('label.weeks_until_harvest', number: in_weeks(days_from_now_to_first_harvest(planting)))
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
= link_to planting_path(slug: planting.slug) do
|
||||
.planting-quick-actions
|
||||
.dropdown
|
||||
%a.planting-menu.btn.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-toggle" => "dropdown", type: "button", href: '#'}
|
||||
%a.planting-menu.btn.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-bs-toggle" => "dropdown", type: "button", href: '#'}
|
||||
|
||||
.dropdown-menu{"aria-labelledby" => "planting-menu"}
|
||||
= link_to edit_planting_path(slug: planting.slug), class: 'dropdown-item' do
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user