mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-05-29 19:26:30 -04:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4857b13dfc |
2
.github/workflows/ci-features-admin.yml
vendored
2
.github/workflows/ci-features-admin.yml
vendored
@@ -38,7 +38,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout this repo
|
- name: Checkout this repo
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Configure sysctl limits
|
- name: Configure sysctl limits
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
2
.github/workflows/ci-features-comments.yml
vendored
2
.github/workflows/ci-features-comments.yml
vendored
@@ -38,7 +38,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout this repo
|
- name: Checkout this repo
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Configure sysctl limits
|
- name: Configure sysctl limits
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout this repo
|
- name: Checkout this repo
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Configure sysctl limits
|
- name: Configure sysctl limits
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
2
.github/workflows/ci-features-crops.yml
vendored
2
.github/workflows/ci-features-crops.yml
vendored
@@ -38,7 +38,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout this repo
|
- name: Checkout this repo
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Configure sysctl limits
|
- name: Configure sysctl limits
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
2
.github/workflows/ci-features-gardens.yml
vendored
2
.github/workflows/ci-features-gardens.yml
vendored
@@ -38,7 +38,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout this repo
|
- name: Checkout this repo
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Configure sysctl limits
|
- name: Configure sysctl limits
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
2
.github/workflows/ci-features-harvests.yml
vendored
2
.github/workflows/ci-features-harvests.yml
vendored
@@ -38,7 +38,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout this repo
|
- name: Checkout this repo
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Configure sysctl limits
|
- name: Configure sysctl limits
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
2
.github/workflows/ci-features-home.yml
vendored
2
.github/workflows/ci-features-home.yml
vendored
@@ -38,7 +38,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout this repo
|
- name: Checkout this repo
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Configure sysctl limits
|
- name: Configure sysctl limits
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
2
.github/workflows/ci-features-members.yml
vendored
2
.github/workflows/ci-features-members.yml
vendored
@@ -38,7 +38,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout this repo
|
- name: Checkout this repo
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Configure sysctl limits
|
- name: Configure sysctl limits
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
102
.github/workflows/ci-features-places.yml
vendored
102
.github/workflows/ci-features-places.yml
vendored
@@ -1,102 +0,0 @@
|
|||||||
name: CI Features - Admin
|
|
||||||
|
|
||||||
on: [pull_request]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
rspec:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
services:
|
|
||||||
db:
|
|
||||||
image: postgres
|
|
||||||
env:
|
|
||||||
##
|
|
||||||
# The Postgres service fails its docker health check unless you
|
|
||||||
# specify these environment variables
|
|
||||||
#
|
|
||||||
POSTGRES_USER: postgres
|
|
||||||
POSTGRES_PASSWORD: postgres
|
|
||||||
POSTGRES_DB: growstuff_test
|
|
||||||
ports: ['5432:5432']
|
|
||||||
options: >-
|
|
||||||
--health-cmd pg_isready
|
|
||||||
--health-interval 10s
|
|
||||||
--health-timeout 5s
|
|
||||||
--health-retries 5
|
|
||||||
env:
|
|
||||||
APP_DOMAIN_NAME: localhost:3000
|
|
||||||
APP_PROTOCOL: http
|
|
||||||
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
|
|
||||||
DATABASE_URL: postgres://postgres:postgres@localhost:5432/growstuff_test
|
|
||||||
DEVISE_SECRET_KEY: secret
|
|
||||||
ELASTIC_SEARCH_VERSION: "7.5.1-amd64"
|
|
||||||
GROWSTUFF_EMAIL: "noreply@test.growstuff.org"
|
|
||||||
GROWSTUFF_FLICKR_KEY: secretkey"
|
|
||||||
GROWSTUFF_FLICKR_SECRET: secretsecret
|
|
||||||
GROWSTUFF_SITE_NAME: "Growstuff (travis)"
|
|
||||||
RAILS_ENV: test
|
|
||||||
RAILS_SECRET_TOKEN: supersecret
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout this repo
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
|
|
||||||
- name: Configure sysctl limits
|
|
||||||
run: |
|
|
||||||
sudo swapoff -a
|
|
||||||
sudo sysctl -w vm.swappiness=1
|
|
||||||
sudo sysctl -w fs.file-max=262144
|
|
||||||
sudo sysctl -w vm.max_map_count=262144
|
|
||||||
|
|
||||||
- name: Start Elasticsearch
|
|
||||||
uses: elastic/elastic-github-actions/elasticsearch@master
|
|
||||||
with:
|
|
||||||
stack-version: 7.5.1
|
|
||||||
|
|
||||||
##
|
|
||||||
# Cache Yarn modules
|
|
||||||
#
|
|
||||||
# See https://github.com/actions/cache/blob/master/examples.md#node---yarn for details
|
|
||||||
#
|
|
||||||
- name: Get yarn cache directory path
|
|
||||||
id: yarn-cache-dir-path
|
|
||||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
|
||||||
- name: Setup yarn cache
|
|
||||||
uses: actions/cache@v4
|
|
||||||
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
|
|
||||||
with:
|
|
||||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
|
||||||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-yarn-
|
|
||||||
|
|
||||||
- name: Install required OS packages
|
|
||||||
run: |
|
|
||||||
sudo apt-get -y install libpq-dev google-chrome-stable
|
|
||||||
|
|
||||||
- name: Install NodeJS
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: '12'
|
|
||||||
|
|
||||||
- name: Install Ruby (version given by .ruby-version) and Bundler
|
|
||||||
uses: ruby/setup-ruby@v1
|
|
||||||
with:
|
|
||||||
bundler-cache: true
|
|
||||||
|
|
||||||
- name: Install required JS packages
|
|
||||||
run: yarn install
|
|
||||||
|
|
||||||
- name: install chrome
|
|
||||||
run: sudo apt-get install google-chrome-stable
|
|
||||||
|
|
||||||
- name: Prepare database for testing
|
|
||||||
run: bundle exec rails db:prepare
|
|
||||||
|
|
||||||
- name: precompile assets
|
|
||||||
run: bundle exec rails assets:precompile
|
|
||||||
|
|
||||||
- name: index into elastic search
|
|
||||||
run: bundle exec rails search:reindex
|
|
||||||
|
|
||||||
- name: Run rspec (places/)
|
|
||||||
run: bundle exec rspec spec/features/places/ -fd
|
|
||||||
2
.github/workflows/ci-features-plantings.yml
vendored
2
.github/workflows/ci-features-plantings.yml
vendored
@@ -38,7 +38,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout this repo
|
- name: Checkout this repo
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Configure sysctl limits
|
- name: Configure sysctl limits
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
102
.github/workflows/ci-features-posts.yml
vendored
102
.github/workflows/ci-features-posts.yml
vendored
@@ -1,102 +0,0 @@
|
|||||||
name: CI Features - Admin
|
|
||||||
|
|
||||||
on: [pull_request]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
rspec:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
services:
|
|
||||||
db:
|
|
||||||
image: postgres
|
|
||||||
env:
|
|
||||||
##
|
|
||||||
# The Postgres service fails its docker health check unless you
|
|
||||||
# specify these environment variables
|
|
||||||
#
|
|
||||||
POSTGRES_USER: postgres
|
|
||||||
POSTGRES_PASSWORD: postgres
|
|
||||||
POSTGRES_DB: growstuff_test
|
|
||||||
ports: ['5432:5432']
|
|
||||||
options: >-
|
|
||||||
--health-cmd pg_isready
|
|
||||||
--health-interval 10s
|
|
||||||
--health-timeout 5s
|
|
||||||
--health-retries 5
|
|
||||||
env:
|
|
||||||
APP_DOMAIN_NAME: localhost:3000
|
|
||||||
APP_PROTOCOL: http
|
|
||||||
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
|
|
||||||
DATABASE_URL: postgres://postgres:postgres@localhost:5432/growstuff_test
|
|
||||||
DEVISE_SECRET_KEY: secret
|
|
||||||
ELASTIC_SEARCH_VERSION: "7.5.1-amd64"
|
|
||||||
GROWSTUFF_EMAIL: "noreply@test.growstuff.org"
|
|
||||||
GROWSTUFF_FLICKR_KEY: secretkey"
|
|
||||||
GROWSTUFF_FLICKR_SECRET: secretsecret
|
|
||||||
GROWSTUFF_SITE_NAME: "Growstuff (travis)"
|
|
||||||
RAILS_ENV: test
|
|
||||||
RAILS_SECRET_TOKEN: supersecret
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout this repo
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
|
|
||||||
- name: Configure sysctl limits
|
|
||||||
run: |
|
|
||||||
sudo swapoff -a
|
|
||||||
sudo sysctl -w vm.swappiness=1
|
|
||||||
sudo sysctl -w fs.file-max=262144
|
|
||||||
sudo sysctl -w vm.max_map_count=262144
|
|
||||||
|
|
||||||
- name: Start Elasticsearch
|
|
||||||
uses: elastic/elastic-github-actions/elasticsearch@master
|
|
||||||
with:
|
|
||||||
stack-version: 7.5.1
|
|
||||||
|
|
||||||
##
|
|
||||||
# Cache Yarn modules
|
|
||||||
#
|
|
||||||
# See https://github.com/actions/cache/blob/master/examples.md#node---yarn for details
|
|
||||||
#
|
|
||||||
- name: Get yarn cache directory path
|
|
||||||
id: yarn-cache-dir-path
|
|
||||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
|
||||||
- name: Setup yarn cache
|
|
||||||
uses: actions/cache@v4
|
|
||||||
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
|
|
||||||
with:
|
|
||||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
|
||||||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-yarn-
|
|
||||||
|
|
||||||
- name: Install required OS packages
|
|
||||||
run: |
|
|
||||||
sudo apt-get -y install libpq-dev google-chrome-stable
|
|
||||||
|
|
||||||
- name: Install NodeJS
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: '12'
|
|
||||||
|
|
||||||
- name: Install Ruby (version given by .ruby-version) and Bundler
|
|
||||||
uses: ruby/setup-ruby@v1
|
|
||||||
with:
|
|
||||||
bundler-cache: true
|
|
||||||
|
|
||||||
- name: Install required JS packages
|
|
||||||
run: yarn install
|
|
||||||
|
|
||||||
- name: install chrome
|
|
||||||
run: sudo apt-get install google-chrome-stable
|
|
||||||
|
|
||||||
- name: Prepare database for testing
|
|
||||||
run: bundle exec rails db:prepare
|
|
||||||
|
|
||||||
- name: precompile assets
|
|
||||||
run: bundle exec rails assets:precompile
|
|
||||||
|
|
||||||
- name: index into elastic search
|
|
||||||
run: bundle exec rails search:reindex
|
|
||||||
|
|
||||||
- name: Run rspec (posts/)
|
|
||||||
run: bundle exec rspec spec/features/posts/ -fd
|
|
||||||
2
.github/workflows/ci-features-seeds.yml
vendored
2
.github/workflows/ci-features-seeds.yml
vendored
@@ -38,7 +38,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout this repo
|
- name: Checkout this repo
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Configure sysctl limits
|
- name: Configure sysctl limits
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
2
.github/workflows/ci-features-timeline.yml
vendored
2
.github/workflows/ci-features-timeline.yml
vendored
@@ -38,7 +38,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout this repo
|
- name: Checkout this repo
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Configure sysctl limits
|
- name: Configure sysctl limits
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
11
.github/workflows/ci-features.yml
vendored
11
.github/workflows/ci-features.yml
vendored
@@ -38,7 +38,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout this repo
|
- name: Checkout this repo
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Configure sysctl limits
|
- name: Configure sysctl limits
|
||||||
run: |
|
run: |
|
||||||
@@ -107,5 +107,14 @@ jobs:
|
|||||||
- name: Run rspec (photos/)
|
- name: Run rspec (photos/)
|
||||||
run: bundle exec rspec spec/features/photos/ -fd
|
run: bundle exec rspec spec/features/photos/ -fd
|
||||||
|
|
||||||
|
- name: Run rspec (places/)
|
||||||
|
run: bundle exec rspec spec/features/places/ -fd
|
||||||
|
|
||||||
|
- name: Run rspec (plantings/)
|
||||||
|
run: bundle exec rspec spec/features/plantings/ -fd
|
||||||
|
|
||||||
|
- name: Run rspec (posts/)
|
||||||
|
run: bundle exec rspec spec/features/posts/ -fd
|
||||||
|
|
||||||
- name: Run rspec (rss/)
|
- name: Run rspec (rss/)
|
||||||
run: bundle exec rspec spec/features/rss/ -fd
|
run: bundle exec rspec spec/features/rss/ -fd
|
||||||
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
@@ -6,7 +6,7 @@ jobs:
|
|||||||
contributors:
|
contributors:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v4
|
||||||
- name: Install ruby version specified in .ruby-version
|
- name: Install ruby version specified in .ruby-version
|
||||||
uses: ruby/setup-ruby@v1
|
uses: ruby/setup-ruby@v1
|
||||||
with:
|
with:
|
||||||
@@ -53,7 +53,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout this repo
|
- name: Checkout this repo
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Configure sysctl limits
|
- name: Configure sysctl limits
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
3.3.8
|
3.3.7
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ submit the change with your pull request.
|
|||||||
- Miles Gould / [pozorvlak](https://github.com/pozorvlak)
|
- Miles Gould / [pozorvlak](https://github.com/pozorvlak)
|
||||||
- Mackenzie Morgan / [maco](https://github.com/maco)
|
- Mackenzie Morgan / [maco](https://github.com/maco)
|
||||||
- Brenda Wallace / [br3nda](https://github.com/br3nda)
|
- Brenda Wallace / [br3nda](https://github.com/br3nda)
|
||||||
- Daniel O'Connor / [CloCkWeRX](https://github.com/CloCkWeRX)
|
|
||||||
|
|
||||||
## Contributors
|
## Contributors
|
||||||
|
|
||||||
@@ -69,6 +68,7 @@ submit the change with your pull request.
|
|||||||
- Jym Paul Carandang / [jacarandang](https://github.com/jacarandang)
|
- Jym Paul Carandang / [jacarandang](https://github.com/jacarandang)
|
||||||
- Anthony Atkinson / [sha1sum](https://github.com/sha1sum)
|
- Anthony Atkinson / [sha1sum](https://github.com/sha1sum)
|
||||||
- Terence Conquest / [twconquest](https://github.com/twconquest)
|
- Terence Conquest / [twconquest](https://github.com/twconquest)
|
||||||
|
- Daniel O'Connor / [CloCkWeRX](https://github.com/CloCkWeRX)
|
||||||
- DV Dasari / [dv2](https://github.com/dv2)
|
- DV Dasari / [dv2](https://github.com/dv2)
|
||||||
- Eric Tillberg / [Thrillberg](https://github.com/Thrillberg)
|
- Eric Tillberg / [Thrillberg](https://github.com/Thrillberg)
|
||||||
- Lucas Nogueira / [lucasnogueira](https://github.com/lucasnogueira)
|
- Lucas Nogueira / [lucasnogueira](https://github.com/lucasnogueira)
|
||||||
@@ -95,11 +95,10 @@ submit the change with your pull request.
|
|||||||
- Ítalo Pires / [italopires](https://github.com/italopires)
|
- Ítalo Pires / [italopires](https://github.com/italopires)
|
||||||
- Bennett Zink / [bennett-zink](https://github.com/bennett-zink)
|
- Bennett Zink / [bennett-zink](https://github.com/bennett-zink)
|
||||||
- Dominick Thornton / [domthor](https://github.com/domthor)
|
- Dominick Thornton / [domthor](https://github.com/domthor)
|
||||||
|
|
||||||
## Bots
|
## Bots
|
||||||
|
|
||||||
### Security and Dependency Updates
|
### Security and Dependency Updates
|
||||||
- `codefactor-io[bot]`
|
- `codefactor-io[bot]`
|
||||||
- DeppBot / [deppbot](https://github.com/deppbot)
|
- DeppBot / [deppbot](https://github.com/deppbot)
|
||||||
- `dependabot[bot]` [dependabot](https://github.com/dependabot-bot) / [dependabot-preview](https://github.com/apps/dependabot-preview)
|
- `dependabot[bot]` [dependabot](https://github.com/dependabot-bot) / [dependabot-preview](https://github.com/apps/dependabot-preview)
|
||||||
- [google-labs-jules[bot]](https://github.com/apps/google-labs-jules)
|
|
||||||
|
|||||||
10
Gemfile
10
Gemfile
@@ -91,9 +91,10 @@ gem 'bootstrap-datepicker-rails'
|
|||||||
# DRY-er easier bootstrap 4 forms
|
# DRY-er easier bootstrap 4 forms
|
||||||
gem "bootstrap_form", ">= 4.5.0"
|
gem "bootstrap_form", ">= 4.5.0"
|
||||||
|
|
||||||
# For connecting to other services (eg Flickr)
|
# For connecting to other services (eg Twitter)
|
||||||
gem 'omniauth', '~> 1.3'
|
gem 'omniauth', '~> 1.3'
|
||||||
gem 'omniauth-flickr', '>= 0.0.15'
|
gem 'omniauth-flickr', '>= 0.0.15'
|
||||||
|
gem 'omniauth-twitter'
|
||||||
|
|
||||||
# Pretty charts
|
# Pretty charts
|
||||||
gem "chartkick"
|
gem "chartkick"
|
||||||
@@ -174,7 +175,6 @@ group :development, :test do
|
|||||||
gem 'rubocop-rspec_rails'
|
gem 'rubocop-rspec_rails'
|
||||||
gem 'webrat' # provides HTML matchers for view tests
|
gem 'webrat' # provides HTML matchers for view tests
|
||||||
|
|
||||||
gem 'crowdin-cli' # for translations
|
|
||||||
gem 'dotenv-rails'
|
gem 'dotenv-rails'
|
||||||
|
|
||||||
# cli utils
|
# cli utils
|
||||||
@@ -192,14 +192,10 @@ group :test do
|
|||||||
gem 'selenium-webdriver'
|
gem 'selenium-webdriver'
|
||||||
gem 'timecop'
|
gem 'timecop'
|
||||||
gem 'vcr'
|
gem 'vcr'
|
||||||
gem "rspec-rebound"
|
|
||||||
gem "percy-capybara", "~> 5.0.0"
|
|
||||||
end
|
end
|
||||||
|
|
||||||
group :travis do
|
group :travis do
|
||||||
gem 'platform-api'
|
gem 'platform-api'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
gem "percy-capybara", "~> 5.0.0"
|
||||||
|
|
||||||
gem "i18n_data", "~> 1.1"
|
|
||||||
|
|||||||
247
Gemfile.lock
247
Gemfile.lock
@@ -33,29 +33,29 @@ GEM
|
|||||||
GEM
|
GEM
|
||||||
remote: https://rubygems.org/
|
remote: https://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
actioncable (7.2.2.2)
|
actioncable (7.2.2.1)
|
||||||
actionpack (= 7.2.2.2)
|
actionpack (= 7.2.2.1)
|
||||||
activesupport (= 7.2.2.2)
|
activesupport (= 7.2.2.1)
|
||||||
nio4r (~> 2.0)
|
nio4r (~> 2.0)
|
||||||
websocket-driver (>= 0.6.1)
|
websocket-driver (>= 0.6.1)
|
||||||
zeitwerk (~> 2.6)
|
zeitwerk (~> 2.6)
|
||||||
actionmailbox (7.2.2.2)
|
actionmailbox (7.2.2.1)
|
||||||
actionpack (= 7.2.2.2)
|
actionpack (= 7.2.2.1)
|
||||||
activejob (= 7.2.2.2)
|
activejob (= 7.2.2.1)
|
||||||
activerecord (= 7.2.2.2)
|
activerecord (= 7.2.2.1)
|
||||||
activestorage (= 7.2.2.2)
|
activestorage (= 7.2.2.1)
|
||||||
activesupport (= 7.2.2.2)
|
activesupport (= 7.2.2.1)
|
||||||
mail (>= 2.8.0)
|
mail (>= 2.8.0)
|
||||||
actionmailer (7.2.2.2)
|
actionmailer (7.2.2.1)
|
||||||
actionpack (= 7.2.2.2)
|
actionpack (= 7.2.2.1)
|
||||||
actionview (= 7.2.2.2)
|
actionview (= 7.2.2.1)
|
||||||
activejob (= 7.2.2.2)
|
activejob (= 7.2.2.1)
|
||||||
activesupport (= 7.2.2.2)
|
activesupport (= 7.2.2.1)
|
||||||
mail (>= 2.8.0)
|
mail (>= 2.8.0)
|
||||||
rails-dom-testing (~> 2.2)
|
rails-dom-testing (~> 2.2)
|
||||||
actionpack (7.2.2.2)
|
actionpack (7.2.2.1)
|
||||||
actionview (= 7.2.2.2)
|
actionview (= 7.2.2.1)
|
||||||
activesupport (= 7.2.2.2)
|
activesupport (= 7.2.2.1)
|
||||||
nokogiri (>= 1.8.5)
|
nokogiri (>= 1.8.5)
|
||||||
racc
|
racc
|
||||||
rack (>= 2.2.4, < 3.2)
|
rack (>= 2.2.4, < 3.2)
|
||||||
@@ -64,15 +64,15 @@ GEM
|
|||||||
rails-dom-testing (~> 2.2)
|
rails-dom-testing (~> 2.2)
|
||||||
rails-html-sanitizer (~> 1.6)
|
rails-html-sanitizer (~> 1.6)
|
||||||
useragent (~> 0.16)
|
useragent (~> 0.16)
|
||||||
actiontext (7.2.2.2)
|
actiontext (7.2.2.1)
|
||||||
actionpack (= 7.2.2.2)
|
actionpack (= 7.2.2.1)
|
||||||
activerecord (= 7.2.2.2)
|
activerecord (= 7.2.2.1)
|
||||||
activestorage (= 7.2.2.2)
|
activestorage (= 7.2.2.1)
|
||||||
activesupport (= 7.2.2.2)
|
activesupport (= 7.2.2.1)
|
||||||
globalid (>= 0.6.0)
|
globalid (>= 0.6.0)
|
||||||
nokogiri (>= 1.8.5)
|
nokogiri (>= 1.8.5)
|
||||||
actionview (7.2.2.2)
|
actionview (7.2.2.1)
|
||||||
activesupport (= 7.2.2.2)
|
activesupport (= 7.2.2.1)
|
||||||
builder (~> 3.1)
|
builder (~> 3.1)
|
||||||
erubi (~> 1.11)
|
erubi (~> 1.11)
|
||||||
rails-dom-testing (~> 2.2)
|
rails-dom-testing (~> 2.2)
|
||||||
@@ -87,22 +87,22 @@ GEM
|
|||||||
active_utils (3.5.0)
|
active_utils (3.5.0)
|
||||||
activesupport (>= 4.2)
|
activesupport (>= 4.2)
|
||||||
i18n
|
i18n
|
||||||
activejob (7.2.2.2)
|
activejob (7.2.2.1)
|
||||||
activesupport (= 7.2.2.2)
|
activesupport (= 7.2.2.1)
|
||||||
globalid (>= 0.3.6)
|
globalid (>= 0.3.6)
|
||||||
activemodel (7.2.2.2)
|
activemodel (7.2.2.1)
|
||||||
activesupport (= 7.2.2.2)
|
activesupport (= 7.2.2.1)
|
||||||
activerecord (7.2.2.2)
|
activerecord (7.2.2.1)
|
||||||
activemodel (= 7.2.2.2)
|
activemodel (= 7.2.2.1)
|
||||||
activesupport (= 7.2.2.2)
|
activesupport (= 7.2.2.1)
|
||||||
timeout (>= 0.4.0)
|
timeout (>= 0.4.0)
|
||||||
activestorage (7.2.2.2)
|
activestorage (7.2.2.1)
|
||||||
actionpack (= 7.2.2.2)
|
actionpack (= 7.2.2.1)
|
||||||
activejob (= 7.2.2.2)
|
activejob (= 7.2.2.1)
|
||||||
activerecord (= 7.2.2.2)
|
activerecord (= 7.2.2.1)
|
||||||
activesupport (= 7.2.2.2)
|
activesupport (= 7.2.2.1)
|
||||||
marcel (~> 1.0)
|
marcel (~> 1.0)
|
||||||
activesupport (7.2.2.2)
|
activesupport (7.2.2.1)
|
||||||
base64
|
base64
|
||||||
benchmark (>= 0.3)
|
benchmark (>= 0.3)
|
||||||
bigdecimal
|
bigdecimal
|
||||||
@@ -156,7 +156,7 @@ GEM
|
|||||||
actionpack (>= 6.1)
|
actionpack (>= 6.1)
|
||||||
activemodel (>= 6.1)
|
activemodel (>= 6.1)
|
||||||
builder (3.3.0)
|
builder (3.3.0)
|
||||||
bullet (8.0.8)
|
bullet (8.0.7)
|
||||||
activesupport (>= 3.0.0)
|
activesupport (>= 3.0.0)
|
||||||
uniform_notifier (~> 1.11)
|
uniform_notifier (~> 1.11)
|
||||||
byebug (12.0.0)
|
byebug (12.0.0)
|
||||||
@@ -200,14 +200,6 @@ GEM
|
|||||||
concurrent-ruby (1.3.5)
|
concurrent-ruby (1.3.5)
|
||||||
connection_pool (2.5.3)
|
connection_pool (2.5.3)
|
||||||
crass (1.0.6)
|
crass (1.0.6)
|
||||||
crowdin-api (1.12.0)
|
|
||||||
open-uri (>= 0.1.0, < 0.2.0)
|
|
||||||
rest-client (>= 2.0.0, < 2.2.0)
|
|
||||||
crowdin-cli (0.2.2)
|
|
||||||
crowdin-api (>= 0.2.0)
|
|
||||||
gli (>= 2.7.0)
|
|
||||||
i18n (>= 0.6.4)
|
|
||||||
rubyzip (>= 1.0.0)
|
|
||||||
csv (3.3.1)
|
csv (3.3.1)
|
||||||
csv_shaper (1.4.0)
|
csv_shaper (1.4.0)
|
||||||
activesupport (>= 3.0.0)
|
activesupport (>= 3.0.0)
|
||||||
@@ -228,10 +220,10 @@ GEM
|
|||||||
railties (>= 4.1.0)
|
railties (>= 4.1.0)
|
||||||
responders
|
responders
|
||||||
warden (~> 1.2.3)
|
warden (~> 1.2.3)
|
||||||
diff-lcs (1.6.2)
|
diff-lcs (1.6.1)
|
||||||
discard (1.4.0)
|
discard (1.4.0)
|
||||||
activerecord (>= 4.2, < 9.0)
|
activerecord (>= 4.2, < 9.0)
|
||||||
domain_name (0.6.20240107)
|
docile (1.1.5)
|
||||||
dotenv (3.1.8)
|
dotenv (3.1.8)
|
||||||
dotenv-rails (3.1.8)
|
dotenv-rails (3.1.8)
|
||||||
dotenv (= 3.1.8)
|
dotenv (= 3.1.8)
|
||||||
@@ -251,24 +243,24 @@ GEM
|
|||||||
elasticsearch-transport (7.0.0)
|
elasticsearch-transport (7.0.0)
|
||||||
faraday
|
faraday
|
||||||
multi_json
|
multi_json
|
||||||
erb (5.0.2)
|
erb (5.0.1)
|
||||||
erubi (1.13.1)
|
erubi (1.13.1)
|
||||||
erubis (2.7.0)
|
erubis (2.7.0)
|
||||||
excon (1.2.5)
|
excon (1.2.5)
|
||||||
logger
|
logger
|
||||||
execjs (2.10.0)
|
execjs (2.10.0)
|
||||||
factory_bot (6.5.4)
|
factory_bot (6.5.0)
|
||||||
activesupport (>= 6.1.0)
|
activesupport (>= 5.0.0)
|
||||||
factory_bot_rails (6.5.0)
|
factory_bot_rails (6.4.4)
|
||||||
factory_bot (~> 6.5)
|
factory_bot (~> 6.5)
|
||||||
railties (>= 6.1.0)
|
railties (>= 5.0.0)
|
||||||
faker (3.5.2)
|
faker (3.5.1)
|
||||||
i18n (>= 1.8.11, < 2)
|
i18n (>= 1.8.11, < 2)
|
||||||
faraday (2.13.4)
|
faraday (2.13.1)
|
||||||
faraday-net_http (>= 2.0, < 3.5)
|
faraday-net_http (>= 2.0, < 3.5)
|
||||||
json
|
json
|
||||||
logger
|
logger
|
||||||
faraday-net_http (3.4.1)
|
faraday-net_http (3.4.0)
|
||||||
net-http (>= 0.5.0)
|
net-http (>= 0.5.0)
|
||||||
ffi (1.16.3)
|
ffi (1.16.3)
|
||||||
flickraw (0.9.10)
|
flickraw (0.9.10)
|
||||||
@@ -283,8 +275,6 @@ GEM
|
|||||||
gibbon (1.2.1)
|
gibbon (1.2.1)
|
||||||
httparty
|
httparty
|
||||||
multi_json (>= 1.9.0)
|
multi_json (>= 1.9.0)
|
||||||
gli (2.22.2)
|
|
||||||
ostruct
|
|
||||||
globalid (1.2.1)
|
globalid (1.2.1)
|
||||||
activesupport (>= 6.1)
|
activesupport (>= 6.1)
|
||||||
gravatar-ultimate (2.0.0)
|
gravatar-ultimate (2.0.0)
|
||||||
@@ -305,7 +295,7 @@ GEM
|
|||||||
activesupport (>= 5.1)
|
activesupport (>= 5.1)
|
||||||
haml (>= 4.0.6)
|
haml (>= 4.0.6)
|
||||||
railties (>= 5.1)
|
railties (>= 5.1)
|
||||||
haml_lint (0.66.0)
|
haml_lint (0.62.0)
|
||||||
haml (>= 5.0)
|
haml (>= 5.0)
|
||||||
parallel (~> 1.10)
|
parallel (~> 1.10)
|
||||||
rainbow
|
rainbow
|
||||||
@@ -321,9 +311,6 @@ GEM
|
|||||||
webrick
|
webrick
|
||||||
highline (3.1.2)
|
highline (3.1.2)
|
||||||
reline
|
reline
|
||||||
http-accept (1.7.0)
|
|
||||||
http-cookie (1.0.8)
|
|
||||||
domain_name (~> 0.5)
|
|
||||||
httparty (0.22.0)
|
httparty (0.22.0)
|
||||||
csv
|
csv
|
||||||
mini_mime (>= 1.0.0)
|
mini_mime (>= 1.0.0)
|
||||||
@@ -341,9 +328,7 @@ GEM
|
|||||||
rainbow (>= 2.2.2, < 4.0)
|
rainbow (>= 2.2.2, < 4.0)
|
||||||
ruby-progressbar (~> 1.8, >= 1.8.1)
|
ruby-progressbar (~> 1.8, >= 1.8.1)
|
||||||
terminal-table (>= 1.5.1)
|
terminal-table (>= 1.5.1)
|
||||||
i18n_data (1.1.0)
|
icalendar (2.11.0)
|
||||||
simple_po_parser (~> 1.1)
|
|
||||||
icalendar (2.11.2)
|
|
||||||
base64
|
base64
|
||||||
ice_cube (~> 0.16)
|
ice_cube (~> 0.16)
|
||||||
logger
|
logger
|
||||||
@@ -353,7 +338,7 @@ GEM
|
|||||||
image_processing (1.12.2)
|
image_processing (1.12.2)
|
||||||
mini_magick (>= 4.9.5, < 5)
|
mini_magick (>= 4.9.5, < 5)
|
||||||
ruby-vips (>= 2.0.17, < 3)
|
ruby-vips (>= 2.0.17, < 3)
|
||||||
io-console (0.8.1)
|
io-console (0.8.0)
|
||||||
irb (1.15.2)
|
irb (1.15.2)
|
||||||
pp (>= 0.6.0)
|
pp (>= 0.6.0)
|
||||||
rdoc (>= 4.0.0)
|
rdoc (>= 4.0.0)
|
||||||
@@ -362,7 +347,7 @@ GEM
|
|||||||
rails-dom-testing (>= 1, < 3)
|
rails-dom-testing (>= 1, < 3)
|
||||||
railties (>= 4.2.0)
|
railties (>= 4.2.0)
|
||||||
thor (>= 0.14, < 2.0)
|
thor (>= 0.14, < 2.0)
|
||||||
json (2.13.2)
|
json (2.12.2)
|
||||||
json-schema (5.1.0)
|
json-schema (5.1.0)
|
||||||
addressable (~> 2.8)
|
addressable (~> 2.8)
|
||||||
jsonapi-resources (0.10.7)
|
jsonapi-resources (0.10.7)
|
||||||
@@ -407,10 +392,6 @@ GEM
|
|||||||
matrix (0.4.2)
|
matrix (0.4.2)
|
||||||
memcachier (0.0.2)
|
memcachier (0.0.2)
|
||||||
method_source (1.1.0)
|
method_source (1.1.0)
|
||||||
mime-types (3.7.0)
|
|
||||||
logger
|
|
||||||
mime-types-data (~> 3.2025, >= 3.2025.0507)
|
|
||||||
mime-types-data (3.2025.0805)
|
|
||||||
mimemagic (0.4.3)
|
mimemagic (0.4.3)
|
||||||
nokogiri (~> 1)
|
nokogiri (~> 1)
|
||||||
rake
|
rake
|
||||||
@@ -425,24 +406,23 @@ GEM
|
|||||||
bigdecimal (~> 3.1)
|
bigdecimal (~> 3.1)
|
||||||
net-http (0.6.0)
|
net-http (0.6.0)
|
||||||
uri
|
uri
|
||||||
net-imap (0.5.9)
|
net-imap (0.4.20)
|
||||||
date
|
date
|
||||||
net-protocol
|
net-protocol
|
||||||
net-pop (0.1.2)
|
net-pop (0.1.2)
|
||||||
net-protocol
|
net-protocol
|
||||||
net-protocol (0.2.2)
|
net-protocol (0.2.2)
|
||||||
timeout
|
timeout
|
||||||
net-smtp (0.5.1)
|
net-smtp (0.5.0)
|
||||||
net-protocol
|
net-protocol
|
||||||
netrc (0.11.0)
|
|
||||||
nio4r (2.7.4)
|
nio4r (2.7.4)
|
||||||
nokogiri (1.18.9)
|
nokogiri (1.18.8)
|
||||||
mini_portile2 (~> 2.8.2)
|
mini_portile2 (~> 2.8.2)
|
||||||
racc (~> 1.4)
|
racc (~> 1.4)
|
||||||
nokogiri (1.18.9-x86_64-linux-gnu)
|
nokogiri (1.18.8-x86_64-linux-gnu)
|
||||||
racc (~> 1.4)
|
racc (~> 1.4)
|
||||||
oauth (0.5.6)
|
oauth (0.5.6)
|
||||||
oj (3.16.11)
|
oj (3.16.10)
|
||||||
bigdecimal (>= 3.0)
|
bigdecimal (>= 3.0)
|
||||||
ostruct (>= 0.2)
|
ostruct (>= 0.2)
|
||||||
omniauth (1.9.2)
|
omniauth (1.9.2)
|
||||||
@@ -454,17 +434,18 @@ GEM
|
|||||||
omniauth-oauth (1.1.0)
|
omniauth-oauth (1.1.0)
|
||||||
oauth
|
oauth
|
||||||
omniauth (~> 1.0)
|
omniauth (~> 1.0)
|
||||||
open-uri (0.1.0)
|
omniauth-twitter (1.4.0)
|
||||||
|
omniauth-oauth (~> 1.1)
|
||||||
|
rack
|
||||||
orm_adapter (0.5.0)
|
orm_adapter (0.5.0)
|
||||||
ostruct (0.6.3)
|
ostruct (0.6.1)
|
||||||
parallel (1.27.0)
|
parallel (1.27.0)
|
||||||
parser (3.3.9.0)
|
parser (3.3.8.0)
|
||||||
ast (~> 2.4.1)
|
ast (~> 2.4.1)
|
||||||
racc
|
racc
|
||||||
percy-capybara (5.0.0)
|
percy-capybara (5.0.0)
|
||||||
capybara (>= 3)
|
capybara (>= 3)
|
||||||
pg (1.6.1)
|
pg (1.5.9)
|
||||||
pg (1.6.1-x86_64-linux)
|
|
||||||
platform-api (3.8.0)
|
platform-api (3.8.0)
|
||||||
heroics (~> 0.1.1)
|
heroics (~> 0.1.1)
|
||||||
moneta (~> 1.0.0)
|
moneta (~> 1.0.0)
|
||||||
@@ -481,7 +462,7 @@ GEM
|
|||||||
date
|
date
|
||||||
stringio
|
stringio
|
||||||
public_suffix (6.0.1)
|
public_suffix (6.0.1)
|
||||||
puma (6.6.1)
|
puma (6.6.0)
|
||||||
nio4r (~> 2.0)
|
nio4r (~> 2.0)
|
||||||
query_diet (0.7.2)
|
query_diet (0.7.2)
|
||||||
racc (1.8.1)
|
racc (1.8.1)
|
||||||
@@ -498,20 +479,20 @@ GEM
|
|||||||
rackup (1.0.1)
|
rackup (1.0.1)
|
||||||
rack (< 3)
|
rack (< 3)
|
||||||
webrick
|
webrick
|
||||||
rails (7.2.2.2)
|
rails (7.2.2.1)
|
||||||
actioncable (= 7.2.2.2)
|
actioncable (= 7.2.2.1)
|
||||||
actionmailbox (= 7.2.2.2)
|
actionmailbox (= 7.2.2.1)
|
||||||
actionmailer (= 7.2.2.2)
|
actionmailer (= 7.2.2.1)
|
||||||
actionpack (= 7.2.2.2)
|
actionpack (= 7.2.2.1)
|
||||||
actiontext (= 7.2.2.2)
|
actiontext (= 7.2.2.1)
|
||||||
actionview (= 7.2.2.2)
|
actionview (= 7.2.2.1)
|
||||||
activejob (= 7.2.2.2)
|
activejob (= 7.2.2.1)
|
||||||
activemodel (= 7.2.2.2)
|
activemodel (= 7.2.2.1)
|
||||||
activerecord (= 7.2.2.2)
|
activerecord (= 7.2.2.1)
|
||||||
activestorage (= 7.2.2.2)
|
activestorage (= 7.2.2.1)
|
||||||
activesupport (= 7.2.2.2)
|
activesupport (= 7.2.2.1)
|
||||||
bundler (>= 1.15.0)
|
bundler (>= 1.15.0)
|
||||||
railties (= 7.2.2.2)
|
railties (= 7.2.2.1)
|
||||||
rails-controller-testing (1.0.5)
|
rails-controller-testing (1.0.5)
|
||||||
actionpack (>= 5.0.1.rc1)
|
actionpack (>= 5.0.1.rc1)
|
||||||
actionview (>= 5.0.1.rc1)
|
actionview (>= 5.0.1.rc1)
|
||||||
@@ -531,9 +512,9 @@ GEM
|
|||||||
rails_stdout_logging
|
rails_stdout_logging
|
||||||
rails_serve_static_assets (0.0.5)
|
rails_serve_static_assets (0.0.5)
|
||||||
rails_stdout_logging (0.0.5)
|
rails_stdout_logging (0.0.5)
|
||||||
railties (7.2.2.2)
|
railties (7.2.2.1)
|
||||||
actionpack (= 7.2.2.2)
|
actionpack (= 7.2.2.1)
|
||||||
activesupport (= 7.2.2.2)
|
activesupport (= 7.2.2.1)
|
||||||
irb (~> 1.13)
|
irb (~> 1.13)
|
||||||
rackup (>= 1.0.0)
|
rackup (>= 1.0.0)
|
||||||
rake (>= 12.2)
|
rake (>= 12.2)
|
||||||
@@ -541,47 +522,42 @@ GEM
|
|||||||
zeitwerk (~> 2.6)
|
zeitwerk (~> 2.6)
|
||||||
rainbow (3.1.1)
|
rainbow (3.1.1)
|
||||||
raindrops (0.20.1)
|
raindrops (0.20.1)
|
||||||
rake (13.3.0)
|
rake (13.2.1)
|
||||||
rate_throttle_client (0.1.2)
|
rate_throttle_client (0.1.2)
|
||||||
rb-fsevent (0.11.2)
|
rb-fsevent (0.11.2)
|
||||||
rb-inotify (0.10.1)
|
rb-inotify (0.10.1)
|
||||||
ffi (~> 1.0)
|
ffi (~> 1.0)
|
||||||
rdoc (6.14.2)
|
rdoc (6.14.0)
|
||||||
erb
|
erb
|
||||||
psych (>= 4.0.0)
|
psych (>= 4.0.0)
|
||||||
recaptcha (5.20.1)
|
recaptcha (5.19.0)
|
||||||
redis-client (0.23.2)
|
redis-client (0.23.2)
|
||||||
connection_pool
|
connection_pool
|
||||||
regexp_parser (2.11.2)
|
regexp_parser (2.10.0)
|
||||||
reline (0.6.2)
|
reline (0.6.1)
|
||||||
io-console (~> 0.5)
|
io-console (~> 0.5)
|
||||||
responders (3.1.1)
|
responders (3.1.1)
|
||||||
actionpack (>= 5.2)
|
actionpack (>= 5.2)
|
||||||
railties (>= 5.2)
|
railties (>= 5.2)
|
||||||
rest-client (2.1.0)
|
|
||||||
http-accept (>= 1.7.0, < 2.0)
|
|
||||||
http-cookie (>= 1.0.2, < 2.0)
|
|
||||||
mime-types (>= 1.16, < 4.0)
|
|
||||||
netrc (~> 0.8)
|
|
||||||
rexml (3.4.1)
|
rexml (3.4.1)
|
||||||
rouge (4.1.2)
|
rouge (4.1.2)
|
||||||
rspec (3.13.0)
|
rspec (3.13.0)
|
||||||
rspec-core (~> 3.13.0)
|
rspec-core (~> 3.13.0)
|
||||||
rspec-expectations (~> 3.13.0)
|
rspec-expectations (~> 3.13.0)
|
||||||
rspec-mocks (~> 3.13.0)
|
rspec-mocks (~> 3.13.0)
|
||||||
rspec-activemodel-mocks (1.3.0)
|
rspec-activemodel-mocks (1.2.1)
|
||||||
activemodel (>= 3.0)
|
activemodel (>= 3.0)
|
||||||
activesupport (>= 3.0)
|
activesupport (>= 3.0)
|
||||||
rspec-mocks (>= 2.99, < 4.0)
|
rspec-mocks (>= 2.99, < 4.0)
|
||||||
rspec-core (3.13.5)
|
rspec-core (3.13.3)
|
||||||
rspec-support (~> 3.13.0)
|
rspec-support (~> 3.13.0)
|
||||||
rspec-expectations (3.13.5)
|
rspec-expectations (3.13.4)
|
||||||
diff-lcs (>= 1.2.0, < 2.0)
|
diff-lcs (>= 1.2.0, < 2.0)
|
||||||
rspec-support (~> 3.13.0)
|
rspec-support (~> 3.13.0)
|
||||||
rspec-mocks (3.13.5)
|
rspec-mocks (3.13.4)
|
||||||
diff-lcs (>= 1.2.0, < 2.0)
|
diff-lcs (>= 1.2.0, < 2.0)
|
||||||
rspec-support (~> 3.13.0)
|
rspec-support (~> 3.13.0)
|
||||||
rspec-rails (8.0.2)
|
rspec-rails (8.0.0)
|
||||||
actionpack (>= 7.2)
|
actionpack (>= 7.2)
|
||||||
activesupport (>= 7.2)
|
activesupport (>= 7.2)
|
||||||
railties (>= 7.2)
|
railties (>= 7.2)
|
||||||
@@ -589,9 +565,7 @@ GEM
|
|||||||
rspec-expectations (~> 3.13)
|
rspec-expectations (~> 3.13)
|
||||||
rspec-mocks (~> 3.13)
|
rspec-mocks (~> 3.13)
|
||||||
rspec-support (~> 3.13)
|
rspec-support (~> 3.13)
|
||||||
rspec-rebound (0.2.1)
|
rspec-support (3.13.3)
|
||||||
rspec-core (~> 3.3)
|
|
||||||
rspec-support (3.13.4)
|
|
||||||
rspectre (0.2.0)
|
rspectre (0.2.0)
|
||||||
parser (>= 3.3.7.1)
|
parser (>= 3.3.7.1)
|
||||||
prism (~> 1.3)
|
prism (~> 1.3)
|
||||||
@@ -607,7 +581,7 @@ GEM
|
|||||||
rswag-ui (2.16.0)
|
rswag-ui (2.16.0)
|
||||||
actionpack (>= 5.2, < 8.1)
|
actionpack (>= 5.2, < 8.1)
|
||||||
railties (>= 5.2, < 8.1)
|
railties (>= 5.2, < 8.1)
|
||||||
rubocop (1.80.0)
|
rubocop (1.76.0)
|
||||||
json (~> 2.3)
|
json (~> 2.3)
|
||||||
language_server-protocol (~> 3.17.0.2)
|
language_server-protocol (~> 3.17.0.2)
|
||||||
lint_roller (~> 1.1.0)
|
lint_roller (~> 1.1.0)
|
||||||
@@ -615,10 +589,10 @@ GEM
|
|||||||
parser (>= 3.3.0.2)
|
parser (>= 3.3.0.2)
|
||||||
rainbow (>= 2.2.2, < 4.0)
|
rainbow (>= 2.2.2, < 4.0)
|
||||||
regexp_parser (>= 2.9.3, < 3.0)
|
regexp_parser (>= 2.9.3, < 3.0)
|
||||||
rubocop-ast (>= 1.46.0, < 2.0)
|
rubocop-ast (>= 1.45.0, < 2.0)
|
||||||
ruby-progressbar (~> 1.7)
|
ruby-progressbar (~> 1.7)
|
||||||
unicode-display_width (>= 2.4.0, < 4.0)
|
unicode-display_width (>= 2.4.0, < 4.0)
|
||||||
rubocop-ast (1.46.0)
|
rubocop-ast (1.45.0)
|
||||||
parser (>= 3.3.7.2)
|
parser (>= 3.3.7.2)
|
||||||
prism (~> 1.4)
|
prism (~> 1.4)
|
||||||
rubocop-capybara (2.22.1)
|
rubocop-capybara (2.22.1)
|
||||||
@@ -627,7 +601,7 @@ GEM
|
|||||||
rubocop-factory_bot (2.27.1)
|
rubocop-factory_bot (2.27.1)
|
||||||
lint_roller (~> 1.1)
|
lint_roller (~> 1.1)
|
||||||
rubocop (~> 1.72, >= 1.72.1)
|
rubocop (~> 1.72, >= 1.72.1)
|
||||||
rubocop-rails (2.33.3)
|
rubocop-rails (2.32.0)
|
||||||
activesupport (>= 4.2.0)
|
activesupport (>= 4.2.0)
|
||||||
lint_roller (~> 1.1)
|
lint_roller (~> 1.1)
|
||||||
rack (>= 1.1)
|
rack (>= 1.1)
|
||||||
@@ -647,7 +621,7 @@ GEM
|
|||||||
ruby-units (4.1.0)
|
ruby-units (4.1.0)
|
||||||
ruby-vips (2.2.1)
|
ruby-vips (2.2.1)
|
||||||
ffi (~> 1.12)
|
ffi (~> 1.12)
|
||||||
rubyzip (3.0.1)
|
rubyzip (2.4.1)
|
||||||
sass (3.7.4)
|
sass (3.7.4)
|
||||||
sass-listen (~> 4.0.0)
|
sass-listen (~> 4.0.0)
|
||||||
sass-listen (4.0.0)
|
sass-listen (4.0.0)
|
||||||
@@ -661,17 +635,17 @@ GEM
|
|||||||
sprockets (> 3.0)
|
sprockets (> 3.0)
|
||||||
sprockets-rails
|
sprockets-rails
|
||||||
tilt
|
tilt
|
||||||
scout_apm (5.7.1)
|
scout_apm (5.6.4)
|
||||||
parser
|
parser
|
||||||
searchkick (5.3.1)
|
searchkick (5.3.1)
|
||||||
activemodel (>= 6.1)
|
activemodel (>= 6.1)
|
||||||
hashie
|
hashie
|
||||||
securerandom (0.4.1)
|
securerandom (0.4.1)
|
||||||
selenium-webdriver (4.35.0)
|
selenium-webdriver (4.32.0)
|
||||||
base64 (~> 0.2)
|
base64 (~> 0.2)
|
||||||
logger (~> 1.4)
|
logger (~> 1.4)
|
||||||
rexml (~> 3.2, >= 3.2.5)
|
rexml (~> 3.2, >= 3.2.5)
|
||||||
rubyzip (>= 1.2.2, < 4.0)
|
rubyzip (>= 1.2.2, < 3.0)
|
||||||
websocket (~> 1.0)
|
websocket (~> 1.0)
|
||||||
sidekiq (7.3.9)
|
sidekiq (7.3.9)
|
||||||
base64
|
base64
|
||||||
@@ -679,7 +653,11 @@ GEM
|
|||||||
logger
|
logger
|
||||||
rack (>= 2.2.4)
|
rack (>= 2.2.4)
|
||||||
redis-client (>= 0.22.2)
|
redis-client (>= 0.22.2)
|
||||||
simple_po_parser (1.1.6)
|
simplecov (0.13.0)
|
||||||
|
docile (~> 1.1.0)
|
||||||
|
json (>= 1.8, < 3)
|
||||||
|
simplecov-html (~> 0.10.0)
|
||||||
|
simplecov-html (0.10.2)
|
||||||
sprockets (3.7.5)
|
sprockets (3.7.5)
|
||||||
base64
|
base64
|
||||||
concurrent-ruby (~> 1.0)
|
concurrent-ruby (~> 1.0)
|
||||||
@@ -691,20 +669,20 @@ GEM
|
|||||||
ssrf_filter (1.1.2)
|
ssrf_filter (1.1.2)
|
||||||
stringio (3.1.7)
|
stringio (3.1.7)
|
||||||
sysexits (1.2.0)
|
sysexits (1.2.0)
|
||||||
temple (0.10.4)
|
temple (0.10.3)
|
||||||
terminal-table (4.0.0)
|
terminal-table (4.0.0)
|
||||||
unicode-display_width (>= 1.1.1, < 4)
|
unicode-display_width (>= 1.1.1, < 4)
|
||||||
terser (1.2.5)
|
terser (1.2.5)
|
||||||
execjs (>= 0.3.0, < 3)
|
execjs (>= 0.3.0, < 3)
|
||||||
thor (1.4.0)
|
thor (1.3.2)
|
||||||
thread_safe (0.3.6)
|
thread_safe (0.3.6)
|
||||||
tilt (2.6.1)
|
tilt (2.6.0)
|
||||||
timecop (0.9.10)
|
timecop (0.9.10)
|
||||||
timeout (0.4.3)
|
timeout (0.4.3)
|
||||||
trollop (1.16.2)
|
trollop (1.16.2)
|
||||||
tzinfo (2.0.6)
|
tzinfo (2.0.6)
|
||||||
concurrent-ruby (~> 1.0)
|
concurrent-ruby (~> 1.0)
|
||||||
unicode-display_width (3.1.5)
|
unicode-display_width (3.1.4)
|
||||||
unicode-emoji (~> 4.0, >= 4.0.4)
|
unicode-emoji (~> 4.0, >= 4.0.4)
|
||||||
unicode-emoji (4.0.4)
|
unicode-emoji (4.0.4)
|
||||||
unicorn (6.1.0)
|
unicorn (6.1.0)
|
||||||
@@ -730,8 +708,7 @@ GEM
|
|||||||
rack-test (>= 0.5.3)
|
rack-test (>= 0.5.3)
|
||||||
webrick (1.9.1)
|
webrick (1.9.1)
|
||||||
websocket (1.2.11)
|
websocket (1.2.11)
|
||||||
websocket-driver (0.8.0)
|
websocket-driver (0.7.6)
|
||||||
base64
|
|
||||||
websocket-extensions (>= 0.1.0)
|
websocket-extensions (>= 0.1.0)
|
||||||
websocket-extensions (0.1.5)
|
websocket-extensions (0.1.5)
|
||||||
will_paginate (4.0.1)
|
will_paginate (4.0.1)
|
||||||
@@ -769,7 +746,6 @@ DEPENDENCIES
|
|||||||
chartkick
|
chartkick
|
||||||
coffee-rails
|
coffee-rails
|
||||||
comfortable_mexican_sofa!
|
comfortable_mexican_sofa!
|
||||||
crowdin-cli
|
|
||||||
csv_shaper
|
csv_shaper
|
||||||
dalli
|
dalli
|
||||||
database_cleaner
|
database_cleaner
|
||||||
@@ -793,7 +769,6 @@ DEPENDENCIES
|
|||||||
haml_lint (>= 0.25.1)
|
haml_lint (>= 0.25.1)
|
||||||
hashie (>= 3.5.3)
|
hashie (>= 3.5.3)
|
||||||
i18n-tasks
|
i18n-tasks
|
||||||
i18n_data (~> 1.1)
|
|
||||||
icalendar
|
icalendar
|
||||||
jquery-rails
|
jquery-rails
|
||||||
jquery-ui-rails!
|
jquery-ui-rails!
|
||||||
@@ -811,6 +786,7 @@ DEPENDENCIES
|
|||||||
oj
|
oj
|
||||||
omniauth (~> 1.3)
|
omniauth (~> 1.3)
|
||||||
omniauth-flickr (>= 0.0.15)
|
omniauth-flickr (>= 0.0.15)
|
||||||
|
omniauth-twitter
|
||||||
percy-capybara (~> 5.0.0)
|
percy-capybara (~> 5.0.0)
|
||||||
pg
|
pg
|
||||||
platform-api
|
platform-api
|
||||||
@@ -828,7 +804,6 @@ DEPENDENCIES
|
|||||||
responders
|
responders
|
||||||
rspec-activemodel-mocks
|
rspec-activemodel-mocks
|
||||||
rspec-rails
|
rspec-rails
|
||||||
rspec-rebound
|
|
||||||
rspectre
|
rspectre
|
||||||
rswag-api
|
rswag-api
|
||||||
rswag-specs
|
rswag-specs
|
||||||
@@ -858,7 +833,7 @@ DEPENDENCIES
|
|||||||
xmlrpc
|
xmlrpc
|
||||||
|
|
||||||
RUBY VERSION
|
RUBY VERSION
|
||||||
ruby 3.3.8p144
|
ruby 3.3.7p123
|
||||||
|
|
||||||
BUNDLED WITH
|
BUNDLED WITH
|
||||||
2.4.22
|
2.4.22
|
||||||
|
|||||||
@@ -62,3 +62,5 @@ For more information about this project, contact [info@growstuff.org](mailto:inf
|
|||||||
|
|
||||||
Security Issues: If you find an authorization bypass or data breach, please contact our maintainers directly at [maintainers@growstuff.org](mailto:maintainers@growstuff.org).
|
Security Issues: If you find an authorization bypass or data breach, please contact our maintainers directly at [maintainers@growstuff.org](mailto:maintainers@growstuff.org).
|
||||||
|
|
||||||
|
You can also contact us on [Twitter](http://twitter.com/growstufforg/) or
|
||||||
|
[Facebook](https://www.facebook.com/pages/Growstuff/1531133417099494) or [Github](https://github.com/Growstuff/growstuff/issues)..
|
||||||
|
|||||||
BIN
app/assets/images/location-not-set.en.png
Normal file
BIN
app/assets/images/location-not-set.en.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 20 KiB |
BIN
app/assets/images/twitter_32.png
Normal file
BIN
app/assets/images/twitter_32.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.5 KiB |
@@ -33,6 +33,13 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.location-not-set {
|
||||||
|
background-image: image-url("location-not-set.en.png");
|
||||||
|
background-position: center;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
height: 250px;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
.card {
|
.card {
|
||||||
.badge-location {
|
.badge-location {
|
||||||
background-color: darken($blue, 10%);
|
background-color: darken($blue, 10%);
|
||||||
|
|||||||
@@ -30,7 +30,3 @@
|
|||||||
@import "predictions";
|
@import "predictions";
|
||||||
@import "homepage";
|
@import "homepage";
|
||||||
@import "maps";
|
@import "maps";
|
||||||
|
|
||||||
@view-transition {
|
|
||||||
navigation: auto;
|
|
||||||
}
|
|
||||||
@@ -57,6 +57,6 @@ class AlternateNamesController < ApplicationController
|
|||||||
private
|
private
|
||||||
|
|
||||||
def alternate_name_params
|
def alternate_name_params
|
||||||
params.require(:alternate_name).permit(:crop_id, :name, :creator_id, :language)
|
params.require(:alternate_name).permit(:crop_id, :name, :creator_id)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -78,7 +78,6 @@ class ApplicationController < ActionController::Base
|
|||||||
:tos_agreement,
|
:tos_agreement,
|
||||||
# profile stuff
|
# profile stuff
|
||||||
:bio, :location, :latitude, :longitude,
|
:bio, :location, :latitude, :longitude,
|
||||||
:website_url, :instagram_handle, :facebook_handle, :bluesky_handle, :other_url,
|
|
||||||
# email settings
|
# email settings
|
||||||
:show_email, :newsletter, :send_notification_email, :send_planting_reminder,
|
:show_email, :newsletter, :send_notification_email, :send_planting_reminder,
|
||||||
# update password
|
# update password
|
||||||
|
|||||||
@@ -13,55 +13,43 @@ class CommentsController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def new
|
def new
|
||||||
@commentable = find_commentable
|
|
||||||
@comment = Comment.new
|
@comment = Comment.new
|
||||||
if @commentable
|
@post = Post.find_by(id: params[:post_id])
|
||||||
@comments = @commentable.comments
|
|
||||||
|
if @post
|
||||||
|
@comments = @post.comments
|
||||||
respond_with(@comments)
|
respond_with(@comments)
|
||||||
else
|
else
|
||||||
redirect_to(request.referer || root_url,
|
redirect_to(request.referer || root_url,
|
||||||
alert: "Can't post a comment on a non-existent commentable")
|
alert: "Can't post a comment on a non-existent post")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def edit
|
def edit
|
||||||
# TODO: Why does this need a collection of comments?
|
@comments = @comment.post.comments
|
||||||
@comments = @comment.commentable.comments
|
|
||||||
@commentable = @comment.commentable
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
@comment = Comment.new(comment_params)
|
@comment = Comment.new(comment_params)
|
||||||
@commentable = @comment.commentable
|
|
||||||
@comment.author = current_member
|
@comment.author = current_member
|
||||||
@comment.save
|
@comment.save
|
||||||
respond_with @comment, location: @commentable
|
respond_with @comment, location: @comment.post
|
||||||
end
|
end
|
||||||
|
|
||||||
def update
|
def update
|
||||||
@comment.update(body: comment_params['body'])
|
@comment.update(body: comment_params['body'])
|
||||||
respond_with @comment, location: @comment.commentable
|
respond_with @comment, location: @comment.post
|
||||||
end
|
end
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
@commentable = @comment.commentable
|
@post = @comment.post
|
||||||
@comment.destroy
|
@comment.destroy
|
||||||
respond_with(@commentable)
|
respond_with(@post)
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def find_commentable
|
|
||||||
return unless params[:comment]
|
|
||||||
|
|
||||||
if params[:comment][:commentable_type] == 'Photo'
|
|
||||||
Photo.find(params[:comment][:commentable_id])
|
|
||||||
elsif params[:comment][:commentable_type] == 'Post'
|
|
||||||
Post.find(params[:comment][:commentable_id])
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def comment_params
|
def comment_params
|
||||||
params.require(:comment).permit(:body, :commentable_id, :commentable_type)
|
params.require(:comment).permit(:body, :post_id)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -166,7 +166,7 @@ class CropsController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def save_crop_names
|
def save_crop_names
|
||||||
AlternateName.create!(names_params(:alt_name).map { |n| { name: n, creator_id: current_member.id, crop_id: @crop.id, language: "EN" } })
|
AlternateName.create!(names_params(:alt_name).map { |n| { name: n, creator_id: current_member.id, crop_id: @crop.id } })
|
||||||
ScientificName.create!(names_params(:sci_name).map { |n| { name: n, creator_id: current_member.id, crop_id: @crop.id } })
|
ScientificName.create!(names_params(:sci_name).map { |n| { name: n, creator_id: current_member.id, crop_id: @crop.id } })
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -181,18 +181,20 @@ class CropsController < ApplicationController
|
|||||||
def recreate_names(param_name, name_type)
|
def recreate_names(param_name, name_type)
|
||||||
return if params[param_name].blank?
|
return if params[param_name].blank?
|
||||||
|
|
||||||
@crop.send("#{name_type}_names").each(&:destroy)
|
destroy_names(name_type)
|
||||||
params[param_name].each_value do |value|
|
params[param_name].each_value do |value|
|
||||||
next if value.empty?
|
create_name!(name_type, value) unless value.empty?
|
||||||
|
|
||||||
if name_type == 'alternate'
|
|
||||||
@crop.send("#{name_type}_names").create!(name: value, creator_id: current_member.id, language: "EN")
|
|
||||||
else
|
|
||||||
@crop.send("#{name_type}_names").create!(name: value, creator_id: current_member.id)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def destroy_names(name_type)
|
||||||
|
@crop.send("#{name_type}_names").each(&:destroy)
|
||||||
|
end
|
||||||
|
|
||||||
|
def create_name!(name_type, value)
|
||||||
|
@crop.send("#{name_type}_names").create!(name: value, creator_id: current_member.id)
|
||||||
|
end
|
||||||
|
|
||||||
def crop_params
|
def crop_params
|
||||||
params.require(:crop).permit(
|
params.require(:crop).permit(
|
||||||
:name, :en_wikipedia_url,
|
:name, :en_wikipedia_url,
|
||||||
@@ -214,12 +216,12 @@ class CropsController < ApplicationController
|
|||||||
def crop_json_fields
|
def crop_json_fields
|
||||||
{
|
{
|
||||||
include: {
|
include: {
|
||||||
plantings: {
|
plantings: {
|
||||||
include: {
|
include: {
|
||||||
owner: { only: %i(id login_name location latitude longitude) }
|
owner: { only: %i(id login_name location latitude longitude) }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
scientific_names: { only: [:name] }, alternate_names: { only: %i(name language) }
|
scientific_names: { only: [:name] }, alternate_names: { only: [:name] }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ class MembersController < ApplicationController
|
|||||||
|
|
||||||
def show
|
def show
|
||||||
@member = Member.confirmed.kept.find_by!(slug: params[:slug])
|
@member = Member.confirmed.kept.find_by!(slug: params[:slug])
|
||||||
|
@twitter_auth = @member.auth('twitter')
|
||||||
@flickr_auth = @member.auth('flickr')
|
@flickr_auth = @member.auth('flickr')
|
||||||
@posts = @member.posts
|
@posts = @member.posts
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController
|
|||||||
@authentication = action.establish_authentication(auth, member)
|
@authentication = action.establish_authentication(auth, member)
|
||||||
|
|
||||||
if action.member_created?
|
if action.member_created?
|
||||||
raise "Invalid provider" unless %w(flickr).index(auth['provider'].to_s)
|
raise "Invalid provider" unless %w(twitter flickr).index(auth['provider'].to_s)
|
||||||
|
|
||||||
session["devise.#{auth['provider']}_data"] = request.env["omniauth.auth"]
|
session["devise.#{auth['provider']}_data"] = request.env["omniauth.auth"]
|
||||||
sign_in member
|
sign_in member
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ class PhotosController < ApplicationController
|
|||||||
|
|
||||||
def show
|
def show
|
||||||
@crops = Crop.distinct.joins(:photo_associations).where(photo_associations: { photo: @photo })
|
@crops = Crop.distinct.joins(:photo_associations).where(photo_associations: { photo: @photo })
|
||||||
@comment = Comment.new(commentable: @photo)
|
|
||||||
respond_with(@photo)
|
respond_with(@photo)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -91,32 +91,6 @@ class PlantingsController < DataController
|
|||||||
respond_with @planting, location: @planting.garden
|
respond_with @planting, location: @planting.garden
|
||||||
end
|
end
|
||||||
|
|
||||||
def transplant
|
|
||||||
# The `load_and_authorize_resource` in DataController will handle finding the
|
|
||||||
# planting and authorizing the action.
|
|
||||||
# We still need to authorize the new garden
|
|
||||||
new_garden = Garden.find(params[:garden_id])
|
|
||||||
authorize! :update, new_garden
|
|
||||||
|
|
||||||
# Mark original planting as finished
|
|
||||||
@planting.update(finished: true, finished_at: Time.zone.now)
|
|
||||||
|
|
||||||
# Create a new planting
|
|
||||||
new_planting = @planting.dup
|
|
||||||
new_planting.garden = new_garden
|
|
||||||
new_planting.slug = nil # let friendly_id generate a new slug
|
|
||||||
new_planting.finished = false
|
|
||||||
new_planting.finished_at = nil
|
|
||||||
|
|
||||||
if new_planting.save
|
|
||||||
redirect_to edit_planting_path(new_planting), notice: 'Planting was successfully transplanted.'
|
|
||||||
else
|
|
||||||
# if the save fails, we should probably roll back the finishing of the original planting
|
|
||||||
@planting.update(finished: false, finished_at: nil)
|
|
||||||
redirect_to @planting, alert: "There was an error transplanting the planting: #{new_planting.errors.full_messages.to_sentence}"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def update_crop_medians
|
def update_crop_medians
|
||||||
@@ -133,7 +107,7 @@ class PlantingsController < DataController
|
|||||||
:crop_id, :description, :garden_id, :planted_at,
|
:crop_id, :description, :garden_id, :planted_at,
|
||||||
:parent_seed_id,
|
:parent_seed_id,
|
||||||
:quantity, :sunniness, :planted_from, :finished,
|
:quantity, :sunniness, :planted_from, :finished,
|
||||||
:finished_at, :failed
|
:finished_at
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ class RegistrationsController < Devise::RegistrationsController
|
|||||||
prepend_before_action :check_captcha, only: [:create] # Change this to be any actions you want to protect with recaptcha.
|
prepend_before_action :check_captcha, only: [:create] # Change this to be any actions you want to protect with recaptcha.
|
||||||
|
|
||||||
def edit
|
def edit
|
||||||
|
@twitter_auth = current_member.auth('twitter')
|
||||||
@flickr_auth = current_member.auth('flickr')
|
@flickr_auth = current_member.auth('flickr')
|
||||||
render "edit"
|
render "edit"
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -19,10 +19,6 @@ class SeedsController < DataController
|
|||||||
where['parent_planting'] = @planting.id
|
where['parent_planting'] = @planting.id
|
||||||
end
|
end
|
||||||
|
|
||||||
if params[:tradeable_to].present?
|
|
||||||
where['tradeable_to'] = params[:tradeable_to]
|
|
||||||
end
|
|
||||||
|
|
||||||
@show_all = (params[:all] == '1')
|
@show_all = (params[:all] == '1')
|
||||||
where['finished'] = false unless @show_all
|
where['finished'] = false unless @show_all
|
||||||
|
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ module ApplicationHelper
|
|||||||
|
|
||||||
uri.query = "&width=#{size}&height=#{size}" if uri.host == 'graph.facebook.com'
|
uri.query = "&width=#{size}&height=#{size}" if uri.host == 'graph.facebook.com'
|
||||||
|
|
||||||
|
# TODO: Assess twitter - https://dev.twitter.com/overview/general/user-profile-images-and-banners
|
||||||
# TODO: Assess flickr - https://www.flickr.com/services/api/misc.buddyicons.html
|
# TODO: Assess flickr - https://www.flickr.com/services/api/misc.buddyicons.html
|
||||||
|
|
||||||
return uri.to_s
|
return uri.to_s
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
module ButtonsHelper
|
module ButtonsHelper
|
||||||
include IconsHelper
|
include IconsHelper
|
||||||
|
|
||||||
def garden_plant_something_button(garden, classes: "btn btn-default")
|
def garden_plant_something_button(garden, classes: "btn btn-default")
|
||||||
return unless can? :edit, garden
|
return unless can? :edit, garden
|
||||||
|
|
||||||
@@ -98,7 +97,7 @@ module ButtonsHelper
|
|||||||
end
|
end
|
||||||
|
|
||||||
def planting_finish_button(planting, classes: 'btn btn-default btn-secondary')
|
def planting_finish_button(planting, classes: 'btn btn-default btn-secondary')
|
||||||
return unless can?(:edit, planting) || planting.finished || planting.failed
|
return unless can?(:edit, planting) || planting.finished
|
||||||
|
|
||||||
link_to planting_path(slug: planting.slug, planting: { finished: 1 }),
|
link_to planting_path(slug: planting.slug, planting: { finished: 1 }),
|
||||||
method: :put, class: "#{classes} append-date" do
|
method: :put, class: "#{classes} append-date" do
|
||||||
@@ -106,15 +105,6 @@ module ButtonsHelper
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def planting_failed_button(planting, classes: 'btn btn-default btn-secondary')
|
|
||||||
return unless can?(:edit, planting) || planting.finished || planting.failed
|
|
||||||
|
|
||||||
link_to planting_path(slug: planting.slug, planting: { failed: 1 }),
|
|
||||||
method: :put, class: "#{classes}" do
|
|
||||||
finished_icon + ' ' + t('buttons.mark_as_failed')
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def seed_finish_button(seed, classes: 'btn btn-default')
|
def seed_finish_button(seed, classes: 'btn btn-default')
|
||||||
return unless can?(:create, Planting) && seed.active
|
return unless can?(:create, Planting) && seed.active
|
||||||
|
|
||||||
@@ -132,7 +122,7 @@ module ButtonsHelper
|
|||||||
end
|
end
|
||||||
|
|
||||||
def planting_save_seeds_button(planting, classes: 'btn btn-default')
|
def planting_save_seeds_button(planting, classes: 'btn btn-default')
|
||||||
return unless can?(:edit, planting) && !planting.failed?
|
return unless can?(:edit, planting)
|
||||||
|
|
||||||
link_to new_planting_seed_path(planting_slug: planting.slug), class: classes do
|
link_to new_planting_seed_path(planting_slug: planting.slug), class: classes do
|
||||||
seed_icon + ' ' + t('buttons.save_seeds')
|
seed_icon + ' ' + t('buttons.save_seeds')
|
||||||
|
|||||||
@@ -43,14 +43,6 @@ module PlantingsHelper
|
|||||||
(planting.first_harvest_predicted_at - Time.zone.today).to_i
|
(planting.first_harvest_predicted_at - Time.zone.today).to_i
|
||||||
end
|
end
|
||||||
|
|
||||||
# Returns a list of gardens the planting can be transplanted to
|
|
||||||
# based on the planting's owner.
|
|
||||||
def transplantable_gardens_by_owner(planting)
|
|
||||||
garden_ids = planting.owner.gardens.select(:id).to_a + GardenCollaborator.where(member_id: planting.owner.id).select(:garden_id).to_a
|
|
||||||
|
|
||||||
Garden.active.where.not(id: planting.garden_id).where(id: garden_ids)
|
|
||||||
end
|
|
||||||
|
|
||||||
def days_from_now_to_last_harvest(planting)
|
def days_from_now_to_last_harvest(planting)
|
||||||
return unless planting.planted_at.present? && planting.last_harvest_predicted_at.present?
|
return unless planting.planted_at.present? && planting.last_harvest_predicted_at.present?
|
||||||
|
|
||||||
|
|||||||
@@ -111,10 +111,6 @@ class Ability
|
|||||||
can :update, Planting do |planting|
|
can :update, Planting do |planting|
|
||||||
planting.garden.garden_collaborators.where(member_id: member.id).any?
|
planting.garden.garden_collaborators.where(member_id: member.id).any?
|
||||||
end
|
end
|
||||||
can :transplant, Planting, garden: { owner_id: member.id }
|
|
||||||
can :transplant, Planting do |planting|
|
|
||||||
planting.garden.garden_collaborators.where(member_id: member.id).any?
|
|
||||||
end
|
|
||||||
can :destroy, Planting do |planting|
|
can :destroy, Planting do |planting|
|
||||||
planting.garden.garden_collaborators.where(member_id: member.id).any?
|
planting.garden.garden_collaborators.where(member_id: member.id).any?
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ class AlternateName < ApplicationRecord
|
|||||||
belongs_to :creator, class_name: 'Member', inverse_of: :created_alternate_names
|
belongs_to :creator, class_name: 'Member', inverse_of: :created_alternate_names
|
||||||
validates :name, presence: true
|
validates :name, presence: true
|
||||||
validates :crop, presence: true
|
validates :crop, presence: true
|
||||||
validates :language, presence: true
|
|
||||||
|
|
||||||
after_commit :reindex
|
after_commit :reindex
|
||||||
|
|
||||||
|
|||||||
@@ -2,27 +2,26 @@
|
|||||||
|
|
||||||
class Comment < ApplicationRecord
|
class Comment < ApplicationRecord
|
||||||
belongs_to :author, class_name: 'Member', inverse_of: :comments
|
belongs_to :author, class_name: 'Member', inverse_of: :comments
|
||||||
belongs_to :commentable, polymorphic: true, counter_cache: true
|
belongs_to :post, counter_cache: true
|
||||||
# validates :body, presence: true
|
|
||||||
|
|
||||||
scope :post_order, -> { order(created_at: :asc) } # for display on post page
|
scope :post_order, -> { order(created_at: :asc) } # for display on post page
|
||||||
|
|
||||||
after_create do
|
after_create do
|
||||||
recipient = commentable.author.id
|
recipient = post.author.id
|
||||||
sender = author.id
|
sender = author.id
|
||||||
# don't send notifications to yourself
|
# don't send notifications to yourself
|
||||||
if recipient != sender
|
if recipient != sender
|
||||||
Notification.create(
|
Notification.create(
|
||||||
recipient_id: recipient,
|
recipient_id: recipient,
|
||||||
sender_id: sender,
|
sender_id: sender,
|
||||||
subject: "#{author} commented on #{commentable.subject}",
|
subject: "#{author} commented on #{post.subject}",
|
||||||
body:,
|
body:,
|
||||||
notifiable: commentable
|
post_id: post.id
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def to_s
|
def to_s
|
||||||
"#{author.login_name} commented on #{commentable.subject}"
|
"#{author.login_name} commented on #{post.subject}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -8,12 +8,7 @@ module Finishable
|
|||||||
scope :current, -> { where.not(finished: true) }
|
scope :current, -> { where.not(finished: true) }
|
||||||
|
|
||||||
def active
|
def active
|
||||||
# Plantings can fail. At the moment, activities and seeds cannot.
|
!finished
|
||||||
if respond_to?(:failed)
|
|
||||||
!finished && !failed
|
|
||||||
else
|
|
||||||
!finished
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ module PredictHarvest
|
|||||||
|
|
||||||
# status
|
# status
|
||||||
def harvest_time?
|
def harvest_time?
|
||||||
return false if crop.perennial || finished || failed
|
return false if crop.perennial || finished
|
||||||
|
|
||||||
# We have harvests but haven't finished
|
# We have harvests but haven't finished
|
||||||
harvests.size.positive? ||
|
harvests.size.positive? ||
|
||||||
|
|||||||
@@ -8,12 +8,12 @@ module PredictPlanting
|
|||||||
before_save :calculate_lifespan
|
before_save :calculate_lifespan
|
||||||
|
|
||||||
def calculate_lifespan
|
def calculate_lifespan
|
||||||
self.lifespan = (planted_at.present? && finished_at.present? && !failed? ? finished_at - planted_at : nil)
|
self.lifespan = (planted_at.present? && finished_at.present? ? finished_at - planted_at : nil)
|
||||||
end
|
end
|
||||||
|
|
||||||
# dates
|
# dates
|
||||||
def finish_predicted_at
|
def finish_predicted_at
|
||||||
if planted_at.blank? || failed?
|
if planted_at.blank?
|
||||||
nil
|
nil
|
||||||
elsif crop.median_lifespan.present?
|
elsif crop.median_lifespan.present?
|
||||||
planted_at + crop.median_lifespan.days
|
planted_at + crop.median_lifespan.days
|
||||||
@@ -34,18 +34,15 @@ module PredictPlanting
|
|||||||
end
|
end
|
||||||
|
|
||||||
def actual_lifespan
|
def actual_lifespan
|
||||||
return unless planted_at.present? && finished_at.present? && !failed?
|
return unless planted_at.present? && finished_at.present?
|
||||||
|
|
||||||
(finished_at - planted_at).to_i
|
(finished_at - planted_at).to_i
|
||||||
end
|
end
|
||||||
|
|
||||||
def age_in_days
|
def age_in_days
|
||||||
return if planted_at.blank?
|
return if planted_at.blank?
|
||||||
return if failed?
|
|
||||||
|
|
||||||
known_last_day ||= finished_at || Time.zone.today
|
known_last_day ||= finished_at || Time.zone.today
|
||||||
known_last_day = Time.zone.today if known_last_day > Time.zone.today
|
|
||||||
|
|
||||||
(known_last_day - planted_at).to_i
|
(known_last_day - planted_at).to_i
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -53,9 +50,9 @@ module PredictPlanting
|
|||||||
Rails.cache.fetch("#{cache_key_with_version}/percentage_grown", expires_in: 8.hours) do
|
Rails.cache.fetch("#{cache_key_with_version}/percentage_grown", expires_in: 8.hours) do
|
||||||
if finished?
|
if finished?
|
||||||
100
|
100
|
||||||
elsif !planted? || failed?
|
elsif !planted?
|
||||||
0
|
0
|
||||||
elsif crop.perennial || (finish_predicted_at.nil? && finished_at.nil?) # This covers future dated finished_at that hasn't occurrred yet.
|
elsif crop.perennial || finish_predicted_at.nil?
|
||||||
nil
|
nil
|
||||||
else
|
else
|
||||||
calculate_percentage_grown
|
calculate_percentage_grown
|
||||||
@@ -74,7 +71,7 @@ module PredictPlanting
|
|||||||
end
|
end
|
||||||
|
|
||||||
def late?
|
def late?
|
||||||
crop.annual? && !finished && !failed &&
|
crop.annual? && !finished &&
|
||||||
planted_at.present? &&
|
planted_at.present? &&
|
||||||
finish_predicted_at.present? &&
|
finish_predicted_at.present? &&
|
||||||
finish_predicted_at <= Time.zone.today
|
finish_predicted_at <= Time.zone.today
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ class CsvImporter
|
|||||||
|
|
||||||
alternate_names.split(/,\s*/).each do |name|
|
alternate_names.split(/,\s*/).each do |name|
|
||||||
altname = AlternateName.find_by(name:, crop: @crop)
|
altname = AlternateName.find_by(name:, crop: @crop)
|
||||||
altname ||= AlternateName.create! name:, crop: @crop, language: "EN", creator: cropbot
|
altname ||= AlternateName.create! name:, crop: @crop, creator: cropbot
|
||||||
@crop.alternate_names << altname
|
@crop.alternate_names << altname
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -10,8 +10,7 @@ class Follow < ApplicationRecord
|
|||||||
recipient_id: followed_id,
|
recipient_id: followed_id,
|
||||||
sender_id: follower_id,
|
sender_id: follower_id,
|
||||||
subject: "#{follower.login_name} is now following you",
|
subject: "#{follower.login_name} is now following you",
|
||||||
body: "#{follower.login_name} just followed you on #{ENV.fetch('GROWSTUFF_SITE_NAME', nil)}. ",
|
body: "#{follower.login_name} just followed you on #{ENV.fetch('GROWSTUFF_SITE_NAME', nil)}. "
|
||||||
notifiable: self
|
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ class Garden < ApplicationRecord
|
|||||||
include Geocodable
|
include Geocodable
|
||||||
include PhotoCapable
|
include PhotoCapable
|
||||||
include Ownable
|
include Ownable
|
||||||
|
|
||||||
friendly_id :garden_slug, use: %i(slugged finders)
|
friendly_id :garden_slug, use: %i(slugged finders)
|
||||||
|
|
||||||
has_many :plantings, dependent: :destroy
|
has_many :plantings, dependent: :destroy
|
||||||
@@ -45,7 +44,6 @@ class Garden < ApplicationRecord
|
|||||||
.where.not(gardens: { latitude: nil })
|
.where.not(gardens: { latitude: nil })
|
||||||
.where.not(gardens: { longitude: nil })
|
.where.not(gardens: { longitude: nil })
|
||||||
}
|
}
|
||||||
|
|
||||||
AREA_UNITS_VALUES = {
|
AREA_UNITS_VALUES = {
|
||||||
"square metres" => "square metre",
|
"square metres" => "square metre",
|
||||||
"square feet" => "square foot",
|
"square feet" => "square foot",
|
||||||
|
|||||||
@@ -91,9 +91,6 @@ class Member < ApplicationRecord
|
|||||||
uniqueness: {
|
uniqueness: {
|
||||||
case_sensitive: false
|
case_sensitive: false
|
||||||
}
|
}
|
||||||
validates :website_url, format: { with: /\Ahttps?:\/\//, message: "must start with http:// or https://" }, allow_blank: true
|
|
||||||
validates :other_url, format: { with: /\Ahttps?:\/\//, message: "must start with http:// or https://" }, allow_blank: true
|
|
||||||
validates :instagram_handle, :facebook_handle, :bluesky_handle, format: { without: %r{\Ahttps?:\/\/|\/}, message: "should be a handle, not a URL" }, allow_blank: true
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Triggers
|
# Triggers
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
class Notification < ApplicationRecord
|
class Notification < ApplicationRecord
|
||||||
belongs_to :sender, class_name: 'Member', inverse_of: :sent_notifications
|
belongs_to :sender, class_name: 'Member', inverse_of: :sent_notifications
|
||||||
belongs_to :recipient, class_name: 'Member', inverse_of: :notifications
|
belongs_to :recipient, class_name: 'Member', inverse_of: :notifications
|
||||||
belongs_to :notifiable, polymorphic: true
|
belongs_to :post, optional: true
|
||||||
|
|
||||||
validates :subject, length: { maximum: 255 }
|
validates :subject, length: { maximum: 255 }
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ class Photo < ApplicationRecord
|
|||||||
PHOTO_CAPABLE = %w(Garden Planting Harvest Seed Post Crop).freeze
|
PHOTO_CAPABLE = %w(Garden Planting Harvest Seed Post Crop).freeze
|
||||||
|
|
||||||
has_many :photo_associations, dependent: :delete_all, inverse_of: :photo
|
has_many :photo_associations, dependent: :delete_all, inverse_of: :photo
|
||||||
has_many :comments, as: :commentable, dependent: :destroy
|
|
||||||
|
|
||||||
# This doesn't work, ActiveRecord tries to use the polymoriphic photographable
|
# This doesn't work, ActiveRecord tries to use the polymoriphic photographable
|
||||||
# relationship instead.
|
# relationship instead.
|
||||||
@@ -84,14 +83,6 @@ class Photo < ApplicationRecord
|
|||||||
"#{title} by #{owner.login_name}"
|
"#{title} by #{owner.login_name}"
|
||||||
end
|
end
|
||||||
|
|
||||||
def subject
|
|
||||||
title
|
|
||||||
end
|
|
||||||
|
|
||||||
def author
|
|
||||||
owner
|
|
||||||
end
|
|
||||||
|
|
||||||
def flickr_photo_id
|
def flickr_photo_id
|
||||||
source_id if source == 'flickr'
|
source_id if source == 'flickr'
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -43,8 +43,7 @@ class Planting < ApplicationRecord
|
|||||||
.where.not(gardens: { latitude: nil })
|
.where.not(gardens: { latitude: nil })
|
||||||
.where.not(gardens: { longitude: nil })
|
.where.not(gardens: { longitude: nil })
|
||||||
}
|
}
|
||||||
scope :active, -> { where(finished: false, failed: false).where('finished_at IS NULL OR finished_at < ?', Time.zone.now) }
|
scope :active, -> { where('finished <> true').where('finished_at IS NULL OR finished_at < ?', Time.zone.now) }
|
||||||
scope :failed, -> { where(failed: true) }
|
|
||||||
scope :annual, -> { joins(:crop).where(crops: { perennial: false }) }
|
scope :annual, -> { joins(:crop).where(crops: { perennial: false }) }
|
||||||
scope :perennial, -> { joins(:crop).where(crops: { perennial: true }) }
|
scope :perennial, -> { joins(:crop).where(crops: { perennial: true }) }
|
||||||
scope :interesting, -> { has_photos.one_per_owner.order(planted_at: :desc) }
|
scope :interesting, -> { has_photos.one_per_owner.order(planted_at: :desc) }
|
||||||
@@ -73,7 +72,6 @@ class Planting < ApplicationRecord
|
|||||||
validates :crop, presence: true, approved: { message: "must be present and exist in our database" }
|
validates :crop, presence: true, approved: { message: "must be present and exist in our database" }
|
||||||
validate :finished_must_be_after_planted
|
validate :finished_must_be_after_planted
|
||||||
validate :owner_must_match_garden_owner
|
validate :owner_must_match_garden_owner
|
||||||
validate :cannot_be_finished_and_failed
|
|
||||||
validates :quantity, allow_nil: true, numericality: {
|
validates :quantity, allow_nil: true, numericality: {
|
||||||
only_integer: true, greater_than_or_equal_to: 0
|
only_integer: true, greater_than_or_equal_to: 0
|
||||||
}
|
}
|
||||||
@@ -98,11 +96,7 @@ class Planting < ApplicationRecord
|
|||||||
end
|
end
|
||||||
|
|
||||||
def finished?
|
def finished?
|
||||||
(finished || (finished_at.present? && finished_at <= Time.zone.today)) && !failed?
|
finished || (finished_at.present? && finished_at <= Time.zone.today)
|
||||||
end
|
|
||||||
|
|
||||||
def failed?
|
|
||||||
failed
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def planted?
|
def planted?
|
||||||
@@ -126,10 +120,6 @@ class Planting < ApplicationRecord
|
|||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def cannot_be_finished_and_failed
|
|
||||||
errors.add(:failed, "can't be true if planting is also finished") if finished && failed
|
|
||||||
end
|
|
||||||
|
|
||||||
# check that any finished_at date occurs after planted_at
|
# check that any finished_at date occurs after planted_at
|
||||||
def finished_must_be_after_planted
|
def finished_must_be_after_planted
|
||||||
return unless planted_at && finished_at # only check if we have both
|
return unless planted_at && finished_at # only check if we have both
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
class Post < ApplicationRecord
|
class Post < ApplicationRecord
|
||||||
extend FriendlyId
|
extend FriendlyId
|
||||||
include Likeable
|
include Likeable
|
||||||
|
|
||||||
friendly_id :author_date_subject, use: %i(slugged finders)
|
friendly_id :author_date_subject, use: %i(slugged finders)
|
||||||
include PhotoCapable
|
include PhotoCapable
|
||||||
|
|
||||||
@@ -11,10 +10,9 @@ class Post < ApplicationRecord
|
|||||||
# Relationships
|
# Relationships
|
||||||
belongs_to :author, class_name: 'Member', inverse_of: :posts
|
belongs_to :author, class_name: 'Member', inverse_of: :posts
|
||||||
belongs_to :forum, optional: true
|
belongs_to :forum, optional: true
|
||||||
has_many :comments, as: :commentable, dependent: :destroy
|
has_many :comments, dependent: :destroy
|
||||||
has_many :crop_posts, dependent: :delete_all
|
has_many :crop_posts, dependent: :delete_all
|
||||||
has_many :crops, through: :crop_posts
|
has_many :crops, through: :crop_posts
|
||||||
has_many :notifications, as: :notifiable, dependent: :destroy
|
|
||||||
|
|
||||||
after_create :send_notification
|
after_create :send_notification
|
||||||
#
|
#
|
||||||
@@ -97,7 +95,6 @@ class Post < ApplicationRecord
|
|||||||
Notification.create(
|
Notification.create(
|
||||||
recipient_id:,
|
recipient_id:,
|
||||||
sender_id: sender,
|
sender_id: sender,
|
||||||
notifiable: self,
|
|
||||||
subject: "#{author} mentioned you in their post #{subject}",
|
subject: "#{author} mentioned you in their post #{subject}",
|
||||||
body:
|
body:
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ module Api
|
|||||||
|
|
||||||
attribute :slug
|
attribute :slug
|
||||||
attribute :planted_at
|
attribute :planted_at
|
||||||
attribute :failed
|
|
||||||
attribute :finished
|
attribute :finished
|
||||||
attribute :finished_at
|
attribute :finished_at
|
||||||
attribute :quantity
|
attribute :quantity
|
||||||
@@ -38,7 +37,9 @@ module Api
|
|||||||
filter :finished
|
filter :finished
|
||||||
|
|
||||||
attribute :percentage_grown
|
attribute :percentage_grown
|
||||||
delegate :percentage_grown, to: :@model
|
def percentage_grown
|
||||||
|
@model.percentage_grown
|
||||||
|
end
|
||||||
|
|
||||||
attribute :crop_name
|
attribute :crop_name
|
||||||
attribute :crop_slug
|
attribute :crop_slug
|
||||||
|
|||||||
@@ -47,7 +47,7 @@
|
|||||||
|
|
||||||
.row
|
.row
|
||||||
.col-md-6
|
.col-md-6
|
||||||
= f.check_box :finished, label: t('buttons.mark_as_finished')
|
= f.check_box :finished, label: 'Mark as finished'
|
||||||
%span.help-block= t('.finish_helper')
|
%span.help-block= t('.finish_helper')
|
||||||
|
|
||||||
.card-footer
|
.card-footer
|
||||||
|
|||||||
@@ -31,8 +31,7 @@
|
|||||||
= f.label :name, class: 'control-label col-md-2'
|
= f.label :name, class: 'control-label col-md-2'
|
||||||
.col-md-8
|
.col-md-8
|
||||||
= f.text_field :name, class: 'form-control'
|
= f.text_field :name, class: 'form-control'
|
||||||
.col-md-8
|
|
||||||
= f.select :language, I18nData.languages.map {|code, name| [name.split(";").first, code] }, class: 'form-control'
|
|
||||||
.form-group
|
.form-group
|
||||||
.form-actions.col-md-offset-2.col-md-8
|
.form-actions.col-md-offset-2.col-md-8
|
||||||
= f.submit 'Save', class: 'btn btn-primary'
|
= f.submit 'Save', class: 'btn btn-primary'
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
#{link_to 'commented', event_model} on #{link_to event_model.commentable, event_model.commentable}
|
#{link_to 'commented', event_model} on #{link_to event_model.post, event_model.post}
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
- @comment ||= Comment.new(commentable: @commentable)
|
|
||||||
.card.col-md-8.col-lg-7.mx-auto.float-none.white.z-depth-1.py-2.px-2
|
.card.col-md-8.col-lg-7.mx-auto.float-none.white.z-depth-1.py-2.px-2
|
||||||
.card-body
|
.card-body
|
||||||
- if content_for? :title
|
- if content_for? :title
|
||||||
@@ -15,13 +14,13 @@
|
|||||||
%li= msg
|
%li= msg
|
||||||
|
|
||||||
.md-form
|
.md-form
|
||||||
= f.text_area :body, rows: 6, class: 'form-control md-textarea', autofocus: 'autofocus', required: true, pattern: '\w+'
|
= f.text_area :body, rows: 6, class: 'form-control md-textarea', autofocus: 'autofocus'
|
||||||
= f.label :body, "Your comment:"
|
= f.label :body, "Your comment:"
|
||||||
|
|
||||||
%span.help-block
|
%span.help-block
|
||||||
= render partial: "shared/markdown_help"
|
= render partial: "shared/markdown_help"
|
||||||
.actions.text-right
|
.actions.text-right
|
||||||
= f.submit 'Post comment', class: 'btn btn-primary'
|
= f.submit 'Post comment', class: 'btn btn-primary'
|
||||||
.field
|
- if defined?(@post)
|
||||||
= f.hidden_field :commentable_id, value: @commentable.id
|
.field
|
||||||
= f.hidden_field :commentable_type, value: @commentable.class.name
|
= f.hidden_field :post_id, value: @post.id
|
||||||
|
|||||||
@@ -2,6 +2,6 @@
|
|||||||
|
|
||||||
%p
|
%p
|
||||||
Editing comment on
|
Editing comment on
|
||||||
= link_to @comment.commentable.subject, @comment.commentable
|
= link_to @comment.post.subject, @comment.post
|
||||||
|
|
||||||
= render 'form', locals: { comment: @comment, commentable: @comment.commentable }
|
= render 'form'
|
||||||
|
|||||||
@@ -5,18 +5,17 @@
|
|||||||
%link= comments_url
|
%link= comments_url
|
||||||
- @comments.each do |comment|
|
- @comments.each do |comment|
|
||||||
%item
|
%item
|
||||||
%title Comment by #{comment.author.login_name} on #{comment.commentable.subject}
|
%title Comment by #{comment.author.login_name} on #{comment.post.subject}
|
||||||
%description
|
%description
|
||||||
:escaped_markdown
|
:escaped_markdown
|
||||||
<p>
|
<p>
|
||||||
Comment on
|
Comment on
|
||||||
#{ link_to comment.commentable.subject, polymorphic_url(comment.commentable) }
|
#{ link_to comment.post.subject, post_url(comment.post) }
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
:escaped_markdown
|
:escaped_markdown
|
||||||
#{ strip_tags markdownify(comment.body) }
|
#{ strip_tags markdownify(comment.body) }
|
||||||
|
|
||||||
%pubdate= comment.created_at.to_fs(:rfc822)
|
%pubdate= comment.created_at.to_fs(:rfc822)
|
||||||
%link= polymorphic_url(comment.commentable)
|
%link= post_url(comment.post)
|
||||||
%guid= comment_url(comment)
|
%guid= comment_url(comment)
|
||||||
|
|
||||||
|
|||||||
@@ -1,17 +1,11 @@
|
|||||||
= content_for :title, "New comment"
|
= content_for :title, "New comment"
|
||||||
- if @commentable.is_a?(Post)
|
|
||||||
%section.blog-post
|
|
||||||
.card.post{ id: "post-#{@commentable.id}" }
|
|
||||||
.card-header
|
|
||||||
%h2.display-3= @commentable.subject
|
|
||||||
.card-body= render "posts/single", post: @commentable || @comment.commentable, subject: true
|
|
||||||
- elsif @commentable.is_a?(Photo)
|
|
||||||
%section.blog-post
|
|
||||||
.card.photo{ id: "photo-#{@commentable.id}" }
|
|
||||||
.card-header
|
|
||||||
%h2.display-3= @commentable.subject
|
|
||||||
.card-body= render "photos/card", photo: @commentable || @comment.commentable, subject: true
|
|
||||||
|
|
||||||
= render partial: "comments/comments", locals: { commentable: @commentable || @comment.commentable }
|
%section.blog-post
|
||||||
|
.card.post{ id: "post-#{@post.id}" }
|
||||||
|
.card-header
|
||||||
|
%h2.display-3= @post.subject
|
||||||
|
.card-body= render "posts/single", post: @post || @comment.post, subject: true
|
||||||
|
|
||||||
= render 'form', locals: { comment: @comment, commentable: @commentable || @comment.commentable }
|
= render partial: "posts/comments", locals: { post: @post || @comment.post }
|
||||||
|
|
||||||
|
= render 'form'
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
- if can? :edit, an
|
- if can? :edit, an
|
||||||
.dropdown.planting-actions
|
.dropdown.planting-actions
|
||||||
%a#crop-actions-altnames.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-bs-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} (#{an.language})"
|
= an.name
|
||||||
.dropdown-menu.dropdown-menu-xs{"aria-labelledby" => "crop-actions-altnames"}
|
.dropdown-menu.dropdown-menu-xs{"aria-labelledby" => "crop-actions-altnames"}
|
||||||
- if can? :edit, an
|
- if can? :edit, an
|
||||||
= link_to edit_alternate_name_path(an), class: 'dropdown-item' do
|
= link_to edit_alternate_name_path(an), class: 'dropdown-item' do
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
= delete_icon
|
= delete_icon
|
||||||
= t('.delete')
|
= t('.delete')
|
||||||
- else
|
- else
|
||||||
.badge= "#{an.name} (#{an.language})"
|
.badge= an.name
|
||||||
|
|
||||||
|
|
||||||
%p.text-right
|
%p.text-right
|
||||||
|
|||||||
@@ -3,6 +3,19 @@
|
|||||||
html: { method: :put, class: 'form-horizontal' }) do |_f|
|
html: { method: :put, class: 'form-horizontal' }) do |_f|
|
||||||
%br/
|
%br/
|
||||||
= render 'devise/shared/error_messages', resource: resource
|
= render 'devise/shared/error_messages', resource: resource
|
||||||
|
.row
|
||||||
|
.col-md-12
|
||||||
|
%p
|
||||||
|
= image_tag "twitter_32.png", size: "32x32", alt: 'Twitter logo'
|
||||||
|
- if @twitter_auth
|
||||||
|
You are connected to Twitter as
|
||||||
|
= link_to @twitter_auth.name, "https://twitter.com/#{@twitter_auth.name}"
|
||||||
|
= link_to "Disconnect", @twitter_auth,
|
||||||
|
confirm: "Are you sure you want to remove this connection?",
|
||||||
|
method: :delete, class: "remove btn btn-danger"
|
||||||
|
- else
|
||||||
|
= link_to 'Connect to Twitter', '/members/auth/twitter', class: 'btn'
|
||||||
|
|
||||||
.row
|
.row
|
||||||
.col-md-12
|
.col-md-12
|
||||||
%p
|
%p
|
||||||
|
|||||||
@@ -13,32 +13,7 @@
|
|||||||
.form-group
|
.form-group
|
||||||
= f.label :bio, class: 'control-label col-md-2'
|
= f.label :bio, class: 'control-label col-md-2'
|
||||||
.col-md-8
|
.col-md-8
|
||||||
= f.text_area :bio, rows: 6, class: 'form-control', placeholder: "I'm am XYZ gardener interested in A, B, C"
|
= f.text_area :bio, rows: 6, class: 'form-control'
|
||||||
|
|
||||||
.form-group
|
|
||||||
= f.label :website_url, 'Website', class: 'control-label col-md-2'
|
|
||||||
.col-md-8
|
|
||||||
= f.url_field :website_url, class: 'form-control', placeholder: "https://you.example.com/"
|
|
||||||
|
|
||||||
.form-group
|
|
||||||
= f.label :instagram_handle, 'Instagram', class: 'control-label col-md-2'
|
|
||||||
.col-md-8
|
|
||||||
= f.text_field :instagram_handle, class: 'form-control', placeholder: 'your_handle'
|
|
||||||
|
|
||||||
.form-group
|
|
||||||
= f.label :facebook_handle, 'Facebook', class: 'control-label col-md-2'
|
|
||||||
.col-md-8
|
|
||||||
= f.text_field :facebook_handle, class: 'form-control', placeholder: 'your_handle'
|
|
||||||
|
|
||||||
.form-group
|
|
||||||
= f.label :bluesky_handle, 'Bluesky', class: 'control-label col-md-2'
|
|
||||||
.col-md-8
|
|
||||||
= f.text_field :bluesky_handle, class: 'form-control', placeholder: 'your_handle'
|
|
||||||
|
|
||||||
.form-group
|
|
||||||
= f.label :other_url, 'Other URL', class: 'control-label col-md-2'
|
|
||||||
.col-md-8
|
|
||||||
= f.url_field :other_url, class: 'form-control', placeholder: "https://you.example.com/"
|
|
||||||
|
|
||||||
.form-group
|
.form-group
|
||||||
%label.control-label.col-md-2
|
%label.control-label.col-md-2
|
||||||
|
|||||||
@@ -51,8 +51,7 @@
|
|||||||
%section.seeds
|
%section.seeds
|
||||||
= cute_icon
|
= cute_icon
|
||||||
= render 'seeds'
|
= render 'seeds'
|
||||||
%p.text-right
|
%p.text-right= link_to "#{t('home.seeds.view_all')} »", seeds_path, class: 'btn btn-block'
|
||||||
= link_to "#{t('home.seeds.view_all')} »", seeds_path(tradeable_to: ['locally', 'nationally', 'internationally']), class: 'btn btn-block'
|
|
||||||
.col-12.col-lg-6
|
.col-12.col-lg-6
|
||||||
%section.discussion.text-center
|
%section.discussion.text-center
|
||||||
= cute_icon
|
= cute_icon
|
||||||
|
|||||||
@@ -1 +1,13 @@
|
|||||||
%h2 All about #{member.login_name}
|
%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_registration_path
|
||||||
|
- else
|
||||||
|
#{member.login_name} hasn't written a bio yet.
|
||||||
|
- else
|
||||||
|
:markdown
|
||||||
|
#{ strip_tags markdownify(member.bio) }
|
||||||
|
|||||||
@@ -1,37 +1,17 @@
|
|||||||
- if member.website_url.present? || member.instagram_handle.present? || member.facebook_handle.present? || member.bluesky_handle.present? || member.other_url.present? || flickr_auth || member.show_email
|
- if twitter_auth || flickr_auth || member.show_email
|
||||||
%h4 Contact
|
%h4 Contact
|
||||||
|
|
||||||
- if member.website_url.present?
|
- if twitter_auth
|
||||||
%p
|
%p
|
||||||
= icon 'fas', 'globe', class: 'fa-fw'
|
= image_tag "twitter_32.png", size: "32x32", alt: 'Twitter logo'
|
||||||
= link_to "Website", member.website_url, target: '_blank', rel: 'noopener noreferrer'
|
= link_to twitter_auth.name, "https://twitter.com/#{twitter_auth.name}"
|
||||||
|
|
||||||
- if member.instagram_handle.present?
|
|
||||||
%p
|
|
||||||
= icon 'fab', 'instagram', class: 'fa-fw'
|
|
||||||
= link_to member.instagram_handle, "https://instagram.com/#{member.instagram_handle}", target: '_blank', rel: 'noopener noreferrer'
|
|
||||||
|
|
||||||
- if member.facebook_handle.present?
|
|
||||||
%p
|
|
||||||
= icon 'fab', 'facebook', class: 'fa-fw'
|
|
||||||
= link_to member.facebook_handle, "https://facebook.com/#{member.facebook_handle}", target: '_blank', rel: 'noopener noreferrer'
|
|
||||||
|
|
||||||
- if member.bluesky_handle.present?
|
|
||||||
%p
|
|
||||||
= icon 'fas', 'comment-dots', class: 'fa-fw'
|
|
||||||
= link_to member.bluesky_handle, "https://bsky.app/profile/#{member.bluesky_handle}", target: '_blank', rel: 'noopener noreferrer'
|
|
||||||
|
|
||||||
- if member.other_url.present?
|
|
||||||
%p
|
|
||||||
= icon 'fas', 'link', class: 'fa-fw'
|
|
||||||
= link_to "More...", member.other_url, target: '_blank', rel: 'noopener noreferrer'
|
|
||||||
|
|
||||||
- if flickr_auth
|
- if flickr_auth
|
||||||
%p
|
%p
|
||||||
= image_tag "flickr_32.png", size: "32x32", alt: 'Flickr logo'
|
= image_tag "flickr_32.png", size: "32x32", alt: 'Flickr logo'
|
||||||
= link_to flickr_auth.name, "https://flickr.com/photos/#{flickr_auth.uid}", target: '_blank', rel: 'noopener noreferrer'
|
= link_to flickr_auth.name, "https://flickr.com/photos/#{flickr_auth.uid}"
|
||||||
|
|
||||||
- if member.show_email
|
- if member.show_email
|
||||||
%p
|
%p
|
||||||
= icon 'fas', 'envelope', class: 'fa-fw'
|
Email:
|
||||||
= mail_to member.email
|
= mail_to member.email
|
||||||
|
|||||||
@@ -5,5 +5,5 @@
|
|||||||
= link_to member.location, place_path(member.location, anchor: "members")
|
= link_to member.location, place_path(member.location, anchor: "members")
|
||||||
- else
|
- else
|
||||||
.location-not-set
|
.location-not-set
|
||||||
%h1 Location not known or geocodable
|
.sr-only Location not known
|
||||||
%p We can't show you what's nearby
|
.sr-only We can't show you what's nearby
|
||||||
|
|||||||
@@ -21,21 +21,6 @@
|
|||||||
.row
|
.row
|
||||||
.col= render "bio", member: @member
|
.col= render "bio", member: @member
|
||||||
.col= render "avatar", member: @member
|
.col= render "avatar", member: @member
|
||||||
.row
|
|
||||||
.col
|
|
||||||
%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_registration_path
|
|
||||||
- else
|
|
||||||
#{@member.login_name} hasn't written a bio yet.
|
|
||||||
- else
|
|
||||||
:markdown
|
|
||||||
#{ strip_tags markdownify(@member.bio) }
|
|
||||||
|
|
||||||
- if @member.roles.any?
|
- if @member.roles.any?
|
||||||
%p
|
%p
|
||||||
- @member.roles.each do |role|
|
- @member.roles.each do |role|
|
||||||
@@ -45,16 +30,12 @@
|
|||||||
= icon 'fas', 'map-marker'
|
= icon 'fas', 'map-marker'
|
||||||
= truncate(@member.location, length: 15, separator: ' ', omission: '... ')
|
= truncate(@member.location, length: 15, separator: ' ', omission: '... ')
|
||||||
%p
|
%p
|
||||||
%small
|
%strong Member since
|
||||||
%strong Member since
|
= @member.created_at.to_fs(:date)
|
||||||
%br
|
|
||||||
= @member.created_at.to_fs(:date)
|
|
||||||
- if @member.last_sign_in_at
|
- if @member.last_sign_in_at
|
||||||
%p
|
%p
|
||||||
%small
|
%strong Last Login
|
||||||
%strong Last Login
|
= @member.last_sign_in_at&.to_fs(:default)
|
||||||
%br
|
|
||||||
= @member.last_sign_in_at&.to_fs(:default)
|
|
||||||
|
|
||||||
- if can? :update, @member
|
- if can? :update, @member
|
||||||
= link_to edit_member_registration_path, class: 'btn btn-block' do
|
= link_to edit_member_registration_path, class: 'btn btn-block' do
|
||||||
@@ -77,7 +58,8 @@
|
|||||||
|
|
||||||
= render "stats", member: @member
|
= render "stats", member: @member
|
||||||
.card-footer
|
.card-footer
|
||||||
= render "contact", member: @member, flickr_auth: @flickr_auth
|
= render "contact", member: @member, twitter_auth: @twitter_auth,
|
||||||
|
flickr_auth: @flickr_auth
|
||||||
|
|
||||||
.col-md-10#content
|
.col-md-10#content
|
||||||
.row
|
.row
|
||||||
|
|||||||
@@ -46,12 +46,4 @@
|
|||||||
- else
|
- else
|
||||||
= @photo.license_name
|
= @photo.license_name
|
||||||
|
|
||||||
= render "associations", photo: @photo
|
= render "associations", photo: @photo
|
||||||
.row
|
|
||||||
- if can? :create, Comment
|
|
||||||
= link_to new_comment_path(comment: { commentable_type: 'Photo', commentable_id: @photo.id }), class: 'btn' do
|
|
||||||
= icon 'fas', 'comment'
|
|
||||||
Comment
|
|
||||||
.row
|
|
||||||
.col-md-9
|
|
||||||
= render 'comments/comments', commentable: @photo
|
|
||||||
@@ -7,16 +7,7 @@
|
|||||||
- if planting.active
|
- if planting.active
|
||||||
= planting_plan_something_button(planting, classes: 'dropdown-item')
|
= planting_plan_something_button(planting, classes: 'dropdown-item')
|
||||||
= planting_finish_button(planting, classes: 'dropdown-item')
|
= planting_finish_button(planting, classes: 'dropdown-item')
|
||||||
= planting_failed_button(planting, classes: 'dropdown-item')
|
|
||||||
= planting_harvest_button(planting, classes: 'dropdown-item')
|
= planting_harvest_button(planting, classes: 'dropdown-item')
|
||||||
= planting_save_seeds_button(planting, classes: 'dropdown-item')
|
= planting_save_seeds_button(planting, classes: 'dropdown-item')
|
||||||
- if can?(:transplant, planting) && planting.active && transplantable_gardens_by_owner(planting).any?
|
|
||||||
.dropdown-divider
|
|
||||||
.px-2
|
|
||||||
= form_tag transplant_planting_path(planting), method: :post do
|
|
||||||
.form-group
|
|
||||||
= label_tag :garden_id, 'Transplant to:'
|
|
||||||
= select_tag :garden_id, options_from_collection_for_select(transplantable_gardens_by_owner(planting), :id, :name), class: 'form-control form-control-sm'
|
|
||||||
= submit_tag 'Transplant', class: 'btn btn-sm btn-primary mt-2'
|
|
||||||
.dropdown-divider
|
.dropdown-divider
|
||||||
= delete_button(planting, classes: 'dropdown-item text-danger')
|
= delete_button(planting, classes: 'dropdown-item text-danger')
|
||||||
|
|||||||
@@ -19,7 +19,6 @@
|
|||||||
|
|
||||||
- if planting.active
|
- if planting.active
|
||||||
= planting_finish_button(planting, classes: 'dropdown-item')
|
= planting_finish_button(planting, classes: 'dropdown-item')
|
||||||
= planting_failed_button(planting, classes: 'dropdown-item')
|
|
||||||
= planting_harvest_button(planting, classes: 'dropdown-item')
|
= planting_harvest_button(planting, classes: 'dropdown-item')
|
||||||
= planting_save_seeds_button(planting, classes: 'dropdown-item')
|
= planting_save_seeds_button(planting, classes: 'dropdown-item')
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
%h2 Seeds saved
|
%h2 Seeds saved
|
||||||
|
|
||||||
- if can?(:edit, planting) && !planting.failed?
|
%a.btn.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-bs-toggle" => "dropdown", role: "button"}
|
||||||
%a.btn.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-bs-toggle" => "dropdown", role: "button"}
|
= seed_icon
|
||||||
= seed_icon
|
= t('buttons.save_seeds')
|
||||||
= t('buttons.save_seeds')
|
.dropdown-menu.dropdown-secondary
|
||||||
.dropdown-menu.dropdown-secondary
|
- Seed::TRADABLE_TO_VALUES.each do |trade|
|
||||||
- Seed::TRADABLE_TO_VALUES.each do |trade|
|
= link_to seeds_path(return: 'planting', seed: {crop_id: planting.crop.id, parent_planting_id: planting.id, tradable_to: trade}), method: :post, class: 'dropdown-item' do
|
||||||
= link_to seeds_path(return: 'planting', seed: {crop_id: planting.crop.id, parent_planting_id: planting.id, tradable_to: trade}), method: :post, class: 'dropdown-item' do
|
Will trade:
|
||||||
Will trade:
|
= trade
|
||||||
= trade
|
|
||||||
|
|
||||||
- if planting.child_seeds.size.positive?
|
- if planting.child_seeds.size.positive?
|
||||||
.index-cards
|
.index-cards
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
- if planting.quantity.to_i.positive? && planting.planted_from.present?
|
- if planting.quantity.to_i.positive? && planting.planted_from.present?
|
||||||
= planting.planted_from.pluralize(planting.quantity.to_i)
|
= planting.planted_from.pluralize(planting.quantity.to_i)
|
||||||
|
|
||||||
- unless planting.finished? || planting.failed?
|
- unless planting.finished?
|
||||||
.card.fact-card.grid-sizer
|
.card.fact-card.grid-sizer
|
||||||
%h3 Growing
|
%h3 Growing
|
||||||
%strong= seedling_icon
|
%strong= seedling_icon
|
||||||
|
|||||||
@@ -34,7 +34,9 @@
|
|||||||
.col-md-4
|
.col-md-4
|
||||||
= f.text_field :planted_at,
|
= f.text_field :planted_at,
|
||||||
value: @planting.planted_at ? @planting.planted_at.to_fs(:ymd) : '',
|
value: @planting.planted_at ? @planting.planted_at.to_fs(:ymd) : '',
|
||||||
class: 'add-datepicker', label: 'When?', title: "Plan out your future plantings by forward dating, and subscribe to your iCalendar feed for reminders to plant"
|
class: 'add-datepicker', label: 'When?'
|
||||||
|
%span.help-inline
|
||||||
|
Tip: Plan our your future plantings by forward dating, and subscribe to your iCalendar feed for reminders to plant
|
||||||
|
|
||||||
.row
|
.row
|
||||||
.col-md-4
|
.col-md-4
|
||||||
@@ -47,17 +49,14 @@
|
|||||||
|
|
||||||
.row
|
.row
|
||||||
.col-md-6
|
.col-md-6
|
||||||
= f.check_box :finished, label: t('buttons.mark_as_finished'), title: t('.finish_helper')
|
= f.check_box :finished, label: 'Mark as finished'
|
||||||
|
%span.help-block= t('.finish_helper')
|
||||||
.col-md-6
|
.col-md-6
|
||||||
= f.text_field :finished_at,
|
= f.text_field :finished_at,
|
||||||
value: @planting.finished_at ? @planting.finished_at.to_fs(:ymd) : '',
|
value: @planting.finished_at ? @planting.finished_at.to_fs(:ymd) : '',
|
||||||
class: 'add-datepicker',
|
class: 'add-datepicker',
|
||||||
label: 'Finished date',
|
label: 'Finished date',
|
||||||
placeholder: 'optional'
|
placeholder: 'optional'
|
||||||
.row
|
|
||||||
.col-md-6
|
|
||||||
= f.check_box :failed, label: t('buttons.mark_as_failed'), title: t('.failed_helper')
|
|
||||||
|
|
||||||
.card-footer
|
.card-footer
|
||||||
.text-right= f.submit 'Save'
|
.text-right= f.submit 'Save'
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
%h2 Harvests
|
%h2 Harvests
|
||||||
- if can?(:edit, planting) && !planting.failed
|
|
||||||
|
- if can? :edit, planting
|
||||||
= render 'harvests/modal', harvest: Harvest.new(crop: planting.crop, planting: planting)
|
= render 'harvests/modal', harvest: Harvest.new(crop: planting.crop, planting: planting)
|
||||||
- if planting.harvests.empty?
|
- if planting.harvests.empty?
|
||||||
%p No harvests recorded
|
%p No harvests recorded
|
||||||
- if planting.finished? && can?(:edit, planting) && can?(:create, Harvest)
|
- if !planting.finished? && can?(:edit, planting) && can?(:create, Harvest)
|
||||||
%p Record your harvests here to improve crop predictions, and you'll be able to compare with your garden next season.
|
%p Record your harvests here to improve crop predictions, and you'll be able to compare with your garden next season.
|
||||||
- else
|
- else
|
||||||
.index-cards
|
.index-cards
|
||||||
|
|||||||
@@ -8,8 +8,6 @@
|
|||||||
%p.small #{harvest_icon} First harvest expected #{I18n.l planting.first_harvest_predicted_at}
|
%p.small #{harvest_icon} First harvest expected #{I18n.l planting.first_harvest_predicted_at}
|
||||||
- if planting.finished_at.present?
|
- if planting.finished_at.present?
|
||||||
%p.small #{finished_icon} Finished #{I18n.l planting.finished_at}
|
%p.small #{finished_icon} Finished #{I18n.l planting.finished_at}
|
||||||
- elsif planting.failed?
|
|
||||||
%p.small #{finished_icon} Failed
|
|
||||||
- elsif planting.finish_predicted_at.present?
|
- elsif planting.finish_predicted_at.present?
|
||||||
%p.small #{finished_icon} Finish expected #{I18n.l planting.finish_predicted_at}
|
%p.small #{finished_icon} Finish expected #{I18n.l planting.finish_predicted_at}
|
||||||
- if planting.planted_at.present? && planting.expected_lifespan.present?
|
- if planting.planted_at.present? && planting.expected_lifespan.present?
|
||||||
|
|||||||
@@ -32,10 +32,8 @@
|
|||||||
%strong= @planting.crop.name.titleize
|
%strong= @planting.crop.name.titleize
|
||||||
%small.text-muted= @planting.crop.default_scientific_name
|
%small.text-muted= @planting.crop.default_scientific_name
|
||||||
%tt
|
%tt
|
||||||
- if @planting.failed?
|
- if @planting.finished?
|
||||||
%span.badge.badge-danger Failed
|
Finished
|
||||||
- elsif @planting.finished?
|
|
||||||
%span.badge.badge-success Finished
|
|
||||||
- elsif @planting.percentage_grown.present?
|
- elsif @planting.percentage_grown.present?
|
||||||
#{@planting.percentage_grown.to_i}%
|
#{@planting.percentage_grown.to_i}%
|
||||||
- if @planting.finish_is_predicatable?
|
- if @planting.finish_is_predicatable?
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
%a{ name: "comments" }
|
%a{ name: "comments" }
|
||||||
- if commentable.comments
|
- if post.comments
|
||||||
%hr/
|
%hr/
|
||||||
%h2
|
%h2
|
||||||
= comment_icon
|
= comment_icon
|
||||||
= localize_plural(commentable.comments, Comment)
|
= localize_plural(post.comments, Comment)
|
||||||
- commentable.comments.post_order.each do |comment|
|
- post.comments.post_order.each do |comment|
|
||||||
= render "comments/single", comment: comment
|
= render "comments/single", comment: comment
|
||||||
|
|
||||||
- else
|
- else
|
||||||
%h2 There are no comments yet
|
%h2 There are no comments yet
|
||||||
|
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
- @post ||= post if defined?(post)
|
|
||||||
%p
|
%p
|
||||||
Posted by
|
Posted by
|
||||||
- if @post.author
|
- if @post.author
|
||||||
@@ -14,7 +13,7 @@
|
|||||||
and edited at
|
and edited at
|
||||||
= @post.updated_at.to_fs(:default)
|
= @post.updated_at.to_fs(:default)
|
||||||
|
|
||||||
= link_to "Permalink", @post
|
= link_to "Permalink", post
|
||||||
|
|
||||||
:markdown
|
:markdown
|
||||||
#{ strip_tags markdownify(@post.body) }
|
#{ strip_tags markdownify(@post.body) }
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
- content_for :buttonbar do
|
- content_for :buttonbar do
|
||||||
- if @post.comments.count > 10 && can?(:create, Comment)
|
- if @post.comments.count > 10 && can?(:create, Comment)
|
||||||
= link_to 'Comment', new_comment_path(comment: { commentable_type: 'Post', commentable_id: @post.id }), class: 'btn'
|
= link_to 'Comment', new_comment_path(post_id: @post.id), class: 'btn'
|
||||||
|
|
||||||
- content_for :breadcrumbs do
|
- content_for :breadcrumbs do
|
||||||
%li.breadcrumb-item= link_to @post.author, @post.author
|
%li.breadcrumb-item= link_to @post.author, @post.author
|
||||||
@@ -48,12 +48,12 @@
|
|||||||
= render 'likes/likes', object: @post
|
= render 'likes/likes', object: @post
|
||||||
.float-right
|
.float-right
|
||||||
- if can? :create, Comment
|
- if can? :create, Comment
|
||||||
= link_to new_comment_path(comment: { commentable_type: 'Post', commentable_id: @post.id }), class: 'btn' do
|
= link_to new_comment_path(post_id: @post.id), class: 'btn' do
|
||||||
= icon 'fas', 'comment'
|
= icon 'fas', 'comment'
|
||||||
Comment
|
Comment
|
||||||
|
|
||||||
%section.comments
|
%section.comments
|
||||||
= render "comments/comments", commentable: @post
|
= render "comments", post: @post
|
||||||
|
|
||||||
.col-md-4.col-12
|
.col-md-4.col-12
|
||||||
= render @post.author
|
= render @post.author
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
|
|
||||||
.row
|
.row
|
||||||
.col-12.col-md-4
|
.col-12.col-md-4
|
||||||
= f.check_box :finished, label: t('buttons.mark_as_finished')
|
= f.check_box :finished, label: 'Mark as finished'
|
||||||
.col-12.col-md-4
|
.col-12.col-md-4
|
||||||
= f.text_field :finished_at, class: 'add-datepicker', value: @seed.finished_at ? @seed.finished_at.to_fs(:ymd) : ''
|
= f.text_field :finished_at, class: 'add-datepicker', value: @seed.finished_at ? @seed.finished_at.to_fs(:ymd) : ''
|
||||||
.col-12.col-md-4
|
.col-12.col-md-4
|
||||||
|
|||||||
@@ -17,14 +17,6 @@
|
|||||||
= check_box_tag 'active', 'all', @show_all
|
= check_box_tag 'active', 'all', @show_all
|
||||||
include finished
|
include finished
|
||||||
%hr/
|
%hr/
|
||||||
%section.filters
|
|
||||||
%h2 Tradeable
|
|
||||||
%ul.nav.flex-column
|
|
||||||
%li.nav-item= link_to "All tradable seeds", seeds_path(tradeable_to: ['locally', 'nationally', 'internationally'])
|
|
||||||
- Seed::TRADABLE_TO_VALUES.each do |value|
|
|
||||||
- unless value == 'nowhere'
|
|
||||||
%li.nav-item= link_to value.capitalize, seeds_path(tradeable_to: value)
|
|
||||||
%hr/
|
|
||||||
- if @owner
|
- if @owner
|
||||||
= render @owner
|
= render @owner
|
||||||
- if @crop
|
- if @crop
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ Mailboxer.setup do |config|
|
|||||||
config.uses_emails = true
|
config.uses_emails = true
|
||||||
|
|
||||||
# Configures the default from for emails sent for Messages and Notifications
|
# Configures the default from for emails sent for Messages and Notifications
|
||||||
config.default_from = "Growstuff <#{ENV.fetch('GROWSTUFF_EMAIL', "no-reply@growstuff.org")}>"
|
config.default_from = "no-reply@growstuff.org"
|
||||||
|
|
||||||
# Configures the methods needed by mailboxer
|
# Configures the methods needed by mailboxer
|
||||||
# config.email_method = :email
|
# config.email_method = :email
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
Rails.application.config.middleware.use OmniAuth::Builder do
|
Rails.application.config.middleware.use OmniAuth::Builder do
|
||||||
|
provider :twitter, ENV.fetch('GROWSTUFF_TWITTER_KEY', nil), ENV.fetch('GROWSTUFF_TWITTER_SECRET', nil)
|
||||||
provider :flickr, ENV.fetch('GROWSTUFF_FLICKR_KEY', nil), ENV.fetch('GROWSTUFF_FLICKR_SECRET', nil), scope: 'read'
|
provider :flickr, ENV.fetch('GROWSTUFF_FLICKR_KEY', nil), ENV.fetch('GROWSTUFF_FLICKR_SECRET', nil), scope: 'read'
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -78,7 +78,6 @@ en:
|
|||||||
harvest_crop: Harvest %{crop_name}
|
harvest_crop: Harvest %{crop_name}
|
||||||
mark_as_active: Mark as active
|
mark_as_active: Mark as active
|
||||||
mark_as_finished: Mark as finished
|
mark_as_finished: Mark as finished
|
||||||
mark_as_failed: Mark as failed
|
|
||||||
mark_as_inactive: Mark as inactive
|
mark_as_inactive: Mark as inactive
|
||||||
my_gardens: My Gardens
|
my_gardens: My Gardens
|
||||||
new_seeds: New saved seed
|
new_seeds: New saved seed
|
||||||
@@ -308,8 +307,6 @@ en:
|
|||||||
finish_helper: >
|
finish_helper: >
|
||||||
A planting is finished when you've harvested all of the crop, or it dies, or it's otherwise
|
A planting is finished when you've harvested all of the crop, or it dies, or it's otherwise
|
||||||
no longer growing in your garden.
|
no longer growing in your garden.
|
||||||
failed_helper: >
|
|
||||||
Mark this planting as failed if it died or was removed without any harvest.
|
|
||||||
index:
|
index:
|
||||||
title:
|
title:
|
||||||
crop_plantings: Everyone's %{crop} plantings
|
crop_plantings: Everyone's %{crop} plantings
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
en:
|
|
||||||
mailboxer:
|
|
||||||
message_mailer:
|
|
||||||
subject_new: "New Notification: %{subject}"
|
|
||||||
subject_reply: "New Reply: %{subject}"
|
|
||||||
notification_mailer:
|
|
||||||
subject: "New notification: %{subject}"
|
|
||||||
@@ -40,9 +40,6 @@ Rails.application.routes.draw do
|
|||||||
collection do
|
collection do
|
||||||
get 'crop/:crop' => 'plantings#index', as: 'plantings_by_crop'
|
get 'crop/:crop' => 'plantings#index', as: 'plantings_by_crop'
|
||||||
end
|
end
|
||||||
member do
|
|
||||||
post :transplant
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
resources :seeds, concerns: :has_photos, param: :slug do
|
resources :seeds, concerns: :has_photos, param: :slug do
|
||||||
|
|||||||
22
crowdin.yml
22
crowdin.yml
@@ -1,22 +0,0 @@
|
|||||||
# Hi there!
|
|
||||||
#
|
|
||||||
# This is a configuration file for the Crowdin CLI.
|
|
||||||
# You'll need to replace the placeholder project_id with your actual
|
|
||||||
# project ID from CrowdIn.
|
|
||||||
#
|
|
||||||
# For more information, see the Crowdin CLI documentation:
|
|
||||||
# https://support.crowdin.com/enterprise/cli-v3/
|
|
||||||
#
|
|
||||||
project_id: "your-project-id"
|
|
||||||
api_token_env: "CROWDIN_API_TOKEN"
|
|
||||||
base_path: "."
|
|
||||||
|
|
||||||
files:
|
|
||||||
- source: '/config/locales/en.yml'
|
|
||||||
translation: '/config/locales/%two_letters_code%.yml'
|
|
||||||
# The 'ignore' property is used to exclude files from processing.
|
|
||||||
# We are ignoring the existing Japanese translation file.
|
|
||||||
ignore:
|
|
||||||
- '/config/locales/ja.yml'
|
|
||||||
- source: '/config/locales/*.en.yml'
|
|
||||||
translation: '/config/locales/%file_name%.%two_letters_code%.yml'
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
class AddSocialMediaToMembers < ActiveRecord::Migration[6.0]
|
|
||||||
def change
|
|
||||||
add_column :members, :website_url, :string
|
|
||||||
add_column :members, :instagram_handle, :string
|
|
||||||
add_column :members, :facebook_handle, :string
|
|
||||||
add_column :members, :bluesky_handle, :string
|
|
||||||
add_column :members, :other_handle, :string
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
class RenameOtherHandleToOtherUrlInMembers < ActiveRecord::Migration[6.0]
|
|
||||||
def change
|
|
||||||
rename_column :members, :other_handle, :other_url
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
# frozen_string_literal: true
|
|
||||||
|
|
||||||
class AddLanguageToAlternateNames < ActiveRecord::Migration[7.2]
|
|
||||||
def change
|
|
||||||
add_column :alternate_names, :language, :string, null: false
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
# frozen_string_literal: true
|
|
||||||
|
|
||||||
class SetDefaultLanguageForExistingAlternateNames < ActiveRecord::Migration[7.2]
|
|
||||||
def up
|
|
||||||
AlternateName.update_all(language: 'en')
|
|
||||||
end
|
|
||||||
|
|
||||||
def down
|
|
||||||
AlternateName.update_all(language: nil)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
class MakeNotificationsPolymorphic < ActiveRecord::Migration[6.1]
|
|
||||||
def change
|
|
||||||
add_column :notifications, :notifiable_type, :string
|
|
||||||
rename_column :notifications, :post_id, :notifiable_id
|
|
||||||
|
|
||||||
reversible do |dir|
|
|
||||||
dir.up do
|
|
||||||
ActiveRecord::Base.connection.execute("UPDATE notifications SET notifiable_type = 'Post' WHERE notifiable_type IS NULL")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
add_index :notifications, %i(notifiable_type notifiable_id)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
class ChangeCommentsPolymorphic < ActiveRecord::Migration[7.2]
|
|
||||||
def change
|
|
||||||
add_column :comments, :commentable_type, :string
|
|
||||||
rename_column :comments, :post_id, :commentable_id
|
|
||||||
|
|
||||||
add_index :comments, %i(commentable_type commentable_id)
|
|
||||||
|
|
||||||
reversible do |dir|
|
|
||||||
dir.up do
|
|
||||||
ActiveRecord::Base.connection.execute("UPDATE comments SET commentable_type = 'Post' WHERE commentable_type IS NULL")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
# frozen_string_literal: true
|
|
||||||
|
|
||||||
class AddPhotosCommentCount < ActiveRecord::Migration[7.2]
|
|
||||||
def change
|
|
||||||
change_table :photos do |t|
|
|
||||||
t.integer :comments_count, default: 0
|
|
||||||
end
|
|
||||||
reversible do |dir|
|
|
||||||
dir.up { set_counter_value }
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def set_counter_value
|
|
||||||
execute <<-SQL.squish
|
|
||||||
UPDATE photos
|
|
||||||
SET comments_count = (
|
|
||||||
SELECT count(1)
|
|
||||||
FROM comments
|
|
||||||
WHERE comments.commentable_id = comments.id
|
|
||||||
AND comments.commentable_type = 'Photo'
|
|
||||||
)
|
|
||||||
SQL
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
# frozen_string_literal: true
|
|
||||||
|
|
||||||
class AddFailedToPlantings < ActiveRecord::Migration[6.0]
|
|
||||||
def change
|
|
||||||
add_column :plantings, :failed, :boolean, default: false, null: false
|
|
||||||
end
|
|
||||||
end
|
|
||||||
17
db/schema.rb
17
db/schema.rb
@@ -10,7 +10,7 @@
|
|||||||
#
|
#
|
||||||
# It's strongly recommended that you check this file into your version control system.
|
# It's strongly recommended that you check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema[7.2].define(version: 2025_08_24_162600) do
|
ActiveRecord::Schema[7.2].define(version: 2024_09_29_041435) do
|
||||||
# These are extensions that must be enabled in order to support this database
|
# These are extensions that must be enabled in order to support this database
|
||||||
enable_extension "plpgsql"
|
enable_extension "plpgsql"
|
||||||
|
|
||||||
@@ -67,7 +67,6 @@ ActiveRecord::Schema[7.2].define(version: 2025_08_24_162600) do
|
|||||||
t.integer "creator_id", null: false
|
t.integer "creator_id", null: false
|
||||||
t.datetime "created_at", precision: nil
|
t.datetime "created_at", precision: nil
|
||||||
t.datetime "updated_at", precision: nil
|
t.datetime "updated_at", precision: nil
|
||||||
t.string "language"
|
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "authentications", id: :serial, force: :cascade do |t|
|
create_table "authentications", id: :serial, force: :cascade do |t|
|
||||||
@@ -203,12 +202,11 @@ ActiveRecord::Schema[7.2].define(version: 2025_08_24_162600) do
|
|||||||
end
|
end
|
||||||
|
|
||||||
create_table "comments", id: :serial, force: :cascade do |t|
|
create_table "comments", id: :serial, force: :cascade do |t|
|
||||||
t.integer "commentable_id", null: false
|
t.integer "post_id", null: false
|
||||||
t.integer "author_id", null: false
|
t.integer "author_id", null: false
|
||||||
t.text "body", null: false
|
t.text "body", null: false
|
||||||
t.datetime "created_at", precision: nil
|
t.datetime "created_at", precision: nil
|
||||||
t.datetime "updated_at", precision: nil
|
t.datetime "updated_at", precision: nil
|
||||||
t.string "commentable_type"
|
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "crop_companions", force: :cascade do |t|
|
create_table "crop_companions", force: :cascade do |t|
|
||||||
@@ -448,11 +446,6 @@ ActiveRecord::Schema[7.2].define(version: 2025_08_24_162600) do
|
|||||||
t.integer "photos_count"
|
t.integer "photos_count"
|
||||||
t.integer "forums_count"
|
t.integer "forums_count"
|
||||||
t.integer "activities_count"
|
t.integer "activities_count"
|
||||||
t.string "website_url"
|
|
||||||
t.string "instagram_handle"
|
|
||||||
t.string "facebook_handle"
|
|
||||||
t.string "bluesky_handle"
|
|
||||||
t.string "other_url"
|
|
||||||
t.index ["confirmation_token"], name: "index_members_on_confirmation_token", unique: true
|
t.index ["confirmation_token"], name: "index_members_on_confirmation_token", unique: true
|
||||||
t.index ["discarded_at"], name: "index_members_on_discarded_at"
|
t.index ["discarded_at"], name: "index_members_on_discarded_at"
|
||||||
t.index ["email"], name: "index_members_on_email", unique: true
|
t.index ["email"], name: "index_members_on_email", unique: true
|
||||||
@@ -472,11 +465,9 @@ ActiveRecord::Schema[7.2].define(version: 2025_08_24_162600) do
|
|||||||
t.string "subject"
|
t.string "subject"
|
||||||
t.text "body"
|
t.text "body"
|
||||||
t.boolean "read", default: false
|
t.boolean "read", default: false
|
||||||
t.integer "notifiable_id"
|
t.integer "post_id"
|
||||||
t.datetime "created_at", precision: nil
|
t.datetime "created_at", precision: nil
|
||||||
t.datetime "updated_at", precision: nil
|
t.datetime "updated_at", precision: nil
|
||||||
t.string "notifiable_type"
|
|
||||||
t.index ["notifiable_type", "notifiable_id"], name: "index_notifications_on_notifiable_type_and_notifiable_id"
|
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "orders_products", id: false, force: :cascade do |t|
|
create_table "orders_products", id: false, force: :cascade do |t|
|
||||||
@@ -509,7 +500,6 @@ ActiveRecord::Schema[7.2].define(version: 2025_08_24_162600) do
|
|||||||
t.datetime "date_taken", precision: nil
|
t.datetime "date_taken", precision: nil
|
||||||
t.integer "likes_count", default: 0
|
t.integer "likes_count", default: 0
|
||||||
t.string "source"
|
t.string "source"
|
||||||
t.integer "comments_count", default: 0
|
|
||||||
t.index ["fullsize_url"], name: "index_photos_on_fullsize_url", unique: true
|
t.index ["fullsize_url"], name: "index_photos_on_fullsize_url", unique: true
|
||||||
t.index ["thumbnail_url"], name: "index_photos_on_thumbnail_url", unique: true
|
t.index ["thumbnail_url"], name: "index_photos_on_thumbnail_url", unique: true
|
||||||
end
|
end
|
||||||
@@ -553,7 +543,6 @@ ActiveRecord::Schema[7.2].define(version: 2025_08_24_162600) do
|
|||||||
t.integer "parent_seed_id"
|
t.integer "parent_seed_id"
|
||||||
t.integer "harvests_count", default: 0
|
t.integer "harvests_count", default: 0
|
||||||
t.integer "likes_count", default: 0
|
t.integer "likes_count", default: 0
|
||||||
t.boolean "failed", default: false, null: false
|
|
||||||
t.index ["slug"], name: "index_plantings_on_slug", unique: true
|
t.index ["slug"], name: "index_plantings_on_slug", unique: true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -40,6 +40,11 @@ GROWSTUFF_SITE_NAME="Growstuff (dev)"
|
|||||||
GROWSTUFF_MAILCHIMP_APIKEY=""
|
GROWSTUFF_MAILCHIMP_APIKEY=""
|
||||||
GROWSTUFF_MAILCHIMP_NEWSLETTER_ID=""
|
GROWSTUFF_MAILCHIMP_NEWSLETTER_ID=""
|
||||||
|
|
||||||
|
# Used for connecting member accounts to Twitter
|
||||||
|
# Get Twitter key from https://dev.twitter.com/apps
|
||||||
|
GROWSTUFF_TWITTER_KEY=""
|
||||||
|
GROWSTUFF_TWITTER_SECRET=""
|
||||||
|
|
||||||
# Used for connecting member accounts to Flickr
|
# Used for connecting member accounts to Flickr
|
||||||
# Get Flickr key from http://www.flickr.com/services/apps/create/apply/
|
# Get Flickr key from http://www.flickr.com/services/apps/create/apply/
|
||||||
GROWSTUFF_FLICKR_KEY=""
|
GROWSTUFF_FLICKR_KEY=""
|
||||||
|
|||||||
@@ -61,6 +61,8 @@ class Growstuff::OauthSignupAction
|
|||||||
|
|
||||||
def determine_name(auth)
|
def determine_name(auth)
|
||||||
case auth['provider']
|
case auth['provider']
|
||||||
|
when 'twitter'
|
||||||
|
auth['info']['nickname']
|
||||||
when 'flickr'
|
when 'flickr'
|
||||||
auth['info']['name']
|
auth['info']['name']
|
||||||
else
|
else
|
||||||
|
|||||||
11
lib/tasks/openfarm.rake
Normal file
11
lib/tasks/openfarm.rake
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
namespace :openfarm do
|
||||||
|
desc "Retrieve crop info from open farm"
|
||||||
|
# usage: rake growstuff:admin_user name=skud
|
||||||
|
|
||||||
|
task import: :environment do
|
||||||
|
Rails.logger = Logger.new(STDOUT)
|
||||||
|
OpenfarmService.new.import!
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
# frozen_string_literal: true
|
|
||||||
|
|
||||||
namespace :photos do
|
|
||||||
desc 'Removes references to photos that dont exist anymore (404)'
|
|
||||||
task prune_404s: :environment do
|
|
||||||
puts 'Checking for broken photo links...'
|
|
||||||
Photo.find_each do |photo|
|
|
||||||
puts "Checking #{photo.fullsize_url}..."
|
|
||||||
uri = URI.parse(photo.fullsize_url)
|
|
||||||
http = Net::HTTP.new(uri.host, uri.port)
|
|
||||||
http.use_ssl = (uri.scheme == 'https')
|
|
||||||
request = Net::HTTP::Head.new(uri.request_uri)
|
|
||||||
response = http.request(request)
|
|
||||||
if response.code == '404'
|
|
||||||
puts "Photo #{photo.id} is broken, deleting."
|
|
||||||
photo.destroy
|
|
||||||
end
|
|
||||||
end
|
|
||||||
puts 'Done.'
|
|
||||||
end
|
|
||||||
end
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user