Compare commits

...

154 Commits

Author SHA1 Message Date
pozorvlak
e95566ed48 Merge pull request #1052 from Growstuff/dev
Release 15
2016-11-24 18:30:36 +00:00
Daniel O'Connor
916fd73071 Merge pull request #1065 from Br3nda/bw/removed-some-duplication
Reduced code duplication in growstuff.rake
2016-11-23 18:11:34 +10:30
Brenda Wallace
18a8d6c5bf Re-instate usage info when args not as expected 2016-11-23 20:38:46 +13:00
Brenda Wallace
37d01e831f Reduced code duplication in growstuff.rake 2016-11-23 20:27:20 +13:00
Mackenzie
6a8b604554 Merge pull request #1063 from Br3nda/use_phantomjs_211_in_travis
Use phantomjs 211 in travis
2016-11-19 23:57:25 -05:00
Miles Gould
2fa282e131 Install PhantomJS 2.1.1 on Travis-CI
I've found it to be much more stable locally - hopefully it will help
with our flaky CI issues (#901).

Code mostly cargo-culted from
9d3afe3d04
2016-11-20 17:22:05 +13:00
pozorvlak
7355061762 Merge pull request #1060 from Br3nda/bw/covert-tabs-to-spaces
Covert all tabs to spaces
2016-11-18 13:39:35 +00:00
Brenda Wallace
5e0cff5b8e Merge remote-tracking branch 'upstream/dev' into bw/covert-tabs-to-spaces
Conflicts:
	app/helpers/seeds_helper.rb
	spec/support/controller_macros.rb
2016-11-17 19:04:44 +13:00
Daniel O'Connor
b3ae03ab7e Merge pull request #1059 from Br3nda/bw/trailing-whitespace-begone
Removed all trailing white space
2016-11-16 14:34:49 +10:30
Brenda Wallace
5ec2877577 Covert all tabs to spaces 2016-11-16 13:18:26 +13:00
Brenda Wallace
e182247774 Removed the ignores for trailing whitespace 2016-11-16 13:09:04 +13:00
Brenda Wallace
6bd9bd98d9 Removed extra blank lines, & added a end of file 2016-11-16 12:52:48 +13:00
Brenda Wallace
0475954acf Removed extra blank lines 2016-11-16 12:50:14 +13:00
Brenda Wallace
0d371593fb Merge remote-tracking branch 'upstream/dev' into bw/trailing-whitespace-begone 2016-11-15 03:25:14 +00:00
Daniel O'Connor
a6ef100e02 Merge pull request #1058 from Br3nda/bw/wiki-link-text-dupe
Removed duplicate wiki_linktext
2016-11-14 18:20:17 +10:30
Mackenzie
adc34b76da Merge pull request #1055 from Br3nda/bw/rubocop-ci
Add rubocop to travis ci
2016-11-13 23:10:00 -05:00
Brenda Wallace
a91c785543 Moved metrics placeholders to main rubocop.yml file 2016-11-14 16:51:17 +13:00
Brenda Wallace
1cac58dadc Allow both " and ' quote styles 2016-11-14 16:49:26 +13:00
Brenda Wallace
510c31f669 Removed 3 blank lines that codeclimate didn't like 2016-11-14 15:10:13 +13:00
Brenda Wallace
bdb057ca0f Removed all trailing white space 2016-11-14 15:05:32 +13:00
Brenda Wallace
dc5d7a8677 Removed duplicate wiki_linktext 2016-11-14 14:30:45 +13:00
Brenda Wallace
1fc1c64f62 Ignore rubocop_todo filename in code climate 2016-11-13 17:42:35 +13:00
Brenda Wallace
d49f33476d Merge remote-tracking branch 'upstream/dev' into bw/rubocop-ci 2016-11-13 16:45:10 +13:00
Mackenzie
2260f56713 Merge pull request #1056 from Br3nda/bw/contributors-case
Contributors check case-insentive
2016-11-12 18:39:18 -05:00
Brenda Wallace
eecd54c5ea Use single quotes, as code climate suggests 2016-11-13 11:12:24 +13:00
Brenda Wallace
e1f0b649f5 if! -> unless, as code climate suggests 2016-11-13 11:10:45 +13:00
Brenda Wallace
9605ec6109 Pass args to system() to be escaped 2016-11-13 11:07:57 +13:00
Brenda Wallace
b2977d6806 Search contributors file, case insensitive. 2016-11-13 11:05:43 +13:00
Brenda Wallace
d091aecaf1 Use https for contributor link
Hoping this will fix the failing contributor error
2016-11-13 10:46:46 +13:00
Brenda Wallace
97f0d5fc5d Add vendor to rubocop exclude path 2016-11-13 10:34:57 +13:00
Brenda Wallace
2bc9b8c8bb Added rubocop check to travisci 2016-11-13 10:20:13 +13:00
Brenda Wallace
e312ee2773 All existing rubocop offfenses in a todo file 2016-11-13 10:20:00 +13:00
Brenda Wallace
c685b970d3 Add rubocop to bundle
So we can manage which version of rubocop to use.
2016-11-13 10:07:41 +13:00
Cesy
621b7e5d29 Merge pull request #1048 from pozorvlak/es_factorygirl_weirdness
Prevent FactoryGirl from trying to connect to ElasticSearch in tests
2016-10-11 08:58:32 +02:00
Cesy
b59ebb7d52 Merge pull request #984 from maco/rubocop_config
Rubocop config (ignore the red x)
2016-10-09 17:28:47 +01:00
Miles Gould
ce2141ddb7 Only initialise Crop.__elasticsearch__ if needed
The mere presence of this field was causing any test that ran
`FactoryGirl.create :alternate_name` to try to connect to an
ElasticSearch server, even if GROWSTUFF_ELASTICSEARCH was false.

Fixes #1047
2016-10-07 14:49:09 +01:00
Miles Gould
36c88c3762 Delete trailing whitespace 2016-10-07 14:48:38 +01:00
Mackenzie Morgan
099b399b24 bundle 2016-10-06 22:00:01 -04:00
Mackenzie Morgan
5092c78fba merge 2016-10-06 21:48:18 -04:00
Cesy
199cdf20a7 Merge pull request #1045 from Br3nda/bw/harvest-link
harvest thumbnail title linking to the harvest itself
2016-09-25 10:21:59 +01:00
Brenda Wallace
7c1040e7aa Corrected contributor name 2016-09-19 21:51:13 +12:00
Brenda Wallace
faf117b002 test for link to member's harvest 2016-09-19 18:02:44 +12:00
Brenda Wallace
13e491cda7 harvest thumbnail title linking to the harvest itself 2016-09-18 18:33:28 +12:00
Cesy
286b7118be Merge pull request #1041 from CloCkWeRX/openfarm-links
Add links to OpenFarm
2016-09-15 11:31:13 +01:00
Cesy
b2dfe31b5c Merge pull request #1043 from CloCkWeRX/fix_1042
Fix map token in prod configuration
2016-09-15 09:09:02 +01:00
Daniel O'Connor
1f005a3d42 Fixes #1042 2016-09-14 21:41:18 +09:30
Daniel O'Connor
36c64bd8dc #1038 Add links to OpenFarm 2016-09-14 14:57:08 +09:30
Daniel O'Connor
277325d58c Merge pull request #1036 from Br3nda/bw/json-sessions
allow registration and signin/out on the API
2016-09-14 14:50:04 +09:30
Brenda Wallace
370f407ad6 Adding Brenda Wallace to contributors 2016-09-13 19:25:22 +12:00
Daniel O'Connor
3ea8e2294e Update README.md
Fixes #1037
2016-09-12 21:57:27 +09:30
Brenda Wallace
c6413afa67 allow registration and signin/out on the API 2016-09-11 14:23:50 +12:00
Cesy
fe137a11bb Merge pull request #1031 from CloCkWeRX/queue_mail
Queue mail in sidekiq
2016-08-24 10:38:13 +01:00
Cesy
0fa15161d4 Merge pull request #811 from CloCkWeRX/add_facebook_signup
Add facebook signup
2016-08-24 10:37:47 +01:00
Daniel O'Connor
aeb8792165 Merge remote-tracking branch 'upstream/dev' into queue_mail 2016-08-24 06:35:51 +09:30
Daniel O'Connor
c60609d507 Merge remote-tracking branch 'upstream/dev' into add_facebook_signup 2016-08-23 16:34:03 +09:30
Daniel O'Connor
ad04c07017 Merge pull request #1034 from cesy/railsupdate
Rails update
2016-08-23 01:03:46 +09:30
Daniel O'Connor
f3f8326360 Merge pull request #1033 from cesy/gemupdate
Updating a few gems
2016-08-23 01:00:36 +09:30
Cesy Avon
3798e386ae Upgrading rails to 4.2.1 2016-08-22 14:14:58 +00:00
Cesy Avon
7d3afa005c Updating a few gems 2016-08-22 14:00:03 +00:00
Daniel O'Connor
3bfe2329f1 Merge pull request #1032 from Growstuff/dev
Release 14
2016-08-22 19:19:04 +09:30
Daniel O'Connor
29765ebc19 rubocop --only HashSyntax --auto-correct 2016-08-22 19:02:27 +09:30
Daniel O'Connor
b91f0e7f63 Whitelist providers to avoid session data being tampered with 2016-08-22 18:59:28 +09:30
Daniel O'Connor
87352b04f1 Refactor to a method to DRY, even if its not 100% the best spot for it to live long term 2016-08-22 18:52:12 +09:30
Daniel O'Connor
0f034523e1 Only maximize if the driver supports such a thing 2016-08-22 18:26:08 +09:30
Daniel O'Connor
20b87e596a Modern syntax 2016-08-22 18:25:57 +09:30
Daniel O'Connor
4b7cffad04 DEPRECATION WARNING: [Devise] bypass option is deprecated and it will be removed in future version of Devise. 2016-08-22 16:42:08 +09:30
Daniel O'Connor
bcb0a19dea Merge remote-tracking branch 'upstream/dev' into add_facebook_signup 2016-08-22 16:37:50 +09:30
Daniel O'Connor
4e2311e8d7 Indent 2016-08-22 16:36:30 +09:30
Daniel O'Connor
c7be0f3b0e Fix redirects and sign the user in if they weren't yet created 2016-08-22 16:35:58 +09:30
Daniel O'Connor
9ab79209ef Adjust TOS url 2016-08-22 16:35:41 +09:30
Daniel O'Connor
1c3016a31e Adjust for when running with selenium-webdriver to avoid clicks being placed in the wrong location; and for drivers that don't support blacklisting 2016-08-22 16:17:36 +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
049d792053 Fix Gemfile.lock 2016-08-16 12:05:14 +09:30
Daniel O'Connor
e399085a57 Update bootstrap-sass coveralls friendly_id js-routes sass-rails simplecov 2016-08-16 11:58:12 +09:30
Daniel O'Connor
18b4a90690 Upgrade excon ffi autoprefixer-rails multi_json mimemagic pry active_utils activemerchant 2016-08-16 11:56:50 +09:30
Daniel O'Connor
a68ffda7eb Upgrade minor gems: kramdown, notifany, httparty, codemirror-rails, bootstrap_form, globalid 2016-08-16 11:56:25 +09:30
Daniel O'Connor
0a722edc88 Fix regression from bad merge 2016-08-16 11:45:58 +09:30
Daniel O'Connor
de407608f2 Merge remote-tracking branch 'upstream/dev' into queue_mail 2016-08-16 11:11:40 +09:30
Daniel O'Connor
ece0fdfe6c Drop sidekiq web for the moment 2016-08-16 11:08:59 +09:30
Daniel O'Connor
5008d35614 Add sidekiq configuration 2016-08-16 11:02:35 +09:30
Daniel O'Connor
6b470f180c #951 Add sidekiq as our activejob backend 2016-08-16 11:01:19 +09:30
Daniel O'Connor
4deb895b4c #951 Add sidekiq 2016-08-16 10:59:30 +09:30
Daniel O'Connor
5d70d822eb #951 Swap to deliver_later implementation 2016-08-16 10:55:40 +09:30
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
0dad02343e Merge remote-tracking branch 'upstream/dev' into add_facebook_signup 2016-08-15 23:14:49 +09:30
Daniel O'Connor
7f6a1a424d Merge remote-tracking branch 'upstream/dev' into add_facebook_signup 2016-08-15 23:13:55 +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
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
43e7d6f7c2 Merge remote-tracking branch 'upstream/dev' into add_facebook_signup 2016-07-05 03:09:36 +09:30
Mackenzie Morgan
58d40e912d Tweak rubocop config
* turn off line length limit
* turn off class documentation requirement
* 30 line methods
2016-06-20 10:35:38 -04:00
Mackenzie Morgan
91991f0c67 update Gemfile.lock 2016-06-09 14:25:04 -04:00
Mackenzie Morgan
306cd13723 add rubocop config with all the things turned on 2016-06-09 14:13:31 -04:00
Mackenzie Morgan
8c624cfacd merge 2016-06-09 14:13:02 -04:00
Daniel O'Connor
083035c924 Merge branch 'dev' of github.com:Growstuff/growstuff into add_facebook_signup 2016-05-23 16:58:22 +09:30
Daniel O'Connor
f81666da5e And cleanup authentications 2015-09-15 12:58:35 +09:30
Daniel O'Connor
4a1bc9f6c0 Avoid test data conflicts and update expectations 2015-09-15 12:44:12 +09:30
Daniel O'Connor
0652c40c52 Avoid test data conflicts causing signup to act as signin-for-existing 2015-09-15 12:34:20 +09:30
Daniel O'Connor
a99145b705 Implement pending spec 2015-09-15 12:27:17 +09:30
Daniel O'Connor
222f875c42 Add more coverage of various scenarios and expected behaviours 2015-09-15 12:26:32 +09:30
Daniel O'Connor
dc983d4863 Add more coverage of various scenarios and expected behaviours 2015-09-15 12:24:37 +09:30
Daniel O'Connor
7256c28038 Refactor to a separate class, containing domain logic 2015-09-15 12:13:47 +09:30
Daniel O'Connor
021cb4f93b Use #{ENV['GROWSTUFF_SITE_NAME']} 2015-09-15 11:38:20 +09:30
Daniel O'Connor
00ca01dc33 Add coverage of the most basic scenarios around sign up and login 2015-09-15 11:20:33 +09:30
Daniel O'Connor
c09b0a0341 Merge branch 'dev' into add_facebook_signup 2015-08-27 12:19:48 +09:30
Daniel O'Connor
8a739b31a1 Minor style 2015-08-27 12:18:09 +09:30
Daniel O'Connor
afec210219 #645 #556 Add facebook links 2015-08-27 12:02:48 +09:30
Daniel O'Connor
dafee90b24 #645 #556 Add facebook auth management 2015-08-27 11:56:37 +09:30
Daniel O'Connor
f6790a5f9b #556 When an avatar is set from an oauth provider, don't encourage the user to update gravatar. 2015-08-27 11:52:49 +09:30
Daniel O'Connor
4983a6dfb3 #556 Improve user avatar sizing 2015-08-27 11:42:36 +09:30
Daniel O'Connor
c4c477fdd8 Merge branch 'add_facebook_signup' into dev 2015-08-27 11:31:07 +09:30
Daniel O'Connor
20b89f0d2f #556 Default to the oauth provided image on account creation 2015-08-27 11:27:15 +09:30
Daniel O'Connor
9564866f6d #645 Avoid collisions by using a 20 character random string as a fallback 2015-08-24 17:33:28 +09:30
Daniel O'Connor
994296640b #645 Implement all of finish signup, fix an edge case of an authentication without a member, fix error messages on failed oauth. 2015-08-24 16:20:39 +09:30
Daniel O'Connor
9a68c7e1c3 #645 Add a 'finish signup' flow 2015-08-24 11:41:36 +09:30
Daniel O'Connor
ec597d4e6e #645 Fix minor logic error 2015-08-24 11:23:41 +09:30
Daniel O'Connor
86e9cd0ec6 #645 Improve error handling and login_name generation. Annoyingly still a change of collisions. 2015-08-21 13:43:58 +09:30
Daniel O'Connor
3a05f75ab0 #645 Add notes around permissions/scopes of later interest 2015-08-21 13:43:24 +09:30
Daniel O'Connor
34b4d30014 #645 Enable account creation or authorisation from a facebook signin (and should work for others with minimal extra work) 2015-08-21 13:22:49 +09:30
Daniel O'Connor
89b6c47bfb #645 Configure devise / omniauth in only one spot, to avoid CSRF errors 2015-08-21 12:21:55 +09:30
Daniel O'Connor
70f48108b4 #645 Add handling for facebook 2015-08-21 12:21:23 +09:30
Daniel O'Connor
df5689ec18 #645 Rename 2015-08-21 11:36:26 +09:30
Daniel O'Connor
22d72b13d5 #645 Add example keys 2015-08-21 11:36:17 +09:30
Daniel O'Connor
dee7ff34c9 #645 Indicate that a member is omniauthable, so devise knows to render sign-in-with-facebook 2015-08-21 11:36:04 +09:30
Daniel O'Connor
07eb305992 #645 Ask for name, email address only 2015-08-21 11:25:57 +09:30
Daniel O'Connor
c7f0076ee6 #645 Add facebook omniauth middleware 2015-08-21 11:21:44 +09:30
Daniel O'Connor
93bc5255e7 #645 Add facebook omniauth provider 2015-08-21 11:21:30 +09:30
262 changed files with 4641 additions and 1415 deletions

View File

@@ -21,6 +21,10 @@ engines:
- javascript
fixme:
enabled: true
exclude_fingerprints: # rubocop_todo filename
- 63b8552079d106832fbe281566b6d028
- d38afbaaea3ecaa9a4cf046b07a01cec
- 57ff3968fd371d3e1f75c237d6c78acf
ratings:
paths:
- "**.rb"

48
.rubocop.yml Normal file
View File

@@ -0,0 +1,48 @@
inherit_from: .rubocop_todo.yml
AllCops:
Include:
- 'Rakefile'
- 'config.ru'
- 'lib/**/*.rake'
Exclude:
- 'db/schema.rb'
- 'vendor/**/*'
Style/StringLiterals:
Enabled: false
Metrics/MethodLength:
Description: 'Avoid methods longer than 30 lines of code.'
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#short-methods'
# Set to 30 once all methods are fixed.
# Max: 30
Max: 104
# Remove the following once the code style matches
# Offense count: 59
Metrics/AbcSize:
Max: 115
# Offense count: 5
# Configuration parameters: CountComments.
Metrics/BlockLength:
Max: 62
# Offense count: 6
# Configuration parameters: CountComments.
Metrics/ClassLength:
Max: 275
# Offense count: 6
Metrics/CyclomaticComplexity:
Max: 11
# Offense count: 1108
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives.
# URISchemes: http, https
Metrics/LineLength:
Max: 223
# Offense count: 8
Metrics/PerceivedComplexity:
Max: 12

2504
.rubocop_todo.yml Normal file
View File

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,9 @@
sudo: false
language: ruby
cache: bundler
cache:
bundler: true
directories:
- travis_phantomjs
env:
matrix:
- GROWSTUFF_SITE_NAME="Growstuff (travis)" RAILS_SECRET_TOKEN='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' GROWSTUFF_ELASTICSEARCH='true'
@@ -9,9 +12,16 @@ env:
secure: "Z5TpM2jEX4UCvNePnk/LwltQX48U2u9BRc+Iypr1x9QW2o228QJhPIOH39a8RMUrepGnkQIq9q3ZRUn98RfrJz1yThtlNFL3NmzdQ57gKgjGwfpa0e4Dwj/ZJqV2D84tDGjvdVYLP7zzaYZxQcwk/cgNpzKf/jq97HLNP7CYuf4="
rvm:
- 2.3.1
before_install:
- export PATH=$PWD/travis_phantomjs/phantomjs-2.1.1-linux-x86_64/bin:$PATH
- if [ $(phantomjs --version) != '2.1.1' ]; then rm -rf $PWD/travis_phantomjs; mkdir -p $PWD/travis_phantomjs; fi
- if [ $(phantomjs --version) != '2.1.1' ]; then wget https://assets.membergetmember.co/software/phantomjs-2.1.1-linux-x86_64.tar.bz2 -O $PWD/travis_phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2; fi
- if [ $(phantomjs --version) != '2.1.1' ]; then tar -xvf $PWD/travis_phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2 -C $PWD/travis_phantomjs; fi
- phantomjs --version
before_script:
- psql -c 'create database growstuff_test;' -U postgres
script:
- bundle exec rubocop --display-cop-names --rails
- script/gemfile_check
- bundle exec script/check_contributors_md
- bundle exec rake db:migrate --trace

View File

@@ -70,3 +70,5 @@ submit the change with your pull request.
- 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)
- Brenda Wallace / [br3nda](https://github.com/br3nda)

15
Gemfile
View File

@@ -1,8 +1,9 @@
# frozen_string_literal: true
source 'https://rubygems.org'
ruby '2.3.1'
gem 'rails', '~> 4.2.0'
gem 'rails', '~> 4.2.1'
gem 'bundler', '>=1.1.5'
@@ -14,11 +15,11 @@ gem 'haml'
gem 'bootstrap-sass', '~> 3.3.6'
gem 'font-awesome-sass'
gem 'uglifier', '~> 2.7.2' # JavaScript compressor
gem 'uglifier', '~> 2.7.2' # JavaScript compressor
gem 'jquery-rails'
gem 'jquery-ui-rails', '~> 5.0.2'
gem 'js-routes' # provides access to Rails routes in Javascript
gem 'js-routes' # provides access to Rails routes in Javascript
gem 'flickraw'
gem 'leaflet-rails'
@@ -38,6 +39,7 @@ gem 'bootstrap-kaminari-views' # bootstrap views for kaminari
gem 'activemerchant'
gem 'active_utils'
gem 'sidekiq'
# Markdown formatting for updates etc
gem 'bluecloth'
@@ -64,9 +66,10 @@ gem 'bootstrap-datepicker-rails'
gem 'omniauth'
gem 'omniauth-twitter'
gem 'omniauth-flickr', '>= 0.0.15'
gem 'omniauth-facebook'
# client for Elasticsearch. Elasticsearch is a flexible
# and powerful, distributed, real-time search and analytics engine.
# and powerful, distributed, real-time search and analytics engine.
# An example of the use in the project is fuzzy crop search.
gem "elasticsearch-model"
gem "elasticsearch-rails"
@@ -78,7 +81,8 @@ group :production, :staging do
gem 'dalli'
gem 'memcachier'
gem 'rails_12factor' # supresses heroku plugin injection
gem 'bonsai-elasticsearch-rails' # Integration with Bonsa-Elasticsearch on heroku
gem 'bonsai-elasticsearch-rails' # Integration with Bonsa-Elasticsearch on heroku
gem 'sparkpost_rails'
end
group :development do
@@ -111,6 +115,7 @@ group :development, :test do
gem 'selenium-webdriver'
gem "codeclimate-test-reporter", group: :test, require: nil
gem "active_merchant-paypal-bogus-gateway"
gem 'rubocop', require: false
end
group :travis do

View File

@@ -1,21 +1,21 @@
GEM
remote: https://rubygems.org/
specs:
actionmailer (4.2.6)
actionpack (= 4.2.6)
actionview (= 4.2.6)
activejob (= 4.2.6)
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)
rails-dom-testing (~> 1.0, >= 1.0.5)
actionpack (4.2.6)
actionview (= 4.2.6)
activesupport (= 4.2.6)
actionpack (4.2.7.1)
actionview (= 4.2.7.1)
activesupport (= 4.2.7.1)
rack (~> 1.6)
rack-test (~> 0.6.2)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (4.2.6)
activesupport (= 4.2.6)
actionview (4.2.7.1)
activesupport (= 4.2.7.1)
builder (~> 3.1)
erubis (~> 2.7.0)
rails-dom-testing (~> 1.0, >= 1.0.5)
@@ -24,25 +24,25 @@ GEM
actionpack
active_merchant-paypal-bogus-gateway (0.1.0)
activemerchant
active_utils (3.2.0)
activesupport (>= 3.2)
active_utils (3.2.2)
activesupport (>= 3.2, < 5.1.0)
i18n
activejob (4.2.6)
activesupport (= 4.2.6)
activejob (4.2.7.1)
activesupport (= 4.2.7.1)
globalid (>= 0.3.0)
activemerchant (1.59.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.6)
activesupport (= 4.2.6)
activemodel (4.2.7.1)
activesupport (= 4.2.7.1)
builder (~> 3.1)
activerecord (4.2.6)
activemodel (= 4.2.6)
activesupport (= 4.2.6)
activerecord (4.2.7.1)
activemodel (= 4.2.7.1)
activesupport (= 4.2.7.1)
arel (~> 6.0)
activesupport (4.2.6)
activesupport (4.2.7.1)
i18n (~> 0.7)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
@@ -51,7 +51,7 @@ GEM
addressable (2.4.0)
arel (6.0.3)
ast (2.3.0)
autoprefixer-rails (6.3.6.2)
autoprefixer-rails (6.4.0.2)
execjs
bcrypt (3.1.11)
better_errors (2.1.1)
@@ -62,19 +62,19 @@ GEM
debug_inspector (>= 0.0.1)
bluecloth (2.2.0)
bonsai-elasticsearch-rails (0.0.4)
bootstrap-datepicker-rails (1.6.1.1)
bootstrap-datepicker-rails (1.6.4.1)
railties (>= 3.0)
bootstrap-kaminari-views (0.0.5)
kaminari (>= 0.13)
rails (>= 3.1)
bootstrap-sass (3.3.6)
bootstrap-sass (3.3.7)
autoprefixer-rails (>= 5.2.1)
sass (>= 3.3.4)
bootstrap_form (2.3.0)
bootstrap_form (2.5.0)
builder (3.2.2)
byebug (9.0.5)
cancancan (1.15.0)
capybara (2.7.1)
capybara (2.8.0)
addressable
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
@@ -96,8 +96,8 @@ GEM
climate_control (>= 0.0.3, < 1.0)
codeclimate-test-reporter (0.6.0)
simplecov (>= 0.7.1, < 1.0.0)
codemirror-rails (5.11)
railties (>= 3.0, < 5)
codemirror-rails (5.16.0)
railties (>= 3.0, < 6.0)
coderay (1.1.1)
coffee-rails (4.1.1)
coffee-script (>= 2.2.0)
@@ -122,18 +122,19 @@ GEM
rails-i18n (>= 4.0.0)
sass-rails (>= 4.0.3)
concurrent-ruby (1.0.2)
coveralls (0.8.13)
json (~> 1.8)
simplecov (~> 0.11.0)
connection_pool (2.2.0)
coveralls (0.8.15)
json (>= 1.8, < 3)
simplecov (~> 0.12.0)
term-ansicolor (~> 1.3)
thor (~> 0.19.1)
tins (~> 1.6.0)
csv_shaper (1.2.0)
tins (>= 1.6.0, < 2)
csv_shaper (1.3.0)
activesupport (>= 3.0.0)
dalli (2.7.6)
database_cleaner (1.5.3)
debug_inspector (0.0.2)
devise (4.1.1)
devise (4.2.0)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
railties (>= 4.1.0, < 5.1)
@@ -145,21 +146,21 @@ GEM
json
thread
thread_safe
elasticsearch (1.0.18)
elasticsearch-api (= 1.0.18)
elasticsearch-transport (= 1.0.18)
elasticsearch-api (1.0.18)
elasticsearch (2.0.0)
elasticsearch-api (= 2.0.0)
elasticsearch-transport (= 2.0.0)
elasticsearch-api (2.0.0)
multi_json
elasticsearch-model (0.1.9)
activesupport (> 3)
elasticsearch (> 0.4)
hashie
elasticsearch-rails (0.1.9)
elasticsearch-transport (1.0.18)
elasticsearch-transport (2.0.0)
faraday
multi_json
erubis (2.7.0)
excon (0.50.1)
excon (0.51.0)
execjs (2.7.0)
factory_girl (4.7.0)
activesupport (>= 3.0.0)
@@ -168,7 +169,7 @@ GEM
railties (>= 3.0.0)
faraday (0.9.2)
multipart-post (>= 1.2, < 3)
ffi (1.9.10)
ffi (1.9.14)
figaro (1.1.1)
thor (~> 0.14)
flickraw (0.9.9)
@@ -181,7 +182,7 @@ GEM
gibbon (1.2.1)
httparty
multi_json (>= 1.9.0)
globalid (0.3.6)
globalid (0.3.7)
activesupport (>= 4.1.0)
gravatar-ultimate (2.0.0)
activesupport (>= 2.3.14)
@@ -196,7 +197,7 @@ GEM
shellany (~> 0.0)
thor (>= 0.18.1)
guard-compat (1.2.1)
guard-rspec (4.7.2)
guard-rspec (4.7.3)
guard (~> 2.1)
guard-compat (~> 1.1)
rspec (>= 2.99.0, < 4.0)
@@ -218,8 +219,7 @@ GEM
haml (~> 4.0.0)
nokogiri (~> 1.6.0)
ruby_parser (~> 3.5)
httparty (0.13.7)
json (~> 1.8)
httparty (0.14.0)
multi_xml (>= 0.5.2)
i18n (0.7.0)
i18n-tasks (0.9.5)
@@ -232,21 +232,22 @@ GEM
parser (>= 2.2.3.0)
term-ansicolor (>= 1.3.2)
terminal-table (>= 1.5.1)
jquery-rails (4.1.1)
jquery-rails (4.2.1)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
jquery-ui-rails (5.0.5)
railties (>= 3.2.16)
js-routes (1.2.6)
js-routes (1.3.0)
railties (>= 3.2)
sprockets-rails
json (1.8.3)
jwt (1.5.4)
kaminari (0.17.0)
actionpack (>= 3.0.0)
activesupport (>= 3.0.0)
kgio (2.10.0)
kramdown (1.11.1)
kramdown (1.12.0)
launchy (2.4.3)
addressable (~> 2.3)
leaflet-markercluster-rails (0.7.0)
@@ -268,40 +269,51 @@ GEM
mime-types (3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2016.0521)
mimemagic (0.3.0)
mimemagic (0.3.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.3.0)
newrelic_rpm (3.16.0.318)
newrelic_rpm (3.16.1.320)
nokogiri (1.6.8)
mini_portile2 (~> 2.1.0)
pkg-config (~> 1.1.7)
notiffany (0.1.0)
notiffany (0.1.1)
nenv (~> 0.1)
shellany (~> 0.0)
oauth (0.5.1)
oauth2 (1.2.0)
faraday (>= 0.8, < 0.10)
jwt (~> 1.0)
multi_json (~> 1.3)
multi_xml (~> 0.5)
rack (>= 1.2, < 3)
omniauth (1.3.1)
hashie (>= 1.2, < 4)
rack (>= 1.0, < 3)
omniauth-facebook (3.0.0)
omniauth-oauth2 (~> 1.2)
omniauth-flickr (0.0.19)
multi_json (~> 1.11.0)
omniauth-oauth (~> 1.0)
omniauth-oauth (1.1.0)
oauth
omniauth (~> 1.0)
omniauth-oauth2 (1.4.0)
oauth2 (~> 1.0)
omniauth (~> 1.2)
omniauth-twitter (1.2.1)
json (~> 1.3)
omniauth-oauth (~> 1.1)
orm_adapter (0.5.0)
paperclip (4.3.6)
activemodel (>= 3.2.0)
activesupport (>= 3.2.0)
paperclip (5.1.0)
activemodel (>= 4.2.0)
activesupport (>= 4.2.0)
cocaine (~> 0.5.5)
mime-types
mimemagic (= 0.3.0)
mimemagic (~> 0.3.0)
parser (2.3.1.2)
ast (~> 2.2)
pg (0.18.4)
@@ -312,25 +324,28 @@ GEM
capybara (~> 2.1)
cliver (~> 0.3.1)
websocket-driver (>= 0.2.0)
pry (0.10.3)
powerpack (0.1.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.6.4)
rack-protection (1.5.3)
rack
rack-test (0.6.3)
rack (>= 1.0)
rails (4.2.6)
actionmailer (= 4.2.6)
actionpack (= 4.2.6)
actionview (= 4.2.6)
activejob (= 4.2.6)
activemodel (= 4.2.6)
activerecord (= 4.2.6)
activesupport (= 4.2.6)
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.2.6)
railties (= 4.2.7.1)
sprockets-rails
rails-deprecated_sanitizer (1.0.3)
activesupport (>= 4.2.0.alpha)
@@ -340,7 +355,7 @@ GEM
rails-deprecated_sanitizer (>= 1.0.1)
rails-html-sanitizer (1.0.3)
loofah (~> 2.0)
rails-i18n (4.0.8)
rails-i18n (4.0.9)
i18n (~> 0.7)
railties (~> 4.0)
rails_12factor (0.0.3)
@@ -348,50 +363,59 @@ GEM
rails_stdout_logging
rails_serve_static_assets (0.0.5)
rails_stdout_logging (0.0.5)
railties (4.2.6)
actionpack (= 4.2.6)
activesupport (= 4.2.6)
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.16.0)
rainbow (2.1.0)
raindrops (0.17.0)
rake (11.2.2)
rb-fsevent (0.9.7)
rb-inotify (0.9.7)
ffi (>= 0.5.0)
responders (2.2.0)
redis (3.3.1)
responders (2.3.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 (3.5.0)
rspec-core (~> 3.5.0)
rspec-expectations (~> 3.5.0)
rspec-mocks (~> 3.5.0)
rspec-activemodel-mocks (1.0.3)
activemodel (>= 3.0)
activesupport (>= 3.0)
rspec-mocks (>= 2.99, < 4.0)
rspec-core (3.4.4)
rspec-support (~> 3.4.0)
rspec-expectations (3.4.0)
rspec-core (3.5.2)
rspec-support (~> 3.5.0)
rspec-expectations (3.5.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.4.0)
rspec-mocks (3.4.1)
rspec-support (~> 3.5.0)
rspec-mocks (3.5.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.4.0)
rspec-rails (3.4.2)
actionpack (>= 3.0, < 4.3)
activesupport (>= 3.0, < 4.3)
railties (>= 3.0, < 4.3)
rspec-core (~> 3.4.0)
rspec-expectations (~> 3.4.0)
rspec-mocks (~> 3.4.0)
rspec-support (~> 3.4.0)
rspec-support (3.4.1)
ruby-units (2.0.0)
ruby_dep (1.3.1)
rspec-support (~> 3.5.0)
rspec-rails (3.5.1)
actionpack (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
rspec-core (~> 3.5.0)
rspec-expectations (~> 3.5.0)
rspec-mocks (~> 3.5.0)
rspec-support (~> 3.5.0)
rspec-support (3.5.0)
rubocop (0.45.0)
parser (>= 2.3.1.1, < 3.0)
powerpack (~> 0.1)
rainbow (>= 1.99.1, < 3.0)
ruby-progressbar (~> 1.7)
unicode-display_width (~> 1.0, >= 1.0.1)
ruby-progressbar (1.8.1)
ruby-units (2.0.1)
ruby_dep (1.4.0)
ruby_parser (3.8.2)
sexp_processor (~> 4.1)
rubyzip (1.2.0)
sass (3.4.22)
sass-rails (5.0.5)
sass-rails (5.0.6)
railties (>= 4.0.0, < 6)
sass (~> 3.1)
sprockets (>= 2.8, < 4.0)
@@ -403,13 +427,24 @@ GEM
websocket (~> 1.0)
sexp_processor (4.7.0)
shellany (0.0.1)
simplecov (0.11.2)
sidekiq (4.1.4)
concurrent-ruby (~> 1.0)
connection_pool (~> 2.2, >= 2.2.0)
redis (~> 3.2, >= 3.2.1)
sinatra (>= 1.4.7)
simplecov (0.12.0)
docile (~> 1.1.0)
json (~> 1.8)
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.0)
sinatra (1.4.7)
rack (~> 1.5)
rack-protection (~> 1.4)
tilt (>= 1.3, < 3)
slop (3.6.0)
sprockets (3.6.2)
sparkpost_rails (1.4.0)
rails (>= 4.0, < 5.1)
sprockets (3.7.0)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-rails (3.1.1)
@@ -423,12 +458,13 @@ GEM
thread (0.2.2)
thread_safe (0.3.5)
tilt (2.0.5)
tins (1.6.0)
tins (1.12.0)
tzinfo (1.2.2)
thread_safe (~> 0.1)
uglifier (2.7.2)
execjs (>= 0.3.0)
json (>= 1.8.0)
unicode-display_width (1.1.1)
unicorn (5.1.0)
kgio (~> 2.6)
raindrops (~> 0.7)
@@ -500,20 +536,24 @@ DEPENDENCIES
memcachier
newrelic_rpm
omniauth
omniauth-facebook
omniauth-flickr (>= 0.0.15)
omniauth-twitter
pg
poltergeist (~> 1.6)
pry
quiet_assets
rails (~> 4.2.0)
rails (~> 4.2.1)
rails_12factor
rake (>= 10.0.0)
rspec-activemodel-mocks
rspec-rails
rubocop
ruby-units
sass-rails (~> 5.0.4)
selenium-webdriver
sidekiq
sparkpost_rails
uglifier (~> 2.7.2)
unicorn
webrat
@@ -523,4 +563,4 @@ RUBY VERSION
ruby 2.3.1p112
BUNDLED WITH
1.12.5
1.13.6

View File

@@ -32,7 +32,7 @@ frontend features. We welcome contributions -- see
* 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 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).
* You may also be interested in our [API](https://github.com/Growstuff/growstuff/wiki/API).
## For designers, writers, researchers, data wranglers, and other contributors

View File

@@ -5,16 +5,15 @@
jQuery ->
el = $('.append-date')
el.datepicker({'format': 'yyyy-mm-dd'})
href = el.attr('href')
el.datepicker({'format': 'yyyy-mm-dd'})
el.click (e) ->
e.stopPropagation()
e.preventDefault()
originalText = $(this).text()
href = $(this).attr('href')
$(this).text('Confirm without date')
$(this).bind('click.confirm', (e) ->
@@ -30,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

@@ -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

@@ -42,4 +42,3 @@ $ ->
element = document.getElementById(tmp)
console.log("%s",tmp)
element.remove()

View File

@@ -2,7 +2,7 @@
@import "bootstrap"
@import "custom_bootstrap/variables"
// this padding needs to be done before the responsive stuff is imported
body
body
// modifying this for our promotional banner. can be replaced after if
// needed.
// padding-top: $navbar-height + 15px
@@ -19,14 +19,14 @@ body
//@import "bootstrap/glyphicons"
.list-inline > li.first
.list-inline > li.first
padding-left: 0px
h2
h2
font-size: 150%
//#subtitle
//#subtitle
// color: lighten($brown, 30%)
// font-style: italic
// font-weight: normal
@@ -34,36 +34,49 @@ h2
// padding-left: 1em
// padding-top: 0px
h3
h3
font-size: 120%
.main
.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)
.six-across:nth-child(6n+1)
margin-left: 0px
.three-across:nth-child(3n+1)
.three-across:nth-child(3n+1)
margin-left: 0px
clear: both
// let's condense the hero unit a little
.jumbotron
.jumbotron
padding-top: 30px
padding-bottom: 30px
// info under the main heading on homepage
.jumbotron .info
.jumbotron .info
padding-top: 15px
// signup widget on homepage
.jumbotron .signup
.jumbotron .signup
background-color: lighten($green, 40%)
border: 1px solid lighten($green, 20%)
border-radius: 6px
@@ -72,19 +85,19 @@ h3
text-align: center
// stats shown on homepage. eg. "999 members..."
p.stats
p.stats
font-weight: bold
.member-cards
.member-cards
display: flex
flex: none
flex-wrap: wrap
justify-content: space-between
.member-thumbnail
.member-thumbnail
padding: .25em
div
div
width: 5em
display: inline-block
vertical-align: top
@@ -103,7 +116,7 @@ p.stats
margin-left: auto
@media (min-width: $screen-md-min)
.planting-thumbnail
.planting-thumbnail
dl.planting-attributes
font-size: 85%
width: 100%
@@ -115,10 +128,14 @@ p.stats
padding-left: 80px
margin-left: auto
#placesmap, #cropmap
.navbar .navbar-form
width: 250px
#placesmap, #cropmap
height: 500px
#membermap
#membermap
height: 250px
.location-not-set
@@ -128,23 +145,23 @@ p.stats
background-repeat: no-repeat
background-position: center
.member-location
.member-location
font-size: small
font-style: italic
.member-location a
.member-location a
color: $brown
.photo-thumbnail
.photo-thumbnail
padding: 0
position: relative
img
width: 100%
.text
.text
display: none
color: #000
position: absolute
@@ -152,100 +169,100 @@ p.stats
background: rgba(0, 0, 0, 0.8)
width: 100%
margin: 0
p
p
padding: 5px
margin: 0
color: #fff
&:hover
.text
&:hover
.text
display: block
.thumbnail
.thumbnail
border: none
text-align: center
margin-bottom: 1.5em
.member-thumbnail
.member-thumbnail
text-align: left
img
img
height: 85px
width: 85px
max-width: 85px
.crop-thumbnail
.crop-thumbnail
height: 220px
.cropinfo
.cropinfo
display: inline-block
max-width: 100%
white-space: nowrap
line-height: 1em
padding-bottom: 2px
.cropname
.cropname
overflow: hidden
text-overflow: ellipsis
.scientificname
.scientificname
font-size: small
font-style: italic
overflow: hidden
text-overflow: ellipsis
.plantingcount
.plantingcount
font-size: small
.crop-name a
.crop-name a
padding-top: 2px
.scientific-name small
.scientific-name small
margin-bottom: -2px
li.crop-hierarchy
li.crop-hierarchy
list-style-type: disc
.navbar-brand
.navbar-brand
margin: 0px
padding: 0px
.navbar-bottom
.navbar-bottom
margin: 40px 0px 0px 0px !important
// footer
footer
#footer1, #footer2, #footer3
footer
#footer1, #footer2, #footer3
text-align: left
padding-top: 1em
padding-bottom: 2em
ul
ul
list-style-type: none
list-style-position: outside
padding-left: 0px
margin-left: 0px
a
a
color: $navbar-default-link-color
text-decoration: none
a:hover
a:hover
color: $navbar-default-link-hover-color
a:active
a:active
color: $navbar-default-link-active-color
.navbar-bottom.navbar
.navbar-bottom.navbar
border-radius: 0
// ensure footer is pushed to bottom of browser window
#maincontainer
#maincontainer
min-height: 80%
html, body
html, body
height: 100%
.crop-image, .member-image
.crop-image, .member-image
width: 100%
height: 100%
@@ -255,24 +272,29 @@ html, body
background: white
z-index: $zindex-tooltip
.alert
a
.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
@media only screen and (max-width: 767px)
.sidebar
margin-left: 0
border-left: none
padding-left: 0
#map
#map
height: 300px
.navbar .nav > li
.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%)
@@ -283,7 +305,7 @@ $state-info-bg: lighten($green, 50%)
$state-success-text: darken($green, 10%)
$state-success-bg: lighten($green, 50%)
.hide
.hide
display: none
#add-sci_name-row, #remove-sci_name-row, #add-alt_name-row, #remove-alt_name-row
@@ -300,14 +322,14 @@ $state-success-bg: lighten($green, 50%)
#gardens_panel_body
height: 20em
.form-group.required .control-label:before
.form-group.required .control-label:before
content: "* "
color: red
.margin-bottom
.margin-bottom
margin-bottom: 1em
.red
.red
color: red
.truncate

View File

@@ -1,7 +1,7 @@
class AccountTypesController < ApplicationController
before_filter :authenticate_member!
load_and_authorize_resource
# GET /account_types
def index
@account_types = AccountType.all
@@ -70,7 +70,7 @@ class AccountTypesController < ApplicationController
end
end
private
private
def account_type_params
params.require(:account_type).permit(:is_paid, :is_permanent_paid, :name)

View File

@@ -1,7 +1,7 @@
class AccountsController < ApplicationController
before_filter :authenticate_member!
load_and_authorize_resource
# GET /accounts
def index
@accounts = Account.all

View File

@@ -7,16 +7,7 @@ class AuthenticationsController < ApplicationController
auth = request.env['omniauth.auth']
@authentication = nil
if auth
name = ''
case auth['provider']
when 'twitter'
name = auth['info']['nickname']
when 'flickr'
name = auth['info']['name']
else
name = auth['info']['name']
end
name = Growstuff::OauthSignupAction.new.determine_name(auth)
@authentication = current_member.authentications
.create_with(

View File

@@ -89,7 +89,7 @@ class CommentsController < ApplicationController
end
end
private
private
def comment_params
params.require(:comment).permit(:author_id, :body, :post_id)

View File

@@ -86,7 +86,7 @@ class CropsController < ApplicationController
# TODO RABL or similar one day to avoid presentation logic here
owner_structure = {
owner: {
only: [:id, :login_name, :location, :latitude, :longitude]
only: [:id, :login_name, :location, :latitude, :longitude]
}
}
render json: @crop.to_json(include: {
@@ -144,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_now!
Notifier.new_crop_request(w, @crop).deliver_later!
end
end
@@ -184,12 +184,12 @@ class CropsController < ApplicationController
sci_name = @crop.scientific_names.create(scientific_name: value, creator_id: current_member.id)
end
end
if previous_status == "pending"
requester = @crop.requester
new_status = @crop.approval_status
Notifier.crop_request_approved(requester, @crop).deliver_now! if new_status == "approved"
Notifier.crop_request_rejected(requester, @crop).deliver_now! if new_status == "rejected"
Notifier.crop_request_approved(requester, @crop).deliver_later! if new_status == "approved"
Notifier.crop_request_rejected(requester, @crop).deliver_later! if new_status == "rejected"
end
format.html { redirect_to @crop, notice: 'Crop was successfully updated.' }
format.json { head :no_content }

View File

@@ -1,7 +1,6 @@
class HarvestsController < ApplicationController
before_filter :authenticate_member!, except: [:index, :show]
load_and_authorize_resource
# GET /harvests
# GET /harvests.json

View File

@@ -1,7 +1,7 @@
class MembersController < ApplicationController
load_and_authorize_resource
skip_authorize_resource only: [:nearby, :unsubscribe]
skip_authorize_resource only: [:nearby, :unsubscribe, :finish_signup]
after_action :expire_cache_fragments, only: :create
@@ -20,15 +20,16 @@ class MembersController < ApplicationController
end
def show
@member = Member.confirmed.find(params[:id])
@twitter_auth = @member.auth('twitter')
@flickr_auth = @member.auth('flickr')
@posts = @member.posts
@member = Member.confirmed.find(params[:id])
@twitter_auth = @member.auth('twitter')
@flickr_auth = @member.auth('flickr')
@facebook_auth = @member.auth('facebook')
@posts = @member.posts
# The garden form partial is called from the "New Garden" tab;
# it requires a garden to be passed in @garden.
# The new garden is not persisted unless Garden#save is called.
@garden = Garden.new
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]) }
@@ -70,10 +71,27 @@ class MembersController < ApplicationController
end
end
def finish_signup
@member = current_member
if request.patch? && params[:member]
if @member.update(member_params)
@member.skip_reconfirmation!
bypass_sign_in(@member)
redirect_to root_path, notice: 'Welcome.'
else
flash[:alert] = 'Failed to complete signup'
@show_errors = true
end
end
end
private
def expire_cache_fragments
expire_fragment("homepage_stats")
end
def member_params
params.require(:member).permit(:login_name, :tos_agreement, :email, :newsletter)
end
end

View File

@@ -46,7 +46,6 @@ class NotificationsController < ApplicationController
@subject = @sender_notification.subject =~ /^Re: / ?
@sender_notification.subject :
"Re: " + @sender_notification.subject
respond_to do |format|
format.html # reply.html.haml

View File

@@ -0,0 +1,51 @@
require './lib/actions/oauth_signup_action'
#
# Handle signup or signin
# from various oauth providers
#
# Heavily overlaps with Authentications controller
#
class OmniauthCallbacksController < Devise::OmniauthCallbacksController
def facebook
create
end
def failure
flash[:alert] = "Authentication failed."
redirect_to request.env['omniauth.origin'] || "/"
end
private
def create
auth = request.env['omniauth.auth']
action = Growstuff::OauthSignupAction.new
@authentication = nil
if auth
member = action.find_or_create_from_authorization(auth)
@authentication = action.establish_authentication(auth, member)
unless action.member_created?
sign_in_and_redirect member, event: :authentication #this will throw if @user is not activated
set_flash_message(:notice, :success, kind: auth['provider']) if is_navigational_format?
else
raise "Invalid provider" unless ['facebook', 'twitter', 'flickr'].index(auth['provider'].to_s)
session["devise.#{auth['provider']}_data"] = request.env["omniauth.auth"]
sign_in member
redirect_to finish_signup_url(member)
end
else
redirect_to request.env['omniauth.origin'] || edit_member_registration_path
end
end
def after_sign_in_path_for(resource)
if resource.tos_agreement
super resource
else
finish_signup_path(resource)
end
end
end

View File

@@ -4,4 +4,4 @@ protected
def after_resetting_password_path_for(resource)
root_path
end
end
end

View File

@@ -108,7 +108,7 @@ class PhotosController < ApplicationController
@photo = Photo.find(params[:id])
@photo.destroy
flash[:alert] = "Photo successfully deleted."
respond_to do |format|
format.html { redirect_to photos_url }
format.json { head :no_content }

View File

@@ -1,8 +1,10 @@
class RegistrationsController < Devise::RegistrationsController
respond_to :json
def edit
@twitter_auth = current_member.auth('twitter')
@flickr_auth = current_member.auth('flickr')
@twitter_auth = current_member.auth('twitter')
@flickr_auth = current_member.auth('flickr')
@facebook_auth = current_member.auth('facebook')
render "edit"
end

View File

@@ -1,7 +1,7 @@
class RolesController < ApplicationController
before_filter :authenticate_member!
load_and_authorize_resource
# GET /roles
def index
@roles = Role.all

View File

@@ -1,4 +1,6 @@
class SessionsController < Devise::SessionsController
respond_to :json
def create
super do |resource|
if Crop.pending_approval.present? && current_member.has_role?(:crop_wrangler)

View File

@@ -20,7 +20,7 @@ module ApplicationHelper
currency = Growstuff::Application.config.currency
link = "http://www.wolframalpha.com/input/?i=#{pid}+#{currency}"
link_to "(convert)", link, target: "_blank"
link_to "(convert)", link, target: "_blank", rel: "noopener noreferrer"
end
def build_alert_classes(alert_type = :info)
@@ -57,7 +57,20 @@ module ApplicationHelper
# Falls back to Gravatar
#
def avatar_uri(member, size = 150)
return member.preferred_avatar_uri if member.preferred_avatar_uri.present?
if member.preferred_avatar_uri.present?
# Some avatars support different sizes
# http://graph.facebook.com/12345678/picture?width=150&height=150
uri = URI.parse(member.preferred_avatar_uri)
if uri.host == 'graph.facebook.com'
uri.query = "&width=#{size}&height=#{size}"
end
# TODO: Assess twitter - https://dev.twitter.com/overview/general/user-profile-images-and-banners
# TODO: Assess flickr - https://www.flickr.com/services/api/misc.buddyicons.html
return uri.to_s
end
Gravatar.new(member.email).image_url({
size: size,
@@ -73,4 +86,3 @@ module ApplicationHelper
"#{size} #{model_name}"
end
end

View File

@@ -1,11 +1,9 @@
module SeedsHelper
def display_seed_description(seed)
if seed.description.nil?
"no description provided."
if seed.description.nil?
"no description provided."
else
truncate(seed.description, length: 130, separator: ' ', omission: '... ') { link_to "Read more", seed_path(seed) }
truncate(seed.description, length: 130, separator: ' ', omission: '... ') { link_to "Read more", seed_path(seed) }
end
end
end
end

View File

@@ -12,7 +12,7 @@ class Notifier < ActionMailer::Base
@notification = notification
@reply_link = reply_link(@notification)
# Encrypting
# Encrypting
@signed_message = verifier.generate ({ member_id: @notification.recipient.id, type: :send_notification_email })
mail(to: @notification.recipient.email,
@@ -25,7 +25,7 @@ class Notifier < ActionMailer::Base
@plantings = @member.plantings.first(5)
@harvests = @member.harvests.first(5)
# Encrypting
# Encrypting
@signed_message = verifier.generate ({ member_id: @member.id, type: :send_planting_reminder })
if @member.send_planting_reminder
@@ -36,7 +36,7 @@ class Notifier < ActionMailer::Base
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)

View File

@@ -22,7 +22,7 @@ class Ability
cannot :read, AccountType
# nobody should be able to view unapproved crops unless they
# are wranglers or admins
# are wranglers or admins
cannot :read, Crop
can :read, Crop, approval_status: "approved"
# scientific names should only be viewable if associated crop is approved

View File

@@ -8,7 +8,7 @@ class Account < ActiveRecord::Base
before_create do |account|
unless account.account_type
account.account_type = AccountType.find_or_create_by(name:
account.account_type = AccountType.find_or_create_by(name:
Growstuff::Application.config.default_account_type
)
end

View File

@@ -50,44 +50,46 @@ class Crop < ActiveRecord::Base
####################################
# Elastic search configuration
include Elasticsearch::Model
include Elasticsearch::Model::Callbacks
# In order to avoid clashing between different environments,
# use Rails.env as a part of index name (eg. development_growstuff)
index_name [Rails.env, "growstuff"].join('_')
settings index: { number_of_shards: 1 },
analysis: {
tokenizer: {
gs_edgeNGram_tokenizer: {
type: "edgeNGram", # edgeNGram: NGram match from the start of a token
min_gram: 3,
max_gram: 10,
# token_chars: Elasticsearch will split on characters
# that dont belong to any of these classes
token_chars: [ "letter", "digit" ]
}
},
analyzer: {
gs_edgeNGram_analyzer: {
tokenizer: "gs_edgeNGram_tokenizer",
filter: ["lowercase"]
}
},
} do
mappings dynamic: 'false' do
indexes :id, type: 'long'
indexes :name, type: 'string', analyzer: 'gs_edgeNGram_analyzer'
indexes :approval_status, type: 'string'
indexes :scientific_names do
indexes :scientific_name,
type: 'string',
analyzer: 'gs_edgeNGram_analyzer',
# Disabling field-length norm (norm). If the norm option is turned on(by default),
# higher weigh would be given for shorter fields, which in our case is irrelevant.
norms: { enabled: false }
end
indexes :alternate_names do
if ENV["GROWSTUFF_ELASTICSEARCH"] == "true"
include Elasticsearch::Model
include Elasticsearch::Model::Callbacks
# In order to avoid clashing between different environments,
# use Rails.env as a part of index name (eg. development_growstuff)
index_name [Rails.env, "growstuff"].join('_')
settings index: { number_of_shards: 1 },
analysis: {
tokenizer: {
gs_edgeNGram_tokenizer: {
type: "edgeNGram", # edgeNGram: NGram match from the start of a token
min_gram: 3,
max_gram: 10,
# token_chars: Elasticsearch will split on characters
# that dont belong to any of these classes
token_chars: [ "letter", "digit" ]
}
},
analyzer: {
gs_edgeNGram_analyzer: {
tokenizer: "gs_edgeNGram_tokenizer",
filter: ["lowercase"]
}
},
} do
mappings dynamic: 'false' do
indexes :id, type: 'long'
indexes :name, type: 'string', analyzer: 'gs_edgeNGram_analyzer'
indexes :approval_status, type: 'string'
indexes :scientific_names do
indexes :scientific_name,
type: 'string',
analyzer: 'gs_edgeNGram_analyzer',
# Disabling field-length norm (norm). If the norm option is turned on(by default),
# higher weigh would be given for shorter fields, which in our case is irrelevant.
norms: { enabled: false }
end
indexes :alternate_names do
indexes :name, type: 'string', analyzer: 'gs_edgeNGram_analyzer'
end
end
end
end
@@ -128,7 +130,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
@@ -312,7 +318,7 @@ class Crop < ActiveRecord::Base
if ENV['GROWSTUFF_ELASTICSEARCH'] == "true"
search_str = query.nil? ? "" : query.downcase
response = __elasticsearch__.search( {
# Finds documents which match any field, but uses the _score from
# Finds documents which match any field, but uses the _score from
# the best field insead of adding up _score from each field.
query: {
multi_match: {

View File

@@ -67,7 +67,7 @@ class Harvest < ActiveRecord::Base
before_save :set_si_weight
# we're storing the harvest weight in kilograms in the db too
# we're storing the harvest weight in kilograms in the db too
# to make data manipulation easier
def set_si_weight
if self.weight_unit != nil
@@ -132,7 +132,7 @@ class Harvest < ActiveRecord::Base
end
def default_photo
return photos.first
return photos.first || crop.default_photo
end
end

View File

@@ -46,7 +46,7 @@ class Member < ActiveRecord::Base
# :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable,
:confirmable, :lockable, :timeoutable
:confirmable, :lockable, :timeoutable, :omniauthable
# set up geocoding
geocoded_by :location
@@ -58,7 +58,7 @@ class Member < ActiveRecord::Base
attr_accessor :login
# Requires acceptance of the Terms of Service
validates_acceptance_of :tos_agreement, allow_nil: false,
validates_acceptance_of :tos_agreement, allow_nil: true,
accept: true
validates :login_name,
@@ -183,7 +183,7 @@ class Member < ActiveRecord::Base
# Returns a hash of Flickr photosets' ids and titles
def flickr_sets
sets = Hash.new
sets = Hash.new
flickr.photosets.getList.each do |p|
sets[p.title] = p.id
end
@@ -262,5 +262,4 @@ class Member < ActiveRecord::Base
def get_follow(member)
self.follows.where(followed_id: member.id).first if already_following?(member)
end
end

View File

@@ -23,7 +23,7 @@ class Notification < ActiveRecord::Base
def send_email
if self.recipient.send_notification_email
Notifier.notify(self).deliver_now
Notifier.notify(self).deliver_later
end
end

View File

@@ -17,7 +17,7 @@ class Order < ActiveRecord::Base
sum = 0
for i in order_items do
subtotal = i.price * i.quantity
sum += subtotal
sum += subtotal
end
return sum
end

View File

@@ -104,7 +104,7 @@ class Planting < ActiveRecord::Base
if differences.compact.empty?
nil
else
else
differences.compact.sum/differences.compact.size
end
end

View File

@@ -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 && !self.crops.include?(crop)
self.crops << crop if crop && !self.crops.include?(crop)
end
end
end

View File

@@ -21,7 +21,7 @@
= f.label :name, :class => 'control-label col-md-2'
.col-md-8
= f.text_field :name, :class => 'form-control'
.form-group
.form-actions.col-md-offset-2.col-md-8
= f.submit 'Save', :class => 'btn btn-primary'

View File

@@ -1,6 +1,6 @@
= 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", 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(' '))

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

@@ -48,7 +48,7 @@
Scientific names
= button_tag "+", :id => "add-sci_name-row", :type => "button"
= button_tag "-", :id => "remove-sci_name-row", :type => "button"
.form-group#scientific_names
- @crop.scientific_names.each.with_index do |sci, index|
.template.col-md-12{ :id => "sci_template[#{index+1}]" }
@@ -64,7 +64,7 @@
= button_tag "+", :id => "add-alt_name-row", :type => "button"
= button_tag "-", :id => "remove-alt_name-row", :type => "button"
.form-group#alternate_names
.form-group#alternate_names
- @crop.alternate_names.each.with_index do |alt, index|
.template.col-md-12{ :id => "alt_template[#{index+1}]" }
.col-md-2

View File

@@ -1,7 +1,7 @@
- content_for :title, (can?(:wrangle, @crop) ? "New crop" : "Suggest a crop")
- content_for :title, (can?(:wrangle, @crop) ? "New crop" : "Suggest a crop")
- unless can? :wrangler, @crop
%p Thanks for taking the time to suggest a crop! Our crop database is managed by volunteers, and we appreciate your help. Here are some things to consider when suggesting a new crop:
%ul

View File

@@ -2,7 +2,7 @@
- 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: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)
@@ -91,4 +91,11 @@
%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 "OpenFarm - Growing guide", "https://openfarm.cc/en/crops/#{URI.escape @crop.name}", 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

@@ -24,7 +24,7 @@
%li{:class => @approval_status == "rejected" ? 'active' : ''}
= link_to "Rejected", wrangle_crops_path(:approval_status => "rejected")
%h2
%h2
- if @approval_status == "pending"
Requested Crops
- elsif @approval_status == "rejected"

View File

@@ -25,3 +25,15 @@
= link_to "Disconnect", @flickr_auth, :confirm => "Are you sure you want to remove this connection?", :method => :delete, :class => "remove"
- else
=link_to 'Connect to Flickr', '/auth/flickr'
.row
.col-md-12
%p
= image_tag "facebook_32.png", :size => "32x32", :alt => 'Facebook logo'
- if @facebook_auth
You are connected to Facebook as
= succeed "." do
=link_to @facebook_auth.name, "http://facebook.com/profile/#{@facebook_auth.uid}"
= link_to "Disconnect", @facebook_auth, :confirm => "Are you sure you want to remove this connection?", :method => :delete, :class => "remove"
- else
=link_to 'Connect to Facebook', '/auth/facebook'

View File

@@ -18,11 +18,12 @@
Profile picture
.col-md-8
= render :partial => "members/avatar", :locals => { :member => @member }
%p
%br/
To change your profile picture, visit
= succeed "." do
= link_to 'gravatar.com', "http://gravatar.com/"
- unless @member.preferred_avatar_uri.present?
%p
%br/
To change your profile picture, visit
= succeed "." do
= link_to 'gravatar.com', "http://gravatar.com/"
.form-group
.form-actions.col-md-offset-2.col-md-8

View File

@@ -1,4 +1,4 @@
- content_for :title, t('.title')
- content_for :title, t('.title')
- if can? :create, Forum
%p

View File

@@ -11,17 +11,17 @@
= link_to image_tag((garden.default_photo ? garden.default_photo.thumbnail_url : 'placeholder_150.png'), :alt => garden.name, :class => 'img'), garden
.col-md-8
%dl.dl-horizontal
%dt Name :
%dt Name :
%dd= link_to garden.name, garden
%dt Location :
%dt Location :
%dd
- if garden.location.blank?
not specified
- else
= link_to garden.location, place_path(garden.location, anchor: "gardens")
%dt Area :
%dt Area :
%dd= garden.area.nil? ? "not specified" : pluralize(garden.area, garden.area_unit)
%dt Active? :
%dt Active? :
%dd= garden.active ? "Yes" : "No"
.col-md-12
%b

View File

@@ -40,8 +40,8 @@
%p No description available yet.
- if can? :edit, @garden
%p
Why not
%p
Why not
= link_to 'tell us more.', edit_garden_path(@garden)
- if @garden.photos.size > 0 or (can? :edit, @garden and can? :create, Photo)

View File

@@ -1,23 +1,23 @@
.panel.panel-success
.panel-heading
%h3.panel-title
= link_to "#{harvest.owner.login_name}'s harvest", harvest.owner
= link_to "#{harvest.owner.login_name}'s #{harvest.crop.name} harvest", harvest
- if can? :edit, harvest
%a.pull-right{:href => edit_harvest_path(harvest), :role => "button", :id => "edit_harvest_glyphicon"}
%span.glyphicon.glyphicon-pencil{:title => "Edit"}
.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 :
%dt Crop :
%dd= link_to harvest.crop.name, harvest.crop
%dt Plant part :
%dt Plant part :
%dd= link_to harvest.plant_part, harvest.plant_part
%dt Quantity :
%dt Quantity :
%dd= display_quantity(harvest)
%dt Harvest date :
%dt Harvest date :
%dd= harvest.harvested_at
.panel-footer
%dt Description

View File

@@ -1,7 +1,7 @@
=content_for :title, "#{@harvest.crop} harvested by #{@harvest.owner}"
- content_for :opengraph do
- @harvest.photos.each do |photo|
= tag("meta", property: "og:image", content: photo.fullsize_url)
= tag("meta", property: "og:image", content: photo.fullsize_url)
= tag("meta", property: "og:image:user_generated", content: "true")
= tag("meta", property: "og:title", content: "#{@harvest.crop} harvested by #{@harvest.owner}")
= tag("meta", property: "og:type", content: "website")
@@ -17,8 +17,8 @@
= link_to "view all #{@harvest.owner}'s harvests", harvests_by_owner_path(:owner => @harvest.owner.slug)
%p
%b Plant part:
- if @harvest.plant_part
= link_to @harvest.plant_part, @harvest.plant_part
- if @harvest.plant_part
= link_to @harvest.plant_part, @harvest.plant_part
- else
not specified
%p

View File

@@ -2,7 +2,7 @@
%p.stats
= t('.message_html', { member: link_to(t('.member_linktext', count: Member.confirmed.size.to_i), members_path),
number_crops: link_to(t('.number_crops_linktext', count: Crop.count.to_i), crops_path),
number_plantings: link_to(t('.number_plantings_linktext', count: Planting.count.to_i), plantings_path),
number_plantings: link_to(t('.number_plantings_linktext', count: Planting.count.to_i), plantings_path),
number_gardens: link_to(t('.number_gardens_linktext', count: Garden.count.to_i), gardens_path) })

View File

@@ -8,16 +8,24 @@
%span.icon-bar
%span.icon-bar
%span.icon-bar
%a.navbar-brand(href=root_path)
%a.navbar-brand.hidden-xs(href=root_path)
= image_tag("growstuff-brand.png", :size => "200x50", :alt => ENV['GROWSTUFF_SITE_NAME'])
= form_tag crops_search_path, :method => :get, :id => 'navbar-search', :class => 'navbar-form pull-right' do
.input
%a.navbar-brand.visible-xs(href=root_path)
= image_tag("growstuff-apple-touch-icon-precomposed.png", :size => "50x50", :class=>"img-responsive", :alt => ENV['GROWSTUFF_SITE_NAME'])
.form.navbar-form.pull-left
= form_tag crops_search_path, :method => :get, :id => 'navbar-search' do
= label_tag :term, "Search crop database:", :class => 'sr-only'
= text_field_tag 'term', nil, :class => 'search-query input-medium form-control', :placeholder => 'Search crops'
= submit_tag "Search", :class => 'btn sr-only'
.input
.input-group
= text_field_tag 'term', nil, :class => 'search-query input-medium form-control', :placeholder => 'Search crops'
.input-group-btn
%button.btn.btn-default{:style => "height: 34px;"}
= submit_tag "Search", :class => 'btn sr-only'
%span.glyphicon.glyphicon-search
.navbar-collapse.collapse#navbar-collapse
%ul.nav.navbar-nav.pull-right
%ul.nav.navbar-nav.navbar-right
%li.dropdown<
%a.dropdown-toggle{'data-toggle' => 'dropdown', :href => crops_path}
Crops

View File

@@ -1,4 +1,4 @@
- if twitter_auth || flickr_auth || member.show_email
- if twitter_auth || flickr_auth || facebook_auth || member.show_email
%h4 Contact
- if twitter_auth
@@ -11,6 +11,11 @@
= image_tag "flickr_32.png", :size => "32x32", :alt => 'Flickr logo'
=link_to flickr_auth.name, "http://flickr.com/photos/#{flickr_auth.uid}"
- if facebook_auth
%p
= image_tag "facebook_32.png", :size => "32x32", :alt => 'Facebook logo'
=link_to facebook_auth.name, "http://facebook.com/profile/#{facebook_auth.uid}"
- if member.show_email
%p
Email:

View File

@@ -7,7 +7,7 @@
- first_garden = false
= link_to g.name, "#garden#{g.id}", 'data-toggle' => 'tab'
- if current_member == member
%li.navbar-right
%li.navbar-right
= link_to new_garden_path, class: 'btn' do
Add New Garden
.tab-content{style: "padding-top: 1em"}
@@ -25,8 +25,8 @@
%p No description available yet.
- if can? :edit, g
%p
Why not
%p
Why not
= link_to 'tell us more.', edit_garden_path(g)

View File

@@ -0,0 +1,40 @@
- content_for :title, "Join Growstuff"
%p Sign up for a Growstuff account to track your veggie garden and connect with other local growers.
= form_for(current_member, :as => 'member', :url => finish_signup_path(current_member), :html => { role: 'form'}) do |f|
- if @show_errors && current_member.errors.any?
%div.alert.alert-danger
- current_member.errors.full_messages.each do |msg|
= msg
%br
.form-group
= f.label :login_name
.controls
= f.text_field :login_name, :autofocus => true, class: 'form-control input-lg'
%p.help-block Choose a login name
.form-group
= f.label :email
.controls
= f.text_field :email, class: 'form-control input-lg', placeholder: 'Example: email@me.com'
%p.help-block Please confirm your email address.
.form-group
.col-md-offset-2.col-md-8.checkbox
%label
= f.check_box :tos_agreement
I agree to the
= succeed "." do
= link_to 'Terms of Service', "#{root_url}/policy/tos"
.form-group
.col-md-offset-2.col-md-8.checkbox
%label
= f.check_box :newsletter, :checked => true
Subscribe to the #{ENV['GROWSTUFF_SITE_NAME']} newsletter
.help-inline
= render :partial => 'devise/registrations/newsletter_blurb'
%div.actions
= f.submit 'Continue', :class => 'btn btn-primary'

View File

@@ -1,9 +1,9 @@
- content_for :title, @member.login_name
- content_for :subtitle, @member.location
- content_for :opengraph do
= tag("meta", property: "og:image", content: avatar_uri(@member, 200))
= tag("meta", property: "og:image:user_generated", content: "true")
= tag("meta", property: "og:title", content: @member.login_name)
= tag("meta", property: "og:image", content: avatar_uri(@member, 200))
= tag("meta", property: "og:image:user_generated", content: "true")
= tag("meta", property: "og:title", content: @member.login_name)
= tag("meta", property: "og:type", content: "profile")
= tag("meta", property: "og:url", content: request.original_url)
= tag("meta", property: "og:site_name", content: ENV['GROWSTUFF_SITE_NAME'])
@@ -37,4 +37,4 @@
= render :partial => "avatar", :locals => { :member => @member }
= render :partial => "account", :locals => { :member => @member }
= render :partial => "stats", :locals => { :member => @member }
= render :partial => "contact", :locals => { :member => @member, :twitter_auth => @twitter_auth, :flickr_auth => @flickr_auth }
= render :partial => "contact", :locals => { :member => @member, :twitter_auth => @twitter_auth, :flickr_auth => @flickr_auth, :facebook_auth => @facebook_auth }

View File

@@ -7,10 +7,10 @@
.row
.col-md-12
- @followers.each do |f|
.col-md-4.three-across
.thumbnail
.col-md-4.three-across
.thumbnail
= render :partial => "members/thumbnail", :locals => { :member => f }
%div.pagination
= page_entries_info @followers
= will_paginate @followers

View File

@@ -7,8 +7,8 @@
.row
.col-md-12
- @follows.each do |f|
.col-md-4.three-across
.thumbnail
.col-md-4.three-across
.thumbnail
= render :partial => "members/thumbnail", :locals => { :member => f }
%div.pagination

View File

@@ -2,7 +2,7 @@
%p Hello #{@member.login_name},
%p
%p
#{@request.requester.login_name} has requested a new crop on #{site_name}.
%ul

View File

@@ -1,6 +1,6 @@
-content_for :title, "#{ENV['GROWSTUFF_SITE_NAME']} community near #{@place}"
- content_for :opengraph do
= tag("meta", property: "og:title", content: "#{ENV['GROWSTUFF_SITE_NAME']} community near #{@place}")
= tag("meta", property: "og:title", content: "#{ENV['GROWSTUFF_SITE_NAME']} community near #{@place}")
= 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'])
@@ -34,7 +34,7 @@
#plantings
%h3= "Recent plantings near #{@place}"
- plantings = []
- @nearby_members.first(10).each do |member|

View File

@@ -1,6 +1,6 @@
- content_for :title, @plant_part.name.titlecase
- content_for :opengraph do
= tag("meta", property: "og:title", content: @plant_part.name.titlecase)
= tag("meta", property: "og:title", content: @plant_part.name.titlecase)
= 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'])

View File

@@ -13,7 +13,7 @@
%dd= link_to planting.garden.name, planting.garden
%dt Planted on:
%dd= planting.planted_at
%dt Quantity:
%dt Quantity:
%dd= "#{display_planting_quantity(planting)}"
%dt Finished on:
%dd= "#{display_finished(planting)}"

View File

@@ -1,4 +1,4 @@
- content_for :title, @owner ? t('.title.owner_plantings', owner: @owner) : @crop ? t('.title.crop_plantings', crop: @crop.name) : t('.title.default')
- content_for :title, @owner ? t('.title.owner_plantings', owner: @owner) : @crop ? t('.title.crop_plantings', crop: @crop.name) : t('.title.default')
- if @owner
= link_to "View #{@owner}'s profile >>", member_path(@owner)

View File

@@ -1,10 +1,10 @@
=content_for :title, "#{@planting.crop} in #{@planting.location}"
- content_for :opengraph do
- @planting.crop.photos.each do |photo|
= tag("meta", property: "og:image", content: photo.fullsize_url)
= tag("meta", property: "og:title", content: "#{@planting.crop} in #{@planting.location}")
= tag("meta", property: "og:image", content: photo.fullsize_url)
= tag("meta", property: "og:title", content: "#{@planting.crop} in #{@planting.location}")
- if @planting.description
= tag("meta", property: "og:description", content: @planting.description)
= tag("meta", property: "og:description", content: @planting.description)
= tag("meta", property: "og:type", content: "website")
= tag("meta", property: "og:url", content: request.original_url)
= tag("meta", property: "og:site_name", content: ENV['GROWSTUFF_SITE_NAME'])
@@ -31,11 +31,11 @@
%dt Quantity:
%dd
="#{display_planting_quantity(@planting)}"
- if !@planting.planted_from.blank?
%dt Planted from:
%dd= "#{display_planted_from(@planting)}"
%dt Sun or shade?
%dd
- sunniness = @planting.sunniness.blank? ? "not specified" : @planting.sunniness

View File

@@ -1,8 +1,8 @@
= content_for :title, @post.subject
- content_for :opengraph do
= tag("meta", property: "og:image", content: avatar_uri(@post.author, 200))
= tag("meta", property: "og:description", content: "#{strip_tags(@post.body).split(' ')[0..20].join(' ')}...")
= tag("meta", property: "og:title", content: @post.subject)
= tag("meta", property: "og:image", content: avatar_uri(@post.author, 200))
= tag("meta", property: "og:description", content: "#{strip_tags(@post.body).split(' ')[0..20].join(' ')}...")
= tag("meta", property: "og:title", content: @post.subject)
= tag("meta", property: "og:type", content: "article")
= tag("meta", property: "og:url", content: request.original_url)
= tag("meta", property: "og:site_name", content: ENV['GROWSTUFF_SITE_NAME'])
@@ -18,7 +18,7 @@
= link_to 'hundreds of different crops', crops_url
and a community from all around the world.
= render :partial => "shared/signin_signup",
= render :partial => "shared/signin_signup",
:locals => { :to => "or to start using #{ENV["GROWSTUFF_SITE_NAME"]} to track what you're planting and harvesting" }
= render :partial => "single", :locals => { :post => @post, :subject => false, :hide_comments => true }

View File

@@ -2,7 +2,7 @@
- @scientific_name.crop.photos.each do |photo|
= tag("meta", property: "og:image", content: photo.fullsize_url)
= tag("meta", property: "og:title", content: @scientific_name.scientific_name)
= tag("meta", property: "og:title", content: @scientific_name.scientific_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'])

View File

@@ -11,15 +11,15 @@
= link_to image_tag((seed.crop.default_photo ? seed.crop.default_photo.thumbnail_url : 'placeholder_150.png'), :alt => seed.crop.name, :class => 'img'), seed.crop
.col-md-8
%dl.dl-horizontal
%dt Crop :
%dt Crop :
%dd= link_to seed.crop.name, seed.crop
%dt Plant before :
%dt Plant before :
%dd= seed.plant_before
%dt Quantity :
%dt Quantity :
%dd= seed.quantity
%dt Will trade to :
%dt Will trade to :
%dd= seed.tradable_to
%dt From location :
%dt From location :
%dd= seed.owner.location
%dt Owner :
%dd= link_to seed.owner.login_name, seed.owner

View File

@@ -69,5 +69,9 @@
- if @seed.owner.location
%p
%small
View other seeds, members and more near
= link_to @seed.owner.location, place_path(@seed.owner.location, anchor: "seeds")
View other seeds, members to trade with and more near
= link_to @seed.owner.location, place_path(@seed.owner.location, anchor: "seeds")
%p
%small
Or
= 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 @seed.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"

View File

@@ -81,5 +81,3 @@
or
=link_to "sign up", new_member_registration_path
to purchase.

View File

View File

@@ -22,4 +22,3 @@ images_dir = "app/assets/images"
preferred_syntax = :sass
# and then run:
# sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass

View File

@@ -108,4 +108,4 @@ module Growstuff
config.active_record.raise_in_transactional_callbacks = true
end
end
end

View File

@@ -62,6 +62,10 @@ GROWSTUFF_PAYPAL_USERNAME: "dummy"
GROWSTUFF_PAYPAL_PASSWORD: "dummy"
GROWSTUFF_PAYPAL_SIGNATURE: "dummy"
# https://developers.facebook.com/
GROWSTUFF_FACEBOOK_KEY: ""
GROWSTUFF_FACEBOOK_SECRET: ""
# Elasticsearch is used for flexible search and it requires another component
# to be installed. To make it easy for people who don't need to test this feature
# it's been turned off for test and development environment as a default.

View File

@@ -31,7 +31,7 @@ Growstuff::Application.configure do
# Expands the lines which load the assets
config.assets.debug = true
# Asset digests allow you to set far-future HTTP expiration dates on all assets,
# Asset digests allow you to set far-future HTTP expiration dates on all assets,
# yet still be able to expire them through the digest params.
config.assets.digest = true
@@ -61,6 +61,7 @@ Growstuff::Application.configure do
# this config variable cannot be put in application.yml as it is needed
# by the assets pipeline, which doesn't have access to ENV.
config.mapbox_map_id = 'growstuff.i3n2il6a'
config.mapbox_access_token = 'pk.eyJ1IjoiZ3Jvd3N0dWZmIiwiYSI6IkdxMkx4alUifQ.n0igaBsw97s14zMa0lwKCA'
config.after_initialize do
ActiveMerchant::Billing::Base.mode = :test
@@ -74,4 +75,6 @@ Growstuff::Application.configure do
end
config.action_controller.action_on_unpermitted_parameters = :raise
config.active_job.queue_adapter = :sidekiq
end

View File

@@ -89,6 +89,7 @@ Growstuff::Application.configure do
# this config variable cannot be put in application.yml as it is needed
# by the assets pipeline, which doesn't have access to ENV.
config.mapbox_map_id = 'growstuff.i3n2c4ie'
config.mapbox_access_token = 'pk.eyJ1IjoiZ3Jvd3N0dWZmIiwiYSI6IkdxMkx4alUifQ.n0igaBsw97s14zMa0lwKCA'
config.after_initialize do
ActiveMerchant::Billing::Base.mode = :production
@@ -101,4 +102,5 @@ Growstuff::Application.configure do
::EXPRESS_GATEWAY = ActiveMerchant::Billing::PaypalExpressGateway.new(paypal_options)
end
config.active_job.queue_adapter = :sidekiq
end

View File

@@ -2,7 +2,7 @@ Growstuff::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
config.action_controller.action_on_unpermitted_parameters = :raise
# Eager load code on boot. This eager loads most of Rails and
# your application in memory, allowing both threaded web servers
# and those relying on copy on write to perform better.
@@ -87,6 +87,7 @@ Growstuff::Application.configure do
# this config variable cannot be put in application.yml as it is needed
# by the assets pipeline, which doesn't have access to ENV.
config.mapbox_map_id = 'growstuff.i3n2hao7'
config.mapbox_access_token = 'pk.eyJ1IjoiZ3Jvd3N0dWZmIiwiYSI6IkdxMkx4alUifQ.n0igaBsw97s14zMa0lwKCA'
config.after_initialize do
ActiveMerchant::Billing::Base.mode = :test
@@ -99,4 +100,5 @@ Growstuff::Application.configure do
::EXPRESS_GATEWAY = ActiveMerchant::Billing::PaypalExpressGateway.new(paypal_options)
end
config.active_job.queue_adapter = :sidekiq
end

View File

@@ -38,7 +38,7 @@ Growstuff::Application.configure do
# Raises error for missing translations
# config.action_view.raise_on_missing_translations = true
# Growstuff config
config.action_mailer.default_url_options = { host: 'localhost:8080' }
@@ -106,3 +106,20 @@ Geocoder::Lookup::Test.add_stub( "Tatooine", [])
Capybara.configure do |config|
config.always_include_port = true
end
OmniAuth.config.test_mode = true
# Fake the omniauth
OmniAuth.config.mock_auth[:facebook] = OmniAuth::AuthHash.new({
provider: 'facebook',
uid: '123545',
info: {
name: "John Testerson",
nickname: 'JohnnyT',
email: 'example.oauth.facebook@example.com',
image: 'http://findicons.com/files/icons/1072/face_avatars/300/i04.png'
},
credentials: {
token: "token",
secret: "donttell"
}
})

View File

@@ -231,4 +231,7 @@ Devise.setup do |config|
# When using omniauth, Devise cannot automatically set Omniauth path,
# so you need to do it manually. For the users scope, it would be:
# config.omniauth_path_prefix = "/my_engine/users/auth"
# Later we may wish to ask for user_photos,user_location, however this means we need to be reviewed by facebook
config.omniauth :facebook, ENV['GROWSTUFF_FACEBOOK_KEY'], ENV['GROWSTUFF_FACEBOOK_SECRET'], scope: 'email,public_profile', display: 'page', info_fields: 'email,name,first_name,last_name,id'
end

View File

@@ -13,4 +13,4 @@ Geocoder.configure(
# Reported as https://github.com/alexreisner/geocoder/issues/509
if Geocoder.config.lookup != :test
Geocoder.configure(lookup: :nominatim)
end
end

View File

@@ -0,0 +1,9 @@
# config/initializers/sidekiq.rb
Sidekiq.configure_server do |config|
config.redis = { url: 'redis://localhost:6379/0', namespace: "app3_sidekiq_#{Rails.env}" }
end
Sidekiq.configure_client do |config|
config.redis = { url: 'redis://localhost:6379/0', namespace: "app3_sidekiq_#{Rails.env}" }
end

View File

@@ -49,7 +49,7 @@ en:
seeds:
index:
title:
title:
default: "Everyone's seeds"
crop_seeds: "Everyone's %{crop} seeds"
owner_seeds: "%{owner} seeds"
@@ -62,7 +62,7 @@ en:
plantings:
index:
title:
title:
default: "Everyone's plantings"
crop_plantings: "Everyone's %{crop} plantings"
owner_plantings: "%{owner} plantings"
@@ -82,22 +82,22 @@ en:
owner_harvests: "%{owner} harvests"
places:
index:
title: "%{site_name} Community Map"
index:
title: "%{site_name} Community Map"
members:
index:
title: "%{site_name} members"
index:
title: "%{site_name} members"
posts:
index:
index:
title:
default: "Everyone's posts"
default: "Everyone's posts"
author_posts: "%{author} posts"
shop:
index:
title: "Shop"
title: "Shop"
forums:
index:
@@ -134,7 +134,6 @@ en:
open_data_title: "Open Data and APIs"
open_data_body_html: "We're building a database of crops, planting advice, seed sources, and other information that anyone can use for free, under a %{creative_commons_link}. You can use this data for research, to build apps, or for any purpose at all. Read more about our %{wiki_link} and %{api_docs_link}."
creative_commons_linktext: "Creative Commons license"
wiki_linktext: "open data"
api_docs_linktext: "API documentation"
get_involved_title: "Get Involved"
get_involved_body_html: "We believe in collaboration, and work closely with our members and the wider food-growing community. Our team includes volunteers from all walks of life and all skill levels. To get involved, visit %{talk_link} or find more information on the %{wiki_link}."

View File

@@ -1,5 +1,4 @@
ja:
home:
blurb:
blurb:
intro: "%{site_name}はガーデナーのコミュニティです。"

View File

@@ -6,7 +6,7 @@ common: &default_settings
# account. This key binds your Agent's data to your account in the
# New Relic service.
license_key: '<%= ENV["NEW_RELIC_LICENSE_KEY"] %>'
# Agent Enabled (Rails Only)
# Use this setting to force the agent to run or not run.
# Default is 'auto' which means the agent will install and run only
@@ -16,7 +16,7 @@ common: &default_settings
# Valid values are true, false and auto.
#
# agent_enabled: auto
# Application Name Set this to be the name of your application as
# you'd like it show up in New Relic. The service will then auto-map
# instances of your application into an "application" on your
@@ -31,12 +31,12 @@ common: &default_settings
# app_name:
# - Ajax Service
# - All Services
#
#
app_name: <%= ENV["NEW_RELIC_APP_NAME"] %>
# When "true", the agent collects performance data about your
# application and reports this data to the New Relic service at
# newrelic.com. This global switch is normally overridden for each
# When "true", the agent collects performance data about your
# application and reports this data to the New Relic service at
# newrelic.com. This global switch is normally overridden for each
# environment below. (formerly called 'enabled')
monitor_mode: true
@@ -54,7 +54,7 @@ common: &default_settings
# '/var/log/') The agent will attempt to create this directory if it
# does not exist.
# log_file_path: 'log'
# Optionally set the name of the log file, defaults to 'newrelic_agent.log'
# log_file_name: 'newrelic_agent.log'
@@ -77,28 +77,28 @@ common: &default_settings
# use a non-blocking lookup, so in a worst case, if you have DNS
# problems, your app may block indefinitely.
# verify_certificate: true
# Set your application's Apdex threshold value with the 'apdex_t'
# setting, in seconds. The apdex_t value determines the buckets used
# to compute your overall Apdex score.
# to compute your overall Apdex score.
# Requests that take less than apdex_t seconds to process will be
# classified as Satisfying transactions; more than apdex_t seconds
# as Tolerating transactions; and more than four times the apdex_t
# value as Frustrating transactions.
# value as Frustrating transactions.
# For more about the Apdex standard, see
# http://newrelic.com/docs/general/apdex
apdex_t: 0.5
#============================== Browser Monitoring ===============================
# New Relic Real User Monitoring gives you insight into the performance real users are
# experiencing with your website. This is accomplished by measuring the time it takes for
# your users' browsers to download and render your web pages by injecting a small amount
# of JavaScript code into the header and footer of each page.
# of JavaScript code into the header and footer of each page.
browser_monitoring:
# By default the agent automatically injects the monitoring JavaScript
# into web pages. Set this attribute to false to turn off this behavior.
auto_instrument: true
# By default the agent automatically injects the monitoring JavaScript
# into web pages. Set this attribute to false to turn off this behavior.
auto_instrument: true
# Proxy settings for connecting to the service.
#
@@ -110,14 +110,14 @@ common: &default_settings
# proxy_user:
# proxy_pass:
# Tells transaction tracer and error collector (when enabled)
# whether or not to capture HTTP params. When true, frameworks can
# exclude HTTP parameters from being captured.
# Rails: the RoR filter_parameter_logging excludes parameters
# Java: create a config setting called "ignored_params" and set it to
# a comma separated list of HTTP parameter names.
# ex: ignored_params: credit_card, ssn, password
# ex: ignored_params: credit_card, ssn, password
capture_params: false
@@ -126,12 +126,12 @@ common: &default_settings
# minute. Included in the transaction is the exact call sequence of
# the transactions including any SQL statements issued.
transaction_tracer:
# Transaction tracer is enabled by default. Set this to false to
# turn it off. This feature is only available at the Professional
# and above product levels.
enabled: true
# Threshold in seconds for when to collect a transaction
# trace. When the response time of a controller action exceeds
# this threshold, a transaction trace will be recorded and sent to
@@ -139,13 +139,13 @@ common: &default_settings
# "apdex_f", which will use the threshold for an dissatisfying
# Apdex controller action - four times the Apdex T value.
transaction_threshold: apdex_f
# When transaction tracer is on, SQL statements can optionally be
# recorded. The recorder has three modes, "off" which sends no
# SQL, "raw" which sends the SQL statement in its original form,
# and "obfuscated", which strips out numeric and string literals
record_sql: obfuscated
# Threshold in seconds for when to collect stack trace for a SQL
# call. In other words, when SQL statements exceed this threshold,
# then capture and send the current stack trace. This is
@@ -157,24 +157,24 @@ common: &default_settings
# set to false when using other adapters.
# explain_enabled: true
# Threshold for query execution time below which query plans will not
# Threshold for query execution time below which query plans will not
# not be captured. Relevant only when `explain_enabled` is true.
# explain_threshold: 0.5
# Error collector captures information about uncaught exceptions and
# sends them to the service for viewing
error_collector:
# Error collector is enabled by default. Set this to false to turn
# it off. This feature is only available at the Professional and above
# product levels
enabled: true
# Rails Only - tells error collector whether or not to capture a
# source snippet around the place of the error when errors are View
# Rails Only - tells error collector whether or not to capture a
# source snippet around the place of the error when errors are View
# related.
capture_source: true
capture_source: true
# To stop specific errors from reporting to New Relic, set this property
# to comma separated values. Default is to ignore routing errors
# which are how 404's get triggered.
@@ -185,7 +185,7 @@ common: &default_settings
# won't run. Useful when you are using the agent to monitor an
# external resource
# disable_samplers: true
# If you aren't interested in visibility in these areas, you can
# disable the instrumentation to reduce overhead.
#
@@ -199,8 +199,8 @@ common: &default_settings
# overhead slightly on every memcached call, and can have security
# implications if your memcached keys are sensitive
# capture_memcache_keys: true
# Certain types of instrumentation such as GC stats will not work if
# Certain types of instrumentation such as GC stats will not work if
# you are running multi-threaded. Please let us know.
# multi_threaded = false
@@ -216,19 +216,19 @@ common: &default_settings
development:
<<: *default_settings
# Turn off communication to New Relic service in development mode (also
# Turn off communication to New Relic service in development mode (also
# 'enabled').
# NOTE: for initial evaluation purposes, you may want to temporarily
# NOTE: for initial evaluation purposes, you may want to temporarily
# turn the agent on in development mode.
monitor_mode: false
# Rails Only - when running in Developer Mode, the New Relic Agent will
# Rails Only - when running in Developer Mode, the New Relic Agent will
# present performance information on the last 100 transactions you have
# executed since starting the mongrel.
# NOTE: There is substantial overhead when running in developer mode.
# Do not use for production or load testing.
# Do not use for production or load testing.
developer_mode: true
# Enable textmate links
# textmate: true

View File

@@ -4,10 +4,11 @@ Growstuff::Application.routes.draw do
resources :plant_parts
devise_for :members, controllers: { registrations: "registrations", passwords: "passwords", sessions: "sessions" }
devise_for :members, controllers: { registrations: "registrations", passwords: "passwords", sessions: "sessions", omniauth_callbacks: "omniauth_callbacks" }
devise_scope :member do
get '/members/unsubscribe/:message' => 'members#unsubscribe', :as => 'unsubscribe_member'
end
match '/members/:id/finish_signup' => 'members#finish_signup', via: [:get, :patch], :as => :finish_signup
resources :members

5
config/sidekiq.yml Normal file
View File

@@ -0,0 +1,5 @@
---
:concurrency: 1
:queues:
- default
- mailers

View File

@@ -1,5 +1,5 @@
class ChangePlantedAtToDate < ActiveRecord::Migration
def change
change_column :plantings, :planted_at, :date
end
end
end

View File

@@ -7,4 +7,4 @@ class AddCropsPostsTable < ActiveRecord::Migration
add_index :crops_posts, [:crop_id, :post_id]
add_index :crops_posts, :crop_id
end
end
end

View File

@@ -1,5 +1,5 @@
class ChangeFollowsMemberIdToFollowerId < ActiveRecord::Migration
def change
rename_column :follows, :member_id, :follower_id
rename_column :follows, :member_id, :follower_id
end
end

View File

@@ -1,14 +1,12 @@
class CreateCms < ActiveRecord::Migration
def self.up
text_limit = case ActiveRecord::Base.connection.adapter_name
when 'PostgreSQL'
{ }
else
{ limit: 16777215 }
end
# -- Sites --------------------------------------------------------------
create_table :comfy_cms_sites do |t|
t.string :label, null: false
@@ -20,7 +18,7 @@ class CreateCms < ActiveRecord::Migration
end
add_index :comfy_cms_sites, :hostname
add_index :comfy_cms_sites, :is_mirrored
# -- Layouts ------------------------------------------------------------
create_table :comfy_cms_layouts do |t|
t.integer :site_id, null: false
@@ -37,7 +35,7 @@ class CreateCms < ActiveRecord::Migration
end
add_index :comfy_cms_layouts, [:parent_id, :position]
add_index :comfy_cms_layouts, [:site_id, :identifier], unique: true
# -- Pages --------------------------------------------------------------
create_table :comfy_cms_pages do |t|
t.integer :site_id, null: false
@@ -56,7 +54,7 @@ class CreateCms < ActiveRecord::Migration
end
add_index :comfy_cms_pages, [:site_id, :full_path]
add_index :comfy_cms_pages, [:parent_id, :position]
# -- Page Blocks --------------------------------------------------------
create_table :comfy_cms_blocks do |t|
t.string :identifier, null: false
@@ -66,7 +64,7 @@ class CreateCms < ActiveRecord::Migration
end
add_index :comfy_cms_blocks, [:identifier]
add_index :comfy_cms_blocks, [:blockable_id, :blockable_type]
# -- Snippets -----------------------------------------------------------
create_table :comfy_cms_snippets do |t|
t.integer :site_id, null: false
@@ -79,7 +77,7 @@ class CreateCms < ActiveRecord::Migration
end
add_index :comfy_cms_snippets, [:site_id, :identifier], unique: true
add_index :comfy_cms_snippets, [:site_id, :position]
# -- Files --------------------------------------------------------------
create_table :comfy_cms_files do |t|
t.integer :site_id, null: false
@@ -96,7 +94,7 @@ class CreateCms < ActiveRecord::Migration
add_index :comfy_cms_files, [:site_id, :file_file_name]
add_index :comfy_cms_files, [:site_id, :position]
add_index :comfy_cms_files, [:site_id, :block_id]
# -- Revisions -----------------------------------------------------------
create_table :comfy_cms_revisions, force: true do |t|
t.string :record_type, null: false
@@ -106,7 +104,7 @@ class CreateCms < ActiveRecord::Migration
end
add_index :comfy_cms_revisions, [:record_type, :record_id, :created_at],
name: 'index_cms_revisions_on_rtype_and_rid_and_created_at'
# -- Categories ---------------------------------------------------------
create_table :comfy_cms_categories, force: true do |t|
t.integer :site_id, null: false
@@ -115,7 +113,7 @@ class CreateCms < ActiveRecord::Migration
end
add_index :comfy_cms_categories, [:site_id, :categorized_type, :label], unique: true,
name: 'index_cms_categories_on_site_id_and_cat_type_and_label'
create_table :comfy_cms_categorizations, force: true do |t|
t.integer :category_id, null: false
t.string :categorized_type, null: false
@@ -124,7 +122,7 @@ class CreateCms < ActiveRecord::Migration
add_index :comfy_cms_categorizations, [:category_id, :categorized_type, :categorized_id], unique: true,
name: 'index_cms_categorizations_on_cat_id_and_catd_type_and_catd_id'
end
def self.down
drop_table :comfy_cms_sites
drop_table :comfy_cms_layouts
@@ -137,4 +135,3 @@ class CreateCms < ActiveRecord::Migration
drop_table :comfy_cms_categorizations
end
end

View File

@@ -89,7 +89,7 @@ def load_test_users
row = CSV.parse(suburb_file.readline)
suburb,country,state,latitude,longitude = row[0]
# Using 'update_column' method instead of 'update' so that
# Using 'update_column' method instead of 'update' so that
# it avoids accessing Geocoding service for faster processing
@user.gardens.first.update_columns(location: suburb, latitude: latitude, longitude: longitude)
@user.update_columns(location: suburb, latitude: latitude, longitude: longitude)

View File

@@ -205,7 +205,7 @@ summer savory,https://en.wikipedia.org/wiki/Summer_savory,,Satureja hortensis
sunflowers,https://en.wikipedia.org/wiki/Sunflower,,Helianthus annuus
sweet potato,https://en.wikipedia.org/wiki/Sweet_potato,,Ipomoea batatas
Swiss chard,https://en.wikipedia.org/wiki/Swiss_chard,,Beta vulgaris var. cicla
tamarillo,https://en.wikipedia.org/wiki/Tamarillo,,Solanum betaceum
tamarillo,https://en.wikipedia.org/wiki/Tamarillo,,Solanum betaceum
tamarind,https://en.wikipedia.org/wiki/Tamarind,,Tamarindus indica
tangerine,https://en.wikipedia.org/wiki/Tangerine,,Citrus tangerina
tansy,https://en.wikipedia.org/wiki/Tansy,,Tanacetum vulgare
1 achiote https://en.wikipedia.org/wiki/Bixa_orellana Bixa orellana
205 sunflowers https://en.wikipedia.org/wiki/Sunflower Helianthus annuus
206 sweet potato https://en.wikipedia.org/wiki/Sweet_potato Ipomoea batatas
207 Swiss chard https://en.wikipedia.org/wiki/Swiss_chard Beta vulgaris var. cicla
208 tamarillo https://en.wikipedia.org/wiki/Tamarillo Solanum betaceum Solanum betaceum
209 tamarind https://en.wikipedia.org/wiki/Tamarind Tamarindus indica
210 tangerine https://en.wikipedia.org/wiki/Tangerine Citrus tangerina
211 tansy https://en.wikipedia.org/wiki/Tansy Tanacetum vulgare

View File

@@ -0,0 +1,76 @@
class Growstuff::OauthSignupAction
#
# Inspects the omniauth information
# and determines if we have an existing member
# (to add authentication to)
# or if this is a new signup
#
# As a side affect, this method sets the @member_created
# variable
#
def find_or_create_from_authorization(auth)
member ||= Member.where(email: auth.info.email).first_or_create do |m|
m.email = auth.info.email
m.password = Devise.friendly_token[0,20]
# First, try the nickname or friendly generate from the email
m.login_name = auth.info.nickname || auth.info.email.split("@").first.gsub(/[^A-Za-z]+/, '_').underscore
# Do we have a collision with an existing account? Generate a 20 character long random name
# so the user can update it later
m.login_name = Devise.friendly_token[0,20] if Member.where(login_name: m.login_name).any?
m.preferred_avatar_uri = auth.info.image # assuming the user model has an image
m.skip_confirmation!
@member_created = true
end
member.save!
member
end
#
# For a given auth hash (from omniauth), and a specified member
# See if:
# - The member already has this authentication or
# - We need to create it
#
def establish_authentication(auth, member)
name = determine_name(auth)
authentication = member.authentications
.create_with(
name: name,
token: auth['credentials']['token'],
secret: auth['credentials']['secret'],
)
.find_or_create_by(
provider: auth['provider'],
uid: auth['uid'],
name: name,
member_id: member.id
)
authentication
end
def member_created?
@member_created
end
def determine_name(auth)
name = ''
case auth['provider']
when 'twitter'
name = auth['info']['nickname']
when 'flickr', 'facebook'
name = auth['info']['name']
else
name = auth['info']['name']
end
name
end
end

View File

@@ -4,18 +4,24 @@ namespace :growstuff do
# usage: rake growstuff:admin_user name=skud
task admin_user: :environment do
member = Member.find_by_login_name(ENV['name']) or raise "Usage: rake growstuff:admin_user name=whoever (login name is case-sensitive)"
admin = Role.find('admin')
member.roles << admin
add_role_to_member! ENV['name'], 'admin'
end
desc "Add a crop wrangler user, by name"
# usage: rake growstuff:cropwrangler_user name=skud
task cropwrangler_user: :environment do
member = Member.find_by_login_name(ENV['name']) or raise "Usage: rake growstuff:cropwrangler_user name=whoever (login name is case-sensitive)"
cw = Role.find('crop-wrangler')
member.roles << cw
add_role_to_member! ENV['name'], 'crop-wrangler'
end
def add_role_to_member!(login_name, role_name)
unless login_name && role_name
raise "Usage: rake growstuff:[rolename] name=[username] "\
"\n (login name is case-sensitive)\n"
end
member = Member.find_by!(login_name: login_name)
role = Role.find_by!(name: role_name)
member.roles << role
end
desc "Upload crops from a CSV file"
@@ -49,7 +55,7 @@ namespace :growstuff do
if Date.today.cwday == send_on_day and Date.today.cweek % every_n_weeks == 0
Member.confirmed.find_each do |m|
Notifier.planting_reminder(m).deliver_now!
Notifier.planting_reminder(m).deliver_later!
end
end
end
@@ -103,31 +109,31 @@ namespace :growstuff do
is_paid: false,
is_permanent_paid: false
)
@paid_account = AccountType.find_or_create_by(
@paid_account = AccountType.find_or_create_by(
name: "Paid",
is_paid: true,
is_permanent_paid: false
)
@seed_account = AccountType.find_or_create_by(
@seed_account = AccountType.find_or_create_by(
name: "Seed",
is_paid: true,
is_permanent_paid: true
)
@staff_account = AccountType.find_or_create_by(
@staff_account = AccountType.find_or_create_by(
name: "Staff",
is_paid: true,
is_permanent_paid: true
)
puts "Adding products..."
Product.find_or_create_by(
Product.find_or_create_by(
name: "Annual subscription",
description: "An annual subscription gives you access to paid account features for one year. Does not auto-renew.",
min_price: 3000,
account_type_id: @paid_account.id,
paid_months: 12
)
Product.find_or_create_by(
Product.find_or_create_by(
name: "Seed account",
description: "A seed account helps Growstuff grow in its early days. It gives you all the features of a paid account, in perpetuity. This account type never expires.",
min_price: 15000,

View File

@@ -28,11 +28,10 @@ Please set it using
end
end
if !system("grep #{author} CONTRIBUTORS.md") then
unless system('grep', '-i', author, 'CONTRIBUTORS.md') then
abort %{
Thanks for your contribution, #{author}!
Please add your name and GitHub handle to the file CONTRIBUTORS.md,
commit it, and update your PR.
}
end

View File

@@ -1,13 +1,13 @@
## DEPRECATION NOTICE: Do not add new tests to this file!
##
## View and controller tests are deprecated in the Growstuff project.
## We no longer write new view and controller tests, but instead write
## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara).
## These test the full stack, behaving as a browser, and require less complicated setup
## to run. Please feel free to delete old view/controller tests as they are reimplemented
## in feature tests.
## View and controller tests are deprecated in the Growstuff project.
## We no longer write new view and controller tests, but instead write
## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara).
## These test the full stack, behaving as a browser, and require less complicated setup
## to run. Please feel free to delete old view/controller tests as they are reimplemented
## in feature tests.
##
## If you submit a pull request containing new view or controller tests, it will not be
## If you submit a pull request containing new view or controller tests, it will not be
## merged.

View File

@@ -1,13 +1,13 @@
## DEPRECATION NOTICE: Do not add new tests to this file!
##
## View and controller tests are deprecated in the Growstuff project.
## We no longer write new view and controller tests, but instead write
## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara).
## These test the full stack, behaving as a browser, and require less complicated setup
## to run. Please feel free to delete old view/controller tests as they are reimplemented
## in feature tests.
## View and controller tests are deprecated in the Growstuff project.
## We no longer write new view and controller tests, but instead write
## feature tests (in spec/features) using Capybara (https://github.com/jnicklas/capybara).
## These test the full stack, behaving as a browser, and require less complicated setup
## to run. Please feel free to delete old view/controller tests as they are reimplemented
## in feature tests.
##
## If you submit a pull request containing new view or controller tests, it will not be
## If you submit a pull request containing new view or controller tests, it will not be
## merged.

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