Compare commits

..

288 Commits

Author SHA1 Message Date
Daniel O'Connor
3bfe2329f1 Merge pull request #1032 from Growstuff/dev
Release 14
2016-08-22 19:19:04 +09:30
Cesy
941001c743 Merge pull request #1029 from CloCkWeRX/add_seed_purchase_links
Add links to ebay, which seems to have a variety of seeds to purchase…
2016-08-16 08:53:09 +01:00
Cesy
40cf5ba63a Merge pull request #1030 from CloCkWeRX/fix_998
Ensure we look at the current control, not the entire collection when marking planting finished
2016-08-16 08:50:30 +01:00
Cesy
9a40449f08 Merge pull request #1024 from CloCkWeRX/mapboxv4
#981 Add mapbox v4
2016-08-16 08:49:44 +01:00
Daniel O'Connor
90a88cf69d Fixes #998 Ensure we look at the current control, not the entire collection 2016-08-16 10:33:23 +09:30
Daniel O'Connor
044a992d25 Merge pull request #1025 from polveenomials/nav-header
Enhancement of the navigation bar (header)
2016-08-15 23:30:11 +09:30
Daniel O'Connor
4b066ec37f Merge pull request #1028 from CloCkWeRX/minor_gem_upgrades_august_2016
Minor gem upgrades for August 2016
2016-08-15 23:28:30 +09:30
Daniel O'Connor
c2dc2c5836 Merge pull request #1027 from CloCkWeRX/cve-2016-6317
Fix CVE-2016-6316 CVE-2016-6317
2016-08-15 23:10:27 +09:30
Daniel O'Connor
58452204aa Add links to ebay, which seems to have a variety of seeds to purchase with our affiliate id 2016-08-15 22:42:32 +09:30
Daniel O'Connor
711ba73d6b Upgrade devise to 4.2 2016-08-15 22:12:34 +09:30
Daniel O'Connor
5354f2732f Update bootstrap-sass coveralls friendly_id js-routes sass-rails simplecov 2016-08-15 22:07:39 +09:30
Daniel O'Connor
9bbaaa2211 Upgrade excon ffi autoprefixer-rails multi_json mimemagic pry active_utils activemerchant 2016-08-15 22:04:43 +09:30
Daniel O'Connor
93c47d774e Upgrade minor gems: kramdown, notifany, httparty, codemirror-rails, bootstrap_form, globalid 2016-08-15 22:01:56 +09:30
Daniel O'Connor
d8ad697d09 Swap tokens 2016-08-15 21:53:17 +09:30
Daniel O'Connor
7308a7cf9a Name: actionview
Version: 4.2.6
Advisory: CVE-2016-6316
Criticality: Unknown
URL: https://groups.google.com/forum/#!topic/rubyonrails-security/I-VWr034ouk
Title: Possible XSS Vulnerability in Action View
Solution: upgrade to ~> 3.2.22.3, ~> 4.2.7.1, >= 5.0.0.1

Name: activerecord
Version: 4.2.6
Advisory: CVE-2016-6317
Criticality: Unknown
URL: https://groups.google.com/forum/#!topic/rubyonrails-security/rgO20zYW33s
Title: Unsafe Query Generation Risk in Active Record
Solution: upgrade to ~> 4.2.7.1
2016-08-15 21:45:26 +09:30
Cesy
c9c49a7e5e Merge pull request #1026 from CloCkWeRX/gardenate_attempt_2
Gardenate attempt 2
2016-08-15 13:15:21 +01:00
Daniel O'Connor
dba6b2a291 Mitigate security concerns with target=_blank via https://www.jitbit.com/alexblog/256-targetblank---the-most-underestimated-vulnerability-ever/ 2016-08-15 21:31:45 +09:30
Daniel O'Connor
7d3991b295 #967 Mitigate security concerns with target=_blank via https://www.jitbit.com/alexblog/256-targetblank---the-most-underestimated-vulnerability-ever/ 2016-08-15 21:30:51 +09:30
Daniel O'Connor
e4c0ecfb5a Add basic test 2016-08-15 21:30:40 +09:30
Daniel O'Connor
fdb0e842de #864 Add links to google, gardenate 2016-08-15 21:30:33 +09:30
polveenomials
85ff36198b Added name to the CONTRIBUTORS.md 2016-08-04 14:27:49 +08:00
Daniel O'Connor
e38321aa33 #981 Add mapbox access token (on my free 50k views account) and update to v4 2016-07-28 14:27:49 +09:30
Kristine Nicole Polvoriza
d1438d1b2e Fixed the nav header in mobile view 2016-07-28 12:31:50 +08:00
pozorvlak
b6f848ef66 Merge pull request #1021 from CloCkWeRX/picture_improvements
If a harvest doesn't have any photos, try to look at the crop's default photo
2016-07-21 18:24:58 +01:00
Daniel O'Connor
ff47784aee Add explicit test coverage 2016-07-21 12:21:56 +09:30
Daniel O'Connor
1dba711057 Add more explicit test coverage 2016-07-21 12:13:37 +09:30
Daniel O'Connor
6911f7b24b Typo 2016-07-21 12:05:37 +09:30
pozorvlak
1e94abd063 Merge pull request #1019 from CloCkWeRX/mobile_searchbar
Use navbar-right, and reposition search box to fix mobile layout
2016-07-20 12:44:03 +01:00
Cesy
3325e1e388 Merge pull request #1020 from Growstuff/dev
Release 13
2016-07-19 10:45:28 +01:00
Daniel O'Connor
4b87977e24 It helps to type properly 2016-07-08 18:12:16 +09:30
Daniel O'Connor
dfa28264c6 #1017 When a crop has no photos, look for harvests of the crop with photos. 2016-07-08 18:09:53 +09:30
Daniel O'Connor
f0c1d6d4c2 #997 Use the harvest photo lookup, not the harvest.crop one 2016-07-08 18:01:53 +09:30
Daniel O'Connor
427b98a157 #997 If a harvest doesn't have any photos, try to look at the crop's default photo 2016-07-08 17:59:32 +09:30
Daniel O'Connor
8f5000443f Use navbar-right, and reposition search box to fix mobile layout 2016-07-08 17:45:00 +09:30
Daniel O'Connor
7947fd6e91 Clean up link_to as per #1013 2016-07-08 17:08:17 +09:30
Daniel O'Connor
70bf5499b2 Clean up logic a bit as per #1013 2016-07-08 17:07:14 +09:30
Daniel O'Connor
6b059cb4f4 Clean up a bit as per #1013 with TODO comments 2016-07-08 17:06:05 +09:30
Daniel O'Connor
efd112c4b8 And vs && - revised version of b50127c166 2016-07-08 17:01:59 +09:30
Mackenzie Morgan
5c7b760f34 Use array literal [] instead of Array.new 2016-07-08 16:58:34 +09:30
Mackenzie Morgan
81ae473972 space between comma-separated arguments 2016-07-08 16:58:29 +09:30
Mackenzie Morgan
a8171bb739 has_key? -> key? 2016-07-08 16:58:22 +09:30
Daniel O'Connor
c803ed4ee6 Merge pull request #976 from pozorvlak/remove_default_shows
Remove "show" methods that just do the default
2016-07-08 16:56:25 +09:30
Daniel O'Connor
9e41a65749 Tweak readme wiki links
Supercedes #1016
2016-07-08 15:33:16 +09:30
Cesy
a7539df5b5 Merge pull request #1018 from CloCkWeRX/minor_rails_bump
Minor gem upgrades for the month
2016-07-01 10:14:22 +01:00
Daniel O'Connor
3950619877 Update various minor gems even more 2016-07-01 17:42:58 +09:30
Daniel O'Connor
7373fd4aa9 Update various minor gems 2016-07-01 17:34:25 +09:30
Daniel O'Connor
c3d9885525 Merge pull request #987 from CloCkWeRX/upgradazzle_rails
Upgrade to rails 4.2.0+ (round 2)
2016-06-29 14:47:05 +09:30
Daniel O'Connor
4b5dee7bdb Merge pull request #1007 from ctlewitt/dev
issue #1006: change "Freenode" to "irc.freenode.net" in README.md
2016-06-29 12:51:05 +09:30
Charley Lewittes
55d846b9e0 Merge remote-tracking branch 'them/dev' into dev 2016-06-22 10:56:56 -04:00
Daniel O'Connor
f2d8349a88 #1012 Tweak script to avoid errors after merge 2016-06-22 10:46:26 +09:30
Daniel O'Connor
7c7dd7c609 Merge pull request #1012 from pozorvlak/check_contributors_md
Check PR author is in CONTRIBUTORS.md under Travis
2016-06-22 10:25:06 +09:30
Charley Lewittes
d8f2c580ee added myself to contributors list 2016-06-21 13:14:26 -04:00
Charley Lewittes
2a0602468d Added link and wording to access Freenode IRC growstuff channel easily
fixes #1006
2016-06-21 13:03:06 -04:00
Charley Lewittes
89a9c18188 fixes #1006: change "Freenode" to "irc.freenode.net" in README.md 2016-06-21 12:49:33 -04:00
Miles Gould
8b426da149 Check PR author is in CONTRIBUTORS.md under Travis
Results of testing this locally (the exit value of the last command is
in my prompt):

```
0 $ TRAVIS=true TRAVIS_REPO_SLUG=growstuff/growstuff
TRAVIS_PULL_REQUEST=1007 script/check_contributors_md
Checking to see if you're in CONTRIBUTORS.md...

Thanks for your contribution, ctlewitt!
Please add your name and GitHub handle to the file CONTRIBUTORS.md,
commit it, and update your PR.

1 $ TRAVIS=true TRAVIS_REPO_SLUG=growstuff/growstuff
TRAVIS_PULL_REQUEST=1008 script/check_contributors_md
Checking to see if you're in CONTRIBUTORS.md...
- Miles Gould / [pozorvlak](https://github.com/pozorvlak)
0 $ script/check_contributors_md
Checking to see if you're in CONTRIBUTORS.md...
- Miles Gould / [pozorvlak](https://github.com/pozorvlak)
0 $
```
2016-06-21 16:37:26 +01:00
pozorvlak
cab98f9750 Merge pull request #1011 from Growstuff/revert-1002-letsencrypt-pt2-1
Revert "challenge code"
2016-06-21 15:28:15 +01:00
pozorvlak
27b7a26fee Merge pull request #1010 from Growstuff/revert-999-letsencrypt
Revert "lets encrypt challenge page"
2016-06-21 15:27:38 +01:00
Cesy
7261fae9f2 Revert "challenge code" 2016-06-21 15:06:02 +01:00
Cesy
628ebd6841 Revert "lets encrypt challenge page" 2016-06-21 15:05:45 +01:00
Cesy
61bbf7c30d Merge pull request #1008 from pozorvlak/test_gemfile_commits
Check for "forgot to commit Gemfile.lock" in CI
2016-06-21 14:57:54 +01:00
Miles Gould
e33803343a Check for "forgot to commit Gemfile.lock" in CI
Quick-and-dirty script to catch an error we've missed a couple of times
in code review, but which is not (AFAICT) covered by any of our existing
checkers. Inspired by the following posts:

 - https://zachholman.com/posts/how-github-writes-blog-posts/
 - https://zachholman.com/talk/move-fast-break-nothing/
2016-06-21 13:32:11 +01:00
Mackenzie
b08a448fdc hotfix commit: letsencrypt try #2 2016-06-20 13:40:49 -04:00
Cesy
7210ebfb22 Merge pull request #1004 from maco/letsencrypt
Letsencrypt, will be backed out once SSL is up and running.
2016-06-20 16:57:24 +01:00
Mackenzie Morgan
039978357b letsencrypt verification for staging 2016-06-20 11:48:19 -04:00
Cesy
7ce2481cbc Merge pull request #1002 from Growstuff/letsencrypt-pt2-1
challenge code - will also get reverted once SSL is up.
2016-06-20 15:49:33 +01:00
Mackenzie
5bc6af87c5 challenge code 2016-06-20 10:46:40 -04:00
Cesy
a5eaf3566e Merge pull request #999 from Growstuff/letsencrypt
lets encrypt challenge page - temporary change for SSL tool, will be backed out after
2016-06-20 15:42:22 +01:00
Mackenzie
63d89be698 lets encrypt challenge page 2016-06-20 10:34:11 -04:00
pozorvlak
1b7be9f9b0 Merge pull request #936 from maco/add_bootstrap_flashes
Add support for Bootstrap alert types
2016-06-20 10:19:36 +01:00
Mackenzie Morgan
7a53e96d52 test the default case 2016-06-19 22:52:51 -04:00
Mackenzie Morgan
b28d146de7 use default of info
add tests
2016-06-19 22:42:20 -04:00
Mackenzie Morgan
55c8be8dc5 merge 2016-06-19 22:27:27 -04:00
Daniel O'Connor
38a273459a Merge pull request #996 from pozorvlak/block_unknown_urls_in_features
Block external URLs in feature tests
2016-06-18 20:21:32 +09:30
Miles Gould
1b07632c69 Block external URLs in features
https://github.com/teampoltergeist/poltergeist/issues/375#issuecomment-42620085
suggested that this might help with our intermittent "Request to
http://localhost:8081 failed to reach server, check DNS and/or server
status" errors in CI - the theory being that the error message is
misleading, and it's actually a daughter request to an external service
timing out. Seems worth a shot. It also ought to speed up testing, but
the effect is slight (20s out of 3.5 minutes) on my machine.

I've blacklisted only URLs I could find in app/views or by tcpdumping a
test run, because I couldn't get whitelisting to work.
2016-06-17 21:12:25 +01:00
pozorvlak
4a12523793 Merge pull request #991 from Growstuff/dev
Release 12
2016-06-17 11:37:29 +01:00
pozorvlak
6aa601b8ab Merge pull request #993 from Growstuff/revert-988-dev
Revert "Handled Issue #950 (Branded Error Pages)"
2016-06-16 13:30:50 +01:00
pozorvlak
a66a040207 Revert "Handled Issue #950 (Branded Error Pages)" 2016-06-16 12:58:22 +01:00
pozorvlak
547a408a99 Merge pull request #988 from Prashanth261993/dev
Add branding to error pages (#950)
2016-06-16 11:12:23 +01:00
pozorvlak
8cd224b7fa Merge pull request #990 from maco/sparkpost_#917
don't override our environment email settings with plain old sendmail
2016-06-15 20:03:35 +01:00
Mackenzie Morgan
8428e93b47 don't override our environment email settings with plain old sendmail 2016-06-15 13:27:51 -04:00
Prashanth
483143f2fe Merge branch 'growstuff-dev' into dev
Conflicts:
	CONTRIBUTORS.md
2016-06-14 17:09:06 +05:30
pozorvlak
1b3d106b6d Merge pull request #989 from maco/sparkpost_#917
update to SparkPost's mailserver
2016-06-13 18:04:43 +01:00
Mackenzie Morgan
e7be006fa7 update to SparkPost's mailserver 2016-06-13 12:12:00 -04:00
Prashanth
b9f40151d8 Handled Issue #950 (Branded Error Pages)
Moved error related views from public to errors (asset pipeline can be used).
Header and footer were included along with the error message.
2016-06-10 18:35:48 +05:30
Daniel O'Connor
fd467acc29 Clean up whitespace 2016-06-10 20:51:02 +09:30
pozorvlak
e1ad0c31c8 Merge pull request #986 from CloCkWeRX/update_various_gems_nokogiri
Update various gems - nokogiri, mime-types, parser, guard-rspec
2016-06-10 11:09:12 +01:00
Daniel O'Connor
ee604dc2b0 Upgrade activemerchant, fixing rails 5 deprecation warnings 2016-06-10 16:04:00 +09:30
Daniel O'Connor
0620646c6d Fix failing specs
- Updated assert_select behaviour given this is now based on nokogiri
 - Adjust some specs not to look for a specific asset name, but a behaviour
 - Adjust some specs for HTML5 style attributes instead of xhtml style
 - Fix tests that did not render before
2016-06-10 16:01:30 +09:30
Daniel O'Connor
df9cf3f5c4 Fix various rails deprecations 2016-06-10 15:58:39 +09:30
Daniel O'Connor
944349760a Fix DEPRECATION WARNING: #timestamps was called without specifying an option for null.
In Rails 5, this behavior will change to `null: false`. You should manually specify `null: true` to prevent the behavior of your existing migrations from changing
2016-06-10 15:57:48 +09:30
Daniel O'Connor
7fe75ee52a Fix DEPRECATION WARNING: #deliver is deprecated. 2016-06-10 15:45:01 +09:30
Daniel O'Connor
e3d7bf9a62 Upgrade to rails 4.2.* 2016-06-10 15:43:04 +09:30
Daniel O'Connor
deaf49c18f Update selenium-webdriver 2016-06-10 15:40:56 +09:30
Daniel O'Connor
53543fff4c Update terminal-table 2016-06-10 15:40:29 +09:30
Daniel O'Connor
ea5e710a70 Update codeclimate-test-reporter 2016-06-10 15:38:43 +09:30
Daniel O'Connor
ad5a52ae74 Update tilt 2016-06-10 15:36:07 +09:30
Daniel O'Connor
c0cc5ab085 Update geocoder 2016-06-10 15:35:29 +09:30
Daniel O'Connor
cf784cbedd Update parser to current 2016-06-10 15:20:31 +09:30
Daniel O'Connor
5c68830919 Update guard-rspec 2016-06-10 15:19:57 +09:30
Daniel O'Connor
370aab41c3 Update mime-types 2016-06-10 15:19:28 +09:30
Daniel O'Connor
081f4021bc Upgrade nokogiri 2016-06-10 15:19:03 +09:30
Daniel O'Connor
36f846fabf Merge pull request #982 from CloCkWeRX/update_gibbon
Upgrade gibbon
2016-06-10 15:13:18 +09:30
pozorvlak
f6d094f57c Merge pull request #985 from lucasnogueira/fix_simplecov_deprecation
Fix SimpleCov Deprecation Warning
2016-06-09 22:37:40 +01:00
Lucas Nogueira
9ce097b7d6 Fix SimpleCov Deprecation Warning 2016-06-09 17:42:11 -03:00
pozorvlak
b03ccce575 Merge pull request #980 from lucasnogueira/replace_pluralize
Replace pluralize calls
2016-06-09 16:39:34 +01:00
Lucas Nogueira
63b8788c80 Change hash syntax 2016-06-09 11:57:56 -03:00
Daniel O'Connor
faa3beddbc Upgrade gibbon 2016-06-10 00:17:28 +09:30
Lucas Nogueira
5dbd5bc1d2 Correct minor typos 2016-06-09 08:21:28 -03:00
Lucas Nogueira
b8b0d98e07 Update the contributors list 2016-06-08 22:06:26 -03:00
Lucas Nogueira
b911ebfd07 Replace pluralize calls 2016-06-08 22:03:40 -03:00
Lucas Nogueira
1ca515bd4e Add missing activerecord model to locales 2016-06-08 21:56:29 -03:00
Lucas Nogueira
905710b6e9 Helper for plural localization 2016-06-08 21:55:33 -03:00
Mackenzie
12e0f674bc Merge pull request #977 from pozorvlak/fix_devise_warnings
Replace deprecated Devise `for` method with `permit`
2016-06-08 13:14:05 -04:00
Mackenzie
18739c2a24 Merge pull request #974 from pozorvlak/remove_vendor_dir
Remove vendor directory
2016-06-08 11:12:14 -04:00
pozorvlak
f3dc2ff7e5 Replace deprecated Devise for method with permit
This should eliminate the screens-ful of deprecation warnings when
running the test suite.
2016-06-08 15:00:05 +00:00
pozorvlak
e6209a5906 Remove "show" methods that just do the default
We can just fall back to the default implementation for these.
2016-06-08 15:58:45 +01:00
Mackenzie
dbf64a4e90 Merge pull request #975 from Growstuff/revert-972-show_concern
Revert "Show concern"
2016-06-08 09:26:58 -04:00
pozorvlak
a8961c3466 Revert "Show concern" 2016-06-08 12:58:32 +01:00
pozorvlak
6931952688 Whitespace fixes 2016-06-07 17:43:36 +00:00
pozorvlak
936aa17ecc Remove references to vendor directory
This consisted of instructions to various code-quality tools to
ignore it.
2016-06-07 17:43:36 +00:00
pozorvlak
f3d7420b8a Remove vendor directory
We no longer need it, since we're now getting the functionality we
needed from upstream gems.
2016-06-07 17:43:35 +00:00
pozorvlak
e419acea6e Install BogusPayPalGateway gem
We were maintaining a vendor fork of active_merchant because they
refused to merge this feature in; it's now been released as a
separate gem.
2016-06-07 17:43:35 +00:00
pozorvlak
95ae15b780 Merge pull request #972 from maco/show_concern
Show concern
2016-06-07 16:22:17 +01:00
Mackenzie Morgan
ed468e79fc Merge branch 'dev' of gitmaco:Growstuff/growstuff into show_concern 2016-06-07 09:57:47 -04:00
Daniel O'Connor
130565af75 Merge pull request #969 from maco/code_climate_token
add Code Climate token to Travis config
2016-06-07 09:01:27 +09:30
Daniel O'Connor
ad8f360336 Merge pull request #970 from maco/codeclimate_exclude_vendor
exclude vendor gems from code climate
2016-06-07 09:01:05 +09:30
Daniel O'Connor
15775403fd Merge pull request #971 from maco/readme_email
info@ email exists again
2016-06-07 09:00:38 +09:30
Mackenzie Morgan
e1b83c32af info@ email exists again 2016-06-06 13:27:13 -04:00
Mackenzie Morgan
3fc7c65247 exclude vendor gems from code climate 2016-06-06 13:14:01 -04:00
Mackenzie Morgan
c8d1239b79 add Code Climate token to Travis config 2016-06-06 09:40:30 -04:00
Cesy
7885257fae Merge pull request #943 from CloCkWeRX/adjust_helper
Deal with .nil quantity of a seed in rendering helper
2016-06-04 12:41:03 +01:00
Daniel O'Connor
a8d22709e6 Add explict test coverage of the helper with nil seeds (page level tests already cover this rendering on crop detail in general) 2016-06-04 20:51:20 +09:30
pozorvlak
31b7b45ae3 Merge pull request #966 from cesy/readme
Updating readme with current wiki status and Gitter link
2016-06-03 14:34:35 +01:00
Cesy Avon
681798b582 Updating readme with current wiki status and Gitter link 2016-06-03 13:12:19 +00:00
Cesy
f05ea56179 Merge pull request #965 from dv2/dev
Add test coverage for GardensHelper
2016-06-03 14:03:07 +01:00
DV Dasari
ed4269ea4c fixing grammar in test descriptions 2016-06-03 07:54:24 -05:00
DV Dasari
085fcc958e Add test coverage for GardensHelper 2016-06-02 22:22:14 -05:00
pozorvlak
8f33fe3595 Merge pull request #960 from CloCkWeRX/update_various_gems
Update various gems
2016-06-02 18:18:12 +01:00
pozorvlak
980a7d79d3 Merge pull request #963 from CloCkWeRX/add_better_opengraph_squashed
Various bugfixes for facebook/opengraph
2016-06-02 17:58:05 +01:00
pozorvlak
9c5c07e087 Merge pull request #948 from cesy/issue875
Fix #875 edited date on comments on homepage
2016-06-02 17:41:59 +01:00
Daniel O'Connor
faaf07cad8 Render the full size image, as facebook doesn't like smaller thumbnails 2016-06-03 01:58:34 +09:30
Daniel O'Connor
0e83a230b9 Helps not to render excess info 2016-06-03 01:54:26 +09:30
Daniel O'Connor
c278b36858 Up the various opengraph images to 200x200 2016-06-03 01:45:43 +09:30
pozorvlak
0805f86b86 Merge pull request #961 from cesy/issue476
Issue 476 edited by date on comments and posts
2016-06-02 16:53:44 +01:00
pozorvlak
aad88f1da6 Merge pull request #962 from CloCkWeRX/add_better_opengraph_squashed
Add better opengraph behaviour, fix facebook share thumbnail size
2016-06-02 16:52:13 +01:00
Daniel O'Connor
7550bc860f #816 Add better opengraph behaviour, fix facebook share thumbnail size 2016-06-03 01:01:03 +09:30
Cesy Avon
fc38e1edea Issue #476 test update 2016-06-02 14:58:10 +00:00
Daniel O'Connor
88a66a705b Update devise to 4.1.X and unpin 2016-06-03 00:23:58 +09:30
Daniel O'Connor
f77fd00931 Remove version pin for rspec-rails 2016-06-03 00:19:49 +09:30
Daniel O'Connor
b5c030905a Upgrade to geocoder current (we shouldn't be affected by the deprecations in 1.2.X or 1.3.X) 2016-06-03 00:16:00 +09:30
Daniel O'Connor
2844e13298 Upgrade factory_girl_rails, factory_girl 2016-06-03 00:10:25 +09:30
Cesy Avon
3e4dc1f9e3 Issue #875 typo causing test error 2016-06-02 14:39:56 +00:00
Cesy Avon
259c1e1731 Fix #476 show edited and posted date on posts and comments 2016-06-02 14:37:33 +00:00
Daniel O'Connor
870aa674b0 Upgrade autoprefixer-rails to current 2016-06-03 00:07:28 +09:30
Daniel O'Connor
b1ab319bf7 Update mime-types-data to current 2016-06-03 00:05:46 +09:30
Daniel O'Connor
857422719a Upgrade byebug to current 2016-06-03 00:04:09 +09:30
Daniel O'Connor
235314bc13 Upgrade js-routes to current 2016-06-03 00:03:48 +09:30
Daniel O'Connor
ac1cd88ae1 Upgrade kaminari to current 2016-06-03 00:01:38 +09:30
Daniel O'Connor
f93ea3c0a1 Upgrade httparty to current 2016-06-03 00:00:08 +09:30
Cesy Avon
0075040aab Fix #875 edited date on comments on homepage 2016-06-02 13:56:03 +00:00
Cesy
f9d51e623c Merge pull request #959 from pozorvlak/remove_capfile
Remove the Capistrano configuration file
2016-06-02 14:13:46 +01:00
Miles Gould
dcd36dcd67 Remove the Capistrano configuration file
Finishes work started in 93e468876d.
2016-06-02 13:45:53 +01:00
Cesy
608a921fce Merge pull request #956 from CloCkWeRX/upgrade_devise4
Upgrade to devise 4.0.*
2016-06-02 10:18:29 +01:00
pozorvlak
4bedf1e6ac Merge pull request #955 from CloCkWeRX/upgrade_geocoder
Swap to geocoder 1.1.9
2016-06-02 09:49:04 +01:00
pozorvlak
ac14c310f6 Merge pull request #954 from CloCkWeRX/ruby_231
Bump to Ruby 2.3.1
2016-06-02 09:48:20 +01:00
Daniel O'Connor
f979da315a Explicitly swap from config.email_regexp = /\A[^@\s]+@([^@\s]+\.)+[^@\W]+\z/
to the new default
2016-06-02 13:50:25 +09:30
Daniel O'Connor
a74ef7de6b Upgrade to devise 4.0.3 2016-06-02 13:49:13 +09:30
Daniel O'Connor
10064121a6 #953 Swap to geocoder 1.1.9; which is the release just after what we had previously pinned 2016-06-02 13:30:42 +09:30
Daniel O'Connor
f8a1ef6066 #952 Try ruby 2.3.1 2016-06-02 13:14:10 +09:30
Daniel O'Connor
40d7b11d90 #952 Try ruby 2.3.1 2016-06-02 13:13:52 +09:30
Mackenzie Morgan
1600dd9e0b Merge branch 'dev' of gitmaco:Growstuff/growstuff into add_bootstrap_flashes 2016-06-01 23:37:25 -04:00
pozorvlak
fbf5164eca Merge pull request #937 from dv2/dev
Add test coverage for Seeds Helper
2016-06-01 16:33:38 +01:00
DV Dasari
21d86a8c2d improve the test descriptions to be more readable 2016-06-01 09:46:22 -05:00
DV Dasari
848c7e117b Add test coverage for Seeds Helper 2016-06-01 09:46:22 -05:00
Cesy
369868672b Merge pull request #942 from pozorvlak/fix_coverage_calculations
Fix coverage calculations
2016-06-01 15:41:42 +01:00
Daniel O'Connor
321f3517a7 #920 Deal with .nil quantity of a seed in rendering helper 2016-06-01 23:26:43 +09:30
Miles Gould
6dd7ec9f95 Fix coverage calculations
SimpleCov was reporting 0% coverage for any files loaded before
`SimpleCov.start` was called, even if they were fully tested. This patch
loads the application *after* starting SimpleCov, leading to more
accurate coverage figures.
2016-06-01 14:54:13 +01:00
Cesy
dc00878ff9 Merge pull request #938 from Growstuff/dev
Release 11
2016-06-01 14:13:42 +01:00
Mackenzie Morgan
90f444dc1a Merge branch 'dev' of gitmaco:Growstuff/growstuff into add_bootstrap_flashes 2016-05-31 10:50:56 -04:00
Miles Gould
4fa2e273aa Merge remote-tracking branch 'origin/pr/933' into dev 2016-05-31 15:48:17 +01:00
pozorvlak
df92e0574a Merge pull request #934 from dv2/dev
Align links properly on "Forgot password page", "Resend confirmation" and "Resend unlock" pages
2016-05-31 15:46:27 +01:00
DV Dasari
e2053e2f8b adding me to CONTRIBUTORS.md 2016-05-31 07:33:40 -05:00
Eric Tillberg
31f0052b9d added to contributors list 2016-05-31 06:49:17 -04:00
pozorvlak
b6169778fd Merge pull request #932 from CloCkWeRX/location-not-set
Add a location not set layout (lets try this again!)
2016-05-31 11:41:11 +01:00
Mackenzie Morgan
32b98a7e40 Add support for Bootstrap alert types
* All alerts are currently shoved into either red (error) or green (success)
* Add support for yellow (warning) and blue (info) alert types

Solution from this Stack Overflow: http://stackoverflow.com/questions/31094771/rails-bootstrap-haml-how-to-convert-this-code-to-display-flash-messages-to
2016-05-30 21:48:11 -04:00
Daniel O'Connor
5111c2a96b Add sr-only text 2016-05-31 09:43:53 +09:30
Eric Tillberg
2ac901c891 feature test for issue 910 2016-05-30 09:06:09 -04:00
Mackenzie
ff4466951c Merge pull request #935 from CloCkWeRX/remove_crowdfunding
Remove crowdfunding code
2016-05-29 23:27:22 -04:00
Daniel O'Connor
8f05e254a2 Remove crowdfunding code 2016-05-30 10:06:51 +09:30
DV Dasari
5122903139 align links on "Resend unlock instructions" page 2016-05-29 18:25:01 -05:00
DV Dasari
1344f776e4 align devise shared links properly on "Resend confirmation instructions" page 2016-05-29 18:23:57 -05:00
DV Dasari
f33367ebac align devise shared links properly on "Forgot your password" page 2016-05-29 18:19:15 -05:00
Eric Tillberg
3ac42deae5 crop approval flash alert for wranglers upon sign in 2016-05-29 16:13:21 -04:00
Daniel O'Connor
3d04e7c125 Add list-inline to ensure the sidebar never conflicts with other content 2016-05-28 09:30:54 +09:30
Daniel O'Connor
fa77f11177 Based on MIT licenced icon-globe (http://fontawesome.io/3.2.1/icon/globe/) 2016-05-28 09:26:00 +09:30
pozorvlak
45c8767234 Merge pull request #922 from maco/bug-#848
Swap over to having "(Optional)" (or translation) after optional form…
2016-05-27 17:41:42 +01:00
Mackenzie Morgan
13dc87f368 Optional field improvements
* Added custom matcher `have_optional(field id name goes here)`
* Fix partial
* Add tests
2016-05-27 11:26:36 -04:00
Mackenzie Morgan
fc0116182f Merge branch 'dev' of gitmaco:Growstuff/growstuff into bug-#848 2016-05-27 11:24:37 -04:00
Mackenzie
bbe9f3f1db Merge pull request #927 from pozorvlak/delete_puts_in_spec
Remove warnings and debugging puts from rspec output
2016-05-27 11:21:52 -04:00
Miles Gould
1009570102 Check href attribute of links in planting reminder
To check the target of a link, you need to pass it to `has_link` as an
`href` keyword argument. We were passing it as a positional argument,
which meant that

 - it was ignored, weakening the tests
 - the output of rspec filled up with annoying warnings.

Fixes #928.
2016-05-27 15:46:21 +01:00
Mackenzie Morgan
47f42d0ffa Merge branch 'dev' of gitmaco:Growstuff/growstuff into bug-#848 2016-05-27 10:22:35 -04:00
Miles Gould
23d21be73f Delete debugging puts statement from spec
Fixes the "rspec output includes an HTML page dump" issue noted at
2089866756 (diff-6464240396bc745d7e89a408c200fd3aR15)
2016-05-27 14:04:30 +01:00
pozorvlak
25f8d2ca44 Merge pull request #924 from maco/capybara-tools
Add capybara-screenshot to assist with feature testing
2016-05-27 13:18:26 +01:00
pozorvlak
58d91ec0b0 Merge pull request #923 from maco/bug-#854
Display one line of description in harvest card, then go to ellipsis …
2016-05-27 12:17:10 +01:00
pozorvlak
85cc9868cb Merge pull request #925 from maco/bug-#906
Capture originalText from the button that's been clicked, not from…
2016-05-27 11:24:08 +01:00
Mackenzie Morgan
75631da398 Set filename of screenshot to test name 2016-05-27 00:21:02 -04:00
Mackenzie Morgan
03c74dae03 Capture originalText from the button that's been clicked, not from the array of all possible date-picker buttons.
Fixes #906
2016-05-26 23:55:49 -04:00
Mackenzie Morgan
2089866756 Display one line of description in harvest card, then go to ellipsis and put read more on next line
Fixes #854
2016-05-26 23:08:23 -04:00
Mackenzie Morgan
8d982c7e3e Add capybara-screenshot to assist with feature testing 2016-05-26 22:39:58 -04:00
Mackenzie Morgan
079cecc529 Swap over to having "(Optional)" (or translation) after optional form elements rather than using placeholder text
Fixes #848
2016-05-26 16:53:46 -04:00
pozorvlak
b0d90f6fd5 Merge pull request #921 from maco/bug-#876
Use standardized & translateable strings for the photo show page
2016-05-26 17:50:12 +01:00
Mackenzie Morgan
58f4ae32d0 test update 2016-05-26 12:28:58 -04:00
Mackenzie Morgan
dd0373a3ee Use standardized & translateable strings for the photo show page
Fixes #876
2016-05-26 11:51:46 -04:00
pozorvlak
170dca7086 Merge pull request #918 from maco/bug-#855
Stop hard-coding strings for pagination
2016-05-26 13:00:33 +01:00
pozorvlak
c930f04b5a Merge pull request #905 from maco/photos
refactor photo controller create for readability
2016-05-26 12:57:29 +01:00
Cesy
f41d919ca8 Merge pull request #916 from maco/bug_873
make seed card heading link to seed page and add owner link. Fixes #873
2016-05-26 09:58:37 +01:00
Cesy
8c4583b0d3 Merge pull request #915 from maco/autocomplete_dropdown
set background color on autocomplete dropdown. Fixes #914
2016-05-26 09:57:02 +01:00
Mackenzie Morgan
972518e9fc Stop hard-coding strings for pagination
Use translation template to set singular/other strings
for .model_name

Fixes #855
2016-05-25 23:15:36 -04:00
pozorvlak
5b38fad85e Merge pull request #912 from maco/small_fixes
Fix two small things (including: make tests stop failing)
2016-05-25 23:25:47 +01:00
Mackenzie Morgan
d227601627 Add config/factory_girl.rb so that rspec doesn't fail with a confusing
'Could not find mapping for #<Member...' error
http://blog.thefrontiergroup.com.au/2011/03/reloading-factory-girl-factories-in-the-rails-3-console/
2016-05-25 17:35:57 -04:00
Mackenzie Morgan
736e45aec9 update Gemfile.lock for code climate 2016-05-25 17:35:23 -04:00
Mackenzie Morgan
11e2e86b06 make seed card heading link to seed page and add owner link. Fixes #873 2016-05-25 16:21:17 -04:00
Mackenzie Morgan
58617b5685 set background color on autocomplete dropdown. Fixes #914 2016-05-25 16:07:49 -04:00
Mackenzie Morgan
8c2aa4844f use CW's case statement idea 2016-05-25 15:15:09 -04:00
Mackenzie Morgan
8648db5518 create SimpleShow concern for models where show's json call is simple 2016-05-25 13:37:01 -04:00
Mackenzie Morgan
b5b201b6df bundle 2016-05-25 10:38:06 -04:00
Mackenzie Morgan
b601fe40b3 refactor photo controller create for readability 2016-05-24 16:59:52 -04:00
pozorvlak
d6999b2a8a Merge pull request #879 from Growstuff/code_climate
Add code climate to README
2016-05-23 19:00:26 +01:00
Mackenzie Morgan
76f152aa35 add Code Climate config file 2016-05-23 13:07:18 -04:00
pozorvlak
63f8a2c5c0 Merge pull request #897 from maco/menu_fix
darken navbar item text when it opens (and the background turns light)
2016-05-23 12:25:22 +01:00
pozorvlak
ae482ecab6 Merge pull request #802 from cesy/issue690
Issue 690 Switch on CMS and remove old files
2016-05-23 12:24:49 +01:00
pozorvlak
a8e63ab397 Merge pull request #898 from CloCkWeRX/adjust_plantings_card_ui
Improve the styling of a planting to be more like the other card-layouts
2016-05-23 12:17:47 +01:00
pozorvlak
a2717ad058 Merge pull request #900 from CloCkWeRX/clip_long_text
Clip long text in definition lists within panels
2016-05-23 12:07:32 +01:00
Daniel O'Connor
92cce5910e Improve planting card UI on mobile 2016-05-23 16:35:58 +09:30
Daniel O'Connor
ab897f05f9 Use panel-body and panel-heading more effectively 2016-05-23 16:21:13 +09:30
Daniel O'Connor
cd8ca02322 Merge remote-tracking branch 'upstream/dev' into adjust_plantings_card_ui 2016-05-23 16:17:39 +09:30
Daniel O'Connor
5104225d11 #856 Clip long text in definition lists within panels 2016-05-23 16:13:53 +09:30
Mackenzie
24d6087ea7 Merge pull request #899 from CloCkWeRX/improve_nearby_places_links
Improve nearby places links
2016-05-22 23:39:53 -04:00
Daniel O'Connor
dc9ee18e96 Update stale test expectation 2016-05-23 12:56:37 +09:30
Daniel O'Connor
b4060b7903 Update stale test expectation 2016-05-23 12:55:50 +09:30
Daniel O'Connor
884a3aad2c Check we have a location before linking to it 2016-05-23 11:51:14 +09:30
Daniel O'Connor
80f826421b Add page anchors to put you to the area you are most interested in 2016-05-23 11:41:42 +09:30
Daniel O'Connor
7872bb48e2 Fixes #872 Add more links and explain them better 2016-05-23 11:35:49 +09:30
Daniel O'Connor
7d10101c57 For a place, talk about the community as a vaguer way of explaining 'members, seeds, plantings, etc' 2016-05-23 11:31:29 +09:30
Daniel O'Connor
d9ed21ba53 Styling the show view of a planting more like the card view (though 100% card view looks funny with the crop thumbnail floating to the right) 2016-05-23 11:24:32 +09:30
Daniel O'Connor
5e8211172b Only show a heading for Notes if there are notes 2016-05-23 11:12:42 +09:30
Daniel O'Connor
24956255d7 Fix layout of view all plantings link 2016-05-23 11:03:23 +09:30
Daniel O'Connor
55380dab04 Fix style regression by moving garden content properly into the container 2016-05-23 10:58:09 +09:30
Daniel O'Connor
e7926b6f22 Improve the styling of a planting to be more like the other card-layouts 2016-05-23 10:48:49 +09:30
Mackenzie Morgan
fe7d8f73f3 darken navbar item text when it opens (and the background turns light)
Fixes #896
2016-05-22 20:49:51 -04:00
Mackenzie
47d7f001fe Merge pull request #895 from cesy/precompile
Precompile css and js with sass
2016-05-22 15:10:43 -04:00
Cesy Avon
23a6722ddb Precompile css and js with sass 2016-05-22 16:34:36 +00:00
Cesy
23e2b756fd Merge pull request #886 from pozorvlak/fix_duplicated_class_warning
Fix "duplicated key: :class" warning in HAML code
2016-05-22 17:21:47 +01:00
pozorvlak
8bea05a77b Merge pull request #803 from cesy/issue734bootstrapaccessibility
Bootstrap accessibility
2016-05-22 17:19:55 +01:00
Cesy
d5ac4bac48 Merge pull request #894 from pozorvlak/upgradegibbon
Fix mailchimp newsletter subscriptions
2016-05-22 17:13:59 +01:00
pozorvlak
1af9b2e6db Merge pull request #892 from cesy/databaseconfig
Moving database.yml and adding gitignore
2016-05-22 17:09:35 +01:00
Cesy
daa3c08706 Fixing broken links to pages that are now in CMS 2016-05-22 16:05:07 +00:00
Cesy
29102e3b52 Cleaning up more tests 2016-05-22 16:05:07 +00:00
Cesy
8c0fc54344 Sorting tests related to moving to CMS 2016-05-22 16:04:39 +00:00
Cesy
f5b20c2f32 About is empty, policy won't work without the routes 2016-05-22 16:01:40 +00:00
Cesy
79734ff603 Fix #690 Removing old static files that are now in CMS 2016-05-22 16:01:40 +00:00
twconquest
397bfd8bca Start removing static page references. 2016-05-22 16:01:40 +00:00
Miles Gould
52dc111210 Merge branch 'dev' into upgradegibbon 2016-05-22 16:57:38 +01:00
Cesy Avon
da1375e34d Making database.yml locally editable 2016-05-22 15:50:22 +00:00
pozorvlak
19f4ee51ed Merge pull request #891 from Growstuff/dev
Release 10
2016-05-22 16:34:18 +01:00
Cesy
7be346d92f Merge pull request #890 from maco/gem_udpate
upgrade gems and make API change for ruby-units
2016-05-22 08:54:07 +01:00
Mackenzie Morgan
51a0a33b2a upgrade gems and make API change for ruby-units 2016-05-21 16:33:42 -04:00
Mackenzie Morgan
0df52b3cd8 update paperclip 2016-05-20 11:28:55 +01:00
Daniel O'Connor
18cd8f5966 #507 #813 Add spec 2016-05-19 15:53:11 -04:00
Kevin Rio
5a31619b46 If i reply to a notification directly, it's not marked as read. #507 2016-05-19 15:53:11 -04:00
Daniel O'Connor
4b4e0cf69a $ rubocop --only HashSyntax --auto-correct
483 files inspected, 2018 offenses detected, 2018 offenses corrected
2016-05-19 15:53:11 -04:00
Mackenzie Morgan
8659ebca2d switch from less to sass
* dependency hell + bit rot on upstream libraries  prevents installation on OS X
2016-05-19 15:52:54 -04:00
Miles Gould
238e0be682 Merge branch 'upgrade_misc_dev_tools' into dev 2016-05-19 15:02:32 +01:00
Mackenzie
4324ceb8ca Merge pull request #884 from pozorvlak/bump_ruby_22x
Bump ruby to 2.2.x
2016-05-19 09:40:48 -04:00
Miles Gould
79db3c4c1d Fix "duplicated key: :class" warning in HAML code
The warning was

    app/views/harvests/_form.html.haml:32: warning: duplicated key at line 32 ignored: :class

We were specifying two `:class` attributes on an HTML tag; I've combined
them into one.
2016-05-19 14:40:24 +01:00
Mackenzie
19d6c8f293 Merge pull request #882 from pozorvlak/install_all_gems_on_travis
Install *all* gems in TravisCI
2016-05-19 09:37:08 -04:00
Miles Gould
bcb74c7ed8 Merge branch 'dev' into bump_ruby_22x 2016-05-19 14:15:33 +01:00
Miles Gould
4a341bb7ab Install *all* gems in CI
Previously we were only installing the gems needed for testing. This
caused our CI to miss an incompatibility problem with a gem that was
only needed for another environment:
https://github.com/Growstuff/growstuff/pull/878#discussion_r63745751
2016-05-19 13:33:36 +01:00
Mackenzie
925027f7f0 add code climate test reporter 2016-05-17 14:02:42 -04:00
Mackenzie
1442a9106c add code climate / travis gem 2016-05-17 13:58:55 -04:00
Mackenzie
fafb421a51 Add code climate to README
Our code climate score is *abysmal*, but now that I've been using it in my job for a few months, I have some ideas how to improve it. It's all about clean code (check out the book of that name from your local library) and readability. So let's add the grade to the README, and I'll figure out how to set it up so that Code Climate is run on pull requests automatically (telling us whether things are going to get better or worse with every PR).
2016-05-17 13:47:33 -04:00
Daniel O'Connor
02615dc522 $ bundle update selenium-webdriver guard guard-rspec rails factory_girl pg simplecov coveralls newrelic_rpm better_errors minitest 2016-05-17 13:33:12 +09:30
Daniel O'Connor
668f6d3a2b Fix 'app/views/harvests/_form.html.haml:39: warning: duplicated key at line 39 ignored: :class' 2016-03-29 00:43:14 +10:30
Daniel O'Connor
b0adec20e7 Fix CVE-2015-7551 (https://www.ruby-lang.org/en/news/2015/12/16/unsafe-tainted-string-usage-in-fiddle-and-dl-cve-2015-7551/) 2016-03-28 23:40:17 +10:30
Daniel O'Connor
6905cd410d Bump to current ruby 2.2.*, as there's an end of life for 2.1.* https://www.ruby-lang.org/en/news/2016/02/24/support-plan-of-ruby-2-0-0-and-2-1/ 2016-03-28 23:38:25 +10:30
twconquest
b2f3755196 Additional config fix to point to correct list id 2015-09-09 19:48:35 +00:00
twconquest
2882e3d1a5 Correct Gibbon list id to point to correct list 2015-08-21 19:29:03 +00:00
Cesy
e8266480e5 Adding bootstrap-accessibility plugin 2015-08-12 14:17:41 +00:00
726 changed files with 3868 additions and 56109 deletions

36
.codeclimate.yml Normal file
View File

@@ -0,0 +1,36 @@
engines:
rubocop:
enabled: true
scss-lint:
enabled: true
shellcheck:
enabled: true
eslint:
enabled: true
coffeelint:
enabled: true
brakeman:
enabled: true
bundler-audit:
enabled: true
duplication:
enabled: true
config:
languages:
- ruby
- javascript
fixme:
enabled: true
ratings:
paths:
- "**.rb"
- "**.js"
- "**.coffee"
- "**.sass"
- "**.haml"
- Gemfile.lock
exclude_paths:
- config/
- db/
- spec/
- public/

2
.gitignore vendored
View File

@@ -8,10 +8,10 @@ coverage
*~
*.DS_Store
config/application.yml
config/database.yml
credentials*.sh
Pathogen:
custom_plan.rb
zeus.json
.bundle
config/application.yml
.idea/**

View File

@@ -1 +1 @@
2.1.8
2.3.1

View File

@@ -7,12 +7,13 @@ env:
- GROWSTUFF_SITE_NAME="Growstuff (travis)" RAILS_SECRET_TOKEN='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' GROWSTUFF_ELASTICSEARCH='false'
global:
secure: "Z5TpM2jEX4UCvNePnk/LwltQX48U2u9BRc+Iypr1x9QW2o228QJhPIOH39a8RMUrepGnkQIq9q3ZRUn98RfrJz1yThtlNFL3NmzdQ57gKgjGwfpa0e4Dwj/ZJqV2D84tDGjvdVYLP7zzaYZxQcwk/cgNpzKf/jq97HLNP7CYuf4="
bundler_args: "--without development production staging"
rvm:
- 2.1.8
- 2.3.1
before_script:
- psql -c 'create database growstuff_test;' -U postgres
script:
- script/gemfile_check
- bundle exec script/check_contributors_md
- bundle exec rake db:migrate --trace
- bundle exec rspec spec/
services:
@@ -35,4 +36,6 @@ deploy:
- restart
after_deploy:
- bundle exec script/heroku_maintenance.rb off
addons:
code_climate:
repo_token: 462e015bbdaabfb20910fc07f2fea253410ecb131444e00f97dbf32dc6789ca6

View File

@@ -66,3 +66,8 @@ submit the change with your pull request.
- Anthony Atkinson / [sha1sum](https://github.com/sha1sum)
- Terence Conquest / [twconquest](https://github.com/twconquest)
- Daniel O'Connor / [CloCkWeRX](https://github.com/CloCkWeRX)
- DV Dasari / [dv2](https://github.com/dv2)
- Eric Tillberg / [Thrillberg](https://github.com/Thrillberg)
- Lucas Nogueira / [lucasnogueira](https://github.com/lucasnogueira)
- Charley Lewittes / [ctlewitt](https://github.com/ctlewitt)
- Kristine Nicole Polvoriza / [polveenomials](https://github.com/polveenomials)

View File

@@ -1,4 +0,0 @@
load 'deploy'
# Uncomment if you are using Rails' asset pipeline
# load 'deploy/assets'
load 'config/deploy' # remove this line to skip loading any of the default tasks

44
Gemfile
View File

@@ -1,20 +1,18 @@
source 'https://rubygems.org'
ruby '2.1.8'
ruby '2.3.1'
gem 'rails', '~> 4.1.11'
gem 'rails', '~> 4.2.0'
gem 'bundler', '>=1.1.5'
gem 'sass-rails', '~> 4.0.4'
gem 'sass-rails', '~> 5.0.4'
gem 'coffee-rails', '~> 4.1.0'
gem 'haml'
# Another CSS preprocessor, used for Bootstrap overrides
gem 'less', '~>2.5.0'
gem 'less-rails', '~> 2.5.0'
# CSS framework
gem 'less-rails-bootstrap', '~> 3.2.0'
gem 'bootstrap-sass', '~> 3.3.6'
gem 'font-awesome-sass'
gem 'uglifier', '~> 2.7.2' # JavaScript compressor
@@ -29,7 +27,7 @@ gem 'unicorn' # http server
gem 'pg'
gem 'figaro' # for handling config via ENV variables
gem 'cancancan', '~> 1.9' # for checking member privileges
gem 'gibbon' # for Mailchimp newsletter subscriptions
gem 'gibbon', '~>1.2.0' # for Mailchimp newsletter subscriptions
gem 'csv_shaper' # CSV export
gem 'ruby-units' # for unit conversion
@@ -38,21 +36,8 @@ gem 'comfortable_mexican_sofa', '~> 1.12.0' # content management system
gem 'kaminari' # pagination
gem 'bootstrap-kaminari-views' # bootstrap views for kaminari
# vendored activemerchant for testing- needed for bogus paypal
# gateway monkeypatch
gem 'activemerchant', '1.33.0',
:path => 'vendor/gems/activemerchant-1.33.0',
:require => 'active_merchant'
gem 'active_utils', '1.0.5',
:path => 'vendor/gems/active_utils-1.0.5'
# less-rails depends on a JavaScript engine; we use therubyracer.
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# long term, we'll probably want node.js for performance, but this will do
# for now as it's easier for new people to install
gem 'therubyracer', '~> 0.12', :platforms => :ruby
# libv8 is needed by therubyracer and is a bit finicky
gem 'libv8', '3.16.14.7'
gem 'activemerchant'
gem 'active_utils'
# Markdown formatting for updates etc
gem 'bluecloth'
@@ -61,7 +46,7 @@ gem 'bluecloth'
gem 'will_paginate', '~> 3.0'
# user signup/login/etc
gem 'devise', '~> 3.5.0'
gem 'devise', '>= 4.0.0'
# nicely formatted URLs
gem 'friendly_id', '~> 5.0.4'
@@ -70,9 +55,7 @@ gem 'friendly_id', '~> 5.0.4'
gem 'gravatar-ultimate'
# For geolocation
gem 'geocoder',
:git => 'https://github.com/alexreisner/geocoder.git',
:ref => '104d46'
gem 'geocoder'
# For easy calendar selection
gem 'bootstrap-datepicker-rails'
@@ -113,18 +96,21 @@ end
group :development, :test do
gem 'haml-rails' # HTML templating language
gem 'rspec-rails', '~> 3.4.0' # unit testing framework
gem 'rspec-rails' # unit testing framework
gem 'rspec-activemodel-mocks'
gem 'byebug' # debugging
gem 'database_cleaner', '~> 1.5.0'
gem 'webrat' # provides HTML matchers for view tests
gem 'factory_girl_rails', '~> 4.5.0' # for creating test data
gem 'factory_girl_rails' # for creating test data
gem 'coveralls', require: false # coverage analysis
gem 'capybara' # integration tests
gem 'capybara-email' # integration tests for email
gem 'capybara-screenshot' # for test debugging
gem 'poltergeist', '~> 1.6' # for headless JS testing
gem 'i18n-tasks' # adds tests for finding missing and unused translations
gem 'selenium-webdriver'
gem "codeclimate-test-reporter", group: :test, require: nil
gem "active_merchant-paypal-bogus-gateway"
end
group :travis do

View File

@@ -1,60 +1,60 @@
GIT
remote: https://github.com/alexreisner/geocoder.git
revision: 104d466ba7097b7dce5ba19f8e4091b7f69ccdf6
ref: 104d46
specs:
geocoder (1.1.8)
PATH
remote: vendor/gems/active_utils-1.0.5
specs:
active_utils (1.0.5)
activesupport (>= 2.3.11)
i18n
PATH
remote: vendor/gems/activemerchant-1.33.0
specs:
activemerchant (1.33.0)
GEM
remote: https://rubygems.org/
specs:
actionmailer (4.1.15)
actionpack (= 4.1.15)
actionview (= 4.1.15)
actionmailer (4.2.7.1)
actionpack (= 4.2.7.1)
actionview (= 4.2.7.1)
activejob (= 4.2.7.1)
mail (~> 2.5, >= 2.5.4)
actionpack (4.1.15)
actionview (= 4.1.15)
activesupport (= 4.1.15)
rack (~> 1.5.2)
rails-dom-testing (~> 1.0, >= 1.0.5)
actionpack (4.2.7.1)
actionview (= 4.2.7.1)
activesupport (= 4.2.7.1)
rack (~> 1.6)
rack-test (~> 0.6.2)
actionview (4.1.15)
activesupport (= 4.1.15)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (4.2.7.1)
activesupport (= 4.2.7.1)
builder (~> 3.1)
erubis (~> 2.7.0)
active_link_to (1.0.2)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
active_link_to (1.0.3)
actionpack
activemodel (4.1.15)
activesupport (= 4.1.15)
active_merchant-paypal-bogus-gateway (0.1.0)
activemerchant
active_utils (3.2.2)
activesupport (>= 3.2, < 5.1.0)
i18n
activejob (4.2.7.1)
activesupport (= 4.2.7.1)
globalid (>= 0.3.0)
activemerchant (1.60.0)
activesupport (>= 3.2.14, < 5.1)
builder (>= 2.1.2, < 4.0.0)
i18n (>= 0.6.9)
nokogiri (~> 1.4)
activemodel (4.2.7.1)
activesupport (= 4.2.7.1)
builder (~> 3.1)
activerecord (4.1.15)
activemodel (= 4.1.15)
activesupport (= 4.1.15)
arel (~> 5.0.0)
activesupport (4.1.15)
i18n (~> 0.6, >= 0.6.9)
activerecord (4.2.7.1)
activemodel (= 4.2.7.1)
activesupport (= 4.2.7.1)
arel (~> 6.0)
activesupport (4.2.7.1)
i18n (~> 0.7)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
addressable (2.3.6)
arel (5.0.1.20140414130214)
autoprefixer-rails (5.1.1)
addressable (2.4.0)
arel (6.0.3)
ast (2.3.0)
autoprefixer-rails (6.4.0.2)
execjs
json
bcrypt (3.1.11)
better_errors (2.0.0)
better_errors (2.1.1)
coderay (>= 1.0.0)
erubis (>= 2.6.6)
rack (>= 0.9.0)
@@ -62,49 +62,51 @@ GEM
debug_inspector (>= 0.0.1)
bluecloth (2.2.0)
bonsai-elasticsearch-rails (0.0.4)
bootstrap-datepicker-rails (1.3.0.2)
bootstrap-datepicker-rails (1.6.1.1)
railties (>= 3.0)
bootstrap-kaminari-views (0.0.5)
kaminari (>= 0.13)
rails (>= 3.1)
bootstrap-sass (3.3.3)
autoprefixer-rails (>= 5.0.0.1)
sass (>= 3.2.19)
bootstrap_form (2.2.0)
bootstrap-sass (3.3.7)
autoprefixer-rails (>= 5.2.1)
sass (>= 3.3.4)
bootstrap_form (2.5.0)
builder (3.2.2)
byebug (3.5.1)
columnize (~> 0.8)
debugger-linecache (~> 1.2)
slop (~> 3.6)
cancancan (1.9.2)
capybara (2.4.4)
byebug (9.0.5)
cancancan (1.15.0)
capybara (2.7.1)
addressable
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
rack-test (>= 0.5.4)
xpath (~> 2.0)
capybara-email (2.4.0)
capybara-email (2.5.0)
capybara (~> 2.4)
mail
childprocess (0.5.6)
capybara-screenshot (1.0.13)
capybara (>= 1.0, < 3)
launchy
childprocess (0.5.9)
ffi (~> 1.0, >= 1.0.11)
climate_control (0.0.3)
activesupport (>= 3.0)
cliver (0.3.2)
cocaine (0.5.7)
cocaine (0.5.8)
climate_control (>= 0.0.3, < 1.0)
codemirror-rails (4.8)
railties (>= 3.0, < 5)
coderay (1.1.0)
coffee-rails (4.1.0)
codeclimate-test-reporter (0.6.0)
simplecov (>= 0.7.1, < 1.0.0)
codemirror-rails (5.16.0)
railties (>= 3.0, < 6.0)
coderay (1.1.1)
coffee-rails (4.1.1)
coffee-script (>= 2.2.0)
railties (>= 4.0.0, < 5.0)
coffee-script (2.3.0)
railties (>= 4.0.0, < 5.1.x)
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.8.0)
columnize (0.9.0)
comfortable_mexican_sofa (1.12.7)
coffee-script-source (1.10.0)
comfortable_mexican_sofa (1.12.9)
active_link_to (>= 1.0.0)
bootstrap-sass (>= 3.2.0)
bootstrap_form (>= 2.2.0)
@@ -119,73 +121,74 @@ GEM
rails (>= 4.0.0, < 5)
rails-i18n (>= 4.0.0)
sass-rails (>= 4.0.3)
commonjs (0.2.7)
coveralls (0.7.1)
multi_json (~> 1.3)
rest-client
simplecov (>= 0.7)
term-ansicolor
thor
csv_shaper (1.1.1)
concurrent-ruby (1.0.2)
coveralls (0.8.15)
json (>= 1.8, < 3)
simplecov (~> 0.12.0)
term-ansicolor (~> 1.3)
thor (~> 0.19.1)
tins (>= 1.6.0, < 2)
csv_shaper (1.2.0)
activesupport (>= 3.0.0)
dalli (2.7.2)
database_cleaner (1.5.0)
dalli (2.7.6)
database_cleaner (1.5.3)
debug_inspector (0.0.2)
debugger-linecache (1.2.0)
devise (3.5.6)
devise (4.2.0)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
railties (>= 3.2.6, < 5)
railties (>= 4.1.0, < 5.1)
responders
thread_safe (~> 0.1)
warden (~> 1.2.3)
diff-lcs (1.2.5)
docile (1.1.5)
domain_name (0.5.24)
unf (>= 0.0.5, < 1.0.0)
easy_translate (0.5.0)
json
thread
thread_safe
elasticsearch (1.0.6)
elasticsearch-api (= 1.0.6)
elasticsearch-transport (= 1.0.6)
elasticsearch-api (1.0.6)
elasticsearch (1.0.18)
elasticsearch-api (= 1.0.18)
elasticsearch-transport (= 1.0.18)
elasticsearch-api (1.0.18)
multi_json
elasticsearch-model (0.1.6)
elasticsearch-model (0.1.9)
activesupport (> 3)
elasticsearch (> 0.4)
hashie
elasticsearch-rails (0.1.6)
elasticsearch-transport (1.0.6)
elasticsearch-rails (0.1.9)
elasticsearch-transport (1.0.18)
faraday
multi_json
erubis (2.7.0)
excon (0.43.0)
execjs (2.6.0)
factory_girl (4.5.0)
excon (0.51.0)
execjs (2.7.0)
factory_girl (4.7.0)
activesupport (>= 3.0.0)
factory_girl_rails (4.5.0)
factory_girl (~> 4.5.0)
factory_girl_rails (4.7.0)
factory_girl (~> 4.7.0)
railties (>= 3.0.0)
faraday (0.9.1)
faraday (0.9.2)
multipart-post (>= 1.2, < 3)
ffi (1.9.10)
figaro (1.0.0)
ffi (1.9.14)
figaro (1.1.1)
thor (~> 0.14)
flickraw (0.9.8)
flickraw (0.9.9)
font-awesome-sass (4.6.2)
sass (>= 3.2)
formatador (0.2.5)
friendly_id (5.0.4)
friendly_id (5.0.5)
activerecord (>= 4.0.0)
gibbon (1.1.4)
geocoder (1.3.7)
gibbon (1.2.1)
httparty
multi_json (>= 1.3.4)
multi_json (>= 1.9.0)
globalid (0.3.7)
activesupport (>= 4.1.0)
gravatar-ultimate (2.0.0)
activesupport (>= 2.3.14)
rack
guard (2.12.8)
guard (2.14.0)
formatador (>= 0.2.4)
listen (>= 2.7, <= 4.0)
listen (>= 2.7, < 4.0)
lumberjack (~> 1.0)
nenv (~> 0.1)
notiffany (~> 0.0)
@@ -193,173 +196,174 @@ GEM
shellany (~> 0.0)
thor (>= 0.18.1)
guard-compat (1.2.1)
guard-rspec (4.6.2)
guard-rspec (4.7.2)
guard (~> 2.1)
guard-compat (~> 1.1)
rspec (>= 2.99.0, < 4.0)
haml (4.1.0.beta.1)
haml (4.0.7)
tilt
haml-rails (0.6.0)
haml-rails (0.9.0)
actionpack (>= 4.0.1)
activesupport (>= 4.0.1)
haml (>= 3.1, < 5.0)
haml (>= 4.0.6, < 5.0)
html2haml (>= 1.0.1)
railties (>= 4.0.1)
hashie (3.3.2)
heroku-api (0.3.22)
excon (~> 0.38)
hashie (3.4.4)
heroku-api (0.4.2)
excon (~> 0.45)
multi_json (~> 1.8)
highline (1.6.21)
hike (1.2.3)
hpricot (0.8.6)
html2haml (1.0.1)
highline (1.7.8)
html2haml (2.0.0)
erubis (~> 2.7.0)
haml (>= 4.0.0.rc.1)
hpricot (~> 0.8.6)
ruby_parser (~> 3.1.1)
http-cookie (1.0.2)
domain_name (~> 0.5)
httparty (0.13.3)
json (~> 1.8)
haml (~> 4.0.0)
nokogiri (~> 1.6.0)
ruby_parser (~> 3.5)
httparty (0.14.0)
multi_xml (>= 0.5.2)
i18n (0.7.0)
i18n-tasks (0.7.8)
activesupport
i18n-tasks (0.9.5)
activesupport (>= 4.0.2)
ast (>= 2.1.0)
easy_translate (>= 0.5.0)
erubis
highline
highline (>= 1.7.3)
i18n
slop (>= 3.5.0)
term-ansicolor
terminal-table
jquery-rails (3.1.3)
railties (>= 3.0, < 5.0)
parser (>= 2.2.3.0)
term-ansicolor (>= 1.3.2)
terminal-table (>= 1.5.1)
jquery-rails (4.1.1)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
jquery-ui-rails (5.0.3)
jquery-ui-rails (5.0.5)
railties (>= 3.2.16)
js-routes (0.9.9)
js-routes (1.2.9)
railties (>= 3.2)
sprockets-rails
json (1.8.3)
kaminari (0.16.3)
kaminari (0.17.0)
actionpack (>= 3.0.0)
activesupport (>= 3.0.0)
kgio (2.9.2)
kramdown (1.5.0)
kgio (2.10.0)
kramdown (1.12.0)
launchy (2.4.3)
addressable (~> 2.3)
leaflet-markercluster-rails (0.7.0)
railties (>= 3.1)
leaflet-rails (0.7.4)
less (2.5.1)
commonjs (~> 0.2.7)
less-rails (2.5.0)
actionpack (>= 3.1)
less (~> 2.5.0)
less-rails-bootstrap (3.2.0)
less-rails (~> 2.5.0)
letter_opener (1.3.0)
leaflet-rails (0.7.7)
letter_opener (1.4.1)
launchy (~> 2.2)
libv8 (3.16.14.7)
listen (3.0.2)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9)
lumberjack (1.0.9)
listen (3.1.5)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
ruby_dep (~> 1.2)
loofah (2.0.3)
nokogiri (>= 1.5.9)
lumberjack (1.0.10)
mail (2.6.4)
mime-types (>= 1.16, < 4)
memcachier (0.0.2)
method_source (0.8.2)
mime-types (2.99.1)
mime-types (3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2016.0521)
mimemagic (0.3.0)
mini_portile2 (2.0.0)
minitest (5.8.4)
multi_json (1.11.2)
mini_portile2 (2.1.0)
minitest (5.9.0)
multi_json (1.11.3)
multi_xml (0.5.5)
multipart-post (2.0.0)
nenv (0.2.0)
netrc (0.10.3)
newrelic_rpm (3.9.8.273)
nokogiri (1.6.7.2)
mini_portile2 (~> 2.0.0.rc2)
notiffany (0.0.6)
nenv (0.3.0)
newrelic_rpm (3.16.0.318)
nokogiri (1.6.8)
mini_portile2 (~> 2.1.0)
pkg-config (~> 1.1.7)
notiffany (0.1.1)
nenv (~> 0.1)
shellany (~> 0.0)
oauth (0.4.7)
omniauth (1.2.2)
oauth (0.5.1)
omniauth (1.3.1)
hashie (>= 1.2, < 4)
rack (~> 1.0)
omniauth-flickr (0.0.15)
rack (>= 1.0, < 3)
omniauth-flickr (0.0.19)
multi_json (~> 1.11.0)
omniauth-oauth (~> 1.0)
omniauth-oauth (1.0.1)
omniauth-oauth (1.1.0)
oauth
omniauth (~> 1.0)
omniauth-twitter (1.1.0)
multi_json (~> 1.3)
omniauth-oauth (~> 1.0)
omniauth-twitter (1.2.1)
json (~> 1.3)
omniauth-oauth (~> 1.1)
orm_adapter (0.5.0)
paperclip (4.3.0)
paperclip (4.3.6)
activemodel (>= 3.2.0)
activesupport (>= 3.2.0)
cocaine (~> 0.5.5)
mime-types
mimemagic (= 0.3.0)
pg (0.17.1)
parser (2.3.1.2)
ast (~> 2.2)
pg (0.18.4)
pkg-config (1.1.7)
plupload-rails (1.2.1)
rails (>= 3.1)
poltergeist (1.6.0)
poltergeist (1.10.0)
capybara (~> 2.1)
cliver (~> 0.3.1)
multi_json (~> 1.0)
websocket-driver (>= 0.2.0)
pry (0.10.1)
pry (0.10.4)
coderay (~> 1.1.0)
method_source (~> 0.8.1)
slop (~> 3.4)
quiet_assets (1.1.0)
railties (>= 3.1, < 5.0)
rack (1.5.5)
rack (1.6.4)
rack-test (0.6.3)
rack (>= 1.0)
rails (4.1.15)
actionmailer (= 4.1.15)
actionpack (= 4.1.15)
actionview (= 4.1.15)
activemodel (= 4.1.15)
activerecord (= 4.1.15)
activesupport (= 4.1.15)
rails (4.2.7.1)
actionmailer (= 4.2.7.1)
actionpack (= 4.2.7.1)
actionview (= 4.2.7.1)
activejob (= 4.2.7.1)
activemodel (= 4.2.7.1)
activerecord (= 4.2.7.1)
activesupport (= 4.2.7.1)
bundler (>= 1.3.0, < 2.0)
railties (= 4.1.15)
sprockets-rails (~> 2.0)
rails-i18n (4.0.3)
i18n (~> 0.6)
railties (= 4.2.7.1)
sprockets-rails
rails-deprecated_sanitizer (1.0.3)
activesupport (>= 4.2.0.alpha)
rails-dom-testing (1.0.7)
activesupport (>= 4.2.0.beta, < 5.0)
nokogiri (~> 1.6.0)
rails-deprecated_sanitizer (>= 1.0.1)
rails-html-sanitizer (1.0.3)
loofah (~> 2.0)
rails-i18n (4.0.8)
i18n (~> 0.7)
railties (~> 4.0)
rails_12factor (0.0.3)
rails_serve_static_assets
rails_stdout_logging
rails_serve_static_assets (0.0.2)
rails_stdout_logging (0.0.3)
railties (4.1.15)
actionpack (= 4.1.15)
activesupport (= 4.1.15)
rails_serve_static_assets (0.0.5)
rails_stdout_logging (0.0.5)
railties (4.2.7.1)
actionpack (= 4.2.7.1)
activesupport (= 4.2.7.1)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
raindrops (0.13.0)
rake (11.1.2)
rb-fsevent (0.9.5)
rb-inotify (0.9.5)
raindrops (0.16.0)
rake (11.2.2)
rb-fsevent (0.9.7)
rb-inotify (0.9.7)
ffi (>= 0.5.0)
ref (1.0.5)
responders (1.1.2)
railties (>= 3.2, < 4.2)
rest-client (1.8.0)
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 3.0)
netrc (~> 0.7)
responders (2.2.0)
railties (>= 4.2.0, < 5.1)
rspec (3.4.0)
rspec-core (~> 3.4.0)
rspec-expectations (~> 3.4.0)
rspec-mocks (~> 3.4.0)
rspec-activemodel-mocks (1.0.1)
rspec-activemodel-mocks (1.0.3)
activemodel (>= 3.0)
activesupport (>= 3.0)
rspec-mocks (>= 2.99, < 4.0)
@@ -380,60 +384,52 @@ GEM
rspec-mocks (~> 3.4.0)
rspec-support (~> 3.4.0)
rspec-support (3.4.1)
ruby-units (1.4.5)
ruby_parser (3.1.3)
ruby-units (2.0.0)
ruby_dep (1.3.1)
ruby_parser (3.8.2)
sexp_processor (~> 4.1)
rubyzip (1.1.7)
sass (3.2.19)
sass-rails (4.0.5)
railties (>= 4.0.0, < 5.0)
sass (~> 3.2.2)
sprockets (~> 2.8, < 3.0)
sprockets-rails (~> 2.0)
selenium-webdriver (2.47.1)
rubyzip (1.2.0)
sass (3.4.22)
sass-rails (5.0.6)
railties (>= 4.0.0, < 6)
sass (~> 3.1)
sprockets (>= 2.8, < 4.0)
sprockets-rails (>= 2.0, < 4.0)
tilt (>= 1.1, < 3)
selenium-webdriver (2.53.4)
childprocess (~> 0.5)
multi_json (~> 1.0)
rubyzip (~> 1.0)
websocket (~> 1.0)
sexp_processor (4.4.4)
sexp_processor (4.7.0)
shellany (0.0.1)
simplecov (0.9.1)
simplecov (0.12.0)
docile (~> 1.1.0)
multi_json (~> 1.0)
simplecov-html (~> 0.8.0)
simplecov-html (0.8.0)
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.0)
slop (3.6.0)
sprockets (2.12.4)
hike (~> 1.2)
multi_json (~> 1.0)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
sprockets-rails (2.3.3)
actionpack (>= 3.0)
activesupport (>= 3.0)
sprockets (>= 2.8, < 4.0)
term-ansicolor (1.3.0)
sprockets (3.7.0)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-rails (3.1.1)
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets (>= 3.0.0)
term-ansicolor (1.3.2)
tins (~> 1.0)
terminal-table (1.4.5)
therubyracer (0.12.1)
libv8 (~> 3.16.14.0)
ref
terminal-table (1.6.0)
thor (0.19.1)
thread (0.1.4)
thread (0.2.2)
thread_safe (0.3.5)
tilt (1.4.1)
tins (1.3.3)
tilt (2.0.5)
tins (1.12.0)
tzinfo (1.2.2)
thread_safe (~> 0.1)
uglifier (2.7.2)
execjs (>= 0.3.0)
json (>= 1.8.0)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.1)
unicorn (4.8.3)
unicorn (5.1.0)
kgio (~> 2.6)
rack
raindrops (~> 0.7)
warden (1.2.6)
rack (>= 1.0)
@@ -441,11 +437,11 @@ GEM
nokogiri (>= 1.2.0)
rack (>= 1.0)
rack-test (>= 0.5.3)
websocket (1.2.2)
websocket-driver (0.5.4)
websocket (1.2.3)
websocket-driver (0.6.4)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.2)
will_paginate (3.0.7)
will_paginate (3.1.0)
xpath (2.0.0)
nokogiri (~> 1.3)
@@ -453,34 +449,39 @@ PLATFORMS
ruby
DEPENDENCIES
active_utils (= 1.0.5)!
activemerchant (= 1.33.0)!
active_merchant-paypal-bogus-gateway
active_utils
activemerchant
better_errors
binding_of_caller
bluecloth
bonsai-elasticsearch-rails
bootstrap-datepicker-rails
bootstrap-kaminari-views
bootstrap-sass (~> 3.3.6)
bundler (>= 1.1.5)
byebug
cancancan (~> 1.9)
capybara
capybara-email
capybara-screenshot
codeclimate-test-reporter
coffee-rails (~> 4.1.0)
comfortable_mexican_sofa (~> 1.12.0)
coveralls
csv_shaper
dalli
database_cleaner (~> 1.5.0)
devise (~> 3.5.0)
devise (>= 4.0.0)
elasticsearch-model
elasticsearch-rails
factory_girl_rails (~> 4.5.0)
factory_girl_rails
figaro
flickraw
font-awesome-sass
friendly_id (~> 5.0.4)
geocoder!
gibbon
geocoder
gibbon (~> 1.2.0)
gravatar-ultimate
guard
guard-rspec
@@ -494,11 +495,7 @@ DEPENDENCIES
kaminari
leaflet-markercluster-rails
leaflet-rails
less (~> 2.5.0)
less-rails (~> 2.5.0)
less-rails-bootstrap (~> 3.2.0)
letter_opener
libv8 (= 3.16.14.7)
memcachier
newrelic_rpm
omniauth
@@ -508,19 +505,21 @@ DEPENDENCIES
poltergeist (~> 1.6)
pry
quiet_assets
rails (~> 4.1.11)
rails (~> 4.2.0)
rails_12factor
rake (>= 10.0.0)
rspec-activemodel-mocks
rspec-rails (~> 3.4.0)
rspec-rails
ruby-units
sass-rails (~> 4.0.4)
sass-rails (~> 5.0.4)
selenium-webdriver
therubyracer (~> 0.12)
uglifier (~> 2.7.2)
unicorn
webrat
will_paginate (~> 3.0)
RUBY VERSION
ruby 2.3.1p112
BUNDLED WITH
1.11.2
1.12.5

View File

@@ -2,6 +2,7 @@
[![Build Status](https://travis-ci.org/Growstuff/growstuff.png)](https://travis-ci.org/Growstuff/growstuff)
[![Coverage Status](https://coveralls.io/repos/Growstuff/growstuff/badge.png)](https://coveralls.io/r/Growstuff/growstuff)
[![Code Climate](https://codeclimate.com/github/Growstuff/growstuff/badges/gpa.svg)](https://codeclimate.com/github/Growstuff/growstuff)
Welcome to the Growstuff project.
@@ -18,8 +19,9 @@ encourage participation from people of all backgrounds and skill levels.
* [Issues](http://github.com/Growstuff/growstuff/issues) (features we're
working on, known bugs, etc)
* [Discussion forums](http://wiki.growstuff.org/index.php/Discussion_forums) (mailing lists, IRC, etc)
* [Wiki](http://wiki.growstuff.org/) (general documentation)
* [Discussion forums](http://talk.growstuff.org/) (design ideas, planning releases)
* [IRC](https://webchat.freenode.net/) growstuff channel (general chat, brainstorming and troubleshooting) or [Gitter](https://gitter.im/Growstuff/growstuff)
* [Wiki](https://github.com/Growstuff/growstuff/wiki) (general documentation, etc. Help by migrating from the [old wiki](https://web.archive.org/web/*/wiki.growstuff.org))
## For coders
@@ -27,9 +29,9 @@ Growstuff is built in Ruby on Rails and also uses JavaScript for
frontend features. We welcome contributions -- see
[CONTRIBUTING](CONTRIBUTING.md) for details.
* To set up your development environment, see [Getting started](http://wiki.growstuff.org/index.php/Development/Getting_Started).
* To set up your development environment, see [Getting started](https://github.com/Growstuff/growstuff/wiki/New-contributor-guide).
* We encourage [pair programming](http://wiki.growstuff.org/index.php/Pairing), especially for newer developers. [Find a pair programming partner.](http://talk.growstuff.org/t/find-a-pair-programming-partner/13)
* Drop in to one of our [discussion forums](http://wiki.growstuff.org/index.php/Discussion_forums) to chat to other developers, get help, etc.
* Drop in to our [discussion forums](http://talk.growstuff.org/), IRC or Gitter to chat to other developers, get help, etc.
* You may also be interested in our [API](http://wiki.growstuff.org/index.php/API).
## For designers, writers, researchers, data wranglers, and other contributors
@@ -49,6 +51,7 @@ Here on Github, you might find these useful:
* [needs: visual design](https://github.com/Growstuff/growstuff/labels/needs:%20visual design) - tasks requiring visual/graphical design
* [needs: documentation](https://github.com/Growstuff/growstuff/labels/needs:%20documentation)
* [needs: data](https://github.com/Growstuff/growstuff/labels/needs:%20data) - tasks requiring data entry, data design, data import, or similar
* [curated:beginner](https://github.com/Growstuff/growstuff/labels/curated:%20beginner) - tasks that are ideal for beginner programmers or people new to the project
Feel free to comment on any of the issues you find there, or open up a broader conversation on [Growstuff Talk](http://talk.growstuff.org).

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

View File

@@ -8,14 +8,12 @@ jQuery ->
el.datepicker({'format': 'yyyy-mm-dd'})
href = el.attr('href')
originalText = el.text()
el.click (e) ->
e.stopPropagation()
e.preventDefault()
originalText = $(this).text()
href = $(this).attr('href')
$(this).text('Confirm without date')
$(this).bind('click.confirm', (e) ->
@@ -31,6 +29,8 @@ jQuery ->
el.one 'changeDate', ->
date = $(this).datepicker('getDate')
href = $(this).attr('href')
url = "#{href}&planting[finished_at]=#{date}"
link = $("<a href='#{url}' data-method='put'></a>")

View File

@@ -16,7 +16,6 @@
//= require jquery
//= require jquery_ujs
//= require jquery-ui/autocomplete
//= require twitter/bootstrap
//= require_tree .
//= require bootstrap-sprockets
//= require bootstrap-datepicker
//= require_tree .

View File

File diff suppressed because one or more lines are too long

View File

@@ -1,6 +1,7 @@
if (document.getElementById("cropmap") !== null) {
mapbox_map_id = "<%= Rails.env == 'test' ? 0 : Growstuff::Application.config.mapbox_map_id %>";
mapbox_base_url = "https://c.tiles.mapbox.com/v3/" + mapbox_map_id + "/{z}/{x}/{y}.png";
mapbox_access_token = "<%= Rails.env == 'test' ? 0 : Growstuff::Application.config.mapbox_access_token %>";
mapbox_base_url = "http://a.tiles.mapbox.com/v4/" + mapbox_map_id + "/{z}/{x}/{y}.png?access_token=" + mapbox_access_token;
L.Icon.Default.imagePath = '/assets'

View File

@@ -1,6 +1,7 @@
if (document.getElementById("membermap") !== null) {
mapbox_map_id = "<%= Rails.env == 'test' ? 0 : Growstuff::Application.config.mapbox_map_id %>";
mapbox_base_url = "https://c.tiles.mapbox.com/v3/" + mapbox_map_id + "/{z}/{x}/{y}.png";
mapbox_access_token = "<%= Rails.env == 'test' ? 0 : Growstuff::Application.config.mapbox_access_token %>";
mapbox_base_url = "http://a.tiles.mapbox.com/v4/" + mapbox_map_id + "/{z}/{x}/{y}.png?access_token=" + mapbox_access_token;
L.Icon.Default.imagePath = '/assets'

View File

@@ -1,7 +1,8 @@
if (document.getElementById("placesmap") !== null) {
places_base_path = "/places";
mapbox_map_id = "<%= Rails.env == 'test' ? 0 : Growstuff::Application.config.mapbox_map_id %>";
mapbox_base_url = "https://c.tiles.mapbox.com/v3/" + mapbox_map_id + "/{z}/{x}/{y}.png";
mapbox_access_token = "<%= Rails.env == 'test' ? 0 : Growstuff::Application.config.mapbox_access_token %>";
mapbox_base_url = "http://a.tiles.mapbox.com/v4/" + mapbox_map_id + "/{z}/{x}/{y}.png?access_token=" + mapbox_access_token;
nominatim_base_url = 'http://nominatim.openstreetmap.org/search/';
nominatim_user_agent_email = "<%= Rails.env == 'test' ? 0 : Growstuff::Application.config.user_agent_email %>";

View File

@@ -1,14 +0,0 @@
/*
* This is a manifest file that'll automatically include all the stylesheets available in this directory
* and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
* the top of the compiled file, but it's generally better to create a new file per style scope.
*= require_self
*= require jquery-ui/autocomplete
*= require bootstrap-datepicker
*= require leaflet
*= require leaflet.markercluster
*= require leaflet.markercluster.default
*= require custom_bootstrap/custom_bootstrap
*= require overrides.css
*= require_tree .
*/

View File

@@ -0,0 +1,7 @@
@import 'jquery-ui/autocomplete'
@import 'bootstrap-datepicker'
@import 'leaflet'
@import 'leaflet.markercluster'
@import 'leaflet.markercluster.default'
@import 'custom_bootstrap/custom_bootstrap'
@import 'overrides'

View File

@@ -0,0 +1 @@
.btn:focus{outline:dotted 2px #000}div.active:focus{outline:dotted 1px #000}a:focus{outline:dotted 1px #000}.close:hover,.close:focus{outline:dotted 1px #000}.nav>li>a:hover,.nav>li>a:focus{outline:dotted 1px #000}.carousel-inner>.item{position:absolute;top:-999999em;display:block;-moz-transition:ease-in-out 0.6s left;-o-transition:ease-in-out 0.6s left;-webkit-transition:ease-in-out 0.6s left;transition:ease-in-out 0.6s left}.carousel-inner>.active{top:0}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{position:relative}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.alert-success{color:#2d4821}.alert-info{color:#214c62}.alert-warning{color:#6c4a00;background-color:#f9f1c6}.alert-danger{color:#d2322d}.alert-danger:hover{color:#a82824}

View File

@@ -1,56 +0,0 @@
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// !!! AUTOMATICALLY GENERATED FILE. DO NOT MODIFY !!!
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// Core variables and mixins
@import "twitter/bootstrap/variables.less";
@import "custom_bootstrap/variables.less"; // Modify this for custom colors, font-sizes, etc
@import "twitter/bootstrap/mixins.less";
@import "custom_bootstrap/mixins.less"; // Modify this for custom mixins
// Reset and dependencies
@import "twitter/bootstrap/normalize.less";
@import "twitter/bootstrap/print.less";
@import "twitter/bootstrap/glyphicons.less";
// Core CSS
@import "twitter/bootstrap/scaffolding.less";
@import "twitter/bootstrap/type.less";
@import "twitter/bootstrap/code.less";
@import "twitter/bootstrap/grid.less";
@import "twitter/bootstrap/tables.less";
@import "twitter/bootstrap/forms.less";
@import "twitter/bootstrap/buttons.less";
// Components
@import "twitter/bootstrap/component-animations.less";
@import "twitter/bootstrap/dropdowns.less";
@import "twitter/bootstrap/button-groups.less";
@import "twitter/bootstrap/input-groups.less";
@import "twitter/bootstrap/navs.less";
@import "twitter/bootstrap/navbar.less";
@import "twitter/bootstrap/breadcrumbs.less";
@import "twitter/bootstrap/pagination.less";
@import "twitter/bootstrap/pager.less";
@import "twitter/bootstrap/labels.less";
@import "twitter/bootstrap/badges.less";
@import "twitter/bootstrap/jumbotron.less";
@import "twitter/bootstrap/thumbnails.less";
@import "twitter/bootstrap/alerts.less";
@import "twitter/bootstrap/progress-bars.less";
@import "twitter/bootstrap/media.less";
@import "twitter/bootstrap/list-group.less";
@import "twitter/bootstrap/panels.less";
@import "twitter/bootstrap/responsive-embed.less";
@import "twitter/bootstrap/wells.less";
@import "twitter/bootstrap/close.less";
// Components w/ JavaScript
@import "twitter/bootstrap/modals.less";
@import "twitter/bootstrap/tooltip.less";
@import "twitter/bootstrap/popovers.less";
@import "twitter/bootstrap/carousel.less";
// Utility classes
@import "twitter/bootstrap/utilities.less";
@import "twitter/bootstrap/responsive-utilities.less";

View File

@@ -0,0 +1,59 @@
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// !!! AUTOMATICALLY GENERATED FILE. DO NOT MODIFY !!!
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// Core variables and mixins
@import "bootstrap-sprockets"
@import "bootstrap/variables"
// Modify this for custom colors, font-sizes, etc
@import "custom_bootstrap/variables"
@import "bootstrap/mixins"
// Modify this for custom mixins
@import "custom_bootstrap/mixins"
// Reset and dependencies
@import "bootstrap/normalize"
@import "bootstrap/print"
@import "bootstrap/glyphicons"
// Core CSS
@import "bootstrap/scaffolding"
@import "bootstrap/type"
@import "bootstrap/code"
@import "bootstrap/grid"
@import "bootstrap/tables"
@import "bootstrap/forms"
@import "bootstrap/buttons"
// Components
@import "bootstrap/component-animations"
@import "bootstrap/dropdowns"
@import "bootstrap/button-groups"
@import "bootstrap/input-groups"
@import "bootstrap/navs"
@import "bootstrap/navbar"
@import "bootstrap/breadcrumbs"
@import "bootstrap/pagination"
@import "bootstrap/pager"
@import "bootstrap/labels"
@import "bootstrap/badges"
@import "bootstrap/jumbotron"
@import "bootstrap/thumbnails"
@import "bootstrap/alerts"
@import "bootstrap/progress-bars"
@import "bootstrap/media"
@import "bootstrap/list-group"
@import "bootstrap/panels"
@import "bootstrap/responsive-embed"
@import "bootstrap/wells"
@import "bootstrap/close"
// Components w/ JavaScript
@import "bootstrap/modals"
@import "bootstrap/tooltip"
@import "bootstrap/popovers"
@import "bootstrap/carousel"
// Utility classes
@import "bootstrap/utilities"
@import "bootstrap/responsive-utilities"

View File

@@ -1,54 +0,0 @@
// Use this file to override Twitter Bootstrap variables or define own variables.
// Import original variables so they can be used in overrides
@import "twitter/bootstrap/variables.less";
// Base colours
@beige: #f3f1ee;
@brown: #413f3b;
@green: #5f8e43;
@blue: #2f4365;
@red: #8e4d43;
@orange: #b2685c;
@yellow: #b2935c;
@body-bg: @beige;
@text-color: @brown;
@link-color: @green;
@brand-primary: @green;
@font-family-sans-serif: "Helvetica Neue", Helvetica, Arial, sans-serif;
@font-family-serif: Georgia, "Times New Roman", Times, serif;
@font-family-mono: Monaco, Menlo, Consolas, "Courier New", monospace;
@font-size-base: 14px;
@font-family-base: @font-family-sans-serif;
@line-height-base: 1.5;
@alt-font-family: @font-family-serif;
@headings-font-family: @font-family-sans-serif;
@headings-font-weight: bold; // instead of browser default, bold
@headings-color: inherit; // empty to use BS default, @textColor
// Hero unit
@jumbotron-bg: darken(@body-bg, 10%);
// Nav bar
@navbar-default-bg: @brown;
@navbar-default-bg-highlight: @brown;
@navbar-default-color: @beige;
@navbar-default-link-color: darken(@beige, 20%);
@navbar-default-link-hover-color: @beige;
@navbar-default-link-active-color: @beige;
@navbar-default-brand-color: lighten(@green, 20%);
// Top nav collapse threshold
@grid-float-breakpoint: @screen-md-min;
@dropdown-bg: lighten(@beige, 10%);
@dropdown-link-color: @brown;
@dropdown-link-hover-color: @brown;
@dropdown-link-hover-bg: lighten(@green, 50%);

View File

@@ -0,0 +1,54 @@
// Use this file to override Twitter Bootstrap variables or define own variables.
// Import original variables so they can be used in overrides
//@import 'bootstrap/variables.scss'
// Base colours
$beige: #f3f1ee
$brown: #413f3b
$green: #5f8e43
$blue: #2f4365
$red: #8e4d43
$orange: #b2685c
$yellow: #b2935c
$body-bg: $beige
$text-color: $brown
$link-color: $green
$brand-primary: $green
$font-family-sans-serif: "Helvetica Neue", Helvetica, Arial, sans-serif
$font-family-serif: Georgia, "Times New Roman", Times, serif
$font-family-mono: Monaco, Menlo, Consolas, "Courier New", monospace
$font-size-base: 14px
$font-family-base: $font-family-sans-serif
$line-height-base: 1.5
$alt-font-family: $font-family-serif
$headings-font-family: $font-family-sans-serif
$headings-font-weight: bold // instead of browser default, bold
$headings-color: inherit // empty to use BS default, $textColor
// Hero unit
$jumbotron-bg: darken($body-bg, 10%)
// Nav bar
$navbar-default-bg: $brown
$navbar-default-bg-highlight: $brown
$navbar-default-color: $beige
$navbar-default-link-color: darken($beige, 20%)
$navbar-default-link-hover-color: $beige
$navbar-default-link-active-color: darken($beige,80%)
$navbar-default-brand-color: lighten($green, 20%)
// Top nav collapse threshold
$grid-float-breakpoint: $screen-md-min
$dropdown-bg: lighten($beige, 10%)
$dropdown-link-color: $brown
$dropdown-link-hover-color: $brown
$dropdown-link-hover-bg: lighten($green, 50%)

View File

@@ -1,10 +0,0 @@
.leaflet-popup-content-wrapper, .leaflet-popup-tip {
border: none;
}
.thumbnail{
background: #fff !important;
border: solid 1px whitesmoke;
}
.thumbnail .crop-thumbnail .cropinfo{
padding-top: 14px;
}

View File

@@ -0,0 +1,10 @@
.leaflet-popup-content-wrapper,
.leaflet-popup-tip
border: none
.thumbnail
background: #fff !important
border: solid 1px whitesmoke
.thumbnail .crop-thumbnail .cropinfo
padding-top: 14px

View File

@@ -1,360 +0,0 @@
@import "twitter/bootstrap/bootstrap";
@import "custom_bootstrap/variables";
// this padding needs to be done before the responsive stuff is imported
body {
// modifying this for our promotional banner. can be replaced after if
// needed.
// padding-top: @navbar-height + 15px;
padding-top: @navbar-height;
}
//@import "twitter/bootstrap/responsive";
// Set the correct sprite paths
@iconSpritePath: asset-path("twitter/bootstrap/glyphicons-halflings");
@iconWhiteSpritePath: asset-path("twitter/bootstrap/glyphicons-halflings-white");
// Set the Font Awesome (Font Awesome is default. You can disable by commenting below lines)
@fontAwesomeEotPath: asset-url("fontawesome-webfont.eot");
@fontAwesomeEotPath_iefix: asset-url("fontawesome-webfont.eot#iefix");
@fontAwesomeWoffPath: asset-url("fontawesome-webfont.woff");
@fontAwesomeTtfPath: asset-url("fontawesome-webfont.ttf");
@fontAwesomeSvgPath: asset-url("fontawesome-webfont.svg#fontawesomeregular");
// Font Awesome
//@import "fontawesome/font-awesome";
// Glyphicons
//@import "twitter/bootstrap/sprites.less";
.list-inline > li.first {
padding-left: 0px;
}
h2 {
font-size: 150%;
}
/*
#subtitle {
color: lighten(@brown, 30%);
margin-top: 0px;
padding-top: 0px;
padding-left: 1em;
font-style: italic;
font-weight: normal;
}
*/
h3 {
font-size: 120%;
}
.main {
padding-right: 1em;
}
.sidebar {
margin-left: -1px;
border-left: 1px solid darken(@beige, 10%);
padding-left: 1em;
}
// this is used for eg. crops and members index pages
.six-across:nth-child(6n+1) {
margin-left: 0px
}
.three-across:nth-child(3n+1) {
margin-left: 0px;
clear: both;
}
// let's condense the hero unit a little
.jumbotron {
padding-top: 30px;
padding-bottom: 30px;
}
// info under the main heading on homepage
.jumbotron .info {
padding-top: 15px;
}
// signup widget on homepage
.jumbotron .signup {
background-color: lighten(@green, 40%);
border: 1px solid lighten(@green, 20%);
border-radius: 6px;
padding: 15px;
text-align: center;
line-height: 200%;
}
// stats shown on homepage. eg. "999 members..."
p.stats {
font-weight: bold;
}
.member-cards {
display: flex;
flex: none;
flex-wrap: wrap;
justify-content: space-between;
}
.member-thumbnail {
padding: .25em;
div {
width: 5em;
display: inline-block;
vertical-align: top;
}
div ~ div {
width: 15em;
padding-left: 1em;
}
}
#placesmap, #cropmap {
height: 500px;
}
#membermap {
height: 250px;
}
.member-location {
font-size: small;
font-style: italic;
}
.member-location a {
color: @brown;
}
.photo-thumbnail {
position:relative;
padding:0;
img {
width:100%;
}
.text {
display:none;
color:#000;
position:absolute;
bottom:0;
background:rgba(0, 0, 0, 0.8);
width:100%;
margin:0;
}
p {
padding:5px;
margin:0;
color:#fff;
}
&:hover {
.text {
display:block;
}
}
}
.thumbnail {
border: none;
text-align: center;
margin-bottom: 1.5em;
.member-thumbnail {
text-align: left;
img {
height: 85px;
width: 85px;
max-width: 85px
}
}
.crop-thumbnail {
height: 220px;
.cropinfo {
display: inline-block;
max-width: 100%;
white-space: nowrap;
line-height: 1em;
padding-bottom: 2px;
.cropname {
overflow: hidden;
text-overflow: ellipsis;
}
.scientificname {
font-size: small;
font-style: italic;
overflow: hidden;
text-overflow: ellipsis;
}
.plantingcount {
font-size: small;
}
}
.crop-name a {
padding-top: 2px;
}
.scientific-name small {
margin-bottom: -2px;
}
}
}
li.crop-hierarchy {
list-style-type: disc;
}
.navbar-brand {
margin: 0px;
padding: 0px;
}
.navbar-bottom {
margin: 40px 0px 0px 0px !important;
}
// footer
footer {
#footer1, #footer2, #footer3 {
text-align: left;
padding-top: 1em;
padding-bottom: 2em;
ul {
list-style-type: none;
list-style-position: outside;
padding-left: 0px;
margin-left: 0px;
}
a {
color: @navbar-default-link-color;
text-decoration: none;
}
a:hover {
color: @navbar-default-link-hover-color;
}
a:active {
color: @navbar-default-link-active-color;
}
}
.navbar-bottom.navbar {
border-radius: 0;
}
}
// ensure footer is pushed to bottom of browser window
#maincontainer {
min-height: 80%;
}
html, body {
height: 100%;
}
//
.crop-image, .member-image {
width: 100%;
height: 100%;
}
// Autosuggest
.ui-autocomplete {
z-index: @zindex-tooltip;
}
// Crowdfunding campaign, Sep-Oct 2014
.crowdfunding-banner {
text-align: center;
font-weight: bold;
background-color: lighten(@green, 30%);
margin-top: 0px;
margin-bottom: 5px;
padding: 15px;
}
.crowdfunding-banner a {
color: @brown;
text-decoration: underline;
}
.alert {
a {
font-weight: 800;
}
}
// Overrides applying only to mobile view. This must be at the end of the overrides file.
@media only screen and (max-width: 767px) {
.sidebar {
margin-left: 0;
border-left: none;
padding-left: 0;
}
#map {
height: 300px;
}
.navbar .nav > li {
display: block;
}
}
/* override "info" alert boxes to be green, not blue, on Growstuff */
@state-info-text: darken(@green, 10%);
@state-info-bg: lighten(@green, 50%);
/* and set "success" to be the same, as it was just very slightly
* different because the default bootstrap green is slightly different
* from ours */
@state-success-text: darken(@green, 10%);
@state-success-bg: lighten(@green, 50%);
.hide {
display: none;
}
#add-sci_name-row, #remove-sci_name-row, #add-alt_name-row, #remove-alt_name-row{
display: none;
}
.panel-footer{
height: 6em;
}
#gardens_panel_body{
height: 20em;
}
.form-group.required .control-label:before {
content: "* ";
color: red;
}
.margin-bottom {
margin-bottom: 1em;
}
.red {
color: red;
}

View File

@@ -0,0 +1,338 @@
@import "bootstrap-sprockets"
@import "bootstrap"
@import "custom_bootstrap/variables"
// this padding needs to be done before the responsive stuff is imported
body
// modifying this for our promotional banner. can be replaced after if
// needed.
// padding-top: $navbar-height + 15px
padding-top: $navbar-height
//@import "bootstrap/responsive"
// Font Awesome
@import "font-awesome-sprockets"
@import "font-awesome"
// Glyphicons
//@import "bootstrap/glyphicons"
.list-inline > li.first
padding-left: 0px
h2
font-size: 150%
//#subtitle
// color: lighten($brown, 30%)
// font-style: italic
// font-weight: normal
// margin-top: 0px
// padding-left: 1em
// padding-top: 0px
h3
font-size: 120%
.main
padding-right: 1em
.navbar .navbar-form
padding-top: 0
padding-bottom: 0
margin-right: 0
margin-left: 15px
border: 0
-webkit-box-shadow: none
box-shadow: none
.img-responsive
max-width: 100%
height: auto
.sidebar
border-left: 1px solid darken($beige, 10%)
margin-left: -1px
padding-left: 1em
// this is used for eg. crops and members index pages
.six-across:nth-child(6n+1)
margin-left: 0px
.three-across:nth-child(3n+1)
margin-left: 0px
clear: both
// let's condense the hero unit a little
.jumbotron
padding-top: 30px
padding-bottom: 30px
// info under the main heading on homepage
.jumbotron .info
padding-top: 15px
// signup widget on homepage
.jumbotron .signup
background-color: lighten($green, 40%)
border: 1px solid lighten($green, 20%)
border-radius: 6px
line-height: 200%
padding: 15px
text-align: center
// stats shown on homepage. eg. "999 members..."
p.stats
font-weight: bold
.member-cards
display: flex
flex: none
flex-wrap: wrap
justify-content: space-between
.member-thumbnail
padding: .25em
div
width: 5em
display: inline-block
vertical-align: top
.member-thumbnail div~div
padding-left: 1em
width: 15em
.planting
dl.planting-attributes
font-size: 85%
dt
text-align: left
dd
margin-left: auto
@media (min-width: $screen-md-min)
.planting-thumbnail
dl.planting-attributes
font-size: 85%
width: 100%
dt
text-align: left
width: 80px
dd
padding-left: 80px
margin-left: auto
.navbar .navbar-form
width: 250px
#placesmap, #cropmap
height: 500px
#membermap
height: 250px
.location-not-set
height: 250px
width: 100%
background-image: image-url('location-not-set.en.png')
background-repeat: no-repeat
background-position: center
.member-location
font-size: small
font-style: italic
.member-location a
color: $brown
.photo-thumbnail
padding: 0
position: relative
img
width: 100%
.text
display: none
color: #000
position: absolute
bottom: 0
background: rgba(0, 0, 0, 0.8)
width: 100%
margin: 0
p
padding: 5px
margin: 0
color: #fff
&:hover
.text
display: block
.thumbnail
border: none
text-align: center
margin-bottom: 1.5em
.member-thumbnail
text-align: left
img
height: 85px
width: 85px
max-width: 85px
.crop-thumbnail
height: 220px
.cropinfo
display: inline-block
max-width: 100%
white-space: nowrap
line-height: 1em
padding-bottom: 2px
.cropname
overflow: hidden
text-overflow: ellipsis
.scientificname
font-size: small
font-style: italic
overflow: hidden
text-overflow: ellipsis
.plantingcount
font-size: small
.crop-name a
padding-top: 2px
.scientific-name small
margin-bottom: -2px
li.crop-hierarchy
list-style-type: disc
.navbar-brand
margin: 0px
padding: 0px
.navbar-bottom
margin: 40px 0px 0px 0px !important
// footer
footer
#footer1, #footer2, #footer3
text-align: left
padding-top: 1em
padding-bottom: 2em
ul
list-style-type: none
list-style-position: outside
padding-left: 0px
margin-left: 0px
a
color: $navbar-default-link-color
text-decoration: none
a:hover
color: $navbar-default-link-hover-color
a:active
color: $navbar-default-link-active-color
.navbar-bottom.navbar
border-radius: 0
// ensure footer is pushed to bottom of browser window
#maincontainer
min-height: 80%
html, body
height: 100%
.crop-image, .member-image
width: 100%
height: 100%
// Autosuggest
.ui-autocomplete
background: white
z-index: $zindex-tooltip
.alert
a
font-weight: 800
// Overrides applying only to mobile view. This must be at the end of the overrides file.
@media only screen and (max-width: 767px)
.sidebar
margin-left: 0
border-left: none
padding-left: 0
#map
height: 300px
.navbar .nav > li
display: block
.navbar .navbar-form
width: 185px
padding-left: 0
padding-right: 0
/* override "info" alert boxes to be green, not blue, on Growstuff */
$state-info-text: darken($green, 10%)
$state-info-bg: lighten($green, 50%)
/* and set "success" to be the same, as it was just very slightly
* different because the default bootstrap green is slightly different
* from ours */
$state-success-text: darken($green, 10%)
$state-success-bg: lighten($green, 50%)
.hide
display: none
#add-sci_name-row, #remove-sci_name-row, #add-alt_name-row, #remove-alt_name-row
display: none
.panel-footer
height: 6em
.panel
.dl-horizontal
text-overflow: ellipsis
overflow: hidden
#gardens_panel_body
height: 20em
.form-group.required .control-label:before
content: "* "
color: red
.margin-bottom
margin-bottom: 1em
.red
color: red
.truncate
overflow: hidden
text-overflow: ellipsis
white-space: nowrap

View File

@@ -1,2 +0,0 @@
class AboutController < ApplicationController
end

View File

@@ -8,7 +8,7 @@ class Admin::OrdersController < ApplicationController
def search
authorize! :manage, :all
@orders = Order.search({:by => params[:search_by], :for => params[:search_text]})
@orders = Order.search({by: params[:search_by], for: params[:search_text]})
if @orders.empty?
flash[:alert] = "Couldn't find order with #{params[:search_by]} = #{params[:search_text]}"

View File

@@ -1,5 +1,5 @@
class AlternateNamesController < ApplicationController
before_filter :authenticate_member!, :except => [:index, :show]
before_filter :authenticate_member!, except: [:index, :show]
load_and_authorize_resource
# GET /alternate_names
@@ -13,17 +13,6 @@ class AlternateNamesController < ApplicationController
end
end
# GET /alternate_names/1
# GET /alternate_names/1.json
def show
@alternate_name = AlternateName.find(params[:id])
respond_to do |format|
format.html # show.html.haml
format.json { render json: @alternate_name }
end
end
# GET /alternate_names/new
# GET /alternate_names/new.json
def new

View File

@@ -35,7 +35,7 @@ class ApplicationController < ActionController::Base
# CanCan error handling
rescue_from CanCan::AccessDenied do |exception|
redirect_to request.referer || root_url, :alert => exception.message
redirect_to request.referer || root_url, alert: exception.message
end
def set_locale
@@ -52,7 +52,7 @@ class ApplicationController < ActionController::Base
protected
def configure_permitted_parameters
devise_parameter_sanitizer.for(:sign_up) do |member|
devise_parameter_sanitizer.permit(:sign_up) do |member|
member.permit(:login_name, :email, :password, :password_confirmation,
:remember_me, :login,
# terms of service
@@ -64,7 +64,7 @@ class ApplicationController < ActionController::Base
)
end
devise_parameter_sanitizer.for(:account_update) do |member|
devise_parameter_sanitizer.permit(:account_update) do |member|
member.permit(:login_name, :email, :password, :password_confirmation,
:remember_me, :login,
# terms of service

View File

@@ -20,14 +20,14 @@ class AuthenticationsController < ApplicationController
@authentication = current_member.authentications
.create_with(
:name => name,
:token => auth['credentials']['token'],
:secret => auth['credentials']['secret']
name: name,
token: auth['credentials']['token'],
secret: auth['credentials']['secret']
)
.find_or_create_by(
:provider => auth['provider'],
:uid => auth['uid'],
:name => name)
provider: auth['provider'],
uid: auth['uid'],
name: name)
flash[:notice] = "Authentication successful."
else

View File

@@ -1,27 +1,16 @@
class CommentsController < ApplicationController
before_filter :authenticate_member!, :except => [:index, :show]
before_filter :authenticate_member!, except: [:index, :show]
load_and_authorize_resource
# GET /comments
# GET /comments.json
def index
@comments = Comment.paginate(:page => params[:page])
@comments = Comment.paginate(page: params[:page])
respond_to do |format|
format.html # index.html.erb
format.json { render json: @comments }
format.rss { render :layout => false }
end
end
# GET /comments/1
# GET /comments/1.json
def show
@comment = Comment.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @comment }
format.rss { render layout: false }
end
end
@@ -39,7 +28,7 @@ class CommentsController < ApplicationController
end
else
redirect_to request.referer || root_url,
:alert => "Can't post a comment on a non-existent post"
alert: "Can't post a comment on a non-existent post"
end
end

View File

@@ -1,9 +1,9 @@
require 'will_paginate/array'
class CropsController < ApplicationController
before_filter :authenticate_member!, :except => [:index, :hierarchy, :search, :show]
before_filter :authenticate_member!, except: [:index, :hierarchy, :search, :show]
load_and_authorize_resource
skip_authorize_resource :only => [:hierarchy, :search]
skip_authorize_resource only: [:hierarchy, :search]
# GET /crops
# GET /crops.json
@@ -11,25 +11,25 @@ class CropsController < ApplicationController
@sort = params[:sort]
if @sort == 'alpha'
# alphabetical order
@crops = Crop.includes(:scientific_names, {:plantings => :photos})
@paginated_crops = @crops.approved.paginate(:page => params[:page])
@crops = Crop.includes(:scientific_names, {plantings: :photos})
@paginated_crops = @crops.approved.paginate(page: params[:page])
else
# default to sorting by popularity
@crops = Crop.popular.includes(:scientific_names, {:plantings => :photos})
@paginated_crops = @crops.approved.paginate(:page => params[:page])
@crops = Crop.popular.includes(:scientific_names, {plantings: :photos})
@paginated_crops = @crops.approved.paginate(page: params[:page])
end
respond_to do |format|
format.html
format.json { render :json => @crops }
format.json { render json: @crops }
format.rss do
@crops = Crop.recent.includes(:scientific_names, :creator)
render :rss => @crops
render rss: @crops
end
format.csv do
@filename = "Growstuff-Crops-#{Time.zone.now.to_s(:number)}.csv"
@crops = Crop.includes(:scientific_names, :plantings, :seeds, :creator)
render :csv => @crops
render csv: @crops
end
end
end
@@ -46,7 +46,7 @@ class CropsController < ApplicationController
@crops = Crop.recent
end
@crops = @crops.paginate(:page => params[:page])
@crops = @crops.paginate(page: params[:page])
@crop_wranglers = Role.crop_wranglers
respond_to do |format|
@@ -66,25 +66,33 @@ class CropsController < ApplicationController
def search
@term = params[:term]
@matches = Crop.search(@term)
@paginated_matches = @matches.paginate(:page => params[:page])
@paginated_matches = @matches.paginate(page: params[:page])
respond_to do |format|
format.html
format.json { render :json => @matches }
format.json { render json: @matches }
end
end
# GET /crops/1
# GET /crops/1.json
def show
@crop = Crop.includes(:scientific_names, {:plantings => :photos}).find(params[:id])
@posts = @crop.posts.paginate(:page => params[:page])
@crop = Crop.includes(:scientific_names, {plantings: :photos}).find(params[:id])
@posts = @crop.posts.paginate(page: params[:page])
respond_to do |format|
format.html # show.html.haml
format.json do
render :json => @crop.to_json(:include => {
:plantings => { :include => { :owner => { :only => [:id, :login_name, :location, :latitude, :longitude] }}}
# TODO RABL or similar one day to avoid presentation logic here
owner_structure = {
owner: {
only: [:id, :login_name, :location, :latitude, :longitude]
}
}
render json: @crop.to_json(include: {
plantings: {
include: owner_structure
}
})
end
end
@@ -136,7 +144,7 @@ class CropsController < ApplicationController
end
unless current_member.has_role? :crop_wrangler
Role.crop_wranglers.each do |w|
Notifier.new_crop_request(w, @crop).deliver!
Notifier.new_crop_request(w, @crop).deliver_now!
end
end
@@ -180,8 +188,8 @@ class CropsController < ApplicationController
if previous_status == "pending"
requester = @crop.requester
new_status = @crop.approval_status
Notifier.crop_request_approved(requester, @crop).deliver! if new_status == "approved"
Notifier.crop_request_rejected(requester, @crop).deliver! if new_status == "rejected"
Notifier.crop_request_approved(requester, @crop).deliver_now! if new_status == "approved"
Notifier.crop_request_rejected(requester, @crop).deliver_now! if new_status == "rejected"
end
format.html { redirect_to @crop, notice: 'Crop was successfully updated.' }
format.json { head :no_content }
@@ -207,6 +215,6 @@ class CropsController < ApplicationController
private
def crop_params
params.require(:crop).permit(:en_wikipedia_url, :name, :parent_id, :creator_id, :approval_status, :request_notes, :reason_for_rejection, :rejection_notes, :scientific_names_attributes => [:scientific_name, :_destroy, :id])
params.require(:crop).permit(:en_wikipedia_url, :name, :parent_id, :creator_id, :approval_status, :request_notes, :reason_for_rejection, :rejection_notes, scientific_names_attributes: [:scientific_name, :_destroy, :id])
end
end

View File

@@ -1,12 +1,12 @@
class FollowsController < ApplicationController
before_filter :authenticate_member!
load_and_authorize_resource
skip_load_resource :only => :create
skip_load_resource only: :create
# POST /follows
def create
@follow = current_member.follows.build(:followed_id => follow_params[:followed_id])
@follow = current_member.follows.build(followed_id: follow_params[:followed_id])
if @follow.save
flash[:notice] = "Followed #{ @follow.followed.login_name }"

View File

@@ -1,15 +1,15 @@
class GardensController < ApplicationController
before_filter :authenticate_member!, :except => [:index, :show]
before_filter :authenticate_member!, except: [:index, :show]
load_and_authorize_resource
# GET /gardens
# GET /gardens.json
def index
@gardens = Garden.paginate(:page => params[:page])
@gardens = Garden.paginate(page: params[:page])
@owner = Member.find_by_slug(params[:owner])
if @owner
@gardens = @owner.gardens.paginate(:page => params[:page])
@gardens = @owner.gardens.paginate(page: params[:page])
end
respond_to do |format|
@@ -87,7 +87,7 @@ class GardensController < ApplicationController
expire_fragment("homepage_stats")
respond_to do |format|
format.html { redirect_to gardens_by_owner_path(:owner => @garden.owner), notice: 'Garden was successfully deleted.' }
format.html { redirect_to gardens_by_owner_path(owner: @garden.owner), notice: 'Garden was successfully deleted.' }
format.json { head :no_content }
end
end

View File

@@ -1,5 +1,5 @@
class HarvestsController < ApplicationController
before_filter :authenticate_member!, :except => [:index, :show]
before_filter :authenticate_member!, except: [:index, :show]
load_and_authorize_resource
@@ -17,27 +17,16 @@ class HarvestsController < ApplicationController
end
respond_to do |format|
format.html { @harvests = @harvests.paginate(:page => params[:page]) }
format.html { @harvests = @harvests.paginate(page: params[:page]) }
format.json { render json: @harvests }
format.csv do
specifics = (@owner ? "#{@owner.login_name}-" : @crop ? "#{@crop.name}-" : nil)
@filename = "Growstuff-#{specifics}Harvests-#{Time.zone.now.to_s(:number)}.csv"
render :csv => @harvests
render csv: @harvests
end
end
end
# GET /harvests/1
# GET /harvests/1.json
def show
@harvest = Harvest.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @harvest }
end
end
# GET /harvests/new
# GET /harvests/new.json
def new

View File

@@ -1,21 +1,21 @@
class MembersController < ApplicationController
load_and_authorize_resource
skip_authorize_resource :only => [:nearby, :unsubscribe]
skip_authorize_resource only: [:nearby, :unsubscribe]
after_action :expire_cache_fragments, :only => :create
after_action :expire_cache_fragments, only: :create
def index
@sort = params[:sort]
if @sort == 'recently_joined'
@members = Member.confirmed.recently_joined.paginate(:page => params[:page])
@members = Member.confirmed.recently_joined.paginate(page: params[:page])
else
@members = Member.confirmed.paginate(:page => params[:page])
@members = Member.confirmed.paginate(page: params[:page])
end
respond_to do |format|
format.html # index.html.haml
format.json { render :json => @members.to_json(:only => [:id, :login_name, :slug, :bio, :created_at, :location, :latitude, :longitude]) }
format.json { render json: @members.to_json(only: [:id, :login_name, :slug, :bio, :created_at, :location, :latitude, :longitude]) }
end
end
@@ -31,22 +31,22 @@ class MembersController < ApplicationController
respond_to do |format|
format.html # show.html.haml
format.json { render :json => @member.to_json(:only => [:id, :login_name, :bio, :created_at, :slug, :location, :latitude, :longitude]) }
format.json { render json: @member.to_json(only: [:id, :login_name, :bio, :created_at, :slug, :location, :latitude, :longitude]) }
format.rss { render(
:layout => false,
:locals => { :member => @member }
layout: false,
locals: { member: @member }
)}
end
end
def view_follows
@member = Member.confirmed.find(params[:login_name])
@follows = @member.followed.paginate(:page => params[:page])
@follows = @member.followed.paginate(page: params[:page])
end
def view_followers
@member = Member.confirmed.find(params[:login_name])
@followers = @member.followers.paginate(:page => params[:page])
@followers = @member.followers.paginate(page: params[:page])
end
EMAIL_TYPE_STRING = {

View File

@@ -40,6 +40,8 @@ class NotificationsController < ApplicationController
def reply
@notification = Notification.new
@sender_notification = Notification.find(params[:id])
@sender_notification.read = true
@sender_notification.save
@recipient = @sender_notification.sender
@subject = @sender_notification.subject =~ /^Re: / ?
@sender_notification.subject :

View File

@@ -8,7 +8,7 @@ class OrderItemsController < ApplicationController
params[:order_item][:price] = params[:order_item][:price].to_f * 100 # convert to cents
end
@order_item = OrderItem.new(order_item_params)
@order_item.order = current_member.current_order || Order.create(:member_id => current_member.id)
@order_item.order = current_member.current_order || Order.create(member_id: current_member.id)
respond_to do |format|
if @order_item.save

View File

@@ -34,15 +34,15 @@ class OrdersController < ApplicationController
@order = Order.find(params[:id])
respond_to do |format|
if @order.update_attributes(:referral_code => params[:referral_code])
if @order.update_attributes(referral_code: params[:referral_code])
response = EXPRESS_GATEWAY.setup_purchase(
@order.total,
:items => @order.activemerchant_items,
:currency => Growstuff::Application.config.currency,
:no_shipping => true,
:ip => request.remote_ip,
:return_url => complete_order_url,
:cancel_return_url => shop_url
items: @order.activemerchant_items,
currency: Growstuff::Application.config.currency,
no_shipping: true,
ip: request.remote_ip,
return_url: complete_order_url,
cancel_return_url: shop_url
)
format.html { redirect_to EXPRESS_GATEWAY.redirect_url_for(response.token) }
else
@@ -58,10 +58,10 @@ class OrdersController < ApplicationController
if (params[:token] && params['PayerID'])
purchase = EXPRESS_GATEWAY.purchase(
@order.total,
:currency => Growstuff::Application.config.currency,
:ip => request.remote_ip,
:payer_id => params['PayerID'],
:token => params[:token]
currency: Growstuff::Application.config.currency,
ip: request.remote_ip,
payer_id: params['PayerID'],
token: params[:token]
)
if purchase.success?
@order.completed_at = Time.zone.now

View File

@@ -0,0 +1,6 @@
class PagesController < ApplicationController
def letsencrypt
# use your code here, not mine
render text: "y9KNck8wqkoQLnlr2RgA2TVwWtyYb4PeY_hzGNx0Tfs.dlIPqFhMDCLyQEccczY3roHZ1UWu6UqVeyb9mkRxheU"
end
end

View File

@@ -1,11 +1,11 @@
class PhotosController < ApplicationController
before_filter :authenticate_member!, :except => [:index, :show]
before_filter :authenticate_member!, except: [:index, :show]
load_and_authorize_resource
# GET /photos
# GET /photos.json
def index
@photos = Photo.paginate(:page => params[:page])
@photos = Photo.paginate(page: params[:page])
respond_to do |format|
format.html # index.html.erb
@@ -13,17 +13,6 @@ class PhotosController < ApplicationController
end
end
# GET /photos/1
# GET /photos/1.json
def show
@photo = Photo.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @photo }
end
end
# GET /photos/new
# GET /photos/new.json
def new
@@ -63,35 +52,29 @@ class PhotosController < ApplicationController
@photo.owner_id = current_member.id
@photo.set_flickr_metadata
# several models can have photos. we need to know what model and the id
# for the entry to attach the photo to
valid_models = ["planting", "harvest", "garden"]
if params[:type]
if valid_models.include?(params[:type])
if params[:id]
item = params[:type].camelcase.constantize.find_by_id(params[:id])
if item
if item.owner.id == current_member.id
# This syntax is weird, so just know that it means this:
# @photo.harvests << item unless @photo.harvests.include?(item)
# but with the correct many-to-many relationship automatically referenced
(@photo.send "#{params[:type]}s") << item unless (@photo.send "#{params[:type]}s").include?(item)
else
flash[:alert] = "You must own both the #{params[:type]} and the photo."
end
else
flash[:alert] = "Couldn't find #{params[:type]} to connect to photo."
end
else
flash[:alert] = "Missing id parameter"
end
collection = case params[:type]
when 'garden'
@photo.gardens
when 'planting'
@photo.plantings
when 'harvest'
@photo.harvests
else
nil
end
if collection && has_item_id
item = params[:type].camelcase.constantize.find_by_id(params[:id])
if item && member_owns_item(item)
collection << item unless collection.include?(item)
else
flash[:alert] = "Cannot attach photos to #{params[:type]}"
flash[:alert] = "Could not find this item owned by you"
end
else
flash[:alert] = "Missing type parameter"
else
flash[:alert] = "Missing or invalid type or id parameter"
end
respond_to do |format|
if @photo.save
format.html { redirect_to @photo, notice: 'Photo was successfully added.' }
@@ -134,6 +117,14 @@ class PhotosController < ApplicationController
private
def has_item_id
params.key? :id
end
def member_owns_item(item)
item.owner.id == current_member.id
end
def photo_params
params.require(:photo).permit(:flickr_photo_id, :owner_id, :title, :license_name,
:license_url, :thumbnail_url, :fullsize_url, :link_url)

View File

@@ -5,7 +5,7 @@ class PlacesController < ApplicationController
respond_to do |format|
format.html
# json response is whatever we want to map here
format.json { render :json => Member.located.to_json(:only => [:id, :login_name, :slug, :location, :latitude, :longitude]) }
format.json { render json: Member.located.to_json(only: [:id, :login_name, :slug, :location, :latitude, :longitude]) }
end
end
@@ -16,7 +16,7 @@ class PlacesController < ApplicationController
@nearby_members = Member.nearest_to(params[:place])
respond_to do |format|
format.html # show.html.haml
format.json { render :json => @nearby_members.to_json(:only => [:id, :login_name, :slug, :location, :latitude, :longitude]) }
format.json { render json: @nearby_members.to_json(only: [:id, :login_name, :slug, :location, :latitude, :longitude]) }
end
end

View File

@@ -1,5 +1,5 @@
class PlantingsController < ApplicationController
before_filter :authenticate_member!, :except => [:index, :show]
before_filter :authenticate_member!, except: [:index, :show]
load_and_authorize_resource
# GET /plantings
@@ -8,21 +8,21 @@ class PlantingsController < ApplicationController
@owner = Member.find_by_slug(params[:owner])
@crop = Crop.find_by_slug(params[:crop])
if @owner
@plantings = @owner.plantings.includes(:owner, :crop, :garden).paginate(:page => params[:page])
@plantings = @owner.plantings.includes(:owner, :crop, :garden).paginate(page: params[:page])
elsif @crop
@plantings = @crop.plantings.includes(:owner, :crop, :garden).paginate(:page => params[:page])
@plantings = @crop.plantings.includes(:owner, :crop, :garden).paginate(page: params[:page])
else
@plantings = Planting.includes(:owner, :crop, :garden).paginate(:page => params[:page])
@plantings = Planting.includes(:owner, :crop, :garden).paginate(page: params[:page])
end
respond_to do |format|
format.html { @plantings = @plantings.paginate(:page => params[:page]) }
format.html { @plantings = @plantings.paginate(page: params[:page]) }
format.json { render json: @plantings }
format.rss { render :layout => false } #index.rss.builder
format.rss { render layout: false } #index.rss.builder
format.csv do
specifics = (@owner ? "#{@owner.login_name}-" : @crop ? "#{@crop.name}-" : nil)
@filename = "Growstuff-#{specifics}Plantings-#{Time.zone.now.to_s(:number)}.csv"
render :csv => @plantings
render csv: @plantings
end
end
end

View File

@@ -1,2 +0,0 @@
class PolicyController < ApplicationController
end

View File

@@ -1,5 +1,5 @@
class PostsController < ApplicationController
before_filter :authenticate_member!, :except => [:index, :show]
before_filter :authenticate_member!, except: [:index, :show]
load_and_authorize_resource
# GET /posts
@@ -8,29 +8,29 @@ class PostsController < ApplicationController
def index
@author = Member.find_by_slug(params[:author])
if @author
@posts = @author.posts.includes(:author, { :comments => :author }).paginate(:page => params[:page])
@posts = @author.posts.includes(:author, { comments: :author }).paginate(page: params[:page])
else
@posts = Post.includes(:author, { :comments => :author }).paginate(:page => params[:page])
@posts = Post.includes(:author, { comments: :author }).paginate(page: params[:page])
end
respond_to do |format|
format.html # index.html.haml
format.json { render json: @posts }
format.rss { render :layout => false } #index.rss.builder
format.rss { render layout: false } #index.rss.builder
end
end
# GET /posts/1
# GET /posts/1.json
def show
@post = Post.includes(:author, { :comments => :author }).find(params[:id])
@post = Post.includes(:author, { comments: :author }).find(params[:id])
respond_to do |format|
format.html # show.html.haml
format.json { render json: @post }
format.rss { render(
:layout => false,
:locals => { :post => @post }
layout: false,
locals: { post: @post }
)}
end
end

View File

@@ -28,7 +28,7 @@ class RegistrationsController < Devise::RegistrationsController
if successfully_updated
set_flash_message :notice, :updated
# Sign in the member bypassing validation in case their password changed
sign_in @member, :bypass => true
sign_in @member, bypass: true
redirect_to edit_member_registration_path
else
render "edit"

View File

@@ -1,5 +1,5 @@
class ScientificNamesController < ApplicationController
before_filter :authenticate_member!, :except => [:index, :show]
before_filter :authenticate_member!, except: [:index, :show]
load_and_authorize_resource
# GET /scientific_names

View File

@@ -1,5 +1,5 @@
class SeedsController < ApplicationController
before_filter :authenticate_member!, :except => [:index, :show]
before_filter :authenticate_member!, except: [:index, :show]
load_and_authorize_resource
# GET /seeds
@@ -8,17 +8,17 @@ class SeedsController < ApplicationController
@owner = Member.find_by_slug(params[:owner])
@crop = Crop.find_by_slug(params[:crop])
if @owner
@seeds = @owner.seeds.includes(:owner, :crop).paginate(:page => params[:page])
@seeds = @owner.seeds.includes(:owner, :crop).paginate(page: params[:page])
elsif @crop
@seeds = @crop.seeds.includes(:owner, :crop).paginate(:page => params[:page])
@seeds = @crop.seeds.includes(:owner, :crop).paginate(page: params[:page])
else
@seeds = Seed.includes(:owner, :crop).paginate(:page => params[:page])
@seeds = Seed.includes(:owner, :crop).paginate(page: params[:page])
end
respond_to do |format|
format.html # index.html.erb
format.json { render json: @seeds }
format.rss { render :layout => false } #index.rss.builder
format.rss { render layout: false } #index.rss.builder
format.csv do
if @owner
@filename = "Growstuff-#{@owner}-Seeds-#{Time.zone.now.to_s(:number)}.csv"
@@ -27,7 +27,7 @@ class SeedsController < ApplicationController
@filename = "Growstuff-Seeds-#{Time.zone.now.to_s(:number)}.csv"
@seeds = Seed.includes(:owner, :crop)
end
render :csv => @seeds
render csv: @seeds
end
end
end

View File

@@ -0,0 +1,9 @@
class SessionsController < Devise::SessionsController
def create
super do |resource|
if Crop.pending_approval.present? && current_member.has_role?(:crop_wrangler)
flash[:alert] = "There are crops waiting to be wrangled."
end
end
end
end

View File

@@ -1,2 +0,0 @@
class SupportController < ApplicationController
end

View File

@@ -19,10 +19,24 @@ module ApplicationHelper
pid = price_in_dollars(price)
currency = Growstuff::Application.config.currency
link = "http://www.wolframalpha.com/input/?i=#{pid}+#{currency}"
return link_to "(convert)",
link,
:target => "_blank"
end
link_to "(convert)", link, target: "_blank", rel: "noopener noreferrer"
end
def build_alert_classes(alert_type = :info)
classes = 'alert alert-dismissable '
case alert_type.to_sym
when :alert, :danger, :error, :validation_errors
classes += 'alert-danger'
when :warning, :todo
classes += 'alert-warning'
when :notice, :success
classes += 'alert-success'
when :info
classes += 'alert-info'
end
classes
end
# Produces a cache key for uniquely identifying cached fragments.
def cache_key_for(klass, identifier="all")
@@ -46,9 +60,17 @@ module ApplicationHelper
return member.preferred_avatar_uri if member.preferred_avatar_uri.present?
Gravatar.new(member.email).image_url({
:size => size,
:default => :identicon
size: size,
default: :identicon
})
end
# Returns a string with the quantity and the right pluralization for a
# given collection and model.
def localize_plural(collection, model)
size = collection.size
model_name = model.model_name.human(count: size)
"#{size} #{model_name}"
end
end

View File

@@ -1,17 +1,21 @@
module CropsHelper
def display_seed_availability(member, crop)
total_quantity = 0
member.seeds.each do |seed|
if seed.crop.name == crop.name
total_quantity = total_quantity + seed.quantity
end
seeds = member.seeds.select {|seed| seed.crop.name == crop.name }
seeds.each do |seed|
total_quantity = total_quantity + seed.quantity if seed.quantity
end
if !seeds.any?
return "You don't have any seeds of this crop."
end
if (total_quantity != 0)
"You have #{pluralize(total_quantity, "seed")} of this crop."
"You have #{total_quantity} #{Seed.model_name.human(count: total_quantity)} of this crop."
else
"You don't have any seeds of this crop."
"You have an unknown quantity of seeds of this crop."
end
end
end
end

View File

@@ -18,11 +18,11 @@ module HarvestsHelper
def display_human_quantity(harvest)
if ! harvest.quantity.blank? && harvest.quantity > 0
if harvest.unit == 'individual' # just the number
number_to_human(harvest.quantity, :strip_insignificant_zeros => true)
number_to_human(harvest.quantity, strip_insignificant_zeros: true)
elsif ! harvest.unit.blank? # pluralize anything else
return pluralize(number_to_human(harvest.quantity, :strip_insignificant_zeros => true), harvest.unit)
return pluralize(number_to_human(harvest.quantity, strip_insignificant_zeros: true), harvest.unit)
else
return "#{number_to_human(harvest.quantity, :strip_insignificant_zeros => true)} #{harvest.unit}"
return "#{number_to_human(harvest.quantity, strip_insignificant_zeros: true)} #{harvest.unit}"
end
else
return nil
@@ -31,7 +31,7 @@ module HarvestsHelper
def display_weight(harvest)
if ! harvest.weight_quantity.blank? && harvest.weight_quantity > 0
return "#{number_to_human(harvest.weight_quantity, :strip_insignificant_zeros => true)} #{harvest.weight_unit}"
return "#{number_to_human(harvest.weight_quantity, strip_insignificant_zeros: true)} #{harvest.weight_unit}"
else
return nil
end
@@ -41,7 +41,7 @@ module HarvestsHelper
if harvest.description.empty?
"No description provided."
else
truncate(harvest.description, length: 130, separator: ' ', omission: '... ') { link_to "Read more", harvest_path(harvest) }
harvest.description
end
end

View File

@@ -2,7 +2,7 @@ module NotificationsHelper
def reply_link(notification)
if notification.post
# comment on the post in question
new_comment_url(:post_id => notification.post.id)
new_comment_url(post_id: notification.post.id)
else
# by default, reply link sends a PM in return
reply_notification_url(notification)

View File

@@ -2,12 +2,10 @@ class Notifier < ActionMailer::Base
include NotificationsHelper
default from: "Growstuff <noreply@growstuff.org>"
def verifier()
if ENV['RAILS_SECRET_TOKEN']
return ActiveSupport::MessageVerifier.new(ENV['RAILS_SECRET_TOKEN'])
else
raise "RAILS_SECRET_TOKEN environment variable not set - have you created config/application.yml?"
end
def verifier
raise "RAILS_SECRET_TOKEN environment variable not set - have you created config/application.yml?" unless ENV['RAILS_SECRET_TOKEN']
return ActiveSupport::MessageVerifier.new(ENV['RAILS_SECRET_TOKEN'])
end
def notify(notification)
@@ -17,8 +15,8 @@ class Notifier < ActionMailer::Base
# Encrypting
@signed_message = verifier.generate ({ member_id: @notification.recipient.id, type: :send_notification_email })
mail(:to => @notification.recipient.email,
:subject => @notification.subject)
mail(to: @notification.recipient.email,
subject: @notification.subject)
end
def planting_reminder(member)
@@ -31,24 +29,24 @@ class Notifier < ActionMailer::Base
@signed_message = verifier.generate ({ member_id: @member.id, type: :send_planting_reminder })
if @member.send_planting_reminder
mail(:to => @member.email,
:subject => "What have you planted lately?")
mail(to: @member.email,
subject: "What have you planted lately?")
end
end
def new_crop_request(member, request)
@member, @request = member, request
mail(:to => @member.email, :subject => "#{@request.requester.login_name} has requested #{@request.name} as a new crop")
mail(to: @member.email, subject: "#{@request.requester.login_name} has requested #{@request.name} as a new crop")
end
def crop_request_approved(member, crop)
@member, @crop = member, crop
mail(:to => @member.email, :subject => "#{crop.name.capitalize} has been approved")
mail(to: @member.email, subject: "#{crop.name.capitalize} has been approved")
end
def crop_request_rejected(member, crop)
@member, @crop = member, crop
mail(:to => @member.email, :subject => "#{crop.name.capitalize} has been rejected")
mail(to: @member.email, subject: "#{crop.name.capitalize} has been rejected")
end
end

View File

@@ -24,7 +24,7 @@ class Ability
# nobody should be able to view unapproved crops unless they
# are wranglers or admins
cannot :read, Crop
can :read, Crop, :approval_status => "approved"
can :read, Crop, approval_status: "approved"
# scientific names should only be viewable if associated crop is approved
cannot :read, ScientificName
can :read, ScientificName do |sn|
@@ -38,15 +38,15 @@ class Ability
if member
# members can see even rejected or pending crops if they requested it
can :read, Crop, :requester_id => member.id
can :read, Crop, requester_id: member.id
# managing your own user settings
can :update, Member, :id => member.id
can :update, Member, id: member.id
# can read/delete notifications that were sent to them
can :read, Notification, :recipient_id => member.id
can :destroy, Notification, :recipient_id => member.id
can :reply, Notification, :recipient_id => member.id
can :read, Notification, recipient_id: member.id
can :destroy, Notification, recipient_id: member.id
can :reply, Notification, recipient_id: member.id
# can send a private message to anyone but themselves
# note: sadly, we can't test for this from the view, but it works
# for the model/controller
@@ -68,58 +68,58 @@ class Ability
# can create & destroy their own authentications against other sites.
can :create, Authentication
can :destroy, Authentication, :member_id => member.id
can :destroy, Authentication, member_id: member.id
# anyone can create a post, or comment on a post,
# but only the author can edit/destroy it.
can :create, Post
can :update, Post, :author_id => member.id
can :destroy, Post, :author_id => member.id
can :update, Post, author_id: member.id
can :destroy, Post, author_id: member.id
can :create, Comment
can :update, Comment, :author_id => member.id
can :destroy, Comment, :author_id => member.id
can :update, Comment, author_id: member.id
can :destroy, Comment, author_id: member.id
# same deal for gardens and plantings
can :create, Garden
can :update, Garden, :owner_id => member.id
can :destroy, Garden, :owner_id => member.id
can :update, Garden, owner_id: member.id
can :destroy, Garden, owner_id: member.id
can :create, Planting
can :update, Planting, :garden => { :owner_id => member.id }
can :destroy, Planting, :garden => { :owner_id => member.id }
can :update, Planting, garden: { owner_id: member.id }
can :destroy, Planting, garden: { owner_id: member.id }
can :create, Harvest
can :update, Harvest, :owner_id => member.id
can :destroy, Harvest, :owner_id => member.id
can :update, Harvest, owner_id: member.id
can :destroy, Harvest, owner_id: member.id
can :create, Photo
can :update, Photo, :owner_id => member.id
can :destroy, Photo, :owner_id => member.id
can :update, Photo, owner_id: member.id
can :destroy, Photo, owner_id: member.id
can :create, Seed
can :update, Seed, :owner_id => member.id
can :destroy, Seed, :owner_id => member.id
can :update, Seed, owner_id: member.id
can :destroy, Seed, owner_id: member.id
# orders/shop/etc
can :create, Order
can :read, Order, :member_id => member.id
can :complete, Order, :member_id => member.id, :completed_at => nil
can :checkout, Order, :member_id => member.id, :completed_at => nil
can :cancel, Order, :member_id => member.id, :completed_at => nil
can :destroy, Order, :member_id => member.id, :completed_at => nil
can :read, Order, member_id: member.id
can :complete, Order, member_id: member.id, completed_at: nil
can :checkout, Order, member_id: member.id, completed_at: nil
can :cancel, Order, member_id: member.id, completed_at: nil
can :destroy, Order, member_id: member.id, completed_at: nil
can :create, OrderItem
# for now, let's not let people mess with individual order items
cannot :read, OrderItem, :order => { :member_id => member.id }
cannot :update, OrderItem, :order => { :member_id => member.id, :completed_at => nil }
cannot :destroy, OrderItem, :order => { :member_id => member.id, :completed_at => nil }
cannot :read, OrderItem, order: { member_id: member.id }
cannot :update, OrderItem, order: { member_id: member.id, completed_at: nil }
cannot :destroy, OrderItem, order: { member_id: member.id, completed_at: nil }
# following/unfollowing permissions
can :create, Follow
cannot :create, Follow, :followed_id => member.id # can't follow yourself
cannot :create, Follow, followed_id: member.id # can't follow yourself
can :destroy, Follow
cannot :destroy, Follow, :followed_id => member.id # can't unfollow yourself
cannot :destroy, Follow, followed_id: member.id # can't unfollow yourself
if member.has_role? :admin

View File

@@ -2,8 +2,8 @@ class Account < ActiveRecord::Base
belongs_to :member
belongs_to :account_type
validates :member_id, :uniqueness => {
:message => 'already has account details associated with it'
validates :member_id, uniqueness: {
message: 'already has account details associated with it'
}
before_create do |account|

View File

@@ -1,5 +1,5 @@
class AlternateName < ActiveRecord::Base
after_commit { |an| an.crop.__elasticsearch__.index_document if an.crop && ENV['GROWSTUFF_ELASTICSEARCH'] == "true" }
belongs_to :crop
belongs_to :creator, :class_name => 'Member'
belongs_to :creator, class_name: 'Member'
end

View File

@@ -1,5 +1,5 @@
class Comment < ActiveRecord::Base
belongs_to :author, :class_name => 'Member'
belongs_to :author, class_name: 'Member'
belongs_to :post
default_scope { order("created_at DESC") }
@@ -11,11 +11,11 @@ class Comment < ActiveRecord::Base
# don't send notifications to yourself
if recipient != sender
Notification.create(
:recipient_id => recipient,
:sender_id => sender,
:subject => "#{self.author} commented on #{self.post.subject}",
:body => self.body,
:post_id => self.post.id
recipient_id: recipient,
sender_id: sender,
subject: "#{self.author} commented on #{self.post.subject}",
body: self.body,
post_id: self.post.id
)
end
end

View File

@@ -4,42 +4,42 @@ class Crop < ActiveRecord::Base
has_many :scientific_names, after_add: :update_index, after_remove: :update_index
accepts_nested_attributes_for :scientific_names,
:allow_destroy => true,
:reject_if => :all_blank
allow_destroy: true,
reject_if: :all_blank
has_many :alternate_names, after_add: :update_index, after_remove: :update_index, dependent: :destroy
has_many :plantings
has_many :photos, :through => :plantings
has_many :photos, through: :plantings
has_many :seeds
has_many :harvests
has_many :plant_parts, -> { uniq }, :through => :harvests
belongs_to :creator, :class_name => 'Member'
belongs_to :requester, :class_name => 'Member'
has_many :plant_parts, -> { uniq }, through: :harvests
belongs_to :creator, class_name: 'Member'
belongs_to :requester, class_name: 'Member'
belongs_to :parent, :class_name => 'Crop'
has_many :varieties, :class_name => 'Crop', :foreign_key => 'parent_id'
belongs_to :parent, class_name: 'Crop'
has_many :varieties, class_name: 'Crop', foreign_key: 'parent_id'
has_and_belongs_to_many :posts
before_destroy {|crop| crop.posts.clear}
default_scope { order("lower(name) asc") }
scope :recent, -> { where(:approval_status => "approved").reorder("created_at desc") }
scope :toplevel, -> { where(:approval_status => "approved", :parent_id => nil) }
scope :popular, -> { where(:approval_status => "approved").reorder("plantings_count desc, lower(name) asc") }
scope :randomized, -> { where(:approval_status => "approved").reorder('random()') } # ok on sqlite and psql, but not on mysql
scope :pending_approval, -> { where(:approval_status => "pending") }
scope :approved, -> { where(:approval_status => "approved") }
scope :rejected, -> { where(:approval_status => "rejected") }
scope :recent, -> { where(approval_status: "approved").reorder("created_at desc") }
scope :toplevel, -> { where(approval_status: "approved", parent_id: nil) }
scope :popular, -> { where(approval_status: "approved").reorder("plantings_count desc, lower(name) asc") }
scope :randomized, -> { where(approval_status: "approved").reorder('random()') } # ok on sqlite and psql, but not on mysql
scope :pending_approval, -> { where(approval_status: "pending") }
scope :approved, -> { where(approval_status: "approved") }
scope :rejected, -> { where(approval_status: "rejected") }
## Wikipedia urls are only necessary when approving a crop
validates :en_wikipedia_url,
:format => {
:with => /\Ahttps?:\/\/en\.wikipedia\.org\/wiki/,
:message => 'is not a valid English Wikipedia URL'
format: {
with: /\Ahttps?:\/\/en\.wikipedia\.org\/wiki/,
message: 'is not a valid English Wikipedia URL'
},
:if => :approved?
if: :approved?
## Reasons are only necessary when rejecting
validates :reason_for_rejection, :presence => true, :if => :rejected?
validates :reason_for_rejection, presence: true, if: :rejected?
## This validation addresses a race condition
validate :approval_status_cannot_be_changed_again
@@ -128,7 +128,11 @@ class Crop < ActiveRecord::Base
# later we can choose a default photo based on different criteria,
# eg. popularity
def default_photo
return photos.first
return photos.first if photos.any?
# Crop has no photos? Look for the most recent harvest with a photo.
harvest_with_photo = Harvest.where(crop_id: id).joins(:photos).order('harvests.id DESC').limit(1).first
return harvest_with_photo.photos.first if harvest_with_photo
end
# crop.sunniness
@@ -206,7 +210,7 @@ class Crop < ActiveRecord::Base
# returns a list of interesting crops, for use on the homepage etc
def Crop.interesting
howmany = 12 # max number to find
interesting_crops = Array.new
interesting_crops = []
Crop.includes(:photos).randomized.each do |c|
break if interesting_crops.size == howmany
next unless c.interesting?
@@ -231,14 +235,14 @@ class Crop < ActiveRecord::Base
crop = Crop.find_or_create_by(name: name)
crop.update_attributes(
:en_wikipedia_url => en_wikipedia_url,
:creator_id => cropbot.id
en_wikipedia_url: en_wikipedia_url,
creator_id: cropbot.id
)
if parent
parent = Crop.find_by_name(parent)
if parent
crop.update_attributes(:parent_id => parent.id)
crop.update_attributes(parent_id: parent.id)
else
logger.warn("Warning: parent crop #{parent} not found")
end
@@ -264,13 +268,13 @@ class Crop < ActiveRecord::Base
raise "cropbot account not found: run rake db:seed" unless cropbot
names_to_add.each do |n|
if self.scientific_names.exists?(:scientific_name => n)
if self.scientific_names.exists?(scientific_name: n)
logger.warn("Warning: skipping duplicate scientific name #{n} for #{self}")
else
self.scientific_names.create(
:scientific_name => n,
:creator_id => cropbot.id
scientific_name: n,
creator_id: cropbot.id
)
end
end
@@ -286,12 +290,12 @@ class Crop < ActiveRecord::Base
names_to_add = alternate_names.split(%r{,\s*})
names_to_add.each do |n|
if self.alternate_names.exists?(:name => n)
if self.alternate_names.exists?(name: n)
logger.warn("Warning: skipping duplicate alternate name #{n} for #{self}")
else
self.alternate_names.create(
:name => n,
:creator_id => cropbot.id
name: n,
creator_id: cropbot.id
)
end
end

View File

@@ -1,14 +1,14 @@
class Follow < ActiveRecord::Base
belongs_to :follower, class_name: "Member"
belongs_to :followed, class_name: "Member"
validates :follower_id, uniqueness: { :scope => :followed_id }
validates :follower_id, uniqueness: { scope: :followed_id }
after_create do
Notification.create(
:recipient_id => self.followed_id,
:sender_id => self.follower_id,
:subject => "#{self.follower.login_name} is now following you",
:body => "#{self.follower.login_name} just followed you on #{ENV["GROWSTUFF_SITE_NAME"]}. "
recipient_id: self.followed_id,
sender_id: self.follower_id,
subject: "#{self.follower.login_name} is now following you",
body: "#{self.follower.login_name} just followed you on #{ENV["GROWSTUFF_SITE_NAME"]}. "
)
end

View File

@@ -3,7 +3,7 @@ class Forum < ActiveRecord::Base
friendly_id :name, use: [:slugged, :finders]
has_many :posts
belongs_to :owner, :class_name => "Member"
belongs_to :owner, class_name: "Member"
def to_s
return name

View File

@@ -3,9 +3,9 @@ class Garden < ActiveRecord::Base
extend FriendlyId
friendly_id :garden_slug, use: [:slugged, :finders]
belongs_to :owner, :class_name => 'Member', :foreign_key => 'owner_id'
has_many :plantings, -> { order(created_at: :desc) }, :dependent => :destroy
has_many :crops, :through => :plantings
belongs_to :owner, class_name: 'Member', foreign_key: 'owner_id'
has_many :plantings, -> { order(created_at: :desc) }, dependent: :destroy
has_many :crops, through: :plantings
has_and_belongs_to_many :photos
@@ -25,23 +25,23 @@ class Garden < ActiveRecord::Base
after_save :mark_inactive_garden_plantings_as_finished
default_scope { order("lower(name) asc") }
scope :active, -> { where(:active => true) }
scope :inactive, -> { where(:active => false) }
scope :active, -> { where(active: true) }
scope :inactive, -> { where(active: false) }
validates :location,
:length => { :maximum => 255 }
length: { maximum: 255 }
validates :name,
:format => {
:with => /\S/
format: {
with: /\S/
},
:length => { :maximum => 255 }
length: { maximum: 255 }
validates :area,
:numericality => {
:only_integer => false,
:greater_than_or_equal_to => 0 },
:allow_nil => true
numericality: {
only_integer: false,
greater_than_or_equal_to: 0 },
allow_nil: true
AREA_UNITS_VALUES = {
"square metres" => "square metre",
@@ -49,10 +49,10 @@ class Garden < ActiveRecord::Base
"hectares" => "hectare",
"acres" => "acre"
}
validates :area_unit, :inclusion => { :in => AREA_UNITS_VALUES.values,
:message => "%{value} is not a valid area unit" },
:allow_nil => true,
:allow_blank => true
validates :area_unit, inclusion: { in: AREA_UNITS_VALUES.values,
message: "%{value} is not a valid area unit" },
allow_nil: true,
allow_blank: true
after_validation :cleanup_area

View File

@@ -4,7 +4,7 @@ class Harvest < ActiveRecord::Base
friendly_id :harvest_slug, use: [:slugged, :finders]
belongs_to :crop
belongs_to :owner, :class_name => 'Member'
belongs_to :owner, class_name: 'Member'
belongs_to :plant_part
has_and_belongs_to_many :photos
@@ -20,17 +20,17 @@ class Harvest < ActiveRecord::Base
default_scope { order('created_at DESC') }
validates :crop, :approved => true
validates :crop, approved: true
validates :crop, :presence => {:message => "must be present and exist in our database"}
validates :crop, presence: {message: "must be present and exist in our database"}
validates :plant_part, :presence => {:message => "must be present and exist in our database"}
validates :plant_part, presence: {message: "must be present and exist in our database"}
validates :quantity,
:numericality => {
:only_integer => false,
:greater_than_or_equal_to => 0 },
:allow_nil => true
numericality: {
only_integer: false,
greater_than_or_equal_to: 0 },
allow_nil: true
UNITS_VALUES = {
"individual" => "individual",
@@ -44,24 +44,24 @@ class Harvest < ActiveRecord::Base
"baskets" => "basket",
"bushels" => "bushel"
}
validates :unit, :inclusion => { :in => UNITS_VALUES.values,
:message => "%{value} is not a valid unit" },
:allow_nil => true,
:allow_blank => true
validates :unit, inclusion: { in: UNITS_VALUES.values,
message: "%{value} is not a valid unit" },
allow_nil: true,
allow_blank: true
validates :weight_quantity,
:numericality => { :only_integer => false },
:allow_nil => true
numericality: { only_integer: false },
allow_nil: true
WEIGHT_UNITS_VALUES = {
"kg" => "kg",
"lb" => "lb",
"oz" => "oz"
}
validates :weight_unit, :inclusion => { :in => WEIGHT_UNITS_VALUES.values,
:message => "%{value} is not a valid unit" },
:allow_nil => true,
:allow_blank => true
validates :weight_unit, inclusion: { in: WEIGHT_UNITS_VALUES.values,
message: "%{value} is not a valid unit" },
allow_nil: true,
allow_blank: true
after_validation :cleanup_quantities
@@ -72,7 +72,7 @@ class Harvest < ActiveRecord::Base
def set_si_weight
if self.weight_unit != nil
weight_string = "#{self.weight_quantity} #{self.weight_unit}"
self.si_weight = Unit(weight_string).convert_to("kg").to_s("%0.3f").delete(" kg").to_f
self.si_weight = Unit.new(weight_string).convert_to("kg").to_s("%0.3f").delete(" kg").to_f
end
end
@@ -104,7 +104,7 @@ class Harvest < ActiveRecord::Base
# 2 buckets of apricots, weighing 10kg
string = ''
if self.quantity
string += "#{number_to_human(self.quantity.to_s, :strip_insignificant_zeros => true)} "
string += "#{number_to_human(self.quantity.to_s, strip_insignificant_zeros: true)} "
if self.unit == 'individual'
string += 'individual '
else
@@ -125,14 +125,14 @@ class Harvest < ActiveRecord::Base
end
if self.weight_quantity
string += " weighing #{number_to_human(self.weight_quantity, :strip_insignificant_zeros => true)} #{self.weight_unit}"
string += " weighing #{number_to_human(self.weight_quantity, strip_insignificant_zeros: true)} #{self.weight_unit}"
end
return string
end
def default_photo
return photos.first
return photos.first || crop.default_photo
end
end

View File

@@ -4,26 +4,26 @@ class Member < ActiveRecord::Base
friendly_id :login_name, use: [:slugged, :finders]
has_many :posts, :foreign_key => 'author_id'
has_many :comments, :foreign_key => 'author_id'
has_many :forums, :foreign_key => 'owner_id'
has_many :posts, foreign_key: 'author_id'
has_many :comments, foreign_key: 'author_id'
has_many :forums, foreign_key: 'owner_id'
has_many :gardens, :foreign_key => 'owner_id'
has_many :plantings, :foreign_key => 'owner_id'
has_many :gardens, foreign_key: 'owner_id'
has_many :plantings, foreign_key: 'owner_id'
has_many :seeds, :foreign_key => 'owner_id'
has_many :harvests, :foreign_key => 'owner_id'
has_many :seeds, foreign_key: 'owner_id'
has_many :harvests, foreign_key: 'owner_id'
has_and_belongs_to_many :roles
has_many :notifications, :foreign_key => 'recipient_id'
has_many :sent_notifications, :foreign_key => 'sender_id'
has_many :notifications, foreign_key: 'recipient_id'
has_many :sent_notifications, foreign_key: 'sender_id'
has_many :authentications
has_many :orders
has_one :account
has_one :account_type, :through => :account
has_one :account_type, through: :account
has_many :photos
@@ -33,13 +33,13 @@ class Member < ActiveRecord::Base
scope :located, -> { where("location <> '' and latitude IS NOT NULL and longitude IS NOT NULL") }
scope :recently_signed_in, -> { reorder('updated_at DESC') }
scope :recently_joined, -> { reorder("confirmed_at desc") }
scope :wants_newsletter, -> { where(:newsletter => true) }
scope :wants_newsletter, -> { where(newsletter: true) }
has_many :follows, :class_name => "Follow", :foreign_key => "follower_id"
has_many :followed, :through => :follows
has_many :follows, class_name: "Follow", foreign_key: "follower_id"
has_many :followed, through: :follows
has_many :inverse_follows, :class_name => "Follow", :foreign_key => "followed_id"
has_many :followers, :through => :inverse_follows, :source => :follower
has_many :inverse_follows, class_name: "Follow", foreign_key: "followed_id"
has_many :followers, through: :inverse_follows, source: :follower
# Include default devise modules. Others available are:
# :token_authenticatable, :confirmable,
@@ -58,34 +58,34 @@ class Member < ActiveRecord::Base
attr_accessor :login
# Requires acceptance of the Terms of Service
validates_acceptance_of :tos_agreement, :allow_nil => false,
:accept => true
validates_acceptance_of :tos_agreement, allow_nil: false,
accept: true
validates :login_name,
:length => {
:minimum => 2,
:maximum => 25,
:message => "should be between 2 and 25 characters long"
length: {
minimum: 2,
maximum: 25,
message: "should be between 2 and 25 characters long"
},
:exclusion => {
:in => %w(growstuff admin moderator staff nearby),
:message => "name is reserved"
exclusion: {
in: %w(growstuff admin moderator staff nearby),
message: "name is reserved"
},
:format => {
:with => /\A\w+\z/,
:message => "may only include letters, numbers, or underscores"
format: {
with: /\A\w+\z/,
message: "may only include letters, numbers, or underscores"
},
:uniqueness => {
:case_sensitive => false
uniqueness: {
case_sensitive: false
}
# Give each new member a default garden
after_create {|member| Garden.create(:name => "Garden", :owner_id => member.id) }
after_create {|member| Garden.create(name: "Garden", owner_id: member.id) }
# and an account record (for paid accounts etc)
# we use find_or_create to avoid accidentally creating a second one,
# which can happen sometimes especially with FactoryGirl associations
after_create {|member| Account.find_or_create_by(:member_id => member.id) }
after_create {|member| Account.find_or_create_by(member_id: member.id) }
after_save :update_newsletter_subscription
@@ -93,7 +93,7 @@ class Member < ActiveRecord::Base
def self.find_first_by_auth_conditions(warden_conditions)
conditions = warden_conditions.dup
if login = conditions.delete(:login)
where(conditions).where(["lower(login_name) = :value OR lower(email) = :value", { :value => login.downcase }]).first
where(conditions).where(["lower(login_name) = :value OR lower(email) = :value", { value: login.downcase }]).first
else
where(conditions).first
end
@@ -108,7 +108,7 @@ class Member < ActiveRecord::Base
end
def current_order
orders.where(:completed_at => nil).first
orders.where(completed_at: nil).first
end
# when purchasing a product that gives you a paid account, this method
@@ -130,7 +130,7 @@ class Member < ActiveRecord::Base
def is_paid?
if account.account_type.is_permanent_paid
return true
elsif account.account_type.is_paid and account.paid_until >= Time.zone.now
elsif account.account_type.is_paid && account.paid_until >= Time.zone.now
return true
else
return false
@@ -163,15 +163,15 @@ class Member < ActiveRecord::Base
result = false
if set
result = flickr.photosets.getPhotos(
:photoset_id => set,
:page => page_num,
:per_page => 30
photoset_id: set,
page: page_num,
per_page: 30
)
else
result = flickr.people.getPhotos(
:user_id => 'me',
:page => page_num,
:per_page => 30
user_id: 'me',
page: page_num,
per_page: 30
)
end
if result
@@ -200,7 +200,7 @@ class Member < ActiveRecord::Base
def Member.interesting
howmany = 12 # max number to find
interesting_members = Array.new
interesting_members = []
Member.confirmed.located.recently_signed_in.each do |m|
break if interesting_members.size == howmany
if m.interesting?
@@ -222,7 +222,7 @@ class Member < ActiveRecord::Base
end
def update_newsletter_subscription
if confirmed_at_changed? and newsletter # just signed up
if confirmed_at_changed? && newsletter # just signed up
newsletter_subscribe
elsif confirmed_at # i.e. after member's confirmed their account
if newsletter_changed? # edited member settings
@@ -239,10 +239,10 @@ class Member < ActiveRecord::Base
return true if (Rails.env.test? && !testing)
gb = Gibbon::API.new
res = gb.lists.subscribe({
:id => Gibbon::API.api_key,
:email => { :email => email },
:merge_vars => { :login_name => login_name },
:double_optin => false # they already confirmed their email with us
id: Growstuff::Application.config.newsletter_list_id,
email: { email: email },
merge_vars: { login_name: login_name },
double_optin: false # they already confirmed their email with us
})
end
@@ -250,17 +250,17 @@ class Member < ActiveRecord::Base
return true if (Rails.env.test? && !testing)
gb = Gibbon::API.new
res = gb.lists.unsubscribe({
:id => ENV['GROWSTUFF_MAILCHIMP_NEWSLETTER_ID'],
:email => { :email => email }
id: Growstuff::Application.config.newsletter_list_id,
email: { email: email }
})
end
def already_following?(member)
self.follows.exists?(:followed_id => member.id)
self.follows.exists?(followed_id: member.id)
end
def get_follow(member)
self.follows.where(:followed_id => member.id).first if already_following?(member)
self.follows.where(followed_id: member.id).first if already_following?(member)
end
end

View File

@@ -1,12 +1,12 @@
class Notification < ActiveRecord::Base
belongs_to :sender, :class_name => 'Member'
belongs_to :recipient, :class_name => 'Member'
belongs_to :sender, class_name: 'Member'
belongs_to :recipient, class_name: 'Member'
belongs_to :post
validates :subject, :length => { :maximum => 255 }
validates :subject, length: { maximum: 255 }
default_scope { order('created_at DESC') }
scope :unread, -> { where(:read => false) }
scope :unread, -> { where(read: false) }
before_create :replace_blank_subject
after_create :send_email
@@ -23,7 +23,7 @@ class Notification < ActiveRecord::Base
def send_email
if self.recipient.send_notification_email
Notifier.notify(self).deliver
Notifier.notify(self).deliver_now
end
end

View File

@@ -1,13 +1,13 @@
class Order < ActiveRecord::Base
belongs_to :member
has_many :order_items, :dependent => :destroy
has_many :order_items, dependent: :destroy
default_scope { order('created_at DESC') }
validates :referral_code, :format => {
:with => /\A[a-zA-Z0-9 ]*\z/,
:message => "may only include letters and numbers"
validates :referral_code, format: {
with: /\A[a-zA-Z0-9 ]*\z/,
message: "may only include letters and numbers"
}
before_save :standardize_referral_code
@@ -27,9 +27,9 @@ class Order < ActiveRecord::Base
items = []
order_items.each do |i|
items.push({
:name => i.product.name,
:quantity => i.quantity,
:amount => i.price
name: i.product.name,
quantity: i.quantity,
amount: i.price
})
end
return items
@@ -87,7 +87,7 @@ class Order < ActiveRecord::Base
end
when "referral_code"
# coerce to uppercase
return Order.where(:referral_code => args[:for].upcase)
return Order.where(referral_code: args[:for].upcase)
end
end
return []

View File

@@ -4,7 +4,7 @@ class OrderItem < ActiveRecord::Base
validate :price_must_be_greater_than_minimum
validates_uniqueness_of :order_id, :message => "may only have one item."
validates_uniqueness_of :order_id, message: "may only have one item."
def price_must_be_greater_than_minimum
@product = Product.find(product_id)

View File

@@ -1,5 +1,5 @@
class Photo < ActiveRecord::Base
belongs_to :owner, :class_name => 'Member'
belongs_to :owner, class_name: 'Member'
has_and_belongs_to_many :plantings
has_and_belongs_to_many :harvests
@@ -23,16 +23,16 @@ class Photo < ActiveRecord::Base
# for easier stubbing and testing.
def flickr_metadata
flickr = owner.flickr
info = flickr.photos.getInfo(:photo_id => flickr_photo_id)
info = flickr.photos.getInfo(photo_id: flickr_photo_id)
licenses = flickr.photos.licenses.getInfo()
license = licenses.find { |l| l.id == info.license }
return {
:title => info.title || "Untitled",
:license_name => license.name,
:license_url => license.url,
:thumbnail_url => FlickRaw.url_q(info),
:fullsize_url => FlickRaw.url_z(info),
:link_url => FlickRaw.url_photopage(info)
title: info.title || "Untitled",
license_name: license.name,
license_url: license.url,
thumbnail_url: FlickRaw.url_q(info),
fullsize_url: FlickRaw.url_z(info),
link_url: FlickRaw.url_photopage(info)
}
end

View File

@@ -1,9 +1,9 @@
class PlantPart < ActiveRecord::Base
extend FriendlyId
friendly_id :name, :use => [:slugged, :finders]
friendly_id :name, use: [:slugged, :finders]
has_many :harvests
has_many :crops, -> { uniq }, :through => :harvests
has_many :crops, -> { uniq }, through: :harvests
def to_s
return name

View File

@@ -3,8 +3,8 @@ class Planting < ActiveRecord::Base
friendly_id :planting_slug, use: [:slugged, :finders]
belongs_to :garden
belongs_to :owner, :class_name => 'Member', :counter_cache => true
belongs_to :crop, :counter_cache => true
belongs_to :owner, class_name: 'Member', counter_cache: true
belongs_to :crop, counter_cache: true
has_and_belongs_to_many :photos
@@ -18,33 +18,33 @@ class Planting < ActiveRecord::Base
end
default_scope { order("created_at desc") }
scope :finished, -> { where(:finished => true) }
scope :current, -> { where(:finished => false) }
scope :finished, -> { where(finished: true) }
scope :current, -> { where(finished: false) }
delegate :name,
:en_wikipedia_url,
:default_scientific_name,
:plantings_count,
:to => :crop,
:prefix => true
to: :crop,
prefix: true
default_scope { order("created_at desc") }
validates :crop, :approved => true
validates :crop, approved: true
validates :crop, :presence => {:message => "must be present and exist in our database"}
validates :crop, presence: {message: "must be present and exist in our database"}
validates :quantity,
:numericality => {
:only_integer => true,
:greater_than_or_equal_to => 0 },
:allow_nil => true
numericality: {
only_integer: true,
greater_than_or_equal_to: 0 },
allow_nil: true
SUNNINESS_VALUES = %w(sun semi-shade shade)
validates :sunniness, :inclusion => { :in => SUNNINESS_VALUES,
:message => "%{value} is not a valid sunniness value" },
:allow_nil => true,
:allow_blank => true
validates :sunniness, inclusion: { in: SUNNINESS_VALUES,
message: "%{value} is not a valid sunniness value" },
allow_nil: true,
allow_blank: true
PLANTED_FROM_VALUES = [
'seed',
@@ -59,16 +59,16 @@ class Planting < ActiveRecord::Base
'graft',
'layering'
]
validates :planted_from, :inclusion => { :in => PLANTED_FROM_VALUES,
:message => "%{value} is not a valid planting method" },
:allow_nil => true,
:allow_blank => true
validates :planted_from, inclusion: { in: PLANTED_FROM_VALUES,
message: "%{value} is not a valid planting method" },
allow_nil: true,
allow_blank: true
validate :finished_must_be_after_planted
# check that any finished_at date occurs after planted_at
def finished_must_be_after_planted
return unless planted_at and finished_at # only check if we have both
return unless planted_at && finished_at # only check if we have both
errors.add(:finished_at, "must be after the planting date") unless planted_at < finished_at
end
@@ -95,9 +95,9 @@ class Planting < ActiveRecord::Base
end
def calculate_days_before_maturity(planting, crop)
p_crop = Planting.where(:crop_id => crop).where.not(:id => planting)
p_crop = Planting.where(crop_id: crop).where.not(id: planting)
differences = p_crop.collect do |p|
if p.finished and !p.finished_at.nil?
if p.finished && !p.finished_at.nil?
(p.finished_at - p.planted_at).to_i
end
end
@@ -109,11 +109,11 @@ class Planting < ActiveRecord::Base
end
end
def planted?(current_date = Date.today)
def planted?(current_date = Date.current)
planted_at.present? && current_date.to_date >= planted_at
end
def percentage_grown(current_date = Date.today)
def percentage_grown(current_date = Date.current)
return nil unless days_before_maturity && planted?(current_date)
days = (current_date.to_date - planted_at.to_date).to_i
@@ -133,7 +133,7 @@ class Planting < ActiveRecord::Base
# we can't do this via a scope (as far as we know) so sadly we have to
# do it this way.
def Planting.interesting(howmany=12, require_photo=true)
interesting_plantings = Array.new
interesting_plantings = []
seen_owners = Hash.new(false) # keep track of which owners we've seen already
Planting.includes(:photos).each do |p|

View File

@@ -1,9 +1,9 @@
class Post < ActiveRecord::Base
extend FriendlyId
friendly_id :author_date_subject, use: [:slugged, :finders]
belongs_to :author, :class_name => 'Member'
belongs_to :author, class_name: 'Member'
belongs_to :forum
has_many :comments, :dependent => :destroy
has_many :comments, dependent: :destroy
has_and_belongs_to_many :crops
before_destroy {|post| post.crops.clear}
after_save :update_crops_posts_association
@@ -11,26 +11,26 @@ class Post < ActiveRecord::Base
# from this direction, so we won't set up an association for now.
after_create do
recipients = Array.new
recipients = []
sender = self.author.id
self.body.scan(Haml::Filters::GrowstuffMarkdown::MEMBER_REGEX) do |m|
# find member case-insensitively and add to list of recipients
member = Member.where('lower(login_name) = ?', $1.downcase).first
recipients << member if member and not recipients.include?(member)
recipients << member if member && !recipients.include?(member)
end
self.body.scan(Haml::Filters::GrowstuffMarkdown::MEMBER_AT_REGEX) do |m|
# find member case-insensitively and add to list of recipients
member = Member.where('lower(login_name) = ?', $1[1..-1].downcase).first
recipients << member if member and not recipients.include?(member)
recipients << member if member && !recipients.include?(member)
end
# don't send notifications to yourself
recipients.map{ |r| r.id }.each do |recipient|
if recipient != sender
Notification.create(
:recipient_id => recipient,
:sender_id => sender,
:subject => "#{self.author} mentioned you in their post #{self.subject}",
:body => self.body,
recipient_id: recipient,
sender_id: sender,
subject: "#{self.author} mentioned you in their post #{self.subject}",
body: self.body,
)
end
end
@@ -39,10 +39,10 @@ class Post < ActiveRecord::Base
default_scope { order("created_at desc") }
validates :subject,
:format => {
:with => /\S/
format: {
with: /\S/
},
:length => { :maximum => 255 }
length: { maximum: 255 }
def author_date_subject
@@ -64,7 +64,7 @@ class Post < ActiveRecord::Base
# return posts sorted by recent activity
def Post.recently_active
Post.all.sort do |a,b|
Post.all.sort do |a, b|
b.recent_activity <=> a.recent_activity
end
end
@@ -77,7 +77,7 @@ class Post < ActiveRecord::Base
# find crop case-insensitively
crop = Crop.where('lower(name) = ?', $1.downcase).first
# create association
self.crops << crop if crop and not self.crops.include?(crop)
self.crops << crop if crop && !self.crops.include?(crop)
end
end
end

View File

@@ -3,10 +3,10 @@ class Product < ActiveRecord::Base
belongs_to :account_type
validates :paid_months,
:numericality => {
:only_integer => true,
:greater_than_or_equal_to => 0 },
:allow_nil => true
numericality: {
only_integer: true,
greater_than_or_equal_to: 0 },
allow_nil: true
def to_s
name

View File

@@ -1,5 +1,5 @@
class ScientificName < ActiveRecord::Base
after_commit { |sn| sn.crop.__elasticsearch__.index_document if sn.crop && ENV['GROWSTUFF_ELASTICSEARCH'] == "true" }
belongs_to :crop
belongs_to :creator, :class_name => 'Member'
belongs_to :creator, class_name: 'Member'
end

View File

@@ -3,62 +3,62 @@ class Seed < ActiveRecord::Base
friendly_id :seed_slug, use: [:slugged, :finders]
belongs_to :crop
belongs_to :owner, :class_name => 'Member', :foreign_key => 'owner_id'
belongs_to :owner, class_name: 'Member', foreign_key: 'owner_id'
default_scope { order("created_at desc") }
validates :crop, :approved => true
validates :crop, approved: true
validates :crop, :presence => {:message => "must be present and exist in our database"}
validates :crop, presence: {message: "must be present and exist in our database"}
validates :quantity,
:numericality => {
:only_integer => true,
:greater_than_or_equal_to => 0 },
:allow_nil => true
numericality: {
only_integer: true,
greater_than_or_equal_to: 0 },
allow_nil: true
validates :days_until_maturity_min,
:numericality => {
:only_integer => true,
:greater_than_or_equal_to => 0 },
:allow_nil => true
numericality: {
only_integer: true,
greater_than_or_equal_to: 0 },
allow_nil: true
validates :days_until_maturity_max,
:numericality => {
:only_integer => true,
:greater_than_or_equal_to => 0 },
:allow_nil => true
numericality: {
only_integer: true,
greater_than_or_equal_to: 0 },
allow_nil: true
scope :tradable, -> { where("tradable_to != 'nowhere'") }
TRADABLE_TO_VALUES = %w(nowhere locally nationally internationally)
validates :tradable_to, :inclusion => { :in => TRADABLE_TO_VALUES,
:message => "You may only trade seed nowhere, locally, nationally, or internationally" },
:allow_nil => false,
:allow_blank => false
validates :tradable_to, inclusion: { in: TRADABLE_TO_VALUES,
message: "You may only trade seed nowhere, locally, nationally, or internationally" },
allow_nil: false,
allow_blank: false
ORGANIC_VALUES = [
'certified organic',
'non-certified organic',
'conventional/non-organic',
'unknown']
validates :organic, :inclusion => { :in => ORGANIC_VALUES,
:message => "You must say whether the seeds are organic or not, or that you don't know" },
:allow_nil => false,
:allow_blank => false
validates :organic, inclusion: { in: ORGANIC_VALUES,
message: "You must say whether the seeds are organic or not, or that you don't know" },
allow_nil: false,
allow_blank: false
GMO_VALUES = [
'certified GMO-free',
'non-certified GMO-free',
'GMO',
'unknown']
validates :gmo, :inclusion => { :in => GMO_VALUES,
:message => "You must say whether the seeds are genetically modified or not, or that you don't know" },
:allow_nil => false,
:allow_blank => false
validates :gmo, inclusion: { in: GMO_VALUES,
message: "You must say whether the seeds are genetically modified or not, or that you don't know" },
allow_nil: false,
allow_blank: false
HEIRLOOM_VALUES = %w(heirloom hybrid unknown)
validates :heirloom, :inclusion => { :in => HEIRLOOM_VALUES,
:message => "You must say whether the seeds are heirloom, hybrid, or unknown" },
:allow_nil => false,
:allow_blank => false
validates :heirloom, inclusion: { in: HEIRLOOM_VALUES,
message: "You must say whether the seeds are heirloom, hybrid, or unknown" },
allow_nil: false,
allow_blank: false
def tradable?
if self.tradable_to == 'nowhere'
@@ -79,7 +79,7 @@ class Seed < ActiveRecord::Base
# returns a list of interesting seeds, for use on the homepage etc
def Seed.interesting
howmany = 12 # max number to find
interesting_seeds = Array.new
interesting_seeds = []
Seed.tradable.each do |s|
break if interesting_seeds.size == howmany

View File

@@ -1,17 +0,0 @@
-content_for :title, 'Contact'
%dl
%dt General contact email
%dd= link_to 'info@growstuff.org', 'mailto:info@growstuff.org'
%dl
%dt
Support and accounts enquiries (not covered by the
=succeed ")" do
=link_to 'FAQ', url_for(:controller => '/support')
%dd= link_to 'support@growstuff.org', 'mailto:support@growstuff.org'
%dl
%dt Media/Press enquiries
%dd= link_to 'media@growstuff.org', 'mailto:media@growstuff.org'
%dl
%dt Twitter
%dd= link_to '@growstufforg', 'http://twitter.com/growstufforg'

View File

@@ -1,3 +1,10 @@
= content_for :title, @alternate_name.name
- content_for :opengraph do
= tag("meta", property: "og:title", content: @alternate_name.name)
= tag("meta", property: "og:type", content: "website")
= tag("meta", property: "og:url", content: request.original_url)
= tag("meta", property: "og:site_name", content: ENV['GROWSTUFF_SITE_NAME'])
%p#notice= notice
= render :partial => 'crops/approval_status_message', :locals => { :crop => @alternate_name.crop }

View File

@@ -5,10 +5,13 @@
= render :partial => "members/avatar", :locals => { :member => comment.author }
.col-md-11
.comment-meta
= (comment.created_at == comment.updated_at) ? 'Posted by' : 'Edited by'
Posted by
= link_to comment.author.login_name, member_path(comment.author)
on
= (comment.created_at == comment.updated_at) ? comment.created_at : comment.updated_at
= comment.created_at
- if comment.updated_at > comment.created_at
and edited at
= comment.updated_at
.comment-body
:growstuff_markdown

View File

@@ -1,7 +1,7 @@
= content_for :title, "Recent comments"
%div.pagination
= page_entries_info @comments, :model => "comments"
= page_entries_info @comments
= will_paginate @comments
- @comments.each do |comment|
@@ -11,7 +11,7 @@
= render :partial => "single", :locals => { :comment => comment }
%div.pagination
= page_entries_info @comments, :model => "comments"
= page_entries_info @comments
= will_paginate @comments
%p

View File

@@ -1,4 +1,12 @@
= content_for :title, @comment.post.subject
- content_for :opengraph do
= tag("meta", property: "og:image", content: avatar_uri(@comment.post.author, 200))
= tag("meta", property: "og:image:user_generated", content: "true")
= tag("meta", property: "og:title", content: @comment.post.subject)
= tag("meta", property: "og:description", content: strip_tags(@comment.post.body).split(' ')[0..20].join(' '))
= tag("meta", property: "og:type", content: "website")
= tag("meta", property: "og:url", content: request.original_url)
= tag("meta", property: "og:site_name", content: ENV['GROWSTUFF_SITE_NAME'])
= render :partial => "posts/single", :locals => { :post => @comment.post }

View File

@@ -1,7 +1,7 @@
%h4 Find #{ crop.name } seeds
- if crop.seeds.empty?
%p
There are no seeds available to trade.
There are no seeds available to trade on Growstuff right now.
- else
%ul
- crop.seeds.tradable.each do |seed|
@@ -10,6 +10,8 @@
= render :partial => 'members/location', :locals => { :member => seed.owner }
%p
= link_to "View all #{crop.name} seeds", seeds_by_crop_path(crop)
%p
= link_to "Purchase seeds via Ebay", "http://rover.ebay.com/rover/1/705-53470-19255-0/1?icep_ff3=9&pub=5575213277&toolid=10001&campid=5337940151&customid=&icep_uq=#{URI.escape crop.name}&icep_sellerId=&icep_ex_kw=&icep_sortBy=12&icep_catId=181003&icep_minPrice=&icep_maxPrice=&ipn=psmain&icep_vectorid=229515&kwid=902099&mtid=824&kw=lg", target: "_blank", rel: "noopener noreferrer"
- if crop.approved?
- if current_member
%p= link_to "List #{crop.name} seeds to trade", new_seed_path(:crop_id => crop.id)

View File

@@ -1,5 +1,12 @@
- content_for :title, @crop.name
- content_for :subtitle, @crop.default_scientific_name
- content_for :opengraph do
- @crop.photos.each do |photo|
= tag("meta", property: "og:image", content: photo.fullsize_url)
= tag("meta", property: "og:title", content: @crop.name)
= tag("meta", property: "og:type", content: "website")
= tag("meta", property: "og:url", content: request.original_url)
= tag("meta", property: "og:site_name", content: ENV['GROWSTUFF_SITE_NAME'])
= render :partial => 'approval_status_message', :locals => { :crop => @crop }
@@ -54,13 +61,13 @@
= render :partial => "shared/signin_signup", :locals => { :to => "post your tips and experiences growing #{ @crop.name.pluralize }" }
- else
%div.pagination
= page_entries_info @posts, :model => "posts"
= page_entries_info @posts
= will_paginate @posts, :params => {:anchor => "posts"}
- @posts.each do |post|
= render :partial => "posts/single", :locals => { :post => post, :subject => true }
%div.pagination
= page_entries_info @posts, :model => "posts"
= page_entries_info @posts
= will_paginate @posts, :params => {:anchor => "posts"}
.col-md-3
@@ -84,4 +91,9 @@
%h4 Learn more about #{ @crop.name.pluralize }
%ul
%li= link_to 'Wikipedia (English)', @crop.en_wikipedia_url
%li= link_to 'Wikipedia (English)', @crop.en_wikipedia_url, target: "_blank", rel: "noopener noreferrer"
%li
= link_to "Gardenate - Planting reminders", "http://www.gardenate.com/plant/#{URI.escape @crop.name}", target: "_blank", rel: "noopener noreferrer"
- if current_member && current_member.location
%li
= link_to "Google", "http://www.google.com/search?q=#{URI.escape ["Growing", @crop.name, current_member.location].join(" ")}", target: "_blank", rel: "noopener noreferrer"

View File

@@ -34,7 +34,7 @@
%div.pagination
= page_entries_info @crops, :model => "crops"
= page_entries_info @crops
= will_paginate @crops
%table{:class => "table table-striped", :id => @approval_status.blank? ? 'recently-added-crops' : "#{@approval_status}-crops"}
@@ -64,7 +64,7 @@
ago.
%div.pagination
= page_entries_info @crops, :model => "crops"
= page_entries_info @crops
= will_paginate @crops

View File

@@ -13,4 +13,6 @@
.form-actions.col-md-offset-2.col-md-8
= f.submit "Resend confirmation instructions", :class => 'btn btn-primary'
= render "devise/shared/links"
.form-group
.col-md-offset-2.col-md-8
= render "devise/shared/links"

View File

@@ -25,7 +25,7 @@
%p
We'd also appreciate it if you'd read our
= succeed "," do
= link_to 'Community Guidelines', url_for(:controller => '/policy', :action => 'community', :only_path => false)
= link_to 'Community Guidelines', "#{root_url}/policy/community"
and make sure you follow them. We want #{site_name} to be a
friendly, welcoming environment for everyone, and we hope you'll
help us keep it that way.

View File

@@ -11,4 +11,6 @@
.form-actions.col-md-offset-2.col-md-8
= f.submit "Send me reset password instructions", :class => 'btn btn-primary'
= render "devise/shared/links"
.form-group
.col-md-offset-2.col-md-8
= render "devise/shared/links"

View File

@@ -31,7 +31,7 @@
= f.check_box :tos_agreement
I agree to the
= succeed "." do
= link_to 'Terms of Service', url_for(:action => 'tos', :controller => '/policy')
= link_to 'Terms of Service', "#{root_url}/policy/tos"
.form-group
.col-md-offset-2.col-md-8.checkbox
%label

View File

@@ -11,4 +11,6 @@
.form-actions.col-md-offset-2.col-md-8
= f.submit "Resend unlock instructions", :class => 'btn btn-primary'
= render "devise/shared/links"
.form-group
.col-md-offset-2.col-md-8
= render "devise/shared/links"

View File

@@ -7,7 +7,7 @@
- @forums.each do |forum|
%h2= forum
%p
= pluralize(forum.posts.size, "post")
= localize_plural(forum.posts, Post)
|
=link_to "Visit forum", forum
|

View File

@@ -1,4 +1,11 @@
- content_for :title, @forum.name
- content_for :opengraph do
- if @forum.description
= tag("meta", property: "og:description", content: strip_tags(@forum.description).split(' ')[0..20].join(' '))
= tag("meta", property: "og:title", content: @forum.name)
= tag("meta", property: "og:type", content: "website")
= tag("meta", property: "og:url", content: request.original_url)
= tag("meta", property: "og:site_name", content: ENV['GROWSTUFF_SITE_NAME'])
%p#notice= notice

View File

@@ -16,15 +16,16 @@
.form-group
= f.label :description, :class => 'control-label col-md-2'
.col-md-8
= f.text_area :description, :rows => 6, :class => 'form-control', :placeholder => 'optional'
= f.text_area :description, :rows => 6, :class => 'form-control'
= render :partial => 'shared/form_optional'
.form-group
= f.label :location, :class => 'control-label col-md-2'
.col-md-8
= f.text_field :location, :value => @garden.location || current_member.location, :class => 'form-control', :placeholder => 'optional', :maxlength => 255
= f.text_field :location, :value => @garden.location || current_member.location, :class => 'form-control', :maxlength => 255
= render :partial => 'shared/form_optional'
%span.help-block
If you have a location set in your profile, it will be used when
you create a new garden.
= t('.location_helper')
- if current_member.location.blank?
=link_to "Set your location now.", edit_member_registration_path
- else
@@ -33,7 +34,8 @@
.form-group
= f.label :area, :class => 'control-label col-md-2'
.col-md-2
= f.number_field :area, :class => 'input-small form-control', :placeholder => 'optional'
= f.number_field :area, :class => 'input-small form-control'
= render :partial => 'shared/form_optional'
.col-md-2
= f.select(:area_unit, Garden::AREA_UNITS_VALUES, {:include_blank => false}, :class => 'form-control')

View File

@@ -18,14 +18,14 @@
- if garden.location.blank?
not specified
- else
= link_to garden.location, place_path(garden.location)
= link_to garden.location, place_path(garden.location, anchor: "gardens")
%dt Area :
%dd= garden.area.nil? ? "not specified" : pluralize(garden.area, garden.area_unit)
%dt Active? :
%dd= garden.active ? "Yes" : "No"
.col-md-12
%b
= "#{pluralize(garden.plantings.size, "Planting")} : "
= "#{localize_plural(garden.plantings, Planting)} : "
= display_garden_plantings(garden.plantings.current)
- if garden.plantings.size > 2
%br

View File

@@ -15,7 +15,7 @@
= render :partial => 'shared/signin_signup', :locals => { :to => 'add a new garden' }
%div.pagination
= page_entries_info @gardens, :model => "gardens"
= page_entries_info @gardens
= will_paginate @gardens
.row
@@ -27,6 +27,6 @@
%p There are no gardens to display.
%div.pagination
= page_entries_info @gardens, :model => "gardens"
= page_entries_info @gardens
= will_paginate @gardens

View File

@@ -1,5 +1,13 @@
=content_for :title, "#{@garden.owner}'s #{@garden}"
- content_for :opengraph do
- @garden.photos.each do |photo|
= tag("meta", property: "og:image", content: photo.fullsize_url)
- if @garden.description
= tag("meta", property: "og:description", content: @garden.description)
= tag("meta", property: "og:title", content: "#{@garden.owner}'s #{@garden}")
= tag("meta", property: "og:type", content: "website")
= tag("meta", property: "og:url", content: request.original_url)
= tag("meta", property: "og:site_name", content: ENV['GROWSTUFF_SITE_NAME'])
.row
.col-md-9
- if can? :edit, @garden or can? :delete, @garden
@@ -39,7 +47,7 @@
- if @garden.photos.size > 0 or (can? :edit, @garden and can? :create, Photo)
.row-fluid
%h3 Photos
%p= pluralize(@garden.photos.length, "photo")
%p= localize_plural(@garden.photos, Photo)
.row-fluid
%ul.thumbnails
- @garden.photos.each do |p|

View File

@@ -19,9 +19,10 @@
= link_to "Request new crops.", new_crop_path
.form-group
= f.label :harvested_at, 'When?', :class => 'control-label col-md-2', :placeholder => 'optional'
= f.label :harvested_at, 'When?', :class => 'control-label col-md-2'
.col-md-2
= f.text_field :harvested_at, :value => @harvest.harvested_at ? @harvest.harvested_at.to_s(:ymd) : '', :class => 'add-datepicker form-control'
= render :partial => 'shared/form_optional'
.form-group
= f.label :quantity, 'How many?', :class => 'control-label col-md-2'
@@ -29,20 +30,23 @@
-# Some browsers (eg Firefox for Android) assume "number" means
-# "integer" unless you specify step="any":
-# http://blog.isotoma.com/2012/03/html5-input-typenumber-and-decimalsfloats-in-chrome/
= f.number_field :quantity, :class => 'input-small', :step => 'any', :class => 'form-control', :placeholder => 'optional'
= f.number_field :quantity, :class => 'input-small form-control', :step => 'any'
= render :partial => 'shared/form_optional'
.col-md-2
= f.select(:unit, Harvest::UNITS_VALUES, {:include_blank => false}, :class => 'input-medium form-control')
.form-group
= f.label :weight_quantity, 'Weighing (in total):', :class => 'control-label col-md-2'
.col-md-2
= f.number_field :weight_quantity, :class => 'input-small', :step => 'any', :class => 'form-control', :placeholder => 'optional'
= f.number_field :weight_quantity, :class => 'input-small form-control', :step => 'any'
= render :partial => 'shared/form_optional'
.col-md-2
= f.select(:weight_unit, Harvest::WEIGHT_UNITS_VALUES, {:include_blank => false}, :class => 'form-control')
.form-group
= f.label :description, 'Notes', :class => 'control-label col-md-2'
.col-md-8
= f.text_area :description, :rows => 6, :class => 'form-control', :placeholder => 'optional'
= f.text_area :description, :rows => 6, :class => 'form-control'
= render :partial => 'shared/form_optional'
.form-group
.form-actions.col-md-offset-2.col-md-8

View File

@@ -8,7 +8,7 @@
.panel-body
.row
.col-md-4
= link_to image_tag((harvest.crop.default_photo ? harvest.crop.default_photo.thumbnail_url : 'placeholder_150.png'), :alt => harvest.crop.name, :class => 'img'), harvest.crop
= link_to image_tag((harvest.default_photo ? harvest.default_photo.thumbnail_url : 'placeholder_150.png'), :alt => harvest.crop.name, :class => 'img'), harvest.crop
.col-md-8
%dl.dl-horizontal
%dt Crop :
@@ -21,5 +21,7 @@
%dd= harvest.harvested_at
.panel-footer
%dt Description
%dd
%dd.truncate
= display_harvest_description(harvest)
= if not harvest.description.empty?
- link_to "Read more", harvest_path(harvest)

Some files were not shown because too many files have changed in this diff Show More