mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-05-27 18:28:31 -04:00
Compare commits
374 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
436527b902 | ||
|
|
260b16da11 | ||
|
|
cf0a646699 | ||
|
|
12ad16a05a | ||
|
|
d525afb07c | ||
|
|
3ff3ffa457 | ||
|
|
e3c689ba6b | ||
|
|
82553d6e0a | ||
|
|
3644a8124f | ||
|
|
5cfa051d75 | ||
|
|
69fb98146b | ||
|
|
01b9e76814 | ||
|
|
594e3470b4 | ||
|
|
7bb7a18b66 | ||
|
|
de4b89fdf7 | ||
|
|
e8d7ed0c2d | ||
|
|
a3ad9189b1 | ||
|
|
da588b7fdb | ||
|
|
a7f9e113d6 | ||
|
|
c3a883de16 | ||
|
|
aa2a761a58 | ||
|
|
a800630b01 | ||
|
|
b69bb219a3 | ||
|
|
a9330f2d77 | ||
|
|
de8bcc38d3 | ||
|
|
99a3be08eb | ||
|
|
d9f04d1fa9 | ||
|
|
1791ed5b01 | ||
|
|
683ec9dd9d | ||
|
|
90e9017a19 | ||
|
|
9f3cb7ee8b | ||
|
|
df952a1779 | ||
|
|
3748f954c5 | ||
|
|
dcbacddb58 | ||
|
|
4e7e82c8a8 | ||
|
|
66bb130a1a | ||
|
|
03ae327e30 | ||
|
|
c1fde41f1f | ||
|
|
a10f6e4783 | ||
|
|
a76d2a3eb0 | ||
|
|
049886459a | ||
|
|
b57cb581dd | ||
|
|
f23cb78dcb | ||
|
|
bfffaab77f | ||
|
|
32af1b28a8 | ||
|
|
9fa72fa5f7 | ||
|
|
e35b15c868 | ||
|
|
22e0e8fba0 | ||
|
|
8caea57c47 | ||
|
|
24dd02a439 | ||
|
|
45c8092a94 | ||
|
|
48829dba3c | ||
|
|
46ee2168e1 | ||
|
|
5dd52ba17f | ||
|
|
78a65f26c6 | ||
|
|
83929cc8ee | ||
|
|
a49f359f9e | ||
|
|
be87d2861a | ||
|
|
481ca79cc1 | ||
|
|
346979c640 | ||
|
|
ec891fc0b2 | ||
|
|
ef6dd88b1e | ||
|
|
5884718fd0 | ||
|
|
0c315981df | ||
|
|
342323e566 | ||
|
|
d7582625c5 | ||
|
|
1cb4181ffc | ||
|
|
9e7a80cb86 | ||
|
|
a8924f95a7 | ||
|
|
7afd38a1ee | ||
|
|
1908f670d9 | ||
|
|
7ef1eb5852 | ||
|
|
f36e9d726e | ||
|
|
0adb24fa4d | ||
|
|
aacf7b1f09 | ||
|
|
b74d89c482 | ||
|
|
3e8f017ad0 | ||
|
|
2e45857e1f | ||
|
|
b8b511e747 | ||
|
|
85f7ca4058 | ||
|
|
ff779b6679 | ||
|
|
f357916779 | ||
|
|
1c4d740217 | ||
|
|
fbb442dfee | ||
|
|
631747e919 | ||
|
|
ff00b2c985 | ||
|
|
a0cdf3a8b2 | ||
|
|
c87a5f2d6b | ||
|
|
53ed4f5b24 | ||
|
|
3300c303be | ||
|
|
e84aaeb56d | ||
|
|
cad361ed7a | ||
|
|
1187719e7b | ||
|
|
859cf7f215 | ||
|
|
6d97a060c3 | ||
|
|
fc04dde1e8 | ||
|
|
e3c52b1a56 | ||
|
|
3258a6754c | ||
|
|
db876ff107 | ||
|
|
b87194336f | ||
|
|
0e98f84da7 | ||
|
|
b9ce3d4fe6 | ||
|
|
d65ab59d35 | ||
|
|
65e0752376 | ||
|
|
3251dd1c54 | ||
|
|
c404d8220d | ||
|
|
48409698ab | ||
|
|
4d7c4f38ae | ||
|
|
c2e4686a23 | ||
|
|
24df32ba7f | ||
|
|
744caef4f2 | ||
|
|
5cac8743f8 | ||
|
|
9c4d83dad3 | ||
|
|
fd3e69c9ab | ||
|
|
b6dfeb980c | ||
|
|
e784ec9b33 | ||
|
|
1df0c36e72 | ||
|
|
a5e7a8d315 | ||
|
|
cafd49c143 | ||
|
|
7c7c66348c | ||
|
|
00ae4ed49f | ||
|
|
12a1484a26 | ||
|
|
5bacdb71cc | ||
|
|
6565e79057 | ||
|
|
f4e53a58de | ||
|
|
97cf1347d5 | ||
|
|
367e298d48 | ||
|
|
e765387e22 | ||
|
|
7b30c4237b | ||
|
|
b788cb44ef | ||
|
|
f61e2438e8 | ||
|
|
e503b1079d | ||
|
|
ccca343959 | ||
|
|
63de10efd4 | ||
|
|
17c5fd61a3 | ||
|
|
44b8500fa8 | ||
|
|
5a12b47c7c | ||
|
|
3db13785a1 | ||
|
|
69d94f7deb | ||
|
|
1ec188c793 | ||
|
|
438b2444df | ||
|
|
de981689fc | ||
|
|
0681fac406 | ||
|
|
9682300b85 | ||
|
|
6f95f1fecf | ||
|
|
43fe29f113 | ||
|
|
fa50ff47bb | ||
|
|
5b19d236d0 | ||
|
|
cad2c90a4f | ||
|
|
919c25ca67 | ||
|
|
29f3cc3238 | ||
|
|
bc9a025788 | ||
|
|
a593aa2a4b | ||
|
|
de63fdc952 | ||
|
|
e7d2ae2c40 | ||
|
|
1019834c41 | ||
|
|
362f7a78b1 | ||
|
|
a2eb568eac | ||
|
|
9d62c012f1 | ||
|
|
cbb50df8d0 | ||
|
|
91a128ae7e | ||
|
|
d9dd797c33 | ||
|
|
f970fc4db2 | ||
|
|
8873986562 | ||
|
|
40b5a47aae | ||
|
|
f29c0ad085 | ||
|
|
96b0198d41 | ||
|
|
48649d1986 | ||
|
|
9e2e93b544 | ||
|
|
1f0f55dc81 | ||
|
|
e3738ca0c6 | ||
|
|
b0d4f9c731 | ||
|
|
83b54365ba | ||
|
|
5a33b2b754 | ||
|
|
69cb87fd0f | ||
|
|
bc058b9152 | ||
|
|
efd6328436 | ||
|
|
19adabc55f | ||
|
|
ccde5b230b | ||
|
|
33f28d1727 | ||
|
|
aa3cf729c8 | ||
|
|
611adc0728 | ||
|
|
a97acfb1ca | ||
|
|
7e03ef1687 | ||
|
|
c12791e428 | ||
|
|
bbe7d967b4 | ||
|
|
f5336bd8f8 | ||
|
|
5a35a3da01 | ||
|
|
fad9eddbc4 | ||
|
|
044f62eae2 | ||
|
|
4786e3e087 | ||
|
|
715a004b13 | ||
|
|
96a007ef3b | ||
|
|
a03d044049 | ||
|
|
9a6c32fe6d | ||
|
|
fc33269f47 | ||
|
|
a80001ffe7 | ||
|
|
30032f5527 | ||
|
|
fa8b10af58 | ||
|
|
9c469fb217 | ||
|
|
6b944e145e | ||
|
|
7748c40ccf | ||
|
|
745281545a | ||
|
|
7b3aefacd3 | ||
|
|
134465d023 | ||
|
|
a581b759a3 | ||
|
|
734b57e395 | ||
|
|
12d151b68c | ||
|
|
472acd0e81 | ||
|
|
7f88b167b4 | ||
|
|
897eac4fae | ||
|
|
41ab646b20 | ||
|
|
8c017b24e0 | ||
|
|
12e3351c77 | ||
|
|
85e4708b71 | ||
|
|
0816b6b114 | ||
|
|
91b5c3e798 | ||
|
|
fc1dc0e4c3 | ||
|
|
9e7957709d | ||
|
|
492bdd915f | ||
|
|
07c976b1fc | ||
|
|
2faada7f14 | ||
|
|
133a67a8f2 | ||
|
|
16dd1e5183 | ||
|
|
4193e38034 | ||
|
|
9eaaa8856f | ||
|
|
3ea9f2b5f2 | ||
|
|
723329ac49 | ||
|
|
89424b931b | ||
|
|
9f3d3b2b8f | ||
|
|
80c1e1bf23 | ||
|
|
01e676678c | ||
|
|
43d7c36fc5 | ||
|
|
6a6f83c6a4 | ||
|
|
f73bb81eb6 | ||
|
|
0407df880b | ||
|
|
20219e23dc | ||
|
|
49bbbeb431 | ||
|
|
82bc07ccd0 | ||
|
|
212651a279 | ||
|
|
1568f4b7d8 | ||
|
|
b7706d0064 | ||
|
|
3a232e1d08 | ||
|
|
a27d273978 | ||
|
|
4e7b0cf698 | ||
|
|
28ac7ff886 | ||
|
|
fa0cb55789 | ||
|
|
42ffc49d74 | ||
|
|
d4d210447a | ||
|
|
7232f4614c | ||
|
|
b9a29115a2 | ||
|
|
23dbfea05a | ||
|
|
3259291eea | ||
|
|
0d0042dba8 | ||
|
|
edcbc939e3 | ||
|
|
c568498941 | ||
|
|
c6c8492528 | ||
|
|
3420f18fb9 | ||
|
|
377a54e692 | ||
|
|
8c1d88b663 | ||
|
|
c746c6d6d7 | ||
|
|
7607daa83a | ||
|
|
f11c1b3d54 | ||
|
|
fc44e87fb9 | ||
|
|
ccc63381a6 | ||
|
|
9b64f5fec1 | ||
|
|
e138b3e8ab | ||
|
|
92db75b3d8 | ||
|
|
755a60447f | ||
|
|
b599818512 | ||
|
|
0a2d0d499c | ||
|
|
e638acd2de | ||
|
|
8d5367be9a | ||
|
|
516274b2b7 | ||
|
|
f13a66391c | ||
|
|
b01385a1e4 | ||
|
|
4ca4d6b030 | ||
|
|
3181c97a2a | ||
|
|
372a7f080d | ||
|
|
29a8628c42 | ||
|
|
6d81ef198c | ||
|
|
e94cbcef02 | ||
|
|
9304e44c08 | ||
|
|
3a9077050e | ||
|
|
64cf71ab4f | ||
|
|
3fb9283ca7 | ||
|
|
a73d492062 | ||
|
|
2528d8af8a | ||
|
|
10cb6c18aa | ||
|
|
34e61082b9 | ||
|
|
b868364e96 | ||
|
|
45c0adb044 | ||
|
|
6c72345d26 | ||
|
|
4648464fb5 | ||
|
|
429e54733d | ||
|
|
daa8717807 | ||
|
|
44b260b1e8 | ||
|
|
9bd7448ae6 | ||
|
|
bb88041fef | ||
|
|
87f1c6c26d | ||
|
|
0e2a5fd205 | ||
|
|
5bb04dc1a4 | ||
|
|
7cedd98b71 | ||
|
|
2209d65aa6 | ||
|
|
ba906868d8 | ||
|
|
4cb3444dcd | ||
|
|
60df62f3fa | ||
|
|
e3a620a109 | ||
|
|
3476d58642 | ||
|
|
a7feac3740 | ||
|
|
ad5730a81c | ||
|
|
e35ebab380 | ||
|
|
3b42806b77 | ||
|
|
c5fbda0223 | ||
|
|
38dbdc8307 | ||
|
|
f830ed1cf2 | ||
|
|
66402e5471 | ||
|
|
8410b6db1e | ||
|
|
aef4800ad3 | ||
|
|
a3b9c50fea | ||
|
|
add275e772 | ||
|
|
9a2818baa9 | ||
|
|
c47a1bc361 | ||
|
|
e04f78d42d | ||
|
|
8ce7c25374 | ||
|
|
c1ab161b89 | ||
|
|
0d55b54371 | ||
|
|
46ac06698a | ||
|
|
81ce6ed8a3 | ||
|
|
0f8d1e7db1 | ||
|
|
507e5a0ebc | ||
|
|
76608a981c | ||
|
|
81d2f9829e | ||
|
|
b7d7f6896e | ||
|
|
88e8e3a59e | ||
|
|
d95bd0e063 | ||
|
|
0c80a00f31 | ||
|
|
1fe9a7d5e0 | ||
|
|
bfb4053bb4 | ||
|
|
2aad8a0ed0 | ||
|
|
7c1cce40b2 | ||
|
|
c253c86787 | ||
|
|
59d823ff8b | ||
|
|
c8903ba25f | ||
|
|
3a5cf37dc0 | ||
|
|
8631b1fc99 | ||
|
|
0c6b6e0e0e | ||
|
|
9f33f497bc | ||
|
|
ad6c1ba2dc | ||
|
|
674d78721d | ||
|
|
3a1bd78252 | ||
|
|
b9b2f4a57e | ||
|
|
e4e9b63e4d | ||
|
|
40adc379ae | ||
|
|
2d73dd2869 | ||
|
|
2abe6d7d12 | ||
|
|
8990e803a0 | ||
|
|
375f647e2d | ||
|
|
0f52ea5aad | ||
|
|
2740b5e47b | ||
|
|
3894127f5c | ||
|
|
17ccea4b28 | ||
|
|
da95581099 | ||
|
|
9e146cde18 | ||
|
|
9b195d1d2e | ||
|
|
eb76db93e4 | ||
|
|
6f80102f79 | ||
|
|
90ca5ec13b | ||
|
|
95974ab21b | ||
|
|
7a064c0667 | ||
|
|
1c9081e788 | ||
|
|
9bcd2d0aa6 | ||
|
|
36a9514add | ||
|
|
6d1385f00c |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -13,3 +13,5 @@ Pathogen:
|
||||
custom_plan.rb
|
||||
zeus.json
|
||||
.bundle
|
||||
config/application.yml
|
||||
.idea/**
|
||||
@@ -1 +1 @@
|
||||
2.1.5
|
||||
2.1.8
|
||||
|
||||
@@ -9,7 +9,7 @@ env:
|
||||
secure: "Z5TpM2jEX4UCvNePnk/LwltQX48U2u9BRc+Iypr1x9QW2o228QJhPIOH39a8RMUrepGnkQIq9q3ZRUn98RfrJz1yThtlNFL3NmzdQ57gKgjGwfpa0e4Dwj/ZJqV2D84tDGjvdVYLP7zzaYZxQcwk/cgNpzKf/jq97HLNP7CYuf4="
|
||||
bundler_args: "--without development production staging"
|
||||
rvm:
|
||||
- 2.1.5
|
||||
- 2.1.8
|
||||
before_script:
|
||||
- psql -c 'create database growstuff_test;' -U postgres
|
||||
script:
|
||||
|
||||
@@ -12,6 +12,7 @@ submit the change with your pull request.
|
||||
- Cesy / [cesy](https://github.com/cesy)
|
||||
- Miles Gould / [pozorvlak](https://github.com/pozorvlak)
|
||||
- Taylor Griffin / [tygriffin](https://github.com/tygriffin)
|
||||
- Mackenzie Morgan / [maco](https://github.com/maco)
|
||||
|
||||
## Contributors
|
||||
|
||||
@@ -23,7 +24,6 @@ submit the change with your pull request.
|
||||
- Maia Sauren / [sauramaia](https://github.com/sauramaia)
|
||||
- Norman Ancajas / [nbancajas](https://github.com/nbancajas)
|
||||
- Jonathan "Duke" Leto / [leto](https://github.com/leto)
|
||||
- Mackenzie Morgan / [maco](https://github.com/maco)
|
||||
- Amy Hendrix / [sabreuse](https://github.com/sabreuse)
|
||||
- CephLPod / [cephLpod](https://github.com/cephLpod/)
|
||||
- Gemma Mason / [gemmaellen](https://github.com/gemmaellen)
|
||||
@@ -54,4 +54,15 @@ submit the change with your pull request.
|
||||
- Rocky Jaiswal / [rocky-jaiswal](https://github.com/rocky-jaiswal)
|
||||
- Robert Landreaux / [robertlandreaux](https://github.com/robertlandreaux)
|
||||
- Savant Krishna / [sksavant](https://github.com/sksavant)
|
||||
|
||||
- Jake Yesbeck / [yez](https://github.com/yez)
|
||||
- Mauricio Gonzalez / [mauricio-gonzalez](https://github.com/mauricio-gonzalez)
|
||||
- Andrey Bazhutkin / [andrba](https://github.com/andrba)
|
||||
- Gabriel Sandoval / [gabrielsandoval](https://github.com/gabrielsandoval)
|
||||
- Cjay Billones / [CjayBillones](https://github.com/CjayBillones)
|
||||
- Katy Ereira / [maccath](https://github.com/maccath)
|
||||
- Gabrielle DeWitt / [gabrielle27](https://github.com/gabrielle27)
|
||||
- Manmeet Singh / [manmeetsingh](https://github.com/manmeetsingh)
|
||||
- Jym Paul Carandang / [jacarandang](https://github.com/jacarandang)
|
||||
- Anthony Atkinson / [sha1sum](https://github.com/sha1sum)
|
||||
- Terence Conquest / [twconquest](https://github.com/twconquest)
|
||||
- Daniel O'Connor / [CloCkWeRX](https://github.com/CloCkWeRX)
|
||||
|
||||
20
Gemfile
20
Gemfile
@@ -1,8 +1,8 @@
|
||||
source 'https://rubygems.org'
|
||||
|
||||
ruby '2.1.5'
|
||||
ruby '2.1.8'
|
||||
|
||||
gem 'rails', '4.1.9'
|
||||
gem 'rails', '~> 4.1.11'
|
||||
|
||||
gem 'bundler', '>=1.1.5'
|
||||
|
||||
@@ -16,7 +16,7 @@ gem 'less-rails', '~> 2.5.0'
|
||||
# CSS framework
|
||||
gem 'less-rails-bootstrap', '~> 3.2.0'
|
||||
|
||||
gem 'uglifier', '~> 2.5.3' # JavaScript compressor
|
||||
gem 'uglifier', '~> 2.7.2' # JavaScript compressor
|
||||
|
||||
gem 'jquery-rails'
|
||||
gem 'jquery-ui-rails', '~> 5.0.2'
|
||||
@@ -35,6 +35,9 @@ gem 'ruby-units' # for unit conversion
|
||||
|
||||
gem 'comfortable_mexican_sofa', '~> 1.12.0' # content management system
|
||||
|
||||
gem 'kaminari' # pagination
|
||||
gem 'bootstrap-kaminari-views' # bootstrap views for kaminari
|
||||
|
||||
# vendored activemerchant for testing- needed for bogus paypal
|
||||
# gateway monkeypatch
|
||||
gem 'activemerchant', '1.33.0',
|
||||
@@ -58,7 +61,7 @@ gem 'bluecloth'
|
||||
gem 'will_paginate', '~> 3.0'
|
||||
|
||||
# user signup/login/etc
|
||||
gem 'devise', '~> 3.4.1'
|
||||
gem 'devise', '~> 3.5.0'
|
||||
|
||||
# nicely formatted URLs
|
||||
gem 'friendly_id', '~> 5.0.4'
|
||||
@@ -104,21 +107,24 @@ group :development do
|
||||
gem 'binding_of_caller'
|
||||
gem 'letter_opener'
|
||||
gem 'quiet_assets'
|
||||
gem 'guard'
|
||||
gem 'guard-rspec'
|
||||
end
|
||||
|
||||
group :development, :test do
|
||||
gem 'haml-rails' # HTML templating language
|
||||
gem 'rspec-rails', '~> 3.1.0' # unit testing framework
|
||||
gem 'rspec-rails', '~> 3.4.0' # unit testing framework
|
||||
gem 'rspec-activemodel-mocks'
|
||||
gem 'byebug' # debugging
|
||||
gem 'database_cleaner', '~> 1.3.0'
|
||||
gem 'database_cleaner', '~> 1.5.0'
|
||||
gem 'webrat' # provides HTML matchers for view tests
|
||||
gem 'factory_girl_rails', '~> 4.5.0' # for creating test data
|
||||
gem 'coveralls', require: false # coverage analysis
|
||||
gem 'capybara' # integration tests
|
||||
gem 'capybara-email' # integration tests for email
|
||||
gem 'poltergeist', '~> 1.5.1' # for headless JS testing
|
||||
gem 'poltergeist', '~> 1.6' # for headless JS testing
|
||||
gem 'i18n-tasks' # adds tests for finding missing and unused translations
|
||||
gem 'selenium-webdriver'
|
||||
end
|
||||
|
||||
group :travis do
|
||||
|
||||
220
Gemfile.lock
220
Gemfile.lock
@@ -20,29 +20,29 @@ PATH
|
||||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
actionmailer (4.1.9)
|
||||
actionpack (= 4.1.9)
|
||||
actionview (= 4.1.9)
|
||||
actionmailer (4.1.15)
|
||||
actionpack (= 4.1.15)
|
||||
actionview (= 4.1.15)
|
||||
mail (~> 2.5, >= 2.5.4)
|
||||
actionpack (4.1.9)
|
||||
actionview (= 4.1.9)
|
||||
activesupport (= 4.1.9)
|
||||
actionpack (4.1.15)
|
||||
actionview (= 4.1.15)
|
||||
activesupport (= 4.1.15)
|
||||
rack (~> 1.5.2)
|
||||
rack-test (~> 0.6.2)
|
||||
actionview (4.1.9)
|
||||
activesupport (= 4.1.9)
|
||||
actionview (4.1.15)
|
||||
activesupport (= 4.1.15)
|
||||
builder (~> 3.1)
|
||||
erubis (~> 2.7.0)
|
||||
active_link_to (1.0.2)
|
||||
actionpack
|
||||
activemodel (4.1.9)
|
||||
activesupport (= 4.1.9)
|
||||
activemodel (4.1.15)
|
||||
activesupport (= 4.1.15)
|
||||
builder (~> 3.1)
|
||||
activerecord (4.1.9)
|
||||
activemodel (= 4.1.9)
|
||||
activesupport (= 4.1.9)
|
||||
activerecord (4.1.15)
|
||||
activemodel (= 4.1.15)
|
||||
activesupport (= 4.1.15)
|
||||
arel (~> 5.0.0)
|
||||
activesupport (4.1.9)
|
||||
activesupport (4.1.15)
|
||||
i18n (~> 0.6, >= 0.6.9)
|
||||
json (~> 1.7, >= 1.7.7)
|
||||
minitest (~> 5.1)
|
||||
@@ -53,7 +53,7 @@ GEM
|
||||
autoprefixer-rails (5.1.1)
|
||||
execjs
|
||||
json
|
||||
bcrypt (3.1.9)
|
||||
bcrypt (3.1.11)
|
||||
better_errors (2.0.0)
|
||||
coderay (>= 1.0.0)
|
||||
erubis (>= 2.6.6)
|
||||
@@ -64,6 +64,9 @@ GEM
|
||||
bonsai-elasticsearch-rails (0.0.4)
|
||||
bootstrap-datepicker-rails (1.3.0.2)
|
||||
railties (>= 3.0)
|
||||
bootstrap-kaminari-views (0.0.5)
|
||||
kaminari (>= 0.13)
|
||||
rails (>= 3.1)
|
||||
bootstrap-sass (3.3.3)
|
||||
autoprefixer-rails (>= 5.0.0.1)
|
||||
sass (>= 3.2.19)
|
||||
@@ -83,10 +86,12 @@ GEM
|
||||
capybara-email (2.4.0)
|
||||
capybara (~> 2.4)
|
||||
mail
|
||||
childprocess (0.5.6)
|
||||
ffi (~> 1.0, >= 1.0.11)
|
||||
climate_control (0.0.3)
|
||||
activesupport (>= 3.0)
|
||||
cliver (0.3.2)
|
||||
cocaine (0.5.5)
|
||||
cocaine (0.5.7)
|
||||
climate_control (>= 0.0.3, < 1.0)
|
||||
codemirror-rails (4.8)
|
||||
railties (>= 3.0, < 5)
|
||||
@@ -124,10 +129,10 @@ GEM
|
||||
csv_shaper (1.1.1)
|
||||
activesupport (>= 3.0.0)
|
||||
dalli (2.7.2)
|
||||
database_cleaner (1.3.0)
|
||||
database_cleaner (1.5.0)
|
||||
debug_inspector (0.0.2)
|
||||
debugger-linecache (1.2.0)
|
||||
devise (3.4.1)
|
||||
devise (3.5.6)
|
||||
bcrypt (~> 3.0)
|
||||
orm_adapter (~> 0.1)
|
||||
railties (>= 3.2.6, < 5)
|
||||
@@ -136,6 +141,8 @@ GEM
|
||||
warden (~> 1.2.3)
|
||||
diff-lcs (1.2.5)
|
||||
docile (1.1.5)
|
||||
domain_name (0.5.24)
|
||||
unf (>= 0.0.5, < 1.0.0)
|
||||
easy_translate (0.5.0)
|
||||
json
|
||||
thread
|
||||
@@ -155,7 +162,7 @@ GEM
|
||||
multi_json
|
||||
erubis (2.7.0)
|
||||
excon (0.43.0)
|
||||
execjs (2.2.2)
|
||||
execjs (2.6.0)
|
||||
factory_girl (4.5.0)
|
||||
activesupport (>= 3.0.0)
|
||||
factory_girl_rails (4.5.0)
|
||||
@@ -163,9 +170,11 @@ GEM
|
||||
railties (>= 3.0.0)
|
||||
faraday (0.9.1)
|
||||
multipart-post (>= 1.2, < 3)
|
||||
ffi (1.9.10)
|
||||
figaro (1.0.0)
|
||||
thor (~> 0.14)
|
||||
flickraw (0.9.8)
|
||||
formatador (0.2.5)
|
||||
friendly_id (5.0.4)
|
||||
activerecord (>= 4.0.0)
|
||||
gibbon (1.1.4)
|
||||
@@ -174,6 +183,20 @@ GEM
|
||||
gravatar-ultimate (2.0.0)
|
||||
activesupport (>= 2.3.14)
|
||||
rack
|
||||
guard (2.12.8)
|
||||
formatador (>= 0.2.4)
|
||||
listen (>= 2.7, <= 4.0)
|
||||
lumberjack (~> 1.0)
|
||||
nenv (~> 0.1)
|
||||
notiffany (~> 0.0)
|
||||
pry (>= 0.9.12)
|
||||
shellany (~> 0.0)
|
||||
thor (>= 0.18.1)
|
||||
guard-compat (1.2.1)
|
||||
guard-rspec (4.6.2)
|
||||
guard (~> 2.1)
|
||||
guard-compat (~> 1.1)
|
||||
rspec (>= 2.99.0, < 4.0)
|
||||
haml (4.1.0.beta.1)
|
||||
tilt
|
||||
haml-rails (0.6.0)
|
||||
@@ -194,6 +217,8 @@ GEM
|
||||
haml (>= 4.0.0.rc.1)
|
||||
hpricot (~> 0.8.6)
|
||||
ruby_parser (~> 3.1.1)
|
||||
http-cookie (1.0.2)
|
||||
domain_name (~> 0.5)
|
||||
httparty (0.13.3)
|
||||
json (~> 1.8)
|
||||
multi_xml (>= 0.5.2)
|
||||
@@ -207,7 +232,7 @@ GEM
|
||||
slop (>= 3.5.0)
|
||||
term-ansicolor
|
||||
terminal-table
|
||||
jquery-rails (3.1.2)
|
||||
jquery-rails (3.1.3)
|
||||
railties (>= 3.0, < 5.0)
|
||||
thor (>= 0.14, < 2.0)
|
||||
jquery-ui-rails (5.0.3)
|
||||
@@ -215,7 +240,10 @@ GEM
|
||||
js-routes (0.9.9)
|
||||
railties (>= 3.2)
|
||||
sprockets-rails
|
||||
json (1.8.2)
|
||||
json (1.8.3)
|
||||
kaminari (0.16.3)
|
||||
actionpack (>= 3.0.0)
|
||||
activesupport (>= 3.0.0)
|
||||
kgio (2.9.2)
|
||||
kramdown (1.5.0)
|
||||
launchy (2.4.3)
|
||||
@@ -233,20 +261,29 @@ GEM
|
||||
letter_opener (1.3.0)
|
||||
launchy (~> 2.2)
|
||||
libv8 (3.16.14.7)
|
||||
mail (2.6.3)
|
||||
mime-types (>= 1.16, < 3)
|
||||
listen (3.0.2)
|
||||
rb-fsevent (>= 0.9.3)
|
||||
rb-inotify (>= 0.9)
|
||||
lumberjack (1.0.9)
|
||||
mail (2.6.4)
|
||||
mime-types (>= 1.16, < 4)
|
||||
memcachier (0.0.2)
|
||||
method_source (0.8.2)
|
||||
mime-types (2.4.3)
|
||||
mini_portile (0.6.1)
|
||||
minitest (5.5.1)
|
||||
multi_json (1.10.1)
|
||||
mime-types (2.99.1)
|
||||
mimemagic (0.3.0)
|
||||
mini_portile2 (2.0.0)
|
||||
minitest (5.8.4)
|
||||
multi_json (1.11.2)
|
||||
multi_xml (0.5.5)
|
||||
multipart-post (2.0.0)
|
||||
netrc (0.10.0)
|
||||
nenv (0.2.0)
|
||||
netrc (0.10.3)
|
||||
newrelic_rpm (3.9.8.273)
|
||||
nokogiri (1.6.5)
|
||||
mini_portile (~> 0.6.0)
|
||||
nokogiri (1.6.7.2)
|
||||
mini_portile2 (~> 2.0.0.rc2)
|
||||
notiffany (0.0.6)
|
||||
nenv (~> 0.1)
|
||||
shellany (~> 0.0)
|
||||
oauth (0.4.7)
|
||||
omniauth (1.2.2)
|
||||
hashie (>= 1.2, < 4)
|
||||
@@ -260,15 +297,16 @@ GEM
|
||||
multi_json (~> 1.3)
|
||||
omniauth-oauth (~> 1.0)
|
||||
orm_adapter (0.5.0)
|
||||
paperclip (4.2.1)
|
||||
activemodel (>= 3.0.0)
|
||||
activesupport (>= 3.0.0)
|
||||
cocaine (~> 0.5.3)
|
||||
paperclip (4.3.0)
|
||||
activemodel (>= 3.2.0)
|
||||
activesupport (>= 3.2.0)
|
||||
cocaine (~> 0.5.5)
|
||||
mime-types
|
||||
mimemagic (= 0.3.0)
|
||||
pg (0.17.1)
|
||||
plupload-rails (1.2.1)
|
||||
rails (>= 3.1)
|
||||
poltergeist (1.5.1)
|
||||
poltergeist (1.6.0)
|
||||
capybara (~> 2.1)
|
||||
cliver (~> 0.3.1)
|
||||
multi_json (~> 1.0)
|
||||
@@ -279,18 +317,18 @@ GEM
|
||||
slop (~> 3.4)
|
||||
quiet_assets (1.1.0)
|
||||
railties (>= 3.1, < 5.0)
|
||||
rack (1.5.2)
|
||||
rack (1.5.5)
|
||||
rack-test (0.6.3)
|
||||
rack (>= 1.0)
|
||||
rails (4.1.9)
|
||||
actionmailer (= 4.1.9)
|
||||
actionpack (= 4.1.9)
|
||||
actionview (= 4.1.9)
|
||||
activemodel (= 4.1.9)
|
||||
activerecord (= 4.1.9)
|
||||
activesupport (= 4.1.9)
|
||||
rails (4.1.15)
|
||||
actionmailer (= 4.1.15)
|
||||
actionpack (= 4.1.15)
|
||||
actionview (= 4.1.15)
|
||||
activemodel (= 4.1.15)
|
||||
activerecord (= 4.1.15)
|
||||
activesupport (= 4.1.15)
|
||||
bundler (>= 1.3.0, < 2.0)
|
||||
railties (= 4.1.9)
|
||||
railties (= 4.1.15)
|
||||
sprockets-rails (~> 2.0)
|
||||
rails-i18n (4.0.3)
|
||||
i18n (~> 0.6)
|
||||
@@ -300,61 +338,77 @@ GEM
|
||||
rails_stdout_logging
|
||||
rails_serve_static_assets (0.0.2)
|
||||
rails_stdout_logging (0.0.3)
|
||||
railties (4.1.9)
|
||||
actionpack (= 4.1.9)
|
||||
activesupport (= 4.1.9)
|
||||
railties (4.1.15)
|
||||
actionpack (= 4.1.15)
|
||||
activesupport (= 4.1.15)
|
||||
rake (>= 0.8.7)
|
||||
thor (>= 0.18.1, < 2.0)
|
||||
raindrops (0.13.0)
|
||||
rake (10.4.2)
|
||||
rake (11.1.2)
|
||||
rb-fsevent (0.9.5)
|
||||
rb-inotify (0.9.5)
|
||||
ffi (>= 0.5.0)
|
||||
ref (1.0.5)
|
||||
responders (1.1.2)
|
||||
railties (>= 3.2, < 4.2)
|
||||
rest-client (1.7.2)
|
||||
rest-client (1.8.0)
|
||||
http-cookie (>= 1.0.2, < 2.0)
|
||||
mime-types (>= 1.16, < 3.0)
|
||||
netrc (~> 0.7)
|
||||
rspec (3.4.0)
|
||||
rspec-core (~> 3.4.0)
|
||||
rspec-expectations (~> 3.4.0)
|
||||
rspec-mocks (~> 3.4.0)
|
||||
rspec-activemodel-mocks (1.0.1)
|
||||
activemodel (>= 3.0)
|
||||
activesupport (>= 3.0)
|
||||
rspec-mocks (>= 2.99, < 4.0)
|
||||
rspec-core (3.1.7)
|
||||
rspec-support (~> 3.1.0)
|
||||
rspec-expectations (3.1.2)
|
||||
rspec-core (3.4.4)
|
||||
rspec-support (~> 3.4.0)
|
||||
rspec-expectations (3.4.0)
|
||||
diff-lcs (>= 1.2.0, < 2.0)
|
||||
rspec-support (~> 3.1.0)
|
||||
rspec-mocks (3.1.3)
|
||||
rspec-support (~> 3.1.0)
|
||||
rspec-rails (3.1.0)
|
||||
actionpack (>= 3.0)
|
||||
activesupport (>= 3.0)
|
||||
railties (>= 3.0)
|
||||
rspec-core (~> 3.1.0)
|
||||
rspec-expectations (~> 3.1.0)
|
||||
rspec-mocks (~> 3.1.0)
|
||||
rspec-support (~> 3.1.0)
|
||||
rspec-support (3.1.2)
|
||||
rspec-support (~> 3.4.0)
|
||||
rspec-mocks (3.4.1)
|
||||
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 (1.4.5)
|
||||
ruby_parser (3.1.3)
|
||||
sexp_processor (~> 4.1)
|
||||
rubyzip (1.1.7)
|
||||
sass (3.2.19)
|
||||
sass-rails (4.0.5)
|
||||
railties (>= 4.0.0, < 5.0)
|
||||
sass (~> 3.2.2)
|
||||
sprockets (~> 2.8, < 3.0)
|
||||
sprockets-rails (~> 2.0)
|
||||
selenium-webdriver (2.47.1)
|
||||
childprocess (~> 0.5)
|
||||
multi_json (~> 1.0)
|
||||
rubyzip (~> 1.0)
|
||||
websocket (~> 1.0)
|
||||
sexp_processor (4.4.4)
|
||||
shellany (0.0.1)
|
||||
simplecov (0.9.1)
|
||||
docile (~> 1.1.0)
|
||||
multi_json (~> 1.0)
|
||||
simplecov-html (~> 0.8.0)
|
||||
simplecov-html (0.8.0)
|
||||
slop (3.6.0)
|
||||
sprockets (2.12.3)
|
||||
sprockets (2.12.4)
|
||||
hike (~> 1.2)
|
||||
multi_json (~> 1.0)
|
||||
rack (~> 1.0)
|
||||
tilt (~> 1.1, != 1.3.0)
|
||||
sprockets-rails (2.2.2)
|
||||
sprockets-rails (2.3.3)
|
||||
actionpack (>= 3.0)
|
||||
activesupport (>= 3.0)
|
||||
sprockets (>= 2.8, < 4.0)
|
||||
@@ -366,27 +420,31 @@ GEM
|
||||
ref
|
||||
thor (0.19.1)
|
||||
thread (0.1.4)
|
||||
thread_safe (0.3.4)
|
||||
thread_safe (0.3.5)
|
||||
tilt (1.4.1)
|
||||
tins (1.3.3)
|
||||
tzinfo (1.2.2)
|
||||
thread_safe (~> 0.1)
|
||||
uglifier (2.5.3)
|
||||
uglifier (2.7.2)
|
||||
execjs (>= 0.3.0)
|
||||
json (>= 1.8.0)
|
||||
unf (0.1.4)
|
||||
unf_ext
|
||||
unf_ext (0.0.7.1)
|
||||
unicorn (4.8.3)
|
||||
kgio (~> 2.6)
|
||||
rack
|
||||
raindrops (~> 0.7)
|
||||
warden (1.2.3)
|
||||
warden (1.2.6)
|
||||
rack (>= 1.0)
|
||||
webrat (0.7.3)
|
||||
nokogiri (>= 1.2.0)
|
||||
rack (>= 1.0)
|
||||
rack-test (>= 0.5.3)
|
||||
websocket-driver (0.5.0)
|
||||
websocket (1.2.2)
|
||||
websocket-driver (0.5.4)
|
||||
websocket-extensions (>= 0.1.0)
|
||||
websocket-extensions (0.1.0)
|
||||
websocket-extensions (0.1.2)
|
||||
will_paginate (3.0.7)
|
||||
xpath (2.0.0)
|
||||
nokogiri (~> 1.3)
|
||||
@@ -402,6 +460,7 @@ DEPENDENCIES
|
||||
bluecloth
|
||||
bonsai-elasticsearch-rails
|
||||
bootstrap-datepicker-rails
|
||||
bootstrap-kaminari-views
|
||||
bundler (>= 1.1.5)
|
||||
byebug
|
||||
cancancan (~> 1.9)
|
||||
@@ -412,8 +471,8 @@ DEPENDENCIES
|
||||
coveralls
|
||||
csv_shaper
|
||||
dalli
|
||||
database_cleaner (~> 1.3.0)
|
||||
devise (~> 3.4.1)
|
||||
database_cleaner (~> 1.5.0)
|
||||
devise (~> 3.5.0)
|
||||
elasticsearch-model
|
||||
elasticsearch-rails
|
||||
factory_girl_rails (~> 4.5.0)
|
||||
@@ -423,6 +482,8 @@ DEPENDENCIES
|
||||
geocoder!
|
||||
gibbon
|
||||
gravatar-ultimate
|
||||
guard
|
||||
guard-rspec
|
||||
haml
|
||||
haml-rails
|
||||
heroku-api
|
||||
@@ -430,6 +491,7 @@ DEPENDENCIES
|
||||
jquery-rails
|
||||
jquery-ui-rails (~> 5.0.2)
|
||||
js-routes
|
||||
kaminari
|
||||
leaflet-markercluster-rails
|
||||
leaflet-rails
|
||||
less (~> 2.5.0)
|
||||
@@ -443,18 +505,22 @@ DEPENDENCIES
|
||||
omniauth-flickr (>= 0.0.15)
|
||||
omniauth-twitter
|
||||
pg
|
||||
poltergeist (~> 1.5.1)
|
||||
poltergeist (~> 1.6)
|
||||
pry
|
||||
quiet_assets
|
||||
rails (= 4.1.9)
|
||||
rails (~> 4.1.11)
|
||||
rails_12factor
|
||||
rake (>= 10.0.0)
|
||||
rspec-activemodel-mocks
|
||||
rspec-rails (~> 3.1.0)
|
||||
rspec-rails (~> 3.4.0)
|
||||
ruby-units
|
||||
sass-rails (~> 4.0.4)
|
||||
selenium-webdriver
|
||||
therubyracer (~> 0.12)
|
||||
uglifier (~> 2.5.3)
|
||||
uglifier (~> 2.7.2)
|
||||
unicorn
|
||||
webrat
|
||||
will_paginate (~> 3.0)
|
||||
|
||||
BUNDLED WITH
|
||||
1.11.2
|
||||
|
||||
13
Guardfile
Normal file
13
Guardfile
Normal file
@@ -0,0 +1,13 @@
|
||||
guard :rspec,
|
||||
cmd: 'bundle exec rspec --format documentation',
|
||||
failed_mode: :keep do
|
||||
watch(%r{^spec/.+_spec\.rb$})
|
||||
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/libs/#{m[1]}_spec.rb" }
|
||||
watch('spec/spec_helper.rb') { "spec" }
|
||||
|
||||
# Rails example
|
||||
watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
|
||||
watch(%r{^app/(.*)(\.erb|\.haml|\.slim)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
|
||||
watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
|
||||
watch('config/routes.rb') { "spec/routing" }
|
||||
end
|
||||
BIN
app/assets/images/sunniness_not specified.png
Normal file
BIN
app/assets/images/sunniness_not specified.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
BIN
app/assets/images/sunniness_semi-shade.png
Normal file
BIN
app/assets/images/sunniness_semi-shade.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
BIN
app/assets/images/sunniness_shade.png
Normal file
BIN
app/assets/images/sunniness_shade.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.3 KiB |
BIN
app/assets/images/sunniness_sun.png
Normal file
BIN
app/assets/images/sunniness_sun.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.8 KiB |
@@ -47,3 +47,7 @@ function showCropMap(cropmap) {
|
||||
|
||||
cropmap.addLayer(markers);
|
||||
}
|
||||
|
||||
$('.btn.toggle.crop-hierarchy').click(function () {
|
||||
$('.toggle.crop-hierarchy').toggleClass('hide');
|
||||
});
|
||||
|
||||
@@ -9,11 +9,11 @@ jQuery ->
|
||||
finished = $('#planting_finished_at')
|
||||
if @checked
|
||||
if previousValue.length
|
||||
date = previousValue
|
||||
date = previousValue
|
||||
finished.val(date)
|
||||
else
|
||||
finished.trigger('focus')
|
||||
else
|
||||
previousValue = finished.val()
|
||||
finished.val('')
|
||||
)
|
||||
)
|
||||
|
||||
@@ -4,3 +4,42 @@
|
||||
|
||||
jQuery ->
|
||||
$('.add-datepicker').datepicker('format' : 'yyyy-mm-dd')
|
||||
$('#add-sci_name-row').css("display", "inline-block")
|
||||
$('#remove-sci_name-row').css("display", "inline-block")
|
||||
$("#add-alt_name-row").css("display", "inline-block")
|
||||
$("#remove-alt_name-row").css("display", "inline-block")
|
||||
|
||||
$ ->
|
||||
sci_template = "<div id='sci_template[INDEX]' class='template col-md-12'><div class='col-md-2'><label>Scientific name INDEX:</label></div><div class='col-md-8'><input name='sci_name[INDEX]' class='form-control', id='sci_name[INDEX]')'></input><span class='help-block'>Scientific name of crop.</span></div><div class='col-md-2'></div></div>"
|
||||
|
||||
sci_index = $('#scientific_names .template').length + 1
|
||||
|
||||
$('#add-sci_name-row').click ->
|
||||
compiled_input = $(sci_template.split("INDEX").join(sci_index))
|
||||
$('#scientific_names').append(compiled_input)
|
||||
sci_index = sci_index + 1
|
||||
|
||||
$('#remove-sci_name-row').click ->
|
||||
if (sci_index > 2)
|
||||
sci_index = sci_index - 1
|
||||
tmp = 'sci_template[' + sci_index + ']'
|
||||
element = document.getElementById(tmp)
|
||||
element.remove()
|
||||
|
||||
alt_template = "<div id='alt_template[INDEX]' class='template col-md-12'><div class='col-md-2'><label>Alternate name INDEX:</label></div><div class='col-md-8'><input name='alt_name[INDEX]' class='form-control', id='alt_name[INDEX]')'></input><span class='help-block'>Alternate name of crop.</span></div><div class='col-md-2'></div></div>"
|
||||
|
||||
alt_index = $('#alternate_names .template').length + 1
|
||||
|
||||
$('#add-alt_name-row').click ->
|
||||
compiled_input = $(alt_template.split("INDEX").join(alt_index))
|
||||
$('#alternate_names').append(compiled_input)
|
||||
alt_index = alt_index + 1
|
||||
|
||||
$('#remove-alt_name-row').click ->
|
||||
if (alt_index > 2)
|
||||
alt_index = alt_index - 1
|
||||
tmp = 'alt_template[' + alt_index + ']'
|
||||
element = document.getElementById(tmp)
|
||||
console.log("%s",tmp)
|
||||
element.remove()
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
.leaflet-popup-content-wrapper, .leaflet-popup-tip {
|
||||
border: none;
|
||||
}
|
||||
.thumbnail{
|
||||
background: #fff !important;
|
||||
border: solid 1px whitesmoke;
|
||||
}
|
||||
.thumbnail .crop-thumbnail .cropinfo{
|
||||
padding-top: 14px;
|
||||
}
|
||||
|
||||
@@ -97,12 +97,25 @@ p.stats {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.homepage-members {
|
||||
height: 100px;
|
||||
.member-cards {
|
||||
display: flex;
|
||||
flex: none;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.member-thumbnail {
|
||||
padding: .25em;
|
||||
|
||||
.homepage-members:nth-child(odd) {
|
||||
margin-left: 0px;
|
||||
div {
|
||||
width: 5em;
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
div ~ div {
|
||||
width: 15em;
|
||||
padding-left: 1em;
|
||||
}
|
||||
}
|
||||
|
||||
#placesmap, #cropmap {
|
||||
@@ -316,3 +329,32 @@ html, body {
|
||||
* from ours */
|
||||
@state-success-text: darken(@green, 10%);
|
||||
@state-success-bg: lighten(@green, 50%);
|
||||
|
||||
.hide {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#add-sci_name-row, #remove-sci_name-row, #add-alt_name-row, #remove-alt_name-row{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.panel-footer{
|
||||
height: 6em;
|
||||
}
|
||||
|
||||
#gardens_panel_body{
|
||||
height: 20em;
|
||||
}
|
||||
|
||||
.form-group.required .control-label:before {
|
||||
content: "* ";
|
||||
color: red;
|
||||
}
|
||||
|
||||
.margin-bottom {
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
|
||||
.red {
|
||||
color: red;
|
||||
}
|
||||
|
||||
@@ -22,6 +22,10 @@ class ApplicationController < ActionController::Base
|
||||
stored_location_for(:member) || root_path
|
||||
end
|
||||
|
||||
def after_sign_out_path_for(resource_or_scope)
|
||||
request.referrer
|
||||
end
|
||||
|
||||
# tweak CanCan defaults because we don't have a "current_user" method
|
||||
# this means that we use current_user in specs but current_member everywhere
|
||||
# else in the code.
|
||||
@@ -33,7 +37,7 @@ class ApplicationController < ActionController::Base
|
||||
rescue_from CanCan::AccessDenied do |exception|
|
||||
redirect_to request.referer || root_url, :alert => exception.message
|
||||
end
|
||||
|
||||
|
||||
def set_locale
|
||||
I18n.locale = params[:locale] || extract_locale_from_subdomain || I18n.default_locale
|
||||
end
|
||||
@@ -48,7 +52,7 @@ class ApplicationController < ActionController::Base
|
||||
protected
|
||||
|
||||
def configure_permitted_parameters
|
||||
devise_parameter_sanitizer.for(:sign_up) do |member|
|
||||
devise_parameter_sanitizer.for(:sign_up) do |member|
|
||||
member.permit(:login_name, :email, :password, :password_confirmation,
|
||||
:remember_me, :login,
|
||||
# terms of service
|
||||
|
||||
@@ -94,9 +94,9 @@ class CropsController < ApplicationController
|
||||
# GET /crops/new.json
|
||||
def new
|
||||
@crop = Crop.new
|
||||
3.times do
|
||||
@crop.scientific_names.build
|
||||
end
|
||||
@crop.alternate_names.build
|
||||
@crop.scientific_names.build
|
||||
|
||||
respond_to do |format|
|
||||
format.html # new.html.haml
|
||||
format.json { render json: @crop }
|
||||
@@ -106,15 +106,15 @@ class CropsController < ApplicationController
|
||||
# GET /crops/1/edit
|
||||
def edit
|
||||
@crop = Crop.find(params[:id])
|
||||
@crop.alternate_names.build if @crop.alternate_names.blank?
|
||||
@crop.scientific_names.build if @crop.scientific_names.blank?
|
||||
|
||||
(3 - @crop.scientific_names.length).times do
|
||||
@crop.scientific_names.build
|
||||
end
|
||||
end
|
||||
|
||||
# POST /crops
|
||||
# POST /crops.json
|
||||
def create
|
||||
|
||||
@crop = Crop.new(crop_params)
|
||||
|
||||
if current_member.has_role? :crop_wrangler
|
||||
@@ -128,6 +128,12 @@ class CropsController < ApplicationController
|
||||
|
||||
respond_to do |format|
|
||||
if @crop.save
|
||||
params[:alt_name].each do |index, value|
|
||||
@crop.alternate_names.create(name: value, creator_id: current_member.id)
|
||||
end
|
||||
params[:sci_name].each do |index, value|
|
||||
@crop.scientific_names.create(scientific_name: value, creator_id: current_member.id)
|
||||
end
|
||||
unless current_member.has_role? :crop_wrangler
|
||||
Role.crop_wranglers.each do |w|
|
||||
Notifier.new_crop_request(w, @crop).deliver!
|
||||
@@ -154,6 +160,23 @@ class CropsController < ApplicationController
|
||||
|
||||
respond_to do |format|
|
||||
if @crop.update(crop_params)
|
||||
if !params[:alt_name].nil?
|
||||
@crop.alternate_names.each do |alt_name|
|
||||
alt_name.destroy
|
||||
end
|
||||
|
||||
params[:alt_name].each do |index, value|
|
||||
alt_name = @crop.alternate_names.create(name: value, creator_id: current_member.id)
|
||||
end
|
||||
|
||||
@crop.scientific_names.each do |sci_name|
|
||||
sci_name.destroy
|
||||
end
|
||||
params[:sci_name].each do |index, value|
|
||||
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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
class MembersController < ApplicationController
|
||||
load_and_authorize_resource
|
||||
|
||||
skip_authorize_resource :only => :nearby
|
||||
skip_authorize_resource :only => [:nearby, :unsubscribe]
|
||||
|
||||
after_action :expire_cache_fragments, :only => :create
|
||||
|
||||
@@ -49,6 +49,27 @@ class MembersController < ApplicationController
|
||||
@followers = @member.followers.paginate(:page => params[:page])
|
||||
end
|
||||
|
||||
EMAIL_TYPE_STRING = {
|
||||
send_notification_email: "direct message notifications",
|
||||
send_planting_reminder: "planting reminders"
|
||||
}
|
||||
|
||||
def unsubscribe
|
||||
begin
|
||||
verifier = ActiveSupport::MessageVerifier.new(ENV['RAILS_SECRET_TOKEN'])
|
||||
decrypted_message = verifier.verify(params[:message])
|
||||
|
||||
@member = Member.find(decrypted_message[:member_id])
|
||||
@type = decrypted_message[:type]
|
||||
@member.update(@type => false)
|
||||
|
||||
flash.now[:notice] = "You have been unsubscribed from #{EMAIL_TYPE_STRING[@type]} emails."
|
||||
|
||||
rescue ActiveSupport::MessageVerifier::InvalidSignature
|
||||
flash.now[:alert] = "We're sorry, there was an error updating your settings."
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def expire_cache_fragments
|
||||
|
||||
@@ -5,7 +5,7 @@ class NotificationsController < ApplicationController
|
||||
|
||||
# GET /notifications
|
||||
def index
|
||||
@notifications = Notification.where(recipient_id: current_member)
|
||||
@notifications = Notification.where(recipient_id: current_member).page(params[:page])
|
||||
|
||||
respond_to do |format|
|
||||
format.html # index.html.erb
|
||||
@@ -36,6 +36,21 @@ class NotificationsController < ApplicationController
|
||||
end
|
||||
end
|
||||
|
||||
# GET /notifications/1/reply
|
||||
def reply
|
||||
@notification = Notification.new
|
||||
@sender_notification = Notification.find(params[:id])
|
||||
@recipient = @sender_notification.sender
|
||||
@subject = @sender_notification.subject =~ /^Re: / ?
|
||||
@sender_notification.subject :
|
||||
"Re: " + @sender_notification.subject
|
||||
|
||||
|
||||
respond_to do |format|
|
||||
format.html # reply.html.haml
|
||||
end
|
||||
end
|
||||
|
||||
# DELETE /notifications/1
|
||||
def destroy
|
||||
@notification = Notification.find(params[:id])
|
||||
|
||||
@@ -124,7 +124,8 @@ class PhotosController < ApplicationController
|
||||
def destroy
|
||||
@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 }
|
||||
|
||||
@@ -21,9 +21,17 @@ class PlacesController < ApplicationController
|
||||
end
|
||||
|
||||
def search
|
||||
respond_to do |format|
|
||||
format.html do
|
||||
redirect_to place_path(params[:new_place])
|
||||
if params[:new_place].empty?
|
||||
respond_to do |format|
|
||||
format.html do
|
||||
redirect_to places_path, alert: 'Please enter a valid location'
|
||||
end
|
||||
end
|
||||
else
|
||||
respond_to do |format|
|
||||
format.html do
|
||||
redirect_to place_path(params[:new_place])
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -20,7 +20,7 @@ class PlantingsController < ApplicationController
|
||||
format.json { render json: @plantings }
|
||||
format.rss { render :layout => false } #index.rss.builder
|
||||
format.csv do
|
||||
specifics = (@owner ? "#{@owner.name}-" : @crop ? "#{@crop.name}-" : nil)
|
||||
specifics = (@owner ? "#{@owner.login_name}-" : @crop ? "#{@crop.name}-" : nil)
|
||||
@filename = "Growstuff-#{specifics}Plantings-#{Time.zone.now.to_s(:number)}.csv"
|
||||
render :csv => @plantings
|
||||
end
|
||||
@@ -71,6 +71,7 @@ class PlantingsController < ApplicationController
|
||||
|
||||
respond_to do |format|
|
||||
if @planting.save
|
||||
@planting.update_attribute(:days_before_maturity, update_days_before_maturity(@planting, planting_params[:crop_id]))
|
||||
format.html { redirect_to @planting, notice: 'Planting was successfully created.' }
|
||||
format.json { render json: @planting, status: :created, location: @planting }
|
||||
expire_fragment("homepage_stats")
|
||||
@@ -89,6 +90,7 @@ class PlantingsController < ApplicationController
|
||||
|
||||
respond_to do |format|
|
||||
if @planting.update(planting_params)
|
||||
@planting.update_attribute(:days_before_maturity, update_days_before_maturity(@planting, planting_params[:crop_id]))
|
||||
format.html { redirect_to @planting, notice: 'Planting was successfully updated.' }
|
||||
format.json { head :no_content }
|
||||
else
|
||||
@@ -119,4 +121,12 @@ class PlantingsController < ApplicationController
|
||||
:quantity, :sunniness, :planted_from, :owner_id, :finished,
|
||||
:finished_at)
|
||||
end
|
||||
|
||||
def update_days_before_maturity(planting, crop_id)
|
||||
if planting.finished_at.nil?
|
||||
planting.calculate_days_before_maturity(planting, crop_id)
|
||||
else
|
||||
(planting.finished_at - planting.planted_at).to_i
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
20
app/controllers/robots_controller.rb
Normal file
20
app/controllers/robots_controller.rb
Normal file
@@ -0,0 +1,20 @@
|
||||
class RobotsController < ApplicationController
|
||||
|
||||
DEFAULT_FILENAME = 'config/robots.txt'.freeze
|
||||
|
||||
def robots
|
||||
filename = if subdomain && subdomain != 'www'
|
||||
"config/robots.#{ subdomain }.txt"
|
||||
end
|
||||
|
||||
file_to_render = File.exists?(filename.to_s) ? filename : DEFAULT_FILENAME
|
||||
|
||||
render file: file_to_render, layout: false, content_type: 'text/plain'
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def subdomain
|
||||
request.subdomain.present? ? request.subdomain : nil
|
||||
end
|
||||
end
|
||||
@@ -31,5 +31,24 @@ module ApplicationHelper
|
||||
"#{klass.name.downcase.pluralize}/#{identifier}-#{count}-#{max_updated_at}"
|
||||
end
|
||||
|
||||
def required_field_help_text
|
||||
asterisk = content_tag :span, '*', class: ['red']
|
||||
text = content_tag :em, 'denotes a required field'
|
||||
content_tag :div, asterisk + ' '.html_safe + text, class: ['margin-bottom']
|
||||
end
|
||||
|
||||
#
|
||||
# Returns an image uri for a given member.
|
||||
#
|
||||
# Falls back to Gravatar
|
||||
#
|
||||
def avatar_uri(member, size = 150)
|
||||
return member.preferred_avatar_uri if member.preferred_avatar_uri.present?
|
||||
|
||||
Gravatar.new(member.email).image_url({
|
||||
:size => size,
|
||||
:default => :identicon
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
17
app/helpers/crops_helper.rb
Normal file
17
app/helpers/crops_helper.rb
Normal file
@@ -0,0 +1,17 @@
|
||||
module CropsHelper
|
||||
def display_seed_availability(member, crop)
|
||||
total_quantity = 0
|
||||
member.seeds.each do |seed|
|
||||
if seed.crop.name == crop.name
|
||||
total_quantity = total_quantity + seed.quantity
|
||||
end
|
||||
end
|
||||
|
||||
if (total_quantity != 0)
|
||||
"You have #{pluralize(total_quantity, "seed")} of this crop."
|
||||
else
|
||||
"You don't have any seeds of this crop."
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
25
app/helpers/gardens_helper.rb
Normal file
25
app/helpers/gardens_helper.rb
Normal file
@@ -0,0 +1,25 @@
|
||||
module GardensHelper
|
||||
|
||||
def display_garden_description(garden)
|
||||
if garden.description.nil?
|
||||
"no description provided."
|
||||
else
|
||||
truncate(garden.description, length: 130, separator: ' ', omission: '... ') { link_to "Read more", garden_path(garden) }
|
||||
end
|
||||
end
|
||||
|
||||
def display_garden_plantings(plantings)
|
||||
if plantings.blank?
|
||||
"None"
|
||||
else
|
||||
output = ""
|
||||
plantings.first(2).each do |planting|
|
||||
output += "<li>"
|
||||
output += planting.quantity.nil? ? "0 " : "#{planting.quantity} "
|
||||
output += link_to planting.crop.name, planting.crop
|
||||
output += ", planted on #{planting.planted_at}</li>"
|
||||
end
|
||||
output.html_safe
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -37,4 +37,12 @@ module HarvestsHelper
|
||||
end
|
||||
end
|
||||
|
||||
def display_harvest_description(harvest)
|
||||
if harvest.description.empty?
|
||||
"No description provided."
|
||||
else
|
||||
truncate(harvest.description, length: 130, separator: ' ', omission: '... ') { link_to "Read more", harvest_path(harvest) }
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -5,12 +5,7 @@ module NotificationsHelper
|
||||
new_comment_url(:post_id => notification.post.id)
|
||||
else
|
||||
# by default, reply link sends a PM in return
|
||||
new_notification_url(
|
||||
:recipient_id => notification.sender.id,
|
||||
:subject => notification.subject =~ /^Re: / ?
|
||||
notification.subject :
|
||||
"Re: " + notification.subject
|
||||
)
|
||||
reply_notification_url(notification)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
45
app/helpers/plantings_helper.rb
Normal file
45
app/helpers/plantings_helper.rb
Normal file
@@ -0,0 +1,45 @@
|
||||
module PlantingsHelper
|
||||
|
||||
def display_days_before_maturity(planting)
|
||||
if planting.finished?
|
||||
0
|
||||
elsif !planting.finished_at.nil?
|
||||
((p = planting.finished_at - DateTime.now).to_i) <= 0 ? 0 : p.to_i
|
||||
elsif planting.days_before_maturity.nil?
|
||||
"unknown"
|
||||
else
|
||||
((p = (planting.planted_at + planting.days_before_maturity) - DateTime.now).to_i <= 0) ? 0 : p.to_i
|
||||
end
|
||||
end
|
||||
|
||||
def display_finished(planting)
|
||||
if !planting.finished_at.nil?
|
||||
planting.finished_at
|
||||
elsif planting.finished
|
||||
"Yes (no date specified)"
|
||||
else
|
||||
"(no date specified)"
|
||||
end
|
||||
end
|
||||
|
||||
def display_planted_from(planting)
|
||||
!planting.planted_from.blank? ? planting.planted_from : "not specified"
|
||||
end
|
||||
|
||||
def display_planting_quantity(planting)
|
||||
!planting.quantity.blank? ? planting.quantity : "not specified"
|
||||
end
|
||||
|
||||
def display_planting(planting)
|
||||
if planting.quantity.to_i > 0 && planting.planted_from.present?
|
||||
return "#{planting.owner} planted #{pluralize(planting.quantity, planting.planted_from)}."
|
||||
elsif planting.quantity.to_i > 0
|
||||
return "#{planting.owner} planted #{pluralize(planting.quantity, 'unit')}."
|
||||
elsif planting.planted_from.present?
|
||||
return "#{planting.owner} planted #{planting.planted_from.pluralize}."
|
||||
else
|
||||
return "#{planting.owner}."
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
11
app/helpers/seeds_helper.rb
Normal file
11
app/helpers/seeds_helper.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
module SeedsHelper
|
||||
|
||||
def display_seed_description(seed)
|
||||
if seed.description.nil?
|
||||
"no description provided."
|
||||
else
|
||||
truncate(seed.description, length: 130, separator: ' ', omission: '... ') { link_to "Read more", seed_path(seed) }
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
@@ -2,10 +2,21 @@ class Notifier < ActionMailer::Base
|
||||
include NotificationsHelper
|
||||
default from: "Growstuff <noreply@growstuff.org>"
|
||||
|
||||
def verifier()
|
||||
if ENV['RAILS_SECRET_TOKEN']
|
||||
return ActiveSupport::MessageVerifier.new(ENV['RAILS_SECRET_TOKEN'])
|
||||
else
|
||||
raise "RAILS_SECRET_TOKEN environment variable not set - have you created config/application.yml?"
|
||||
end
|
||||
end
|
||||
|
||||
def notify(notification)
|
||||
@notification = notification
|
||||
@reply_link = reply_link(@notification)
|
||||
|
||||
# Encrypting
|
||||
@signed_message = verifier.generate ({ member_id: @notification.recipient.id, type: :send_notification_email })
|
||||
|
||||
mail(:to => @notification.recipient.email,
|
||||
:subject => @notification.subject)
|
||||
end
|
||||
@@ -16,6 +27,9 @@ class Notifier < ActionMailer::Base
|
||||
@plantings = @member.plantings.first(5)
|
||||
@harvests = @member.harvests.first(5)
|
||||
|
||||
# Encrypting
|
||||
@signed_message = verifier.generate ({ member_id: @member.id, type: :send_planting_reminder })
|
||||
|
||||
if @member.send_planting_reminder
|
||||
mail(:to => @member.email,
|
||||
:subject => "What have you planted lately?")
|
||||
|
||||
@@ -46,6 +46,7 @@ class Ability
|
||||
# can read/delete notifications that were sent to them
|
||||
can :read, Notification, :recipient_id => member.id
|
||||
can :destroy, Notification, :recipient_id => member.id
|
||||
can :reply, Notification, :recipient_id => member.id
|
||||
# can send a private message to anyone but themselves
|
||||
# note: sadly, we can't test for this from the view, but it works
|
||||
# for the model/controller
|
||||
|
||||
@@ -7,7 +7,7 @@ class Crop < ActiveRecord::Base
|
||||
:allow_destroy => true,
|
||||
:reject_if => :all_blank
|
||||
|
||||
has_many :alternate_names, after_add: :update_index, after_remove: :update_index
|
||||
has_many :alternate_names, after_add: :update_index, after_remove: :update_index, dependent: :destroy
|
||||
has_many :plantings
|
||||
has_many :photos, :through => :plantings
|
||||
has_many :seeds
|
||||
@@ -116,7 +116,7 @@ class Crop < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def default_scientific_name
|
||||
if scientific_names.count > 0
|
||||
if scientific_names.size > 0
|
||||
return scientific_names.first.scientific_name
|
||||
else
|
||||
return nil
|
||||
@@ -177,7 +177,7 @@ class Crop < ActiveRecord::Base
|
||||
def interesting?
|
||||
min_plantings = 3 # needs this many plantings to be interesting
|
||||
min_photos = 3 # needs this many photos to be interesting
|
||||
return false unless photos.count >= min_photos
|
||||
return false unless photos.size >= min_photos
|
||||
return false unless plantings_count >= min_plantings
|
||||
return true
|
||||
end
|
||||
@@ -207,8 +207,8 @@ class Crop < ActiveRecord::Base
|
||||
def Crop.interesting
|
||||
howmany = 12 # max number to find
|
||||
interesting_crops = Array.new
|
||||
Crop.randomized.each do |c|
|
||||
break if interesting_crops.length == howmany
|
||||
Crop.includes(:photos).randomized.each do |c|
|
||||
break if interesting_crops.size == howmany
|
||||
next unless c.interesting?
|
||||
interesting_crops.push(c)
|
||||
end
|
||||
|
||||
@@ -28,10 +28,14 @@ class Garden < ActiveRecord::Base
|
||||
scope :active, -> { where(:active => true) }
|
||||
scope :inactive, -> { where(:active => false) }
|
||||
|
||||
validates :location,
|
||||
:length => { :maximum => 255 }
|
||||
|
||||
validates :name,
|
||||
:format => {
|
||||
:with => /\S/
|
||||
}
|
||||
},
|
||||
:length => { :maximum => 255 }
|
||||
|
||||
validates :area,
|
||||
:numericality => {
|
||||
|
||||
@@ -24,6 +24,8 @@ class Harvest < ActiveRecord::Base
|
||||
|
||||
validates :crop, :presence => {:message => "must be present and exist in our database"}
|
||||
|
||||
validates :plant_part, :presence => {:message => "must be present and exist in our database"}
|
||||
|
||||
validates :quantity,
|
||||
:numericality => {
|
||||
:only_integer => false,
|
||||
|
||||
@@ -202,7 +202,7 @@ class Member < ActiveRecord::Base
|
||||
howmany = 12 # max number to find
|
||||
interesting_members = Array.new
|
||||
Member.confirmed.located.recently_signed_in.each do |m|
|
||||
break if interesting_members.length == howmany
|
||||
break if interesting_members.size == howmany
|
||||
if m.interesting?
|
||||
interesting_members.push(m)
|
||||
end
|
||||
|
||||
@@ -3,6 +3,8 @@ class Notification < ActiveRecord::Base
|
||||
belongs_to :recipient, :class_name => 'Member'
|
||||
belongs_to :post
|
||||
|
||||
validates :subject, :length => { :maximum => 255 }
|
||||
|
||||
default_scope { order('created_at DESC') }
|
||||
scope :unread, -> { where(:read => false) }
|
||||
|
||||
@@ -10,7 +12,7 @@ class Notification < ActiveRecord::Base
|
||||
after_create :send_email
|
||||
|
||||
def self.unread_count
|
||||
self.unread.count
|
||||
self.unread.size
|
||||
end
|
||||
|
||||
def replace_blank_subject
|
||||
|
||||
@@ -94,6 +94,41 @@ class Planting < ActiveRecord::Base
|
||||
return photos.present?
|
||||
end
|
||||
|
||||
def calculate_days_before_maturity(planting, crop)
|
||||
p_crop = Planting.where(:crop_id => crop).where.not(:id => planting)
|
||||
differences = p_crop.collect do |p|
|
||||
if p.finished and !p.finished_at.nil?
|
||||
(p.finished_at - p.planted_at).to_i
|
||||
end
|
||||
end
|
||||
|
||||
if differences.compact.empty?
|
||||
nil
|
||||
else
|
||||
differences.compact.sum/differences.compact.size
|
||||
end
|
||||
end
|
||||
|
||||
def planted?(current_date = Date.today)
|
||||
planted_at.present? && current_date.to_date >= planted_at
|
||||
end
|
||||
|
||||
def percentage_grown(current_date = Date.today)
|
||||
return nil unless days_before_maturity && planted?(current_date)
|
||||
|
||||
days = (current_date.to_date - planted_at.to_date).to_i
|
||||
|
||||
return 0 if current_date < planted_at
|
||||
return 100 if days > days_before_maturity
|
||||
percent = (days/days_before_maturity*100).to_i
|
||||
|
||||
if percent >= 100
|
||||
percent = 100
|
||||
end
|
||||
|
||||
percent
|
||||
end
|
||||
|
||||
# return a list of interesting plantings, for the homepage etc.
|
||||
# we can't do this via a scope (as far as we know) so sadly we have to
|
||||
# do it this way.
|
||||
@@ -101,8 +136,8 @@ class Planting < ActiveRecord::Base
|
||||
interesting_plantings = Array.new
|
||||
seen_owners = Hash.new(false) # keep track of which owners we've seen already
|
||||
|
||||
Planting.all.each do |p|
|
||||
break if interesting_plantings.count == howmany # got enough yet?
|
||||
Planting.includes(:photos).each do |p|
|
||||
break if interesting_plantings.size == howmany # got enough yet?
|
||||
if require_photo
|
||||
next unless p.photos.present? # skip those without photos, if required
|
||||
end
|
||||
|
||||
@@ -10,12 +10,40 @@ class Post < ActiveRecord::Base
|
||||
# also has_many notifications, but kinda meaningless to get at them
|
||||
# from this direction, so we won't set up an association for now.
|
||||
|
||||
after_create do
|
||||
recipients = Array.new
|
||||
sender = self.author.id
|
||||
self.body.scan(Haml::Filters::GrowstuffMarkdown::MEMBER_REGEX) do |m|
|
||||
# find member case-insensitively and add to list of recipients
|
||||
member = Member.where('lower(login_name) = ?', $1.downcase).first
|
||||
recipients << member if member and not recipients.include?(member)
|
||||
end
|
||||
self.body.scan(Haml::Filters::GrowstuffMarkdown::MEMBER_AT_REGEX) do |m|
|
||||
# find member case-insensitively and add to list of recipients
|
||||
member = Member.where('lower(login_name) = ?', $1[1..-1].downcase).first
|
||||
recipients << member if member and not recipients.include?(member)
|
||||
end
|
||||
# don't send notifications to yourself
|
||||
recipients.map{ |r| r.id }.each do |recipient|
|
||||
if recipient != sender
|
||||
Notification.create(
|
||||
:recipient_id => recipient,
|
||||
:sender_id => sender,
|
||||
:subject => "#{self.author} mentioned you in their post #{self.subject}",
|
||||
:body => self.body,
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
default_scope { order("created_at desc") }
|
||||
|
||||
validates :subject,
|
||||
:format => {
|
||||
:with => /\S/
|
||||
}
|
||||
},
|
||||
:length => { :maximum => 255 }
|
||||
|
||||
|
||||
def author_date_subject
|
||||
# slugs are created before created_at is set
|
||||
@@ -24,7 +52,7 @@ class Post < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def comment_count
|
||||
self.comments.count
|
||||
self.comments.size
|
||||
end
|
||||
|
||||
# return the timestamp of the most recent activity on this post
|
||||
|
||||
@@ -82,7 +82,7 @@ class Seed < ActiveRecord::Base
|
||||
interesting_seeds = Array.new
|
||||
|
||||
Seed.tradable.each do |s|
|
||||
break if interesting_seeds.length == howmany
|
||||
break if interesting_seeds.size == howmany
|
||||
if s.interesting?
|
||||
interesting_seeds.push(s)
|
||||
end
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
= form_for @account_type do |f|
|
||||
- if @account_type.errors.any?
|
||||
#error_explanation
|
||||
%h2= "#{pluralize(@account_type.errors.count, "error")} prohibited this account_type from being saved:"
|
||||
%h2= "#{pluralize(@account_type.errors.size, "error")} prohibited this account_type from being saved:"
|
||||
%ul
|
||||
- @account_type.errors.full_messages.each do |msg|
|
||||
%li= msg
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
= form_for @account do |f|
|
||||
- if @account.errors.any?
|
||||
#error_explanation
|
||||
%h2= "#{pluralize(@account.errors.count, "error")} prohibited this account from being saved:"
|
||||
%h2= "#{pluralize(@account.errors.size, "error")} prohibited this account from being saved:"
|
||||
%ul
|
||||
- @account.errors.full_messages.each do |msg|
|
||||
%li= msg
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
- unless @orders.empty?
|
||||
%h2
|
||||
Found
|
||||
= pluralize(@orders.count, "result")
|
||||
= pluralize(@orders.size, "result")
|
||||
|
||||
%table.table.table-striped
|
||||
%tr
|
||||
@@ -28,7 +28,7 @@
|
||||
%td
|
||||
= order.referral_code
|
||||
%td
|
||||
- if order.order_items.count > 0
|
||||
- if order.order_items.size > 0
|
||||
- order.order_items.each do |o|
|
||||
= o.quantity
|
||||
x
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
= form_for @alternate_name, :html => {:class => 'form-horizontal', :role => "form"} do |f|
|
||||
- if @alternate_name.errors.any?
|
||||
#error_explanation
|
||||
%h2= "#{pluralize(@alternate_name.errors.count, "error")} prohibited this alternate_name from being saved:"
|
||||
%h2= "#{pluralize(@alternate_name.errors.size, "error")} prohibited this alternate_name from being saved:"
|
||||
%ul
|
||||
- @alternate_name.errors.full_messages.each do |msg|
|
||||
%li= msg
|
||||
@@ -16,10 +16,12 @@
|
||||
= f.label :crop_id, :class => 'control-label col-md-2'
|
||||
.col-md-8
|
||||
= collection_select(:alternate_name, :crop_id, Crop.all, :id, :name, { :selected => @alternate_name.crop_id || @crop.id }, :class => 'form-control')
|
||||
|
||||
.form-group
|
||||
= 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'
|
||||
= f.submit 'Save', :class => 'btn btn-primary'
|
||||
@@ -11,5 +11,5 @@
|
||||
|
||||
- if can? :edit, @alternate_name
|
||||
= link_to 'Edit', edit_alternate_name_path(@alternate_name), :class => 'btn btn-default btn-xs'
|
||||
\|
|
||||
\|
|
||||
= link_to 'Back', alternate_names_path
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
= form_for(@comment, :html => {:class => "form-horizontal", :role => "form"}) do |f|
|
||||
- if @comment.errors.any?
|
||||
#error_explanation
|
||||
%h2= "#{pluralize(@comment.errors.count, "error")} prohibited this comment from being saved:"
|
||||
%h2= "#{pluralize(@comment.errors.size, "error")} prohibited this comment from being saved:"
|
||||
%ul
|
||||
- @comment.errors.full_messages.each do |msg|
|
||||
%li= msg
|
||||
|
||||
.form-group
|
||||
= f.label :body, "Your comment:"
|
||||
= f.text_area :body, :rows => 6, :class => 'form-control'
|
||||
= f.text_area :body, :rows => 6, :class => 'form-control', :autofocus => 'autofocus'
|
||||
%span.help-block
|
||||
= render :partial => "shared/markdown_help"
|
||||
.actions
|
||||
|
||||
@@ -5,10 +5,10 @@
|
||||
= render :partial => "members/avatar", :locals => { :member => comment.author }
|
||||
.col-md-11
|
||||
.comment-meta
|
||||
Posted by
|
||||
= (comment.created_at == comment.updated_at) ? 'Posted by' : 'Edited by'
|
||||
= link_to comment.author.login_name, member_path(comment.author)
|
||||
at
|
||||
= comment.created_at
|
||||
on
|
||||
= (comment.created_at == comment.updated_at) ? comment.created_at : comment.updated_at
|
||||
|
||||
.comment-body
|
||||
:growstuff_markdown
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
= form_for @crop, :html => {:class => 'form-horizontal', :role => "form"} do |f|
|
||||
- if @crop.errors.any?
|
||||
#error_explanation
|
||||
%h3= "#{pluralize(@crop.errors.count, "error")} prohibited this crop from being saved:"
|
||||
%h3= "#{pluralize(@crop.errors.size, "error")} prohibited this crop from being saved:"
|
||||
%ul
|
||||
- @crop.errors.full_messages.each do |msg|
|
||||
%li= msg
|
||||
@@ -17,7 +17,7 @@
|
||||
-# Everyone (wranglers and requesters) sees the basic info section
|
||||
%h2 Basic information
|
||||
|
||||
.form-group
|
||||
.form-group#new_crop
|
||||
= f.label :name, :class => 'control-label col-md-2'
|
||||
.col-md-8
|
||||
= f.text_field :name, :class => 'form-control'
|
||||
@@ -30,7 +30,7 @@
|
||||
.form-group
|
||||
= f.label :en_wikipedia_url, 'Wikipedia URL', :class => 'control-label col-md-2'
|
||||
.col-md-8
|
||||
= f.text_field :en_wikipedia_url, :class => 'form-control'
|
||||
= f.text_field :en_wikipedia_url, :class => 'form-control', :id => "en_wikipedia_url"
|
||||
%span.help-block
|
||||
Link to the crop's page on the English language Wikipedia (required).
|
||||
|
||||
@@ -44,19 +44,35 @@
|
||||
|
||||
|
||||
-# Everyone (wranglers and requesters) gets to add scientific names
|
||||
%h2 Scientific names
|
||||
%p You may enter up to 3 scientific names for a crop. Most crops will have only one.
|
||||
%h2
|
||||
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}]" }
|
||||
.col-md-2
|
||||
= label_tag :scientific_names, "Scientific name #{index+1}:", :class => 'control-label'
|
||||
.col-md-8
|
||||
= text_field_tag "sci_name[#{index+1}]", sci.scientific_name, :id => "sci_name[#{index+1}]", :class => 'form-control'
|
||||
%span.help-block Scientific name of crop.
|
||||
.col-md-2
|
||||
|
||||
= f.fields_for :scientific_names do |sn|
|
||||
.form-group
|
||||
= sn.label :scientific_name, "Scientific name", :class => 'control-label col-md-2'
|
||||
.col-md-8
|
||||
= sn.text_field :scientific_name, :class => 'form-control'
|
||||
.col-md-2
|
||||
- if sn.object && sn.object.persisted?
|
||||
%label.checkbox
|
||||
= sn.check_box :_destroy
|
||||
= sn.label :_destroy, "Delete"
|
||||
%h2
|
||||
Alternate names
|
||||
= button_tag "+", :id => "add-alt_name-row", :type => "button"
|
||||
= button_tag "-", :id => "remove-alt_name-row", :type => "button"
|
||||
|
||||
.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
|
||||
= label_tag :alternate_names, "Alternate name #{index+1}:", :class => 'control-label'
|
||||
.col-md-8
|
||||
= text_field_tag "alt_name[#{index+1}]", alt.name, :id => "alt_name[#{index+1}]", :class => 'form-control'
|
||||
%span.help-block Alternate name of crop.
|
||||
.col-md-2
|
||||
|
||||
-# This is used for comments from crop requesters. We need to show it
|
||||
-# to everyone, but we don't include it on new crops from wranglers.
|
||||
@@ -66,7 +82,7 @@
|
||||
.form-group
|
||||
= f.label :request_notes, 'Comments', :class => 'control-label col-md-2'
|
||||
.col-md-8
|
||||
= f.text_area :request_notes, :rows => 3, :class => 'form-control'
|
||||
= f.text_area :request_notes, :rows => 3, :class => 'form-control', :id => 'request_notes'
|
||||
|
||||
-# A final explanation of what's going to happen next, for crop requesters
|
||||
- unless can? :wrangle, @crop
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
%ul
|
||||
- @count ||= 0
|
||||
- unless defined? max
|
||||
- max = 0 # list all without "show all" toggle button
|
||||
- display_crops.each do |c|
|
||||
%li.crop-hierarchy
|
||||
%li.crop-hierarchy{:class => max != 0 && @count >= max ? ['hide', 'toggle'] : []}
|
||||
= link_to c, c
|
||||
- @count += 1
|
||||
- if c.varieties.present?
|
||||
- c.varieties.each do |v|
|
||||
= render :partial => 'hierarchy', :locals => { :display_crops => [ v ] }
|
||||
= render :partial => 'hierarchy', :locals => { :display_crops => [ v ], :max => max }
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
%ul
|
||||
- crop.plantings.take(3).each do |planting|
|
||||
%li
|
||||
= link_to "#{planting.owner} planted #{planting.quantity} #{planting.planted_from}.", planting_path(planting)
|
||||
= link_to display_planting(planting), planting_path(planting)
|
||||
= render :partial => 'members/location', :locals => { :member => planting.owner }
|
||||
%small
|
||||
= distance_of_time_in_words(planting.created_at, Time.zone.now)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
%p
|
||||
%small
|
||||
- if crop.scientific_names.count > 0
|
||||
- if crop.scientific_names.size > 0
|
||||
%i
|
||||
= crop.scientific_names.first.scientific_name
|
||||
%br/
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
.thumbnail
|
||||
.crop-thumbnail
|
||||
- if crop
|
||||
= link_to image_tag((crop.default_photo ? crop.default_photo.thumbnail_url : 'placeholder_150.png'), :alt => crop.name, :class => 'img'), crop
|
||||
.cropinfo
|
||||
.cropname
|
||||
= link_to crop.name, crop
|
||||
- if crop.scientific_names.count > 0
|
||||
.scientificname
|
||||
= crop.scientific_names.first.scientific_name
|
||||
.plantingcount
|
||||
Planted
|
||||
= pluralize(crop.plantings.size, "time")
|
||||
- cache cache_key_for(Crop, crop.id) do
|
||||
= link_to image_tag((crop.default_photo ? crop.default_photo.thumbnail_url : 'placeholder_150.png'), :alt => crop.name, :class => 'img'), crop
|
||||
.cropinfo
|
||||
.cropname
|
||||
= link_to crop.name, crop
|
||||
- if crop.scientific_names.size > 0
|
||||
.scientificname
|
||||
= crop.scientific_names.first.scientific_name
|
||||
.plantingcount
|
||||
Planted
|
||||
= pluralize(crop.plantings.size, "time")
|
||||
|
||||
@@ -1,15 +1,20 @@
|
||||
- if crop.parent
|
||||
%p
|
||||
= crop.name
|
||||
is a variety of
|
||||
= succeed "." do
|
||||
= link_to crop.parent, crop.parent
|
||||
.varieties
|
||||
- if crop.parent
|
||||
%p
|
||||
= crop.name
|
||||
is a variety of
|
||||
= succeed "." do
|
||||
= link_to crop.parent, crop.parent
|
||||
|
||||
- unless crop.varieties.empty?
|
||||
%p
|
||||
Varieties of #{crop.name}:
|
||||
- unless crop.varieties.empty?
|
||||
%p
|
||||
Varieties of #{crop.name}:
|
||||
|
||||
= render :partial => 'hierarchy', :locals => { :display_crops => [ crop ] }
|
||||
- max = 5
|
||||
= render :partial => 'hierarchy', :locals => { :display_crops => [ crop ], :max => max }
|
||||
- if max != 0 && @count > max
|
||||
= button_tag "Show all #{@count-1} varieties", :class => 'btn btn-link toggle crop-hierarchy'
|
||||
= button_tag "Show less varieties", :class => 'btn btn-link toggle crop-hierarchy hide'
|
||||
|
||||
- if ! crop.parent and crop.varieties.empty?
|
||||
%p None known.
|
||||
- if ! crop.parent and crop.varieties.empty?
|
||||
%p None known.
|
||||
|
||||
@@ -49,7 +49,7 @@ csv.headers *all_headers
|
||||
|
||||
if c.scientific_names.any?
|
||||
csv.cell :default_scientific_name, c.default_scientific_name
|
||||
csv.cell :scientific_name_count, c.scientific_names.count
|
||||
csv.cell :scientific_name_count, c.scientific_names.size
|
||||
end
|
||||
|
||||
if c.parent
|
||||
@@ -58,8 +58,8 @@ csv.headers *all_headers
|
||||
end
|
||||
|
||||
csv.cell :plantings_count, c.plantings_count || 0
|
||||
csv.cell :seeds_count, c.seeds.count
|
||||
csv.cell :harvests_count, c.harvests.count
|
||||
csv.cell :seeds_count, c.seeds.size
|
||||
csv.cell :harvests_count, c.harvests.size
|
||||
|
||||
# Sunniness
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
- content_for :title, "Browse crops"
|
||||
- content_for :subtitle, "#{@crops.size} total"
|
||||
- content_for :title, t('.title')
|
||||
- content_for :subtitle, t('.subtitle', crops_size: @crops.size)
|
||||
|
||||
- if can? :wrangle, Crop
|
||||
= link_to 'Wrangle Crops', wrangle_crops_path, :class => 'btn btn-primary'
|
||||
|
||||
@@ -13,7 +13,9 @@
|
||||
|
||||
- if can? :create, Seed
|
||||
= link_to 'Add seeds to stash', new_seed_path(:params => { :crop_id => @crop.id }), :class => 'btn btn-default'
|
||||
|
||||
- if member_signed_in?
|
||||
= display_seed_availability(@current_member, @crop)
|
||||
= link_to "View your seeds", seeds_by_owner_path(:owner => current_member.slug)
|
||||
|
||||
.row
|
||||
.col-md-9
|
||||
|
||||
@@ -9,24 +9,28 @@
|
||||
%span.help-block If you change your email address you will have to reconfirm.
|
||||
|
||||
.form-group
|
||||
.col-md-offset-2.col-md-8
|
||||
= f.check_box :show_email
|
||||
Show email publicly on your profile page.
|
||||
.col-md-offset-2.col-md-8.checkbox
|
||||
%label
|
||||
= f.check_box :show_email
|
||||
Show email publicly on your profile page.
|
||||
|
||||
.form-group
|
||||
.col-md-offset-2.col-md-8
|
||||
= f.check_box :send_notification_email
|
||||
Receive emailed copies of Inbox notifications (eg. private messages).
|
||||
.col-md-offset-2.col-md-8.checkbox
|
||||
%label
|
||||
= f.check_box :send_notification_email
|
||||
Receive emailed copies of Inbox notifications (eg. private messages).
|
||||
|
||||
.form-group
|
||||
.col-md-offset-2.col-md-8
|
||||
= f.check_box :send_planting_reminder
|
||||
Receive regular reminders to track your planting and harvesting.
|
||||
.col-md-offset-2.col-md-8.checkbox
|
||||
%label
|
||||
= f.check_box :send_planting_reminder
|
||||
Receive regular reminders to track your planting and harvesting.
|
||||
|
||||
.form-group
|
||||
.col-md-offset-2.col-md-8
|
||||
= f.check_box :newsletter
|
||||
Subscribe to the #{ENV['GROWSTUFF_SITE_NAME']} newsletter
|
||||
.col-md-offset-2.col-md-8.checkbox
|
||||
%label
|
||||
= f.check_box :newsletter
|
||||
Subscribe to the #{ENV['GROWSTUFF_SITE_NAME']} newsletter
|
||||
.help-block
|
||||
= render :partial => 'newsletter_blurb'
|
||||
|
||||
|
||||
@@ -26,15 +26,17 @@
|
||||
.col-md-8= f.password_field :password_confirmation, :class => 'form-control'
|
||||
|
||||
.form-group
|
||||
.col-md-offset-2.col-md-8
|
||||
= f.check_box :tos_agreement
|
||||
I agree to the
|
||||
= succeed "." do
|
||||
= link_to 'Terms of Service', url_for(:action => 'tos', :controller => '/policy')
|
||||
.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', url_for(:action => 'tos', :controller => '/policy')
|
||||
.form-group
|
||||
.col-md-offset-2.col-md-8
|
||||
= f.check_box :newsletter, :checked => true
|
||||
Subscribe to the #{ENV['GROWSTUFF_SITE_NAME']} newsletter
|
||||
.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 => 'newsletter_blurb'
|
||||
|
||||
|
||||
@@ -15,9 +15,10 @@
|
||||
|
||||
- if devise_mapping.rememberable?
|
||||
.form-group
|
||||
.col-md-8.col-md-offset-2
|
||||
= f.check_box :remember_me
|
||||
Remember me
|
||||
.col-md-8.col-md-offset-2.checkbox
|
||||
%label
|
||||
= f.check_box :remember_me
|
||||
Remember me
|
||||
|
||||
.form-group
|
||||
.form-actions.col-md-8.col-md-offset-2
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
= form_for @forum, :html => { :class => 'form-horizontal', :role => "form" } do |f|
|
||||
- if @forum.errors.any?
|
||||
#error_explanation
|
||||
%h2= "#{pluralize(@forum.errors.count, "error")} prohibited this forum from being saved:"
|
||||
%h2= "#{pluralize(@forum.errors.size, "error")} prohibited this forum from being saved:"
|
||||
%ul
|
||||
- @forum.errors.full_messages.each do |msg|
|
||||
%li= msg
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
- content_for :title, "Forums"
|
||||
- content_for :title, t('.title')
|
||||
|
||||
- if can? :create, Forum
|
||||
%p
|
||||
@@ -7,7 +7,7 @@
|
||||
- @forums.each do |forum|
|
||||
%h2= forum
|
||||
%p
|
||||
= pluralize(forum.posts.count, "post")
|
||||
= pluralize(forum.posts.size, "post")
|
||||
|
|
||||
=link_to "Visit forum", forum
|
||||
|
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
Posts
|
||||
=link_to "Post something", new_post_path(:forum_id => @forum.id), :class => 'btn btn-primary'
|
||||
|
||||
- if @forum.posts.count > 0
|
||||
- if @forum.posts.size > 0
|
||||
=render :partial => "posts/summary", :locals => { :posts => @forum.posts }
|
||||
- else
|
||||
No posts yet.
|
||||
|
||||
@@ -1,25 +1,27 @@
|
||||
= required_field_help_text
|
||||
|
||||
= form_for(@garden, :html => {:class => "form-horizontal", :role => "form"}) do |f|
|
||||
- if @garden.errors.any?
|
||||
#error_explanation
|
||||
%h2= "#{pluralize(@garden.errors.count, "error")} prohibited this garden from being saved:"
|
||||
%h2= "#{pluralize(@garden.errors.size, "error")} prohibited this garden from being saved:"
|
||||
%ul
|
||||
- @garden.errors.full_messages.each do |msg|
|
||||
%li= msg
|
||||
|
||||
.form-group
|
||||
.form-group.required
|
||||
= f.label :name, :class => 'control-label col-md-2'
|
||||
.col-md-8
|
||||
= f.text_field :name, :class => 'form-control'
|
||||
= f.text_field :name, :class => 'form-control', :maxlength => 255, :required => "required"
|
||||
|
||||
.form-group
|
||||
= f.label :description, :class => 'control-label col-md-2'
|
||||
.col-md-8
|
||||
= f.text_area :description, :rows => 6, :class => 'form-control'
|
||||
= f.text_area :description, :rows => 6, :class => 'form-control', :placeholder => 'optional'
|
||||
|
||||
.form-group
|
||||
= f.label :location, :class => 'control-label col-md-2'
|
||||
.col-md-8
|
||||
= f.text_field :location, :value => @garden.location || current_member.location, :class => 'form-control'
|
||||
= f.text_field :location, :value => @garden.location || current_member.location, :class => 'form-control', :placeholder => 'optional', :maxlength => 255
|
||||
%span.help-block
|
||||
If you have a location set in your profile, it will be used when
|
||||
you create a new garden.
|
||||
@@ -31,7 +33,7 @@
|
||||
.form-group
|
||||
= f.label :area, :class => 'control-label col-md-2'
|
||||
.col-md-2
|
||||
= f.number_field :area, :class => 'input-small form-control'
|
||||
= f.number_field :area, :class => 'input-small form-control', :placeholder => 'optional'
|
||||
.col-md-2
|
||||
= f.select(:area_unit, Garden::AREA_UNITS_VALUES, {:include_blank => false}, :class => 'form-control')
|
||||
|
||||
|
||||
36
app/views/gardens/_thumbnail.html.haml
Normal file
36
app/views/gardens/_thumbnail.html.haml
Normal file
@@ -0,0 +1,36 @@
|
||||
.panel.panel-success
|
||||
.panel-heading
|
||||
%h3.panel-title
|
||||
= link_to "#{garden.owner.login_name}'s garden", garden.owner
|
||||
- if can? :edit, garden
|
||||
%a.pull-right{:href => edit_garden_path(garden), :role => "button", :id => "edit_garden_glyphicon"}
|
||||
%span.glyphicon.glyphicon-pencil{:title => "Edit"}
|
||||
.panel-body{:id => "gardens_panel_body"}
|
||||
.row
|
||||
.col-md-4
|
||||
= 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 :
|
||||
%dd= link_to garden.name, garden
|
||||
%dt Location :
|
||||
%dd
|
||||
- if garden.location.blank?
|
||||
not specified
|
||||
- else
|
||||
= link_to garden.location, place_path(garden.location)
|
||||
%dt Area :
|
||||
%dd= garden.area.nil? ? "not specified" : pluralize(garden.area, garden.area_unit)
|
||||
%dt Active? :
|
||||
%dd= garden.active ? "Yes" : "No"
|
||||
.col-md-12
|
||||
%b
|
||||
= "#{pluralize(garden.plantings.size, "Planting")} : "
|
||||
= display_garden_plantings(garden.plantings.current)
|
||||
- if garden.plantings.size > 2
|
||||
%br
|
||||
= link_to "See more plantings >>", garden_path(garden)
|
||||
.panel-footer
|
||||
%dt Description
|
||||
%dd
|
||||
= display_garden_description(garden)
|
||||
@@ -14,56 +14,19 @@
|
||||
- else
|
||||
= render :partial => 'shared/signin_signup', :locals => { :to => 'add a new garden' }
|
||||
|
||||
- if @gardens.length > 0
|
||||
|
||||
%div.pagination
|
||||
= page_entries_info @gardens, :model => "gardens"
|
||||
= will_paginate @gardens
|
||||
|
||||
%table.table.table-striped
|
||||
%tr
|
||||
- unless @owner
|
||||
%th Owner
|
||||
%th Garden name
|
||||
%th Description
|
||||
%th Location
|
||||
%th Area
|
||||
%th Active?
|
||||
%th Plantings
|
||||
%th
|
||||
%div.pagination
|
||||
= page_entries_info @gardens, :model => "gardens"
|
||||
= will_paginate @gardens
|
||||
|
||||
.row
|
||||
- if @gardens.size > 0
|
||||
- @gardens.each do |garden|
|
||||
%tr
|
||||
- unless @owner
|
||||
%td= link_to garden.owner.login_name, garden.owner
|
||||
%td= link_to garden.name, garden
|
||||
%td= garden.description
|
||||
%td
|
||||
- if ! garden.location.blank?
|
||||
= link_to garden.location, place_path(garden.location)
|
||||
%td
|
||||
- if garden.area
|
||||
= pluralize(garden.area, garden.area_unit)
|
||||
%td= garden.active ? "Yes" : "No"
|
||||
%td
|
||||
- if garden.plantings.empty?
|
||||
None
|
||||
- else
|
||||
%ul
|
||||
- garden.plantings.each do |p|
|
||||
%li
|
||||
= p.quantity
|
||||
= link_to p.crop.name, p
|
||||
- if p.planted_at
|
||||
planted on
|
||||
= p.planted_at
|
||||
|
||||
%td= link_to 'Details', garden, :class => 'btn btn-default btn-xs'
|
||||
.col-md-6
|
||||
=render :partial => 'gardens/thumbnail', :locals => {:garden => garden}
|
||||
- else
|
||||
%p There are no gardens to display.
|
||||
|
||||
%div.pagination
|
||||
= page_entries_info @gardens, :model => "gardens"
|
||||
= will_paginate @gardens
|
||||
|
||||
- else
|
||||
%p There are no gardens to display.
|
||||
%div.pagination
|
||||
= page_entries_info @gardens, :model => "gardens"
|
||||
= will_paginate @gardens
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
.row
|
||||
.col-md-9
|
||||
|
||||
- if can? :edit, @garden or can? :delete, @garden
|
||||
%p.btn-group
|
||||
- if can? :edit, @garden
|
||||
@@ -28,37 +27,46 @@
|
||||
%div
|
||||
:growstuff_markdown
|
||||
#{strip_tags @garden.description}
|
||||
- unless @garden.description
|
||||
.row-fluid
|
||||
%p No description available yet.
|
||||
|
||||
- if @garden.photos.count > 0 or (can? :edit, @garden and can? :create, Photo)
|
||||
.row
|
||||
%h2 Photos
|
||||
- if can? :edit, @garden
|
||||
%p
|
||||
Why not
|
||||
= link_to 'tell us more.', edit_garden_path(@garden)
|
||||
|
||||
%ul.thumbnails
|
||||
- @garden.photos.each do |p|
|
||||
.col-md-2.six-across
|
||||
= render :partial => 'photos/thumbnail', :locals => { :photo => p }
|
||||
- if @garden.photos.size > 0 or (can? :edit, @garden and can? :create, Photo)
|
||||
.row-fluid
|
||||
%h3 Photos
|
||||
%p= pluralize(@garden.photos.length, "photo")
|
||||
.row-fluid
|
||||
%ul.thumbnails
|
||||
- @garden.photos.each do |p|
|
||||
.col-md-2.six-across
|
||||
= render :partial => 'photos/thumbnail', :locals => { :photo => p }
|
||||
.row-fluid
|
||||
- if can? :create, Photo and can? :edit, @garden
|
||||
.col-md-2
|
||||
.thumbnail(style='height: 220px')
|
||||
%p{:style => 'text-align: center; padding-top: 50px'}
|
||||
= link_to "Add photo", new_photo_path(:type => "garden", :id => @garden.id), :class => 'btn btn-primary'
|
||||
%p
|
||||
= link_to "Add photo", new_photo_path(:type => "garden", :id => @garden.id), :class => 'btn btn-primary'
|
||||
|
||||
.row-fluid
|
||||
%h3 What's planted here?
|
||||
- if @garden.plantings.current.size > 0
|
||||
- @garden.plantings.current.each.with_index do |planting_current, index_current|
|
||||
= render partial: "plantings/thumbnail", locals: {:planting => planting_current}
|
||||
- else
|
||||
%p
|
||||
Nothing is currently planted here.
|
||||
|
||||
%h3
|
||||
What's planted here?
|
||||
|
||||
- if @garden.plantings.current.count > 0
|
||||
- @garden.plantings.current.each do |p|
|
||||
= render :partial => "plantings/thumbnail", :locals => { :planting => p }
|
||||
- else
|
||||
%p
|
||||
Nothing is currently planted here.
|
||||
|
||||
- if @garden.plantings.finished.count > 0
|
||||
.row-fluid
|
||||
%h3 Previously planted in this garden
|
||||
- @garden.plantings.finished.each do |p|
|
||||
= render :partial => "plantings/thumbnail", :locals => { :planting => p }
|
||||
|
||||
- if @garden.plantings.finished.size > 0
|
||||
- @garden.plantings.finished.each.with_index do |planting_finished|
|
||||
= render partial: "plantings/thumbnail", locals: {:planting => planting_finished}
|
||||
- else
|
||||
%p
|
||||
Nothing has been planted here.
|
||||
.col-md-3
|
||||
%h4 About this garden
|
||||
%p
|
||||
@@ -82,7 +90,7 @@
|
||||
- else
|
||||
= link_to "#{othergarden}", garden_path(othergarden)
|
||||
|
||||
- if @garden.owner.gardens.inactive.count > 0
|
||||
- if @garden.owner.gardens.inactive.size > 0
|
||||
%h4= "Inactive gardens"
|
||||
%ul
|
||||
- @garden.owner.gardens.inactive.each do |othergarden|
|
||||
|
||||
@@ -1,23 +1,25 @@
|
||||
= required_field_help_text
|
||||
|
||||
= form_for(@harvest, :html => {:class => "form-horizontal", :role => :form}) do |f|
|
||||
- if @harvest.errors.any?
|
||||
#error_explanation
|
||||
%h2= "#{pluralize(@harvest.errors.count, "error")} prohibited this harvest from being saved:"
|
||||
%h2= "#{pluralize(@harvest.errors.size, "error")} prohibited this harvest from being saved:"
|
||||
%ul
|
||||
- @harvest.errors.full_messages.each do |msg|
|
||||
%li= msg
|
||||
|
||||
.form-group
|
||||
.form-group.required
|
||||
= f.label :crop, 'What did you harvest?', :class => 'control-label col-md-2'
|
||||
.col-md-4
|
||||
= auto_suggest @harvest, :crop, :class => 'form-control col-md-2', :default => @crop
|
||||
.col-md-4
|
||||
= collection_select(:harvest, :plant_part_id, PlantPart.all, :id, :name, { :selected => @harvest.plant_part_id }, { :class => 'form-control' })
|
||||
= collection_select(:harvest, :plant_part_id, PlantPart.all, :id, :name, { :selected => @harvest.plant_part_id }, { :class => 'form-control', :prompt => 'e.g. fruit', :required => "required" })
|
||||
%span.help-block.col-md-8
|
||||
Can't find what you're looking for?
|
||||
= link_to "Request new crops.", new_crop_path
|
||||
|
||||
.form-group
|
||||
= f.label :harvested_at, 'When?', :class => 'control-label col-md-2'
|
||||
= f.label :harvested_at, 'When?', :class => 'control-label col-md-2', :placeholder => 'optional'
|
||||
.col-md-2
|
||||
= f.text_field :harvested_at, :value => @harvest.harvested_at ? @harvest.harvested_at.to_s(:ymd) : '', :class => 'add-datepicker form-control'
|
||||
|
||||
@@ -27,20 +29,20 @@
|
||||
-# Some browsers (eg Firefox for Android) assume "number" means
|
||||
-# "integer" unless you specify step="any":
|
||||
-# http://blog.isotoma.com/2012/03/html5-input-typenumber-and-decimalsfloats-in-chrome/
|
||||
= f.number_field :quantity, :class => 'input-small', :step => 'any', :class => 'form-control'
|
||||
= f.number_field :quantity, :class => 'input-small', :step => 'any', :class => 'form-control', :placeholder => 'optional'
|
||||
.col-md-2
|
||||
= f.select(:unit, Harvest::UNITS_VALUES, {:include_blank => false}, :class => 'input-medium form-control')
|
||||
|
||||
.form-group
|
||||
= f.label :weight_quantity, 'Weighing (in total):', :class => 'control-label col-md-2'
|
||||
.col-md-2
|
||||
= f.number_field :weight_quantity, :class => 'input-small', :step => 'any', :class => 'form-control'
|
||||
= f.number_field :weight_quantity, :class => 'input-small', :step => 'any', :class => 'form-control', :placeholder => 'optional'
|
||||
.col-md-2
|
||||
= f.select(:weight_unit, Harvest::WEIGHT_UNITS_VALUES, {:include_blank => false}, :class => 'form-control')
|
||||
.form-group
|
||||
= f.label :description, 'Notes', :class => 'control-label col-md-2'
|
||||
.col-md-8
|
||||
= f.text_area :description, :rows => 6, :class => 'form-control'
|
||||
= f.text_area :description, :rows => 6, :class => 'form-control', :placeholder => 'optional'
|
||||
|
||||
.form-group
|
||||
.form-actions.col-md-offset-2.col-md-8
|
||||
|
||||
25
app/views/harvests/_thumbnail.html.haml
Normal file
25
app/views/harvests/_thumbnail.html.haml
Normal file
@@ -0,0 +1,25 @@
|
||||
.panel.panel-success
|
||||
.panel-heading
|
||||
%h3.panel-title
|
||||
= link_to "#{harvest.owner.login_name}'s harvest", harvest.owner
|
||||
- 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
|
||||
.col-md-8
|
||||
%dl.dl-horizontal
|
||||
%dt Crop :
|
||||
%dd= link_to harvest.crop.name, harvest.crop
|
||||
%dt Plant part :
|
||||
%dd= link_to harvest.plant_part, harvest.plant_part
|
||||
%dt Quantity :
|
||||
%dd= display_quantity(harvest)
|
||||
%dt Harvest date :
|
||||
%dd= harvest.harvested_at
|
||||
.panel-footer
|
||||
%dt Description
|
||||
%dd
|
||||
= display_harvest_description(harvest)
|
||||
@@ -1,4 +1,6 @@
|
||||
- content_for :title, @owner ? "#{@owner}'s harvests" : @crop ? "Everyone's #{@crop.name} harvests" : "Everyone's harvests"
|
||||
- content_for :title, @owner ? t('.title.owner_harvests', owner: @owner) : @crop ? t('.title.crop_harvests', crop: @crop.name) : t('.title.default')
|
||||
- if @owner
|
||||
= link_to "View #{@owner}'s profile >>", member_path(@owner)
|
||||
|
||||
%p
|
||||
#{ENV['GROWSTUFF_SITE_NAME']} helps you track what you're
|
||||
@@ -21,36 +23,15 @@
|
||||
%div.pagination
|
||||
= page_entries_info @harvests, :model => "harvests"
|
||||
= will_paginate @harvests
|
||||
|
||||
- if @harvests.length > 0
|
||||
|
||||
%table.table.table-striped
|
||||
%tr
|
||||
- unless @owner
|
||||
%th Owner
|
||||
%th Crop
|
||||
%th Plant part
|
||||
%th Date
|
||||
%th Quantity
|
||||
%th Description
|
||||
%th
|
||||
|
||||
.row
|
||||
- if @harvests.size > 0
|
||||
- @harvests.each do |harvest|
|
||||
%tr
|
||||
- unless @owner
|
||||
%td= link_to harvest.owner.login_name, harvest.owner
|
||||
%td= link_to harvest.crop.name, harvest.crop
|
||||
%td
|
||||
- if harvest.plant_part
|
||||
= link_to harvest.plant_part.name, harvest.plant_part
|
||||
%td= harvest.harvested_at
|
||||
%td= display_quantity(harvest)
|
||||
%td= harvest.description
|
||||
%td= link_to 'Details', harvest, :class => 'btn btn-default btn-xs'
|
||||
.col-md-6
|
||||
=render :partial => 'harvests/thumbnail', :locals => {:harvest => harvest}
|
||||
|
||||
%div.pagination
|
||||
= page_entries_info @harvests, :model => "harvests"
|
||||
= will_paginate @harvests
|
||||
%div.pagination
|
||||
= page_entries_info @harvests, :model => "harvests"
|
||||
= will_paginate @harvests
|
||||
|
||||
%ul.list-inline
|
||||
%li The data on this page is available in the following formats:
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
:growstuff_markdown
|
||||
#{ @harvest.description != "" ? @harvest.description : "No description given." }
|
||||
|
||||
- if @harvest.photos.count > 0 or (can? :edit, @harvest and can? :create, Photo)
|
||||
- if @harvest.photos.size > 0 or (can? :edit, @harvest and can? :create, Photo)
|
||||
%h2 Pictures
|
||||
|
||||
%ul.thumbnails
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
.hidden-xs
|
||||
- members = Member.interesting.first(6)
|
||||
- if members.present?
|
||||
%section
|
||||
%h2= t('.title')
|
||||
|
||||
.row
|
||||
.member-cards
|
||||
- members.each do |m|
|
||||
.col-md-4.homepage-members
|
||||
= render :partial => "members/thumbnail", :locals => { :member => m }
|
||||
= render :partial => "members/thumbnail", :locals => { :member => m }
|
||||
|
||||
%p.text-right
|
||||
= link_to "#{t('.view_all')} »", members_path
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
%h2= t('.title')
|
||||
|
||||
- cache cache_key_for(Seed) do
|
||||
- if seeds.length > 0
|
||||
- if seeds.size > 0
|
||||
|
||||
%table.table.table-striped
|
||||
%tr
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
- cache("homepage_stats") do
|
||||
%p.stats
|
||||
= t('.message_html', { member: link_to(t('.member_linktext', count: Member.confirmed.count.to_i), members_path),
|
||||
number_crops: link_to(t('.number_crops_linktext', count: Crop.count.to_i), crops_path),
|
||||
= 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_gardens: link_to(t('.number_gardens_linktext', count: Garden.count.to_i), gardens_path) })
|
||||
|
||||
|
||||
@@ -7,3 +7,6 @@
|
||||
!= cms_snippet_content(:footer2)
|
||||
.col-md-4#footer3
|
||||
!= cms_snippet_content(:footer3)
|
||||
%div(style="float: right;")
|
||||
%a(href="http://opendefinition.org/ossd/")
|
||||
%img(src="http://assets.okfn.org/images/ok_buttons/os_80x15_blue.png" alt="")
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
.sr-only
|
||||
=link_to "Skip navigation menu", "#skipnav"
|
||||
=link_to t(".skip"), "#skipnav"
|
||||
.navbar.navbar-default.navbar-fixed-top(role="navigation")
|
||||
.container
|
||||
.navbar-header
|
||||
@@ -10,56 +10,61 @@
|
||||
%span.icon-bar
|
||||
%a.navbar-brand(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
|
||||
= 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'
|
||||
|
||||
.navbar-collapse.collapse#navbar-collapse
|
||||
%ul.nav.navbar-nav
|
||||
%ul.nav.navbar-nav.pull-right
|
||||
%li.dropdown<
|
||||
%a.dropdown-toggle{'data-toggle' => 'dropdown', :href => crops_path}
|
||||
Crops
|
||||
%b.caret
|
||||
%ul.dropdown-menu
|
||||
%li= link_to "Browse Crops", crops_path
|
||||
%li= link_to "Seeds", seeds_path
|
||||
%li= link_to "Plantings", plantings_path
|
||||
%li= link_to "Harvests", harvests_path
|
||||
%li= link_to t('.browse_crops'), crops_path
|
||||
%li= link_to t('.seeds'), seeds_path
|
||||
%li= link_to t('.plantings'), plantings_path
|
||||
%li= link_to t('.harvests'), harvests_path
|
||||
%li.dropdown<
|
||||
%a.dropdown-toggle{'data-toggle' => 'dropdown', :href => members_path}
|
||||
Community
|
||||
%b.caret
|
||||
%ul.dropdown-menu
|
||||
%li= link_to "Community Map", places_path
|
||||
%li= link_to "Browse Members", members_path
|
||||
%li= link_to "Posts", posts_path
|
||||
%li= link_to "Forums", forums_path
|
||||
|
||||
%li= link_to t('.community_map'), places_path
|
||||
%li= link_to t('.browse_members'), members_path
|
||||
%li= link_to t('.posts'), posts_path
|
||||
%li= link_to t('.forums'), forums_path
|
||||
%li= link_to t('.support_growstuff'), shop_path
|
||||
|
||||
- if member_signed_in?
|
||||
%li.dropdown<
|
||||
%a.dropdown-toggle{'data-toggle' => 'dropdown', :href => root_path}
|
||||
- if current_member.notifications.unread_count > 0
|
||||
Your Stuff (#{current_member.notifications.unread_count})
|
||||
= t('.your_stuff', unread_count: current_member.notifications.unread_count)
|
||||
- else
|
||||
Your Stuff
|
||||
#{current_member.login_name}
|
||||
%b.caret
|
||||
%ul.dropdown-menu
|
||||
%li= link_to "Profile", member_path(current_member)
|
||||
%li= link_to "Gardens", gardens_by_owner_path(:owner => current_member.slug)
|
||||
%li= link_to "Plantings", plantings_by_owner_path(:owner => current_member.slug)
|
||||
%li= link_to "Harvests", harvests_by_owner_path(:owner => current_member.slug)
|
||||
%li= link_to "Seeds", seeds_by_owner_path(:owner => current_member.slug)
|
||||
%li= link_to "Posts", posts_by_author_path(:author => current_member.slug)
|
||||
%li= link_to "Account", orders_path
|
||||
%li= link_to t('.profile'), member_path(current_member)
|
||||
%li= link_to t('.gardens'), gardens_by_owner_path(:owner => current_member.slug)
|
||||
%li= link_to t('.plantings'), plantings_by_owner_path(:owner => current_member.slug)
|
||||
%li= link_to t('.harvest'), harvests_by_owner_path(:owner => current_member.slug)
|
||||
%li= link_to t('.seeds'), seeds_by_owner_path(:owner => current_member.slug)
|
||||
%li= link_to t('.posts'), posts_by_author_path(:author => current_member.slug)
|
||||
%li= link_to t('.account'), orders_path
|
||||
%li
|
||||
- if current_member.notifications.unread_count > 0
|
||||
= link_to("Inbox (#{current_member.notifications.unread_count})", notifications_path)
|
||||
= link_to(t('.inbox_unread', unread_count: current_member.notifications.unread_count), notifications_path)
|
||||
- else
|
||||
= link_to("Inbox", notifications_path)
|
||||
= link_to(t('.inbox'), notifications_path)
|
||||
- if current_member.has_role?(:crop_wrangler) || current_member.has_role?(:admin)
|
||||
%li{:class => 'divider', :role => 'presentation'}
|
||||
- if current_member.has_role?(:crop_wrangler)
|
||||
%li= link_to "Crop Wrangling", wrangle_crops_path
|
||||
%li= link_to t('.crop_wrangling'), wrangle_crops_path
|
||||
- if current_member.has_role?(:admin)
|
||||
%li= link_to "Admin", admin_path
|
||||
%li= link_to "Support Growstuff", shop_path
|
||||
%li= link_to t('.admin'), admin_path
|
||||
|
||||
|
||||
%li= link_to "Sign out", destroy_member_session_path, :method => :delete
|
||||
@@ -68,11 +73,6 @@
|
||||
%li= link_to 'Sign in', new_member_session_path, :id => 'navbar-signin'
|
||||
%li= link_to 'Sign up', new_member_registration_path, :id => 'navbar-signup'
|
||||
|
||||
= form_tag crops_search_path, :method => :get, :id => 'navbar-search', :class => 'navbar-form pull-right' do
|
||||
.input
|
||||
= 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'
|
||||
|
||||
- # anchor tag for accessibility link to skip the navigation menu
|
||||
%a{:name => 'skipnav'}
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
%head
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta property="og:image" content="#{image_url 'growstuff-apple-touch-icon-precomposed.png'}"/>
|
||||
<meta property="og:title" content="#{content_for?(:title) ? yield(:title) + " - #{ ENV['GROWSTUFF_SITE_NAME']} " : ENV['GROWSTUFF_SITE_NAME']}" />
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:url" content="#{root_url}" />
|
||||
<meta property="og:site_name" content="#{ENV['GROWSTUFF_SITE_NAME']}" />
|
||||
|
||||
- if (content_for?(:member_rss_login_name) && content_for(:member_rss_slug))
|
||||
= auto_discovery_link_tag(:rss, { :controller => "/members", :action => 'show', :format => "rss", :id => yield(:member_rss_slug) }, { :title => "#{ ENV['GROWSTUFF_SITE_NAME'] }- #{yield(:member_rss_login_name)}'s posts" })
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
!!! 5
|
||||
%html(lang="en")
|
||||
%html(lang="en" prefix="og: http://ogp.me/ns#")
|
||||
= render :partial => "layouts/meta"
|
||||
%body
|
||||
= render :partial => "layouts/header"
|
||||
|
||||
@@ -9,3 +9,16 @@
|
||||
= member.account_type
|
||||
account
|
||||
|
||||
%p
|
||||
%strong Last Login:
|
||||
= member.last_sign_in_at
|
||||
|
||||
%p
|
||||
%strong Member Roles:
|
||||
%br
|
||||
- if member.has_role? :admin
|
||||
Administrator
|
||||
- if member.has_role? :crop_wrangler
|
||||
Crop Wrangler
|
||||
- else
|
||||
Member
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
= link_to |
|
||||
image_tag( |
|
||||
Gravatar.new(member.email).image_url( |
|
||||
options = { |
|
||||
:size => defined?(size) ? size : 150, |
|
||||
:default => :identicon }), |
|
||||
image_tag(avatar_uri(member, 150), |
|
||||
:alt => '', |
|
||||
:class => 'img img-responsive avatar' ), |
|
||||
:class => 'img img-responsive avatar' ), |
|
||||
member_path(member)
|
||||
|
||||
@@ -7,35 +7,49 @@
|
||||
- first_garden = false
|
||||
= link_to g.name, "#garden#{g.id}", 'data-toggle' => 'tab'
|
||||
- if current_member == member
|
||||
%li= link_to 'New Garden', new_garden_path
|
||||
.tab-content
|
||||
%li.navbar-right
|
||||
= link_to new_garden_path, class: 'btn' do
|
||||
Add New Garden
|
||||
.tab-content{style: "padding-top: 1em"}
|
||||
- first_garden = true
|
||||
- member.gardens.each do |g|
|
||||
|
||||
%div{:class => ['tab-pane', first_garden ? 'active' : ''], :id => "garden#{g.id}"}
|
||||
- first_garden = false
|
||||
|
||||
%div
|
||||
.container
|
||||
:growstuff_markdown
|
||||
#{ strip_tags g.description }
|
||||
|
||||
- if g.photos.count > 0 or (can? :edit, g and can? :create, Photo)
|
||||
- unless g.description
|
||||
.row
|
||||
%h2 Photos
|
||||
%p No description available yet.
|
||||
|
||||
%ul.thumbnails
|
||||
- g.photos.each do |p|
|
||||
.col-md-2.six-across
|
||||
= render :partial => 'photos/thumbnail', :locals => { :photo => p }
|
||||
- if can? :create, Photo and can? :edit, g
|
||||
.col-md-2
|
||||
.thumbnail(style='height: 220px')
|
||||
%p{:style => 'text-align: center; padding-top: 50px'}
|
||||
= link_to "Add photo", new_photo_path(:type => "garden", :id => g.id), :class => 'btn btn-primary'
|
||||
- if can? :edit, g
|
||||
%p
|
||||
Why not
|
||||
= link_to 'tell us more.', edit_garden_path(g)
|
||||
|
||||
|
||||
- if g.photos.size > 0 or (can? :edit, g and can? :create, Photo)
|
||||
.row
|
||||
%h3 Photos
|
||||
%p= pluralize(g.photos.length, "photo")
|
||||
.row
|
||||
%ul.thumbnails
|
||||
- g.photos.each do |p|
|
||||
.col-md-2.six-across
|
||||
= render :partial => 'photos/thumbnail', :locals => { :photo => p }
|
||||
.row
|
||||
- if can? :create, Photo and can? :edit, g
|
||||
%p
|
||||
= link_to "Add photo", new_photo_path(:type => "garden", :id => g.id), :class => 'btn btn-primary'
|
||||
|
||||
%h3 What's planted here?
|
||||
- g.featured_plantings.each do |p|
|
||||
= render :partial => "plantings/thumbnail", :locals => { :planting => p, :hide_description => true }
|
||||
.row
|
||||
- if g.featured_plantings.size > 0
|
||||
- g.featured_plantings.each.with_index do |planting|
|
||||
.col-xs-12.col-lg-6
|
||||
= render partial: "plantings/thumbnail", locals: {:planting => planting}
|
||||
|
||||
%p
|
||||
= link_to "More about this garden...", url_for(g)
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
= link_to |
|
||||
image_tag( |
|
||||
Gravatar.new(member.email).image_url( |
|
||||
options = { |
|
||||
:size => defined?(size) ? size : 150, |
|
||||
:default => :identicon }), |
|
||||
:alt => member.login_name, |
|
||||
:class => 'img-responsive member-image' |
|
||||
), |
|
||||
member, |
|
||||
:rel => "popover", |
|
||||
'data-trigger' => 'hover', |
|
||||
'data-title' => member.login_name, |
|
||||
'data-content' => "#{ render :partial => 'members/popover', :locals => { :member => member } }", |
|
||||
'data-html' => true
|
||||
@@ -1,15 +0,0 @@
|
||||
%small
|
||||
%p
|
||||
- if member.location
|
||||
%i
|
||||
= member.location
|
||||
%p
|
||||
Joined
|
||||
= distance_of_time_in_words(member.created_at, Time.zone.now)
|
||||
ago.
|
||||
%p
|
||||
= pluralize(member.gardens.size, "garden")
|
||||
%br/
|
||||
= pluralize(member.plantings.size, "planting")
|
||||
%br/
|
||||
= pluralize(member.seeds.size, "seed")
|
||||
@@ -2,34 +2,34 @@
|
||||
|
||||
%ul
|
||||
%li
|
||||
- if member.plantings.count > 0
|
||||
- if member.plantings.size > 0
|
||||
= link_to pluralize(member.plantings.size, "planting"), plantings_by_owner_path(:owner => member)
|
||||
- else
|
||||
0 plantings
|
||||
%li
|
||||
- if member.harvests.count > 0
|
||||
- if member.harvests.size > 0
|
||||
= link_to pluralize(member.harvests.size, "harvest"), harvests_by_owner_path(:owner => member)
|
||||
- else
|
||||
0 harvests
|
||||
%li
|
||||
- if member.seeds.count > 0
|
||||
- if member.seeds.size > 0
|
||||
= link_to pluralize(member.seeds.size, "seeds"), seeds_by_owner_path(:owner => member)
|
||||
- else
|
||||
0 seeds
|
||||
%li
|
||||
- if member.posts.count > 0
|
||||
- if member.posts.size > 0
|
||||
= link_to pluralize(member.posts.size, "post"), posts_by_author_path(:author => member)
|
||||
- else
|
||||
0 posts
|
||||
|
||||
%li
|
||||
- if member.followed.count > 0
|
||||
- if member.followed.size > 0
|
||||
= link_to pluralize(member.followed.size, "follow"), member_follows_path(member)
|
||||
- else
|
||||
0 following
|
||||
|
||||
%li
|
||||
- if member.followers.count > 0
|
||||
- if member.followers.size > 0
|
||||
= link_to pluralize(member.followers.size, "follower"), member_followers_path(member)
|
||||
- else
|
||||
0 followers
|
||||
|
||||
@@ -1,17 +1,24 @@
|
||||
- cache member do
|
||||
.row
|
||||
.member-thumbnail
|
||||
.col-md-3
|
||||
= render :partial => "members/image_with_popover", :locals => { :member => member }
|
||||
.col-md-9
|
||||
%p
|
||||
= link_to member.login_name, member
|
||||
- if ! member.location.blank?
|
||||
%small
|
||||
%br/
|
||||
%i= member.location
|
||||
- if ! member.plantings.empty?
|
||||
%small
|
||||
%br/
|
||||
Recently planted:
|
||||
!= member.plantings.first(3).map{|p| link_to p.crop_name, p }.join(", ")
|
||||
.member-thumbnail.panel
|
||||
%div
|
||||
= render :partial => "members/avatar", :locals => { :member => member }
|
||||
%div
|
||||
%p.login-name
|
||||
= link_to member.login_name, member
|
||||
- if !member.location.blank?
|
||||
%small
|
||||
%br/
|
||||
%i= member.location
|
||||
- if !member.plantings.empty?
|
||||
%small
|
||||
%br/
|
||||
Recently planted:
|
||||
!= member.plantings.first(3).map{|p| link_to p.crop_name, p }.join(", ")
|
||||
%p
|
||||
%small
|
||||
Joined
|
||||
= distance_of_time_in_words(member.created_at, Time.zone.now)
|
||||
ago.
|
||||
%p
|
||||
%small
|
||||
= [pluralize(member.gardens.size, "garden"), pluralize(member.plantings.size, "planting"), pluralize(member.seeds.size, "seed")].join(", ")
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
= content_for :title, "#{ENV['GROWSTUFF_SITE_NAME']} members"
|
||||
= content_for :title, t(".title", site_name: "#{ENV['GROWSTUFF_SITE_NAME']}")
|
||||
|
||||
= form_tag(members_path, :method => :get, :class => 'form-inline', :role => 'form') do
|
||||
.form-group
|
||||
@@ -10,11 +10,9 @@
|
||||
= page_entries_info @members, :model => "members"
|
||||
= will_paginate @members
|
||||
|
||||
.row
|
||||
.member-cards
|
||||
- @members.each do |m|
|
||||
.col-md-4.three-across
|
||||
.thumbnail
|
||||
= render :partial => "members/thumbnail", :locals => { :member => m }
|
||||
= render :partial => "members/thumbnail", :locals => { :member => m }
|
||||
|
||||
%div.pagination
|
||||
= page_entries_info @members, :model => "members"
|
||||
|
||||
5
app/views/members/unsubscribe.html.haml
Normal file
5
app/views/members/unsubscribe.html.haml
Normal file
@@ -0,0 +1,5 @@
|
||||
- content_for :title, "Unsubscribe #{@member}"
|
||||
|
||||
%p
|
||||
If you wish to unsubscribe from other Growstuff emails, you may do so via
|
||||
= link_to "your settings page", edit_member_registration_url
|
||||
@@ -1,7 +1,7 @@
|
||||
= form_for @notification do |f|
|
||||
- if @notification.errors.any?
|
||||
#error_explanation
|
||||
%h2= "#{pluralize(@post.errors.count, "error")} prohibited this message from being sent:"
|
||||
%h2= "#{pluralize(@post.errors.size, "error")} prohibited this message from being sent:"
|
||||
%ul
|
||||
- @notification.errors.full_messages.each do |msg|
|
||||
%li= msg
|
||||
@@ -13,7 +13,7 @@
|
||||
To:
|
||||
= link_to @recipient, @recipient
|
||||
= label_tag :notification, "Subject:"
|
||||
= f.text_field :subject, :value => @subject, :class => 'form-control'
|
||||
= f.text_field :subject, :value => @subject, :class => 'form-control', :maxlength => 255
|
||||
= label_tag :body, "Type your message here:"
|
||||
= f.text_area :body, :rows => 12, :class => 'form-control'
|
||||
%span.help-block
|
||||
|
||||
13
app/views/notifications/_notification.html.haml
Normal file
13
app/views/notifications/_notification.html.haml
Normal file
@@ -0,0 +1,13 @@
|
||||
%p
|
||||
From
|
||||
= link_to notification.sender, notification.sender
|
||||
on
|
||||
= notification.created_at
|
||||
|
||||
- if notification.post_id
|
||||
in response to:
|
||||
= link_to notification.post.subject, notification.post
|
||||
|
||||
.well
|
||||
:growstuff_markdown
|
||||
#{ strip_tags(notification.body) }
|
||||
@@ -1,6 +1,7 @@
|
||||
- content_for :title, "Inbox"
|
||||
|
||||
- if @notifications.length > 0
|
||||
- if @notifications.size > 0
|
||||
= paginate @notifications, theme: 'twitter-bootstrap-3'
|
||||
%table.table.table-striped
|
||||
%tr
|
||||
%th From
|
||||
@@ -28,5 +29,6 @@
|
||||
%strong= n.created_at
|
||||
%td
|
||||
= link_to 'Delete', n, method: :delete, data: { confirm: 'Are you sure?' }, :class => 'btn btn-default btn-xs'
|
||||
= paginate @notifications, theme: 'twitter-bootstrap-3'
|
||||
- else
|
||||
You have no messages.
|
||||
|
||||
6
app/views/notifications/reply.html.haml
Normal file
6
app/views/notifications/reply.html.haml
Normal file
@@ -0,0 +1,6 @@
|
||||
= content_for :title, "Send a message to #{@recipient}"
|
||||
|
||||
= render @sender_notification
|
||||
|
||||
=render 'form'
|
||||
|
||||
@@ -1,18 +1,6 @@
|
||||
= content_for :title, @notification.subject
|
||||
|
||||
%p
|
||||
From
|
||||
= link_to @notification.sender, @notification.sender
|
||||
on
|
||||
= @notification.created_at
|
||||
|
||||
- if @notification.post_id
|
||||
in response to:
|
||||
= link_to @notification.post.subject, @notification.post
|
||||
|
||||
.well
|
||||
:growstuff_markdown
|
||||
#{ strip_tags(@notification.body) }
|
||||
= render @notification
|
||||
|
||||
%p
|
||||
=link_to 'Delete', @notification, method: :delete, data: { confirm: 'Are you sure?' }, :class => 'btn btn-default'
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
%br/
|
||||
= link_to "View this message in your inbox", notification_url(@notification)
|
||||
%br/
|
||||
= link_to "Turn off these notifications", edit_member_registration_url
|
||||
= link_to "Unsubscribe from direct message notifications", unsubscribe_member_url(@signed_message)
|
||||
from these notifications
|
||||
|
||||
= render :partial => 'signature'
|
||||
@@ -64,5 +64,5 @@
|
||||
%hr/
|
||||
%p
|
||||
Don't want to get these emails any more?
|
||||
= link_to "Turn off these notifications", edit_member_registration_url
|
||||
= link_to "Unsubscribe from planting reminders", unsubscribe_member_url(@signed_message)
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
- else
|
||||
In progress
|
||||
%td
|
||||
- if order.order_items.count > 0
|
||||
- if order.order_items.size > 0
|
||||
- order.order_items.each do |o|
|
||||
= o.quantity
|
||||
x
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
- if @order.errors.any?
|
||||
.alert
|
||||
#error_explanation
|
||||
%h3= "#{pluralize(@order.errors.count, "error")} stopped you from checking out:"
|
||||
%h3= "#{pluralize(@order.errors.size, "error")} stopped you from checking out:"
|
||||
%ul
|
||||
- @order.errors.full_messages.each do |msg|
|
||||
%li= msg
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
- if @sets and @current_set
|
||||
%h2= @sets.key(@current_set)
|
||||
|
||||
- if @sets and @sets.length > 0
|
||||
- if @sets and @sets.size > 0
|
||||
%p
|
||||
= form_tag(new_photo_path, :method => :get, :class => 'form-inline') do
|
||||
= label_tag :set, "Choose a photo album:", :class => 'control-label'
|
||||
|
||||
@@ -19,11 +19,19 @@
|
||||
%p= link_to 'Delete Photo', @photo, method: :delete, data: { confirm: 'Are you sure?' }, :class => 'btn btn-default btn-xs'
|
||||
|
||||
.col-md-6
|
||||
- if @photo.plantings.count > 0
|
||||
- if @photo.plantings.size > 0 or @photo.harvests.size > 0 or @photo.gardens.size > 0
|
||||
%p This photo depicts:
|
||||
%ul
|
||||
- @photo.plantings.each do |p|
|
||||
%li= link_to p, p
|
||||
- if @photo.plantings.size > 0
|
||||
- @photo.plantings.each do |p|
|
||||
%li= link_to p, p
|
||||
- if @photo.harvests.size > 0
|
||||
- @photo.harvests.each do |h|
|
||||
%li= link_to h, h
|
||||
- if @photo.gardens.size > 0
|
||||
- @photo.gardens.each do |g|
|
||||
%li= link_to g, g
|
||||
|
||||
|
||||
.row
|
||||
.col-md-12
|
||||
|
||||
6
app/views/places/_search_form.html.haml
Normal file
6
app/views/places/_search_form.html.haml
Normal file
@@ -0,0 +1,6 @@
|
||||
%form{:action => search_places_path, :method => :get, :class => 'form-inline', :role => 'form'}
|
||||
.form-group
|
||||
= label_tag :new_place, "Change location:", :class => 'sr-only'
|
||||
= text_field_tag :new_place, '', :class => 'form-control', :placeholder => "New location..."
|
||||
= submit_tag "Search", :class => 'btn btn-primary', :id => "search_button"
|
||||
%br/
|
||||
@@ -1,4 +1,4 @@
|
||||
-content_for :title, "#{ENV['GROWSTUFF_SITE_NAME']} Community Map"
|
||||
|
||||
-content_for :title, t(".title", site_name: "#{ENV['GROWSTUFF_SITE_NAME']}")
|
||||
= render partial: 'search_form'
|
||||
%div#placesmap
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user