Compare commits
1224 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cf8fab8ed9 | ||
|
|
376e6c08d3 | ||
|
|
0cbaac3c75 | ||
|
|
6be9640625 | ||
|
|
1841548936 | ||
|
|
d3b927b44b | ||
|
|
9d68690d86 | ||
|
|
900e7361c6 | ||
|
|
7b0fdcf007 | ||
|
|
9aa4fa8031 | ||
|
|
391111a5bf | ||
|
|
818c8f0c37 | ||
|
|
915030e583 | ||
|
|
832719b01a | ||
|
|
0d8cbc5bf2 | ||
|
|
bac8f5e4cc | ||
|
|
69980d9ec6 | ||
|
|
2129b6480d | ||
|
|
fe860aa1ab | ||
|
|
a382caab48 | ||
|
|
e1e9a52186 | ||
|
|
66c8ce78bc | ||
|
|
e1a2b168c9 | ||
|
|
8763c22284 | ||
|
|
9ec2f76909 | ||
|
|
b94cb2abd6 | ||
|
|
7abafd7b74 | ||
|
|
502862128f | ||
|
|
96b1e78962 | ||
|
|
e077f6c7b1 | ||
|
|
b25a938936 | ||
|
|
0952d7d32f | ||
|
|
9963502026 | ||
|
|
5c2b14376e | ||
|
|
330bc912c1 | ||
|
|
bd46c37f07 | ||
|
|
c08c038df1 | ||
|
|
0fb9ea7a11 | ||
|
|
89c29ea73c | ||
|
|
9c116f5887 | ||
|
|
eb1013f925 | ||
|
|
9bd1484a95 | ||
|
|
7a90c020fc | ||
|
|
0a69ee682c | ||
|
|
8b5c63e898 | ||
|
|
dfe12fd7f8 | ||
|
|
73a2ac87da | ||
|
|
9cce0e39f6 | ||
|
|
10c20c7f91 | ||
|
|
f52b828abe | ||
|
|
c76fb15cfd | ||
|
|
167417a711 | ||
|
|
7fcd3cba8d | ||
|
|
9cb58ab0c9 | ||
|
|
702bbeb724 | ||
|
|
38fbc52a6f | ||
|
|
34e86f5881 | ||
|
|
20c72e1205 | ||
|
|
c02562518d | ||
|
|
723ebff923 | ||
|
|
62e7c716dd | ||
|
|
b17e4eed7d | ||
|
|
19727144d8 | ||
|
|
e62adc297a | ||
|
|
2e46cccd21 | ||
|
|
bbc19a5436 | ||
|
|
4cf0f85ee8 | ||
|
|
d268d2b09e | ||
|
|
200a1c9a84 | ||
|
|
ebacd83dde | ||
|
|
c878baa886 | ||
|
|
564731667e | ||
|
|
bae25cfe8f | ||
|
|
5f3dd04068 | ||
|
|
2eddaf90cf | ||
|
|
91d2998507 | ||
|
|
7eb0ee16b9 | ||
|
|
83392ddda1 | ||
|
|
847f4d88d6 | ||
|
|
fb9a1fdfd3 | ||
|
|
783406d730 | ||
|
|
be67b858b4 | ||
|
|
a796ba904a | ||
|
|
012f2f0cfa | ||
|
|
3e8c61c0c3 | ||
|
|
844f68ef4c | ||
|
|
e95566ed48 | ||
|
|
916fd73071 | ||
|
|
18a8d6c5bf | ||
|
|
37d01e831f | ||
|
|
975deab4b2 | ||
|
|
fb6f1ac0a8 | ||
|
|
069343803e | ||
|
|
36d38fe624 | ||
|
|
0d6680f574 | ||
|
|
dac2343b68 | ||
|
|
f24e02fd11 | ||
|
|
dddc7b020d | ||
|
|
12a9a0b97d | ||
|
|
6a8f48693b | ||
|
|
50a0668c1d | ||
|
|
a7e88a55b3 | ||
|
|
8012d9f6a8 | ||
|
|
73a050df13 | ||
|
|
d0a1a113b6 | ||
|
|
a8bffd3bce | ||
|
|
f6aac07c3d | ||
|
|
72f1d83af4 | ||
|
|
138080c4d4 | ||
|
|
cf70bfebe9 | ||
|
|
5fc1ab9c60 | ||
|
|
6078734136 | ||
|
|
917e33bccf | ||
|
|
6a8b604554 | ||
|
|
2fa282e131 | ||
|
|
810fe14c69 | ||
|
|
f4a26d0580 | ||
|
|
0a54c2d986 | ||
|
|
9c4f011fbc | ||
|
|
951727e266 | ||
|
|
7355061762 | ||
|
|
2872a1c29d | ||
|
|
fd29a94d6e | ||
|
|
5e0cff5b8e | ||
|
|
b3ae03ab7e | ||
|
|
5ec2877577 | ||
|
|
e182247774 | ||
|
|
6bd9bd98d9 | ||
|
|
0475954acf | ||
|
|
0d371593fb | ||
|
|
a6ef100e02 | ||
|
|
adc34b76da | ||
|
|
a91c785543 | ||
|
|
1cac58dadc | ||
|
|
510c31f669 | ||
|
|
bdb057ca0f | ||
|
|
dc5d7a8677 | ||
|
|
1fc1c64f62 | ||
|
|
d49f33476d | ||
|
|
2260f56713 | ||
|
|
eecd54c5ea | ||
|
|
e1f0b649f5 | ||
|
|
9605ec6109 | ||
|
|
b2977d6806 | ||
|
|
d091aecaf1 | ||
|
|
97f0d5fc5d | ||
|
|
2bc9b8c8bb | ||
|
|
e312ee2773 | ||
|
|
c685b970d3 | ||
|
|
621b7e5d29 | ||
|
|
b59ebb7d52 | ||
|
|
ce2141ddb7 | ||
|
|
36c88c3762 | ||
|
|
099b399b24 | ||
|
|
5092c78fba | ||
|
|
199cdf20a7 | ||
|
|
7c1040e7aa | ||
|
|
faf117b002 | ||
|
|
13e491cda7 | ||
|
|
286b7118be | ||
|
|
b2dfe31b5c | ||
|
|
1f005a3d42 | ||
|
|
36c64bd8dc | ||
|
|
277325d58c | ||
|
|
370f407ad6 | ||
|
|
3ea8e2294e | ||
|
|
c6413afa67 | ||
|
|
fe137a11bb | ||
|
|
0fa15161d4 | ||
|
|
aeb8792165 | ||
|
|
c60609d507 | ||
|
|
ad04c07017 | ||
|
|
f3f8326360 | ||
|
|
3798e386ae | ||
|
|
7d3afa005c | ||
|
|
3bfe2329f1 | ||
|
|
29765ebc19 | ||
|
|
b91f0e7f63 | ||
|
|
87352b04f1 | ||
|
|
0f034523e1 | ||
|
|
20b87e596a | ||
|
|
4b7cffad04 | ||
|
|
bcb0a19dea | ||
|
|
4e2311e8d7 | ||
|
|
c7be0f3b0e | ||
|
|
9ab79209ef | ||
|
|
1c3016a31e | ||
|
|
941001c743 | ||
|
|
40cf5ba63a | ||
|
|
9a40449f08 | ||
|
|
049d792053 | ||
|
|
e399085a57 | ||
|
|
18b4a90690 | ||
|
|
a68ffda7eb | ||
|
|
0a722edc88 | ||
|
|
de407608f2 | ||
|
|
ece0fdfe6c | ||
|
|
5008d35614 | ||
|
|
6b470f180c | ||
|
|
4deb895b4c | ||
|
|
5d70d822eb | ||
|
|
90a88cf69d | ||
|
|
044a992d25 | ||
|
|
4b066ec37f | ||
|
|
0dad02343e | ||
|
|
7f6a1a424d | ||
|
|
c2dc2c5836 | ||
|
|
58452204aa | ||
|
|
711ba73d6b | ||
|
|
5354f2732f | ||
|
|
9bbaaa2211 | ||
|
|
93c47d774e | ||
|
|
d8ad697d09 | ||
|
|
7308a7cf9a | ||
|
|
c9c49a7e5e | ||
|
|
dba6b2a291 | ||
|
|
7d3991b295 | ||
|
|
e4c0ecfb5a | ||
|
|
fdb0e842de | ||
|
|
85ff36198b | ||
|
|
e38321aa33 | ||
|
|
d1438d1b2e | ||
|
|
b6f848ef66 | ||
|
|
ff47784aee | ||
|
|
1dba711057 | ||
|
|
6911f7b24b | ||
|
|
1e94abd063 | ||
|
|
3325e1e388 | ||
|
|
4b87977e24 | ||
|
|
dfa28264c6 | ||
|
|
f0c1d6d4c2 | ||
|
|
427b98a157 | ||
|
|
8f5000443f | ||
|
|
7947fd6e91 | ||
|
|
70bf5499b2 | ||
|
|
6b059cb4f4 | ||
|
|
efd112c4b8 | ||
|
|
5c7b760f34 | ||
|
|
81ae473972 | ||
|
|
a8171bb739 | ||
|
|
c803ed4ee6 | ||
|
|
9e41a65749 | ||
|
|
43e7d6f7c2 | ||
|
|
a7539df5b5 | ||
|
|
3950619877 | ||
|
|
7373fd4aa9 | ||
|
|
c3d9885525 | ||
|
|
4b5dee7bdb | ||
|
|
55d846b9e0 | ||
|
|
f2d8349a88 | ||
|
|
7c7dd7c609 | ||
|
|
d8f2c580ee | ||
|
|
2a0602468d | ||
|
|
89a9c18188 | ||
|
|
8b426da149 | ||
|
|
cab98f9750 | ||
|
|
27b7a26fee | ||
|
|
7261fae9f2 | ||
|
|
628ebd6841 | ||
|
|
61bbf7c30d | ||
|
|
e33803343a | ||
|
|
b08a448fdc | ||
|
|
7210ebfb22 | ||
|
|
039978357b | ||
|
|
7ce2481cbc | ||
|
|
5bc6af87c5 | ||
|
|
a5eaf3566e | ||
|
|
58d40e912d | ||
|
|
63d89be698 | ||
|
|
1b7be9f9b0 | ||
|
|
7a53e96d52 | ||
|
|
b28d146de7 | ||
|
|
55c8be8dc5 | ||
|
|
38a273459a | ||
|
|
1b07632c69 | ||
|
|
4a12523793 | ||
|
|
6aa601b8ab | ||
|
|
a66a040207 | ||
|
|
547a408a99 | ||
|
|
8cd224b7fa | ||
|
|
8428e93b47 | ||
|
|
483143f2fe | ||
|
|
1b3d106b6d | ||
|
|
e7be006fa7 | ||
|
|
b9f40151d8 | ||
|
|
fd467acc29 | ||
|
|
e1ad0c31c8 | ||
|
|
ee604dc2b0 | ||
|
|
0620646c6d | ||
|
|
df9cf3f5c4 | ||
|
|
944349760a | ||
|
|
7fe75ee52a | ||
|
|
e3d7bf9a62 | ||
|
|
deaf49c18f | ||
|
|
53543fff4c | ||
|
|
ea5e710a70 | ||
|
|
ad5a52ae74 | ||
|
|
c0cc5ab085 | ||
|
|
cf784cbedd | ||
|
|
5c68830919 | ||
|
|
370aab41c3 | ||
|
|
081f4021bc | ||
|
|
36f846fabf | ||
|
|
f6d094f57c | ||
|
|
9ce097b7d6 | ||
|
|
91991f0c67 | ||
|
|
306cd13723 | ||
|
|
8c624cfacd | ||
|
|
b03ccce575 | ||
|
|
63b8788c80 | ||
|
|
faa3beddbc | ||
|
|
5dbd5bc1d2 | ||
|
|
b8b0d98e07 | ||
|
|
b911ebfd07 | ||
|
|
1ca515bd4e | ||
|
|
905710b6e9 | ||
|
|
12e0f674bc | ||
|
|
18739c2a24 | ||
|
|
f3dc2ff7e5 | ||
|
|
e6209a5906 | ||
|
|
dbf64a4e90 | ||
|
|
a8961c3466 | ||
|
|
6931952688 | ||
|
|
936aa17ecc | ||
|
|
f3d7420b8a | ||
|
|
e419acea6e | ||
|
|
95ae15b780 | ||
|
|
ed468e79fc | ||
|
|
130565af75 | ||
|
|
ad8f360336 | ||
|
|
15775403fd | ||
|
|
e1b83c32af | ||
|
|
3fc7c65247 | ||
|
|
c8d1239b79 | ||
|
|
7885257fae | ||
|
|
a8d22709e6 | ||
|
|
31b7b45ae3 | ||
|
|
681798b582 | ||
|
|
f05ea56179 | ||
|
|
ed4269ea4c | ||
|
|
085fcc958e | ||
|
|
8f33fe3595 | ||
|
|
980a7d79d3 | ||
|
|
9c5c07e087 | ||
|
|
faaf07cad8 | ||
|
|
0e83a230b9 | ||
|
|
c278b36858 | ||
|
|
0805f86b86 | ||
|
|
aad88f1da6 | ||
|
|
7550bc860f | ||
|
|
fc38e1edea | ||
|
|
88a66a705b | ||
|
|
f77fd00931 | ||
|
|
b5c030905a | ||
|
|
2844e13298 | ||
|
|
3e4dc1f9e3 | ||
|
|
259c1e1731 | ||
|
|
870aa674b0 | ||
|
|
b1ab319bf7 | ||
|
|
857422719a | ||
|
|
235314bc13 | ||
|
|
ac1cd88ae1 | ||
|
|
f93ea3c0a1 | ||
|
|
0075040aab | ||
|
|
f9d51e623c | ||
|
|
dcd36dcd67 | ||
|
|
608a921fce | ||
|
|
4bedf1e6ac | ||
|
|
ac14c310f6 | ||
|
|
f979da315a | ||
|
|
a74ef7de6b | ||
|
|
10064121a6 | ||
|
|
f8a1ef6066 | ||
|
|
40d7b11d90 | ||
|
|
1600dd9e0b | ||
|
|
fbf5164eca | ||
|
|
21d86a8c2d | ||
|
|
848c7e117b | ||
|
|
369868672b | ||
|
|
321f3517a7 | ||
|
|
6dd7ec9f95 | ||
|
|
dc00878ff9 | ||
|
|
90f444dc1a | ||
|
|
4fa2e273aa | ||
|
|
df92e0574a | ||
|
|
e2053e2f8b | ||
|
|
31f0052b9d | ||
|
|
b6169778fd | ||
|
|
32b98a7e40 | ||
|
|
5111c2a96b | ||
|
|
2ac901c891 | ||
|
|
ff4466951c | ||
|
|
8f05e254a2 | ||
|
|
5122903139 | ||
|
|
1344f776e4 | ||
|
|
f33367ebac | ||
|
|
3ac42deae5 | ||
|
|
3d04e7c125 | ||
|
|
fa77f11177 | ||
|
|
45c8767234 | ||
|
|
13dc87f368 | ||
|
|
fc0116182f | ||
|
|
bbe9f3f1db | ||
|
|
1009570102 | ||
|
|
47f42d0ffa | ||
|
|
23d21be73f | ||
|
|
25f8d2ca44 | ||
|
|
58d91ec0b0 | ||
|
|
85cc9868cb | ||
|
|
75631da398 | ||
|
|
03c74dae03 | ||
|
|
2089866756 | ||
|
|
8d982c7e3e | ||
|
|
079cecc529 | ||
|
|
b0d90f6fd5 | ||
|
|
58f4ae32d0 | ||
|
|
dd0373a3ee | ||
|
|
170dca7086 | ||
|
|
c930f04b5a | ||
|
|
f41d919ca8 | ||
|
|
8c4583b0d3 | ||
|
|
972518e9fc | ||
|
|
5b38fad85e | ||
|
|
d227601627 | ||
|
|
736e45aec9 | ||
|
|
11e2e86b06 | ||
|
|
58617b5685 | ||
|
|
8c2aa4844f | ||
|
|
8648db5518 | ||
|
|
b5b201b6df | ||
|
|
b601fe40b3 | ||
|
|
d6999b2a8a | ||
|
|
76f152aa35 | ||
|
|
63f8a2c5c0 | ||
|
|
ae482ecab6 | ||
|
|
a8e63ab397 | ||
|
|
a2717ad058 | ||
|
|
083035c924 | ||
|
|
92cce5910e | ||
|
|
ab897f05f9 | ||
|
|
cd8ca02322 | ||
|
|
5104225d11 | ||
|
|
24d6087ea7 | ||
|
|
dc9ee18e96 | ||
|
|
b4060b7903 | ||
|
|
884a3aad2c | ||
|
|
80f826421b | ||
|
|
7872bb48e2 | ||
|
|
7d10101c57 | ||
|
|
d9ed21ba53 | ||
|
|
5e8211172b | ||
|
|
24956255d7 | ||
|
|
55380dab04 | ||
|
|
e7926b6f22 | ||
|
|
fe7d8f73f3 | ||
|
|
47d7f001fe | ||
|
|
23a6722ddb | ||
|
|
23e2b756fd | ||
|
|
8bea05a77b | ||
|
|
d5ac4bac48 | ||
|
|
1af9b2e6db | ||
|
|
daa3c08706 | ||
|
|
29102e3b52 | ||
|
|
8c0fc54344 | ||
|
|
f5b20c2f32 | ||
|
|
79734ff603 | ||
|
|
397bfd8bca | ||
|
|
52dc111210 | ||
|
|
da1375e34d | ||
|
|
19f4ee51ed | ||
|
|
7be346d92f | ||
|
|
51a0a33b2a | ||
|
|
0df52b3cd8 | ||
|
|
18cd8f5966 | ||
|
|
5a31619b46 | ||
|
|
4b4e0cf69a | ||
|
|
8659ebca2d | ||
|
|
238e0be682 | ||
|
|
4324ceb8ca | ||
|
|
79db3c4c1d | ||
|
|
19d6c8f293 | ||
|
|
bcb74c7ed8 | ||
|
|
4a341bb7ab | ||
|
|
925027f7f0 | ||
|
|
1442a9106c | ||
|
|
fafb421a51 | ||
|
|
02615dc522 | ||
|
|
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 | ||
|
|
668f6d3a2b | ||
|
|
90e9017a19 | ||
|
|
9f3cb7ee8b | ||
|
|
df952a1779 | ||
|
|
3748f954c5 | ||
|
|
dcbacddb58 | ||
|
|
b0adec20e7 | ||
|
|
4e7e82c8a8 | ||
|
|
6905cd410d | ||
|
|
66bb130a1a | ||
|
|
03ae327e30 | ||
|
|
c1fde41f1f | ||
|
|
a10f6e4783 | ||
|
|
a76d2a3eb0 | ||
|
|
049886459a | ||
|
|
b57cb581dd | ||
|
|
f23cb78dcb | ||
|
|
bfffaab77f | ||
|
|
32af1b28a8 | ||
|
|
9fa72fa5f7 | ||
|
|
e35b15c868 | ||
|
|
22e0e8fba0 | ||
|
|
8caea57c47 | ||
|
|
24dd02a439 | ||
|
|
45c8092a94 | ||
|
|
48829dba3c | ||
|
|
46ee2168e1 | ||
|
|
5dd52ba17f | ||
|
|
78a65f26c6 | ||
|
|
f81666da5e | ||
|
|
4a1bc9f6c0 | ||
|
|
0652c40c52 | ||
|
|
a99145b705 | ||
|
|
222f875c42 | ||
|
|
dc983d4863 | ||
|
|
7256c28038 | ||
|
|
021cb4f93b | ||
|
|
83929cc8ee | ||
|
|
00ca01dc33 | ||
|
|
a49f359f9e | ||
|
|
be87d2861a | ||
|
|
481ca79cc1 | ||
|
|
346979c640 | ||
|
|
ec891fc0b2 | ||
|
|
ef6dd88b1e | ||
|
|
b2f3755196 | ||
|
|
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 | ||
|
|
c09b0a0341 | ||
|
|
8a739b31a1 | ||
|
|
afec210219 | ||
|
|
dafee90b24 | ||
|
|
f6790a5f9b | ||
|
|
4983a6dfb3 | ||
|
|
c4c477fdd8 | ||
|
|
20b89f0d2f | ||
|
|
53ed4f5b24 | ||
|
|
3300c303be | ||
|
|
e84aaeb56d | ||
|
|
cad361ed7a | ||
|
|
1187719e7b | ||
|
|
859cf7f215 | ||
|
|
6d97a060c3 | ||
|
|
fc04dde1e8 | ||
|
|
9564866f6d | ||
|
|
e3c52b1a56 | ||
|
|
3258a6754c | ||
|
|
db876ff107 | ||
|
|
994296640b | ||
|
|
9a68c7e1c3 | ||
|
|
ec597d4e6e | ||
|
|
2882e3d1a5 | ||
|
|
86e9cd0ec6 | ||
|
|
3a05f75ab0 | ||
|
|
34b4d30014 | ||
|
|
89b6c47bfb | ||
|
|
70f48108b4 | ||
|
|
df5689ec18 | ||
|
|
22d72b13d5 | ||
|
|
dee7ff34c9 | ||
|
|
07eb305992 | ||
|
|
c7f0076ee6 | ||
|
|
93bc5255e7 | ||
|
|
b87194336f | ||
|
|
0e98f84da7 | ||
|
|
b9ce3d4fe6 | ||
|
|
d65ab59d35 | ||
|
|
65e0752376 | ||
|
|
3251dd1c54 | ||
|
|
c404d8220d | ||
|
|
48409698ab | ||
|
|
4d7c4f38ae | ||
|
|
c2e4686a23 | ||
|
|
24df32ba7f | ||
|
|
744caef4f2 | ||
|
|
5cac8743f8 | ||
|
|
9c4d83dad3 | ||
|
|
fd3e69c9ab | ||
|
|
b6dfeb980c | ||
|
|
e8266480e5 | ||
|
|
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 | ||
|
|
d6b83454fe | ||
|
|
8ce7c25374 | ||
|
|
c1ab161b89 | ||
|
|
0d55b54371 | ||
|
|
46ac06698a | ||
|
|
81ce6ed8a3 | ||
|
|
0f8d1e7db1 | ||
|
|
507e5a0ebc | ||
|
|
76608a981c | ||
|
|
81d2f9829e | ||
|
|
b7d7f6896e | ||
|
|
88e8e3a59e | ||
|
|
d95bd0e063 | ||
|
|
0c80a00f31 | ||
|
|
1fe9a7d5e0 | ||
|
|
bfb4053bb4 | ||
|
|
2aad8a0ed0 | ||
|
|
7c1cce40b2 | ||
|
|
d7ef598654 | ||
|
|
bd0da36d63 | ||
|
|
6dedf1b030 | ||
|
|
c253c86787 | ||
|
|
59d823ff8b | ||
|
|
c8903ba25f | ||
|
|
3a5cf37dc0 | ||
|
|
8631b1fc99 | ||
|
|
0c6b6e0e0e | ||
|
|
9f33f497bc | ||
|
|
920ca2948b | ||
|
|
ad6c1ba2dc | ||
|
|
674d78721d | ||
|
|
3a1bd78252 | ||
|
|
b9b2f4a57e | ||
|
|
e4e9b63e4d | ||
|
|
40adc379ae | ||
|
|
9e53105f43 | ||
|
|
6505254e6c | ||
|
|
2d73dd2869 | ||
|
|
2abe6d7d12 | ||
|
|
ead9a250af | ||
|
|
3a9ec8cf6d | ||
|
|
8990e803a0 | ||
|
|
c76e9ccbf6 | ||
|
|
375f647e2d | ||
|
|
1b62c5cb97 | ||
|
|
0f52ea5aad | ||
|
|
2740b5e47b | ||
|
|
3894127f5c | ||
|
|
17ccea4b28 | ||
|
|
7bca5c8845 | ||
|
|
017df0484c | ||
|
|
d338bab82b | ||
|
|
35f8c126b6 | ||
|
|
eafe90e295 | ||
|
|
7b911034b8 | ||
|
|
798b89db11 | ||
|
|
506e3e550c | ||
|
|
8ab3167a28 | ||
|
|
436e7e3c59 | ||
|
|
9f1091a1c8 | ||
|
|
3b1e855da3 | ||
|
|
da95581099 | ||
|
|
d7f8bff17a | ||
|
|
a7caa2fbaa | ||
|
|
b215ef03c7 | ||
|
|
3cbbbc79fb | ||
|
|
eb5e9e926b | ||
|
|
ef2d1eb683 | ||
|
|
965f87393d | ||
|
|
023333b15f | ||
|
|
2241a760c2 | ||
|
|
e4dabd1725 | ||
|
|
1dfac3fb2f | ||
|
|
d0f856d389 | ||
|
|
ac6aa730c1 | ||
|
|
cd12412b46 | ||
|
|
9e146cde18 | ||
|
|
9b195d1d2e | ||
|
|
eb76db93e4 | ||
|
|
6f80102f79 | ||
|
|
90ca5ec13b | ||
|
|
28288c51fe | ||
|
|
70cdab96c4 | ||
|
|
e906d293a2 | ||
|
|
abdc43ef40 | ||
|
|
3ed7edbfbf | ||
|
|
95974ab21b | ||
|
|
7e9f18e89e | ||
|
|
e09f050088 | ||
|
|
5bfab90b5b | ||
|
|
7a064c0667 | ||
|
|
3289e7b950 | ||
|
|
102763f2ab | ||
|
|
09a78d4661 | ||
|
|
e0d8126514 | ||
|
|
1c9081e788 | ||
|
|
5cceb2c4ff | ||
|
|
66fcad69fa | ||
|
|
9bcd2d0aa6 | ||
|
|
2ab73d3df6 | ||
|
|
623dbdd418 | ||
|
|
78c4fc36b1 | ||
|
|
9ccef5471f | ||
|
|
0fc4c3cb4d | ||
|
|
c61f7b8e72 | ||
|
|
b81e034254 | ||
|
|
07f7572b13 | ||
|
|
2697fea249 | ||
|
|
cbb4f9d7ac | ||
|
|
0dbc2e1964 | ||
|
|
319fc12ebb | ||
|
|
2db7bf638b | ||
|
|
36a9514add | ||
|
|
497121a221 | ||
|
|
e17a3a2ab1 | ||
|
|
49a5a26f17 | ||
|
|
b66b8263c1 | ||
|
|
c3429cc0f3 | ||
|
|
f7a2ec2054 | ||
|
|
95ecdad024 | ||
|
|
e6cbbb3e3d | ||
|
|
b78ccaa097 | ||
|
|
593d6e7ec1 | ||
|
|
4c6b96e590 | ||
|
|
8631c78f9a | ||
|
|
a69ad34359 | ||
|
|
1099e4c9fe | ||
|
|
3a53f4f8a8 | ||
|
|
076a6cc1df | ||
|
|
b842bff9cb | ||
|
|
80a28085f1 | ||
|
|
0dd8cbccf0 | ||
|
|
abece6473b | ||
|
|
ff1b941690 | ||
|
|
85a6eb6195 | ||
|
|
87bfceb035 | ||
|
|
b95975d632 | ||
|
|
075cdb8272 | ||
|
|
7db4dee61a | ||
|
|
0993917dc6 | ||
|
|
d6cb20e2c4 | ||
|
|
3e65656c7b | ||
|
|
47dc94f820 | ||
|
|
c1870d46a2 | ||
|
|
1988c22626 | ||
|
|
a795d452c6 | ||
|
|
656b0e44d8 | ||
|
|
af39df5e0c | ||
|
|
1f23e1a646 | ||
|
|
ca47127197 | ||
|
|
7ca89908cd | ||
|
|
2c94f61843 | ||
|
|
7326acba81 | ||
|
|
77b4b76f14 | ||
|
|
eca27d18ea | ||
|
|
2f67ffd2f8 | ||
|
|
40d13fadb3 | ||
|
|
3791f4aa6f | ||
|
|
79c60dc7c7 | ||
|
|
5035b65883 | ||
|
|
4211ebec76 | ||
|
|
d02edc3dd1 | ||
|
|
e86200b942 | ||
|
|
776b5450f9 | ||
|
|
c80b42d9bc | ||
|
|
6aa37e6e26 | ||
|
|
089a3d5c24 | ||
|
|
1741567e19 | ||
|
|
de5b16e384 | ||
|
|
a8c203aea0 | ||
|
|
2aa30475e9 | ||
|
|
9a5e15b292 | ||
|
|
bb9695b272 | ||
|
|
d436fd86f8 | ||
|
|
3f393b0937 | ||
|
|
fb271633d9 | ||
|
|
e40fad76fd | ||
|
|
41db12d8d7 | ||
|
|
28d29291a7 | ||
|
|
22e0379769 | ||
|
|
b60bbbcb4e | ||
|
|
0da121a48d | ||
|
|
6b6ffd6e58 | ||
|
|
21dbf87ab9 | ||
|
|
a5fcd9f860 | ||
|
|
2853bf5c70 | ||
|
|
2d55d88db8 | ||
|
|
2567e7cd74 | ||
|
|
e2bac619b7 | ||
|
|
0bdab0d9fc | ||
|
|
e55fe55dc7 | ||
|
|
5a474d523c | ||
|
|
d126392ee2 | ||
|
|
c38dc4661d | ||
|
|
675ac5a03f | ||
|
|
233f9dfd88 | ||
|
|
b414598b07 | ||
|
|
2c4e768a3a | ||
|
|
04d61bd040 | ||
|
|
5a96b7efd6 | ||
|
|
329e147add | ||
|
|
334b5bf63f | ||
|
|
58940a6765 | ||
|
|
2442539e1b | ||
|
|
b56237115e | ||
|
|
038192095d | ||
|
|
9a18b4b62b | ||
|
|
c6f5abc036 | ||
|
|
ad76a04e8f | ||
|
|
0b70be4939 | ||
|
|
da2590791e | ||
|
|
79a7958519 | ||
|
|
f4d452f3bc | ||
|
|
d08e2f09db | ||
|
|
d5cc3f300a | ||
|
|
1982cecc31 | ||
|
|
2f05f1dbdb | ||
|
|
a67a55c599 | ||
|
|
253b5a3f85 | ||
|
|
45aaf31722 | ||
|
|
d0b9917e84 | ||
|
|
32dcacf9ba | ||
|
|
0e0c309c15 | ||
|
|
6d1385f00c | ||
|
|
dabfeeea3c | ||
|
|
20b9996f14 | ||
|
|
1ea5257da4 | ||
|
|
3c360ab1b8 | ||
|
|
b1c60572ef | ||
|
|
14ad572f18 | ||
|
|
1481d01cf8 | ||
|
|
492781ea3d | ||
|
|
542d978d9c | ||
|
|
c893dcd271 | ||
|
|
57552455e3 | ||
|
|
fe69e2f11d | ||
|
|
684a3d2229 | ||
|
|
3d738e1b7c | ||
|
|
a5daa156ab | ||
|
|
018b2b4711 | ||
|
|
d12ec968c4 | ||
|
|
531a0bd9ea | ||
|
|
7950c577e9 | ||
|
|
3bc77f9b09 | ||
|
|
05260c05c2 | ||
|
|
d0ea54237e | ||
|
|
f404d54d02 | ||
|
|
5a2d9eabf4 | ||
|
|
1b936100e7 | ||
|
|
34ea6eb37f | ||
|
|
2c006ec430 | ||
|
|
f541261e43 | ||
|
|
f910fdfa73 | ||
|
|
72f86c4ad0 | ||
|
|
0cb192ce36 | ||
|
|
3aadc5d68f | ||
|
|
1387f381d2 | ||
|
|
7257f2e557 | ||
|
|
025bfdb4b0 | ||
|
|
1a50566328 | ||
|
|
ae914daa0c | ||
|
|
b984475335 | ||
|
|
59f5101858 | ||
|
|
e7d3e4d6dd | ||
|
|
79e1835216 | ||
|
|
e4072fb395 | ||
|
|
666d6dac48 | ||
|
|
ea5b340933 | ||
|
|
534c299383 | ||
|
|
99eb33ccbb | ||
|
|
760e5ca74e | ||
|
|
cd57c9cd34 | ||
|
|
2a184bcb2e | ||
|
|
df63819602 | ||
|
|
628d5b24c1 | ||
|
|
8221d5b441 | ||
|
|
ad7cfdabd0 | ||
|
|
4237dfb269 | ||
|
|
c512b079fa | ||
|
|
b4cd151a03 | ||
|
|
eab958eac4 | ||
|
|
17e94e01d0 | ||
|
|
6451077d1d | ||
|
|
ce265e281a | ||
|
|
f4511c79e6 | ||
|
|
06c7703628 | ||
|
|
619e8590c8 | ||
|
|
88efcf4da6 | ||
|
|
556ba33172 | ||
|
|
9d7b939d42 | ||
|
|
0bea278c5c | ||
|
|
65814f1ef6 | ||
|
|
1a7fc57f66 | ||
|
|
db0eb3e4da | ||
|
|
175996ce90 | ||
|
|
323f635b7b | ||
|
|
f70f82014f | ||
|
|
8756808444 | ||
|
|
bb6e798bce | ||
|
|
a5c226d128 | ||
|
|
729dba8e0b | ||
|
|
85c3e74cdd | ||
|
|
c7bcbf6323 | ||
|
|
f3302a9e30 | ||
|
|
1e331fc19d | ||
|
|
31a7011260 | ||
|
|
181c36cdc9 | ||
|
|
36ac0b75e7 | ||
|
|
f9cec41360 | ||
|
|
19dcf6f3d5 | ||
|
|
d5aef16860 | ||
|
|
1d28c30680 | ||
|
|
9a3c4e69e8 | ||
|
|
55ba535353 | ||
|
|
56025d3d33 | ||
|
|
59cae7a8ce | ||
|
|
9a9f859b70 | ||
|
|
ba3a1f6298 | ||
|
|
10e6e7c3cb | ||
|
|
a510489570 | ||
|
|
fcbc6002d1 | ||
|
|
eeb48e2ad6 | ||
|
|
b114ed2414 | ||
|
|
1064f39020 | ||
|
|
b5a460a1b7 | ||
|
|
9a961b80e5 | ||
|
|
7bc05fa118 | ||
|
|
f7af7e649d | ||
|
|
4efb93ea45 | ||
|
|
a5edb6497c | ||
|
|
d6314ea9a1 | ||
|
|
c244ca672f | ||
|
|
401777cc4c | ||
|
|
7ef8afb1ba | ||
|
|
e25bb5578a | ||
|
|
401f3e176e | ||
|
|
10ae117914 | ||
|
|
86cea2ad9f | ||
|
|
ccef46a5cf | ||
|
|
c803da3dfa | ||
|
|
02ff45f705 | ||
|
|
8a05a959c3 | ||
|
|
e5d407b1ce | ||
|
|
5cd53be5be | ||
|
|
c6cc8ee6bb | ||
|
|
eaf4ea04ac | ||
|
|
007f7112a7 | ||
|
|
f62fd8484a | ||
|
|
849bdac81b | ||
|
|
c1d2f2c9cc | ||
|
|
d92d22d99c | ||
|
|
8829acba3f | ||
|
|
66c4a19ad6 | ||
|
|
a65b78084f | ||
|
|
cdaa9c03a2 | ||
|
|
a35a573b2b | ||
|
|
314cdc687a | ||
|
|
df3b300967 | ||
|
|
d174f25d03 | ||
|
|
cf7ead3d84 | ||
|
|
18c40809a6 | ||
|
|
c83b01bbb7 | ||
|
|
fb595de457 | ||
|
|
acbd3f9a9e | ||
|
|
98c1680138 | ||
|
|
0ffe9adc86 | ||
|
|
56b4f8a221 | ||
|
|
f1945151c7 | ||
|
|
cc31e864d5 | ||
|
|
868e5c2079 | ||
|
|
70185156aa | ||
|
|
7fc886f43c | ||
|
|
8e79199766 | ||
|
|
40a88b5b09 | ||
|
|
c6f56a23d6 |
40
.codeclimate.yml
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
engines:
|
||||||
|
rubocop:
|
||||||
|
enabled: true
|
||||||
|
scss-lint:
|
||||||
|
enabled: true
|
||||||
|
shellcheck:
|
||||||
|
enabled: true
|
||||||
|
eslint:
|
||||||
|
enabled: true
|
||||||
|
coffeelint:
|
||||||
|
enabled: true
|
||||||
|
brakeman:
|
||||||
|
enabled: true
|
||||||
|
bundler-audit:
|
||||||
|
enabled: true
|
||||||
|
duplication:
|
||||||
|
enabled: true
|
||||||
|
config:
|
||||||
|
languages:
|
||||||
|
- ruby
|
||||||
|
- javascript
|
||||||
|
fixme:
|
||||||
|
enabled: true
|
||||||
|
exclude_fingerprints: # rubocop_todo filename
|
||||||
|
- 63b8552079d106832fbe281566b6d028
|
||||||
|
- d38afbaaea3ecaa9a4cf046b07a01cec
|
||||||
|
- 57ff3968fd371d3e1f75c237d6c78acf
|
||||||
|
ratings:
|
||||||
|
paths:
|
||||||
|
- "**.rb"
|
||||||
|
- "**.js"
|
||||||
|
- "**.coffee"
|
||||||
|
- "**.sass"
|
||||||
|
- "**.haml"
|
||||||
|
- Gemfile.lock
|
||||||
|
exclude_paths:
|
||||||
|
- config/
|
||||||
|
- db/
|
||||||
|
- spec/
|
||||||
|
- public/
|
||||||
2
.gitignore
vendored
@@ -8,8 +8,10 @@ coverage
|
|||||||
*~
|
*~
|
||||||
*.DS_Store
|
*.DS_Store
|
||||||
config/application.yml
|
config/application.yml
|
||||||
|
config/database.yml
|
||||||
credentials*.sh
|
credentials*.sh
|
||||||
Pathogen:
|
Pathogen:
|
||||||
custom_plan.rb
|
custom_plan.rb
|
||||||
zeus.json
|
zeus.json
|
||||||
.bundle
|
.bundle
|
||||||
|
.idea/**
|
||||||
68
.rubocop.yml
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
inherit_from: .rubocop_todo.yml
|
||||||
|
AllCops:
|
||||||
|
Include:
|
||||||
|
- 'Rakefile'
|
||||||
|
- 'config.ru'
|
||||||
|
- 'lib/**/*.rake'
|
||||||
|
Exclude:
|
||||||
|
- 'db/schema.rb'
|
||||||
|
- 'vendor/**/*'
|
||||||
|
|
||||||
|
Style/FileName:
|
||||||
|
Exclude:
|
||||||
|
- 'Gemfile'
|
||||||
|
- 'Gemfile.lock'
|
||||||
|
|
||||||
|
Style/StringLiterals:
|
||||||
|
Enabled: false
|
||||||
|
|
||||||
|
Style/MultilineMethodCallIndentation:
|
||||||
|
EnforcedStyle: indented
|
||||||
|
|
||||||
|
# Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth.
|
||||||
|
# SupportedStyles: with_first_parameter, with_fixed_indentation
|
||||||
|
Style/AlignParameters:
|
||||||
|
EnforcedStyle: with_fixed_indentation
|
||||||
|
|
||||||
|
Metrics/MethodLength:
|
||||||
|
Description: 'Avoid methods longer than 30 lines of code.'
|
||||||
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#short-methods'
|
||||||
|
# Set to 30 once all methods are fixed.
|
||||||
|
# Max: 30
|
||||||
|
Max: 104
|
||||||
|
|
||||||
|
# Remove the following once the code style matches
|
||||||
|
# Offense count: 59
|
||||||
|
Metrics/AbcSize:
|
||||||
|
Max: 115
|
||||||
|
|
||||||
|
# Offense count: 5
|
||||||
|
# Configuration parameters: CountComments.
|
||||||
|
Metrics/BlockLength:
|
||||||
|
Max: 62
|
||||||
|
|
||||||
|
# Offense count: 6
|
||||||
|
# Configuration parameters: CountComments.
|
||||||
|
Metrics/ClassLength:
|
||||||
|
Max: 275
|
||||||
|
|
||||||
|
# Offense count: 6
|
||||||
|
Metrics/CyclomaticComplexity:
|
||||||
|
Max: 11
|
||||||
|
|
||||||
|
Metrics/LineLength:
|
||||||
|
Max: 120
|
||||||
|
|
||||||
|
# Offense count: 8
|
||||||
|
Metrics/PerceivedComplexity:
|
||||||
|
Max: 10
|
||||||
|
|
||||||
|
# See https://github.com/bbatsov/rubocop/issues/3629
|
||||||
|
Rails/HttpPositionalArguments:
|
||||||
|
Enabled: false
|
||||||
|
|
||||||
|
Style/Documentation:
|
||||||
|
Enabled: false
|
||||||
|
|
||||||
|
Style/FrozenStringLiteralComment:
|
||||||
|
Enabled: false
|
||||||
1088
.rubocop_todo.yml
Normal file
@@ -1 +1 @@
|
|||||||
2.1.5
|
2.3.1
|
||||||
|
|||||||
58
.travis.yml
@@ -1,12 +1,58 @@
|
|||||||
---
|
sudo: false
|
||||||
language: ruby
|
language: ruby
|
||||||
|
cache:
|
||||||
env: GROWSTUFF_SITE_NAME="Growstuff (travis)" RAILS_SECRET_TOKEN='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
|
bundler: true
|
||||||
bundler_args: --without development production staging
|
directories:
|
||||||
|
- travis_phantomjs
|
||||||
|
env:
|
||||||
|
matrix:
|
||||||
|
- GROWSTUFF_SITE_NAME="Growstuff (travis)" RAILS_SECRET_TOKEN='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' GROWSTUFF_ELASTICSEARCH='true'
|
||||||
|
- GROWSTUFF_SITE_NAME="Growstuff (travis)" RAILS_SECRET_TOKEN='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' GROWSTUFF_ELASTICSEARCH='false'
|
||||||
|
global:
|
||||||
|
secure: "Z5TpM2jEX4UCvNePnk/LwltQX48U2u9BRc+Iypr1x9QW2o228QJhPIOH39a8RMUrepGnkQIq9q3ZRUn98RfrJz1yThtlNFL3NmzdQ57gKgjGwfpa0e4Dwj/ZJqV2D84tDGjvdVYLP7zzaYZxQcwk/cgNpzKf/jq97HLNP7CYuf4="
|
||||||
rvm:
|
rvm:
|
||||||
- 2.1.5
|
- 2.3.1
|
||||||
|
before_install:
|
||||||
|
- export PATH=$PWD/travis_phantomjs/phantomjs-2.1.1-linux-x86_64/bin:$PATH
|
||||||
|
- >
|
||||||
|
if [ $(phantomjs --version) != '2.1.1' ]; then
|
||||||
|
PHANTOM_URL=https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2;
|
||||||
|
rm -rf $PWD/travis_phantomjs;
|
||||||
|
mkdir -p $PWD/travis_phantomjs;
|
||||||
|
wget $PHANTOM_URL -O $PWD/travis_phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2;
|
||||||
|
tar -xvf $PWD/travis_phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2 -C $PWD/travis_phantomjs;
|
||||||
|
fi
|
||||||
|
- phantomjs --version
|
||||||
before_script:
|
before_script:
|
||||||
- psql -c 'create database growstuff_test;' -U postgres
|
- bundle exec rake db:create db:migrate db:test:prepare
|
||||||
|
- bundle exec rake assets:precompile
|
||||||
script:
|
script:
|
||||||
|
- bundle exec rubocop --display-cop-names --rails
|
||||||
|
- script/gemfile_check
|
||||||
|
- bundle exec script/check_contributors_md
|
||||||
- bundle exec rake db:migrate --trace
|
- bundle exec rake db:migrate --trace
|
||||||
- bundle exec rspec spec/
|
- bundle exec rspec spec/
|
||||||
|
services:
|
||||||
|
- elasticsearch
|
||||||
|
before_deploy:
|
||||||
|
- bundle exec script/heroku_maintenance.rb on
|
||||||
|
deploy:
|
||||||
|
provider: heroku
|
||||||
|
api_key:
|
||||||
|
secure: WrQxf0fEKkCdXrjcejurobOnNNz3he4dDwjBbToXbQTQNDObPp7NetJrLsfM8FiUFEeOuvhIHHiDQtMvY720zGGAGxDptvgFS+0QHCUqoTRZA/yFfUmHlG2jROXTzk5uVK0AE4k6Ion5kX8+mM0EnMT/7u+MTFiukrJctSiEXfg=
|
||||||
|
on:
|
||||||
|
repo: Growstuff/growstuff
|
||||||
|
app:
|
||||||
|
dev: growstuff-staging
|
||||||
|
master: growstuff-prod
|
||||||
|
travis_deploy: tranquil-basin-3130
|
||||||
|
travis_containers: tranquil-basin-3130
|
||||||
|
run:
|
||||||
|
- "rake db:migrate"
|
||||||
|
- "script/deploy-tasks.sh"
|
||||||
|
- restart
|
||||||
|
after_deploy:
|
||||||
|
- bundle exec script/heroku_maintenance.rb off
|
||||||
|
addons:
|
||||||
|
code_climate:
|
||||||
|
repo_token: 462e015bbdaabfb20910fc07f2fea253410ecb131444e00f97dbf32dc6789ca6
|
||||||
|
|||||||
7
.yamllint
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
extends: relaxed
|
||||||
|
|
||||||
|
rules:
|
||||||
|
# 80 chars should be enough, but don't fail if a line is longer
|
||||||
|
line-length:
|
||||||
|
max: 150
|
||||||
|
level: warning
|
||||||
@@ -11,10 +11,12 @@ submit the change with your pull request.
|
|||||||
- Alex Bayley / [Skud](https://github.com/Skud)
|
- Alex Bayley / [Skud](https://github.com/Skud)
|
||||||
- Cesy / [cesy](https://github.com/cesy)
|
- Cesy / [cesy](https://github.com/cesy)
|
||||||
- Miles Gould / [pozorvlak](https://github.com/pozorvlak)
|
- Miles Gould / [pozorvlak](https://github.com/pozorvlak)
|
||||||
- Joseph Caudle / [jcaudle](https://github.com/jcaudle)
|
- Taylor Griffin / [tygriffin](https://github.com/tygriffin)
|
||||||
|
- Mackenzie Morgan / [maco](https://github.com/maco)
|
||||||
|
|
||||||
## Contributors
|
## Contributors
|
||||||
|
|
||||||
|
- Joseph Caudle / [jcaudle](https://github.com/jcaudle)
|
||||||
- Ricky Amianym / [amianym](https://github.com/amianym)
|
- Ricky Amianym / [amianym](https://github.com/amianym)
|
||||||
- Juliet Kemp / [julietk](https://github.com/julietk)
|
- Juliet Kemp / [julietk](https://github.com/julietk)
|
||||||
- Federico Mena Quintero / [federicomenaquintero](https://github.com/federicomenaquintero)
|
- Federico Mena Quintero / [federicomenaquintero](https://github.com/federicomenaquintero)
|
||||||
@@ -22,7 +24,6 @@ submit the change with your pull request.
|
|||||||
- Maia Sauren / [sauramaia](https://github.com/sauramaia)
|
- Maia Sauren / [sauramaia](https://github.com/sauramaia)
|
||||||
- Norman Ancajas / [nbancajas](https://github.com/nbancajas)
|
- Norman Ancajas / [nbancajas](https://github.com/nbancajas)
|
||||||
- Jonathan "Duke" Leto / [leto](https://github.com/leto)
|
- Jonathan "Duke" Leto / [leto](https://github.com/leto)
|
||||||
- Mackenzie Morgan / [maco](https://github.com/maco)
|
|
||||||
- Amy Hendrix / [sabreuse](https://github.com/sabreuse)
|
- Amy Hendrix / [sabreuse](https://github.com/sabreuse)
|
||||||
- CephLPod / [cephLpod](https://github.com/cephLpod/)
|
- CephLPod / [cephLpod](https://github.com/cephLpod/)
|
||||||
- Gemma Mason / [gemmaellen](https://github.com/gemmaellen)
|
- Gemma Mason / [gemmaellen](https://github.com/gemmaellen)
|
||||||
@@ -40,7 +41,6 @@ submit the change with your pull request.
|
|||||||
- Marty Hines / [martyhines](https://github.com/martyhines)
|
- Marty Hines / [martyhines](https://github.com/martyhines)
|
||||||
- Amelia Greenhall / [ameliagreenhall](https://github.com/ameliagreenhall)
|
- Amelia Greenhall / [ameliagreenhall](https://github.com/ameliagreenhall)
|
||||||
- Barb Natali / [barbnatali](https://github.com/barbnatali)
|
- Barb Natali / [barbnatali](https://github.com/barbnatali)
|
||||||
- Taylor Griffin / [tygriffin](https://github.com/tygriffin)
|
|
||||||
- Marlena Compton / [Marlena](https://github.com/marlena)
|
- Marlena Compton / [Marlena](https://github.com/marlena)
|
||||||
- Elizabeth A. Kari / [catfriend](https://github.com/catfriend)
|
- Elizabeth A. Kari / [catfriend](https://github.com/catfriend)
|
||||||
- Cheri Allen / [cherimarie](https://github.com/cherimarie)
|
- Cheri Allen / [cherimarie](https://github.com/cherimarie)
|
||||||
@@ -51,4 +51,24 @@ submit the change with your pull request.
|
|||||||
- Yoong Kang Lim / [yoongkang](https://github.com/yoongkang)
|
- Yoong Kang Lim / [yoongkang](https://github.com/yoongkang)
|
||||||
- Kevin Yang / [kevieyang](https://github.com/kevieyang)
|
- Kevin Yang / [kevieyang](https://github.com/kevieyang)
|
||||||
- Justin Hamman / [juzham](https://github.com/juzham)
|
- Justin Hamman / [juzham](https://github.com/juzham)
|
||||||
|
- 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)
|
||||||
|
- DV Dasari / [dv2](https://github.com/dv2)
|
||||||
|
- Eric Tillberg / [Thrillberg](https://github.com/Thrillberg)
|
||||||
|
- Lucas Nogueira / [lucasnogueira](https://github.com/lucasnogueira)
|
||||||
|
- Charley Lewittes / [ctlewitt](https://github.com/ctlewitt)
|
||||||
|
- Kristine Nicole Polvoriza / [polveenomials](https://github.com/polveenomials)
|
||||||
|
- Brenda Wallace / [br3nda](https://github.com/br3nda)
|
||||||
|
|||||||
4
Capfile
@@ -1,4 +0,0 @@
|
|||||||
load 'deploy'
|
|
||||||
# Uncomment if you are using Rails' asset pipeline
|
|
||||||
# load 'deploy/assets'
|
|
||||||
load 'config/deploy' # remove this line to skip loading any of the default tasks
|
|
||||||
191
Gemfile
@@ -1,83 +1,90 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
source 'https://rubygems.org'
|
source 'https://rubygems.org'
|
||||||
|
|
||||||
ruby "2.1.5"
|
ruby '2.3.1'
|
||||||
|
|
||||||
|
gem 'rails', '~> 4.2.1'
|
||||||
|
|
||||||
gem 'bundler', '>=1.1.5'
|
gem 'bundler', '>=1.1.5'
|
||||||
|
|
||||||
gem 'rails', '3.2.13'
|
gem 'sass-rails', '~> 5.0.4'
|
||||||
gem 'rack', '~>1.4.5'
|
gem 'coffee-rails', '~> 4.1.0'
|
||||||
gem 'json', '~>1.7.7'
|
|
||||||
gem 'haml'
|
gem 'haml'
|
||||||
|
|
||||||
|
# CSS framework
|
||||||
|
gem 'bootstrap-sass', '~> 3.3.6'
|
||||||
|
gem 'font-awesome-sass'
|
||||||
|
|
||||||
|
gem 'uglifier', '~> 2.7.2' # JavaScript compressor
|
||||||
|
|
||||||
|
gem 'jquery-rails'
|
||||||
|
gem 'jquery-ui-rails', '~> 5.0.2'
|
||||||
|
gem 'js-routes' # provides access to Rails routes in Javascript
|
||||||
|
gem 'flickraw'
|
||||||
|
|
||||||
gem 'leaflet-rails'
|
gem 'leaflet-rails'
|
||||||
gem 'leaflet-markercluster-rails'
|
gem 'leaflet-markercluster-rails'
|
||||||
gem 'unicorn' # http server
|
gem 'unicorn' # http server
|
||||||
|
|
||||||
gem 'pg'
|
gem 'pg'
|
||||||
|
gem 'figaro' # for handling config via ENV variables
|
||||||
|
gem 'cancancan', '~> 1.9' # for checking member privileges
|
||||||
|
gem 'gibbon', '~>1.2.0' # for Mailchimp newsletter subscriptions
|
||||||
|
gem 'csv_shaper' # CSV export
|
||||||
|
gem 'ruby-units' # for unit conversion
|
||||||
|
|
||||||
gem 'figaro' # for handling config via ENV variables
|
gem 'comfortable_mexican_sofa', '~> 1.12.0' # content management system
|
||||||
|
|
||||||
gem 'cancan' # for checking member privileges
|
gem 'kaminari' # pagination
|
||||||
|
gem 'bootstrap-kaminari-views' # bootstrap views for kaminari
|
||||||
|
|
||||||
gem 'gibbon' # for Mailchimp newsletter subscriptions
|
gem 'activemerchant'
|
||||||
|
gem 'active_utils'
|
||||||
|
gem 'sidekiq'
|
||||||
|
|
||||||
gem 'csv_shaper' # CSV export
|
# Markdown formatting for updates etc
|
||||||
|
gem 'bluecloth'
|
||||||
|
|
||||||
# vendored activemerchant for testing- needed for bogus paypal
|
# Pagination
|
||||||
# gateway monkeypatch
|
gem 'will_paginate', '~> 3.0'
|
||||||
gem 'activemerchant', '1.33.0',
|
|
||||||
:path => 'vendor/gems/activemerchant-1.33.0',
|
# user signup/login/etc
|
||||||
:require => 'active_merchant'
|
gem 'devise', '>= 4.0.0'
|
||||||
gem 'active_utils', '1.0.5',
|
|
||||||
:path => 'vendor/gems/active_utils-1.0.5'
|
# nicely formatted URLs
|
||||||
|
gem 'friendly_id', '~> 5.0.4'
|
||||||
|
|
||||||
|
# gravatars
|
||||||
|
gem 'gravatar-ultimate'
|
||||||
|
|
||||||
|
# For geolocation
|
||||||
|
gem 'geocoder'
|
||||||
|
|
||||||
|
# For easy calendar selection
|
||||||
|
gem 'bootstrap-datepicker-rails'
|
||||||
|
|
||||||
|
# For connecting to other services (eg Twitter)
|
||||||
|
gem 'omniauth'
|
||||||
|
gem 'omniauth-twitter'
|
||||||
|
gem 'omniauth-flickr', '>= 0.0.15'
|
||||||
|
gem 'omniauth-facebook'
|
||||||
|
|
||||||
|
# client for Elasticsearch. Elasticsearch is a flexible
|
||||||
|
# and powerful, distributed, real-time search and analytics engine.
|
||||||
|
# An example of the use in the project is fuzzy crop search.
|
||||||
|
gem "elasticsearch-model"
|
||||||
|
gem "elasticsearch-rails"
|
||||||
|
|
||||||
|
gem 'rake', '>= 10.0.0'
|
||||||
|
|
||||||
group :production, :staging do
|
group :production, :staging do
|
||||||
gem 'newrelic_rpm'
|
gem 'newrelic_rpm'
|
||||||
gem 'dalli'
|
gem 'dalli'
|
||||||
gem 'memcachier'
|
gem 'memcachier'
|
||||||
gem 'rails_12factor' # supresses heroku plugin injection
|
gem 'rails_12factor' # supresses heroku plugin injection
|
||||||
|
gem 'bonsai-elasticsearch-rails' # Integration with Bonsa-Elasticsearch on heroku
|
||||||
|
gem 'sparkpost_rails'
|
||||||
end
|
end
|
||||||
|
|
||||||
# Gems used only for assets and not required
|
|
||||||
# in production environments by default.
|
|
||||||
group :assets do
|
|
||||||
# CSS preprocessor, used for app/assets/stylesheets/application.css
|
|
||||||
gem 'sass-rails', '~> 3.2.3'
|
|
||||||
# CoffeeScript is a Python-like language that compiles to JavaScript
|
|
||||||
gem 'coffee-rails', '~> 3.2.1'
|
|
||||||
|
|
||||||
# less-rails depends on a JavaScript engine; we use therubyracer.
|
|
||||||
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
|
|
||||||
# long term, we'll probably want node.js for performance, but this will do
|
|
||||||
# for now as it's easier for new people to install
|
|
||||||
gem "therubyracer", "~> 0.12", :platforms => :ruby
|
|
||||||
# libv8 is needed by therubyracer and is a bit finicky
|
|
||||||
gem 'libv8', '3.16.14.7'
|
|
||||||
|
|
||||||
# Another CSS preprocessor, used for Bootstrap overrides
|
|
||||||
gem "less", '~>2.5.0'
|
|
||||||
gem "less-rails", '~> 2.5.0'
|
|
||||||
# CSS framework
|
|
||||||
gem "less-rails-bootstrap", '~> 3.2.0'
|
|
||||||
|
|
||||||
gem 'uglifier', '>= 1.0.3' # JavaScript compressor
|
|
||||||
|
|
||||||
gem 'compass-rails', '~> 1.0.3' # Yet Another CSS framework
|
|
||||||
end
|
|
||||||
|
|
||||||
gem 'jquery-rails'
|
|
||||||
gem 'jquery-ui-rails'
|
|
||||||
gem 'js-routes' # provides access to Rails routes in Javascript
|
|
||||||
gem 'flickraw'
|
|
||||||
|
|
||||||
# To use ActiveModel has_secure_password
|
|
||||||
# gem 'bcrypt-ruby', '~> 3.0.0'
|
|
||||||
|
|
||||||
# To use Jbuilder templates for JSON
|
|
||||||
# gem 'jbuilder'
|
|
||||||
|
|
||||||
# Use unicorn as the app server
|
|
||||||
# gem 'unicorn'
|
|
||||||
|
|
||||||
group :development do
|
group :development do
|
||||||
# A debugger and irb alternative. Pry doesn't play nice
|
# A debugger and irb alternative. Pry doesn't play nice
|
||||||
# with unicorn, so start a Webrick server when debugging
|
# with unicorn, so start a Webrick server when debugging
|
||||||
@@ -86,48 +93,34 @@ group :development do
|
|||||||
gem 'better_errors'
|
gem 'better_errors'
|
||||||
gem 'binding_of_caller'
|
gem 'binding_of_caller'
|
||||||
gem 'letter_opener'
|
gem 'letter_opener'
|
||||||
|
gem 'quiet_assets'
|
||||||
|
gem 'guard'
|
||||||
|
gem 'guard-rspec'
|
||||||
end
|
end
|
||||||
|
|
||||||
# Markdown formatting for updates etc
|
|
||||||
gem 'bluecloth'
|
|
||||||
|
|
||||||
# Pagination
|
|
||||||
gem 'will_paginate', '~> 3.0'
|
|
||||||
|
|
||||||
# user signup/login/etc
|
|
||||||
gem 'devise', '~> 3.2.0'
|
|
||||||
|
|
||||||
# nicely formatted URLs
|
|
||||||
gem 'friendly_id', '~> 4.0.10'
|
|
||||||
|
|
||||||
# gravatars
|
|
||||||
gem 'gravatar-ultimate'
|
|
||||||
|
|
||||||
# For geolocation
|
|
||||||
gem 'geocoder',
|
|
||||||
:git => 'https://github.com/alexreisner/geocoder.git',
|
|
||||||
:ref => '104d46'
|
|
||||||
|
|
||||||
# For easy calendar selection
|
|
||||||
gem 'bootstrap-datepicker-rails'
|
|
||||||
|
|
||||||
# For connecting to other services (eg Twitter)
|
|
||||||
gem 'omniauth'
|
|
||||||
gem 'omniauth-twitter'
|
|
||||||
gem 'omniauth-flickr', '>= 0.0.15'
|
|
||||||
|
|
||||||
gem 'rake', '>= 10.0.0'
|
|
||||||
|
|
||||||
group :development, :test do
|
group :development, :test do
|
||||||
gem 'byebug' # debugging
|
gem 'haml-rails' # HTML templating language
|
||||||
gem 'haml-rails' # HTML templating language
|
gem 'rspec-rails' # unit testing framework
|
||||||
gem 'rspec-rails', '~> 2.12.1' # unit testing framework
|
gem 'rspec-activemodel-mocks'
|
||||||
gem 'database_cleaner', '~> 1.3.0'
|
gem 'byebug' # debugging
|
||||||
gem 'webrat' # provides HTML matchers for view tests
|
gem 'database_cleaner', '~> 1.5.0'
|
||||||
gem 'factory_girl_rails', '~> 4.0' # for creating test data
|
gem 'webrat' # provides HTML matchers for view tests
|
||||||
gem 'coveralls', require: false # coverage analysis
|
gem 'factory_girl_rails' # for creating test data
|
||||||
gem 'capybara' # integration tests
|
gem 'coveralls', require: false # coverage analysis
|
||||||
gem 'capybara-email' # integration tests for email
|
gem 'capybara' # integration tests
|
||||||
gem 'poltergeist', '~> 1.5.1' # for headless JS testing
|
gem 'capybara-email' # integration tests for email
|
||||||
gem 'i18n-tasks' # adds tests for finding missing and unused translations
|
gem 'capybara-screenshot' # for test debugging
|
||||||
|
gem 'poltergeist' # for headless JS testing
|
||||||
|
gem 'i18n-tasks' # adds tests for finding missing and unused translations
|
||||||
|
gem 'selenium-webdriver'
|
||||||
|
gem "active_merchant-paypal-bogus-gateway"
|
||||||
|
gem 'rubocop', require: false
|
||||||
|
end
|
||||||
|
|
||||||
|
group :test do
|
||||||
|
gem 'codeclimate-test-reporter', require: false
|
||||||
|
end
|
||||||
|
|
||||||
|
group :travis do
|
||||||
|
gem 'heroku-api'
|
||||||
end
|
end
|
||||||
|
|||||||
693
Gemfile.lock
@@ -1,320 +1,485 @@
|
|||||||
GIT
|
|
||||||
remote: https://github.com/alexreisner/geocoder.git
|
|
||||||
revision: 104d466ba7097b7dce5ba19f8e4091b7f69ccdf6
|
|
||||||
ref: 104d46
|
|
||||||
specs:
|
|
||||||
geocoder (1.1.8)
|
|
||||||
|
|
||||||
PATH
|
|
||||||
remote: vendor/gems/active_utils-1.0.5
|
|
||||||
specs:
|
|
||||||
active_utils (1.0.5)
|
|
||||||
activesupport (>= 2.3.11)
|
|
||||||
i18n
|
|
||||||
|
|
||||||
PATH
|
|
||||||
remote: vendor/gems/activemerchant-1.33.0
|
|
||||||
specs:
|
|
||||||
activemerchant (1.33.0)
|
|
||||||
|
|
||||||
GEM
|
GEM
|
||||||
remote: https://rubygems.org/
|
remote: https://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
actionmailer (3.2.13)
|
actionmailer (4.2.7.1)
|
||||||
actionpack (= 3.2.13)
|
actionpack (= 4.2.7.1)
|
||||||
mail (~> 2.5.3)
|
actionview (= 4.2.7.1)
|
||||||
actionpack (3.2.13)
|
activejob (= 4.2.7.1)
|
||||||
activemodel (= 3.2.13)
|
mail (~> 2.5, >= 2.5.4)
|
||||||
activesupport (= 3.2.13)
|
rails-dom-testing (~> 1.0, >= 1.0.5)
|
||||||
builder (~> 3.0.0)
|
actionpack (4.2.7.1)
|
||||||
|
actionview (= 4.2.7.1)
|
||||||
|
activesupport (= 4.2.7.1)
|
||||||
|
rack (~> 1.6)
|
||||||
|
rack-test (~> 0.6.2)
|
||||||
|
rails-dom-testing (~> 1.0, >= 1.0.5)
|
||||||
|
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
||||||
|
actionview (4.2.7.1)
|
||||||
|
activesupport (= 4.2.7.1)
|
||||||
|
builder (~> 3.1)
|
||||||
erubis (~> 2.7.0)
|
erubis (~> 2.7.0)
|
||||||
journey (~> 1.0.4)
|
rails-dom-testing (~> 1.0, >= 1.0.5)
|
||||||
rack (~> 1.4.5)
|
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
||||||
rack-cache (~> 1.2)
|
active_link_to (1.0.3)
|
||||||
rack-test (~> 0.6.1)
|
actionpack
|
||||||
sprockets (~> 2.2.1)
|
active_merchant-paypal-bogus-gateway (0.1.0)
|
||||||
activemodel (3.2.13)
|
activemerchant
|
||||||
activesupport (= 3.2.13)
|
active_utils (3.2.3)
|
||||||
builder (~> 3.0.0)
|
activesupport (>= 3.2, < 5.1.0)
|
||||||
activerecord (3.2.13)
|
i18n
|
||||||
activemodel (= 3.2.13)
|
activejob (4.2.7.1)
|
||||||
activesupport (= 3.2.13)
|
activesupport (= 4.2.7.1)
|
||||||
arel (~> 3.0.2)
|
globalid (>= 0.3.0)
|
||||||
tzinfo (~> 0.3.29)
|
activemerchant (1.61.0)
|
||||||
activeresource (3.2.13)
|
activesupport (>= 3.2.14, < 5.1)
|
||||||
activemodel (= 3.2.13)
|
builder (>= 2.1.2, < 4.0.0)
|
||||||
activesupport (= 3.2.13)
|
i18n (>= 0.6.9)
|
||||||
activesupport (3.2.13)
|
nokogiri (~> 1.4)
|
||||||
i18n (= 0.6.1)
|
activemodel (4.2.7.1)
|
||||||
multi_json (~> 1.0)
|
activesupport (= 4.2.7.1)
|
||||||
addressable (2.3.6)
|
builder (~> 3.1)
|
||||||
arel (3.0.3)
|
activerecord (4.2.7.1)
|
||||||
bcrypt (3.1.9)
|
activemodel (= 4.2.7.1)
|
||||||
better_errors (2.0.0)
|
activesupport (= 4.2.7.1)
|
||||||
|
arel (~> 6.0)
|
||||||
|
activesupport (4.2.7.1)
|
||||||
|
i18n (~> 0.7)
|
||||||
|
json (~> 1.7, >= 1.7.7)
|
||||||
|
minitest (~> 5.1)
|
||||||
|
thread_safe (~> 0.3, >= 0.3.4)
|
||||||
|
tzinfo (~> 1.1)
|
||||||
|
addressable (2.5.0)
|
||||||
|
public_suffix (~> 2.0, >= 2.0.2)
|
||||||
|
arel (6.0.3)
|
||||||
|
ast (2.3.0)
|
||||||
|
autoprefixer-rails (6.4.0.2)
|
||||||
|
execjs
|
||||||
|
bcrypt (3.1.11)
|
||||||
|
better_errors (2.1.1)
|
||||||
coderay (>= 1.0.0)
|
coderay (>= 1.0.0)
|
||||||
erubis (>= 2.6.6)
|
erubis (>= 2.6.6)
|
||||||
rack (>= 0.9.0)
|
rack (>= 0.9.0)
|
||||||
binding_of_caller (0.7.2)
|
binding_of_caller (0.7.2)
|
||||||
debug_inspector (>= 0.0.1)
|
debug_inspector (>= 0.0.1)
|
||||||
bluecloth (2.2.0)
|
bluecloth (2.2.0)
|
||||||
bootstrap-datepicker-rails (1.3.0.2)
|
bonsai-elasticsearch-rails (0.0.4)
|
||||||
|
bootstrap-datepicker-rails (1.6.4.1)
|
||||||
railties (>= 3.0)
|
railties (>= 3.0)
|
||||||
builder (3.0.4)
|
bootstrap-kaminari-views (0.0.5)
|
||||||
byebug (3.5.1)
|
kaminari (>= 0.13)
|
||||||
columnize (~> 0.8)
|
rails (>= 3.1)
|
||||||
debugger-linecache (~> 1.2)
|
bootstrap-sass (3.3.7)
|
||||||
slop (~> 3.6)
|
autoprefixer-rails (>= 5.2.1)
|
||||||
cancan (1.6.10)
|
sass (>= 3.3.4)
|
||||||
capybara (2.4.4)
|
bootstrap_form (2.5.2)
|
||||||
|
builder (3.2.2)
|
||||||
|
byebug (9.0.6)
|
||||||
|
cancancan (1.15.0)
|
||||||
|
capybara (2.10.1)
|
||||||
|
addressable
|
||||||
mime-types (>= 1.16)
|
mime-types (>= 1.16)
|
||||||
nokogiri (>= 1.3.3)
|
nokogiri (>= 1.3.3)
|
||||||
rack (>= 1.0.0)
|
rack (>= 1.0.0)
|
||||||
rack-test (>= 0.5.4)
|
rack-test (>= 0.5.4)
|
||||||
xpath (~> 2.0)
|
xpath (~> 2.0)
|
||||||
capybara-email (2.4.0)
|
capybara-email (2.5.0)
|
||||||
capybara (~> 2.4)
|
capybara (~> 2.4)
|
||||||
mail
|
mail
|
||||||
chunky_png (1.3.3)
|
capybara-screenshot (1.0.14)
|
||||||
|
capybara (>= 1.0, < 3)
|
||||||
|
launchy
|
||||||
|
childprocess (0.5.9)
|
||||||
|
ffi (~> 1.0, >= 1.0.11)
|
||||||
|
climate_control (0.0.3)
|
||||||
|
activesupport (>= 3.0)
|
||||||
cliver (0.3.2)
|
cliver (0.3.2)
|
||||||
coderay (1.1.0)
|
cocaine (0.5.8)
|
||||||
coffee-rails (3.2.2)
|
climate_control (>= 0.0.3, < 1.0)
|
||||||
|
codeclimate-test-reporter (0.6.0)
|
||||||
|
simplecov (>= 0.7.1, < 1.0.0)
|
||||||
|
codemirror-rails (5.16.0)
|
||||||
|
railties (>= 3.0, < 6.0)
|
||||||
|
coderay (1.1.1)
|
||||||
|
coffee-rails (4.1.1)
|
||||||
coffee-script (>= 2.2.0)
|
coffee-script (>= 2.2.0)
|
||||||
railties (~> 3.2.0)
|
railties (>= 4.0.0, < 5.1.x)
|
||||||
coffee-script (2.3.0)
|
coffee-script (2.4.1)
|
||||||
coffee-script-source
|
coffee-script-source
|
||||||
execjs
|
execjs
|
||||||
coffee-script-source (1.8.0)
|
coffee-script-source (1.10.0)
|
||||||
columnize (0.8.9)
|
comfortable_mexican_sofa (1.12.9)
|
||||||
commonjs (0.2.7)
|
active_link_to (>= 1.0.0)
|
||||||
compass (0.12.7)
|
bootstrap-sass (>= 3.2.0)
|
||||||
chunky_png (~> 1.2)
|
bootstrap_form (>= 2.2.0)
|
||||||
fssm (>= 0.2.7)
|
codemirror-rails (>= 3.0.0)
|
||||||
sass (~> 3.2.19)
|
coffee-rails (>= 3.1.0)
|
||||||
compass-rails (1.0.3)
|
haml-rails (>= 0.3.0)
|
||||||
compass (>= 0.12.2, < 0.14)
|
jquery-rails (>= 3.0.0)
|
||||||
coveralls (0.7.1)
|
jquery-ui-rails (>= 5.0.0)
|
||||||
multi_json (~> 1.3)
|
kramdown (>= 1.0.0)
|
||||||
rest-client
|
paperclip (>= 4.0.0)
|
||||||
simplecov (>= 0.7)
|
plupload-rails (>= 1.2.1)
|
||||||
term-ansicolor
|
rails (>= 4.0.0, < 5)
|
||||||
thor
|
rails-i18n (>= 4.0.0)
|
||||||
csv_shaper (1.1.1)
|
sass-rails (>= 4.0.3)
|
||||||
|
concurrent-ruby (1.0.2)
|
||||||
|
connection_pool (2.2.0)
|
||||||
|
coveralls (0.8.16)
|
||||||
|
json (>= 1.8, < 3)
|
||||||
|
simplecov (~> 0.12.0)
|
||||||
|
term-ansicolor (~> 1.3.0)
|
||||||
|
thor (~> 0.19.1)
|
||||||
|
tins (>= 1.6.0, < 2)
|
||||||
|
csv_shaper (1.3.0)
|
||||||
activesupport (>= 3.0.0)
|
activesupport (>= 3.0.0)
|
||||||
dalli (2.7.2)
|
dalli (2.7.6)
|
||||||
database_cleaner (1.3.0)
|
database_cleaner (1.5.3)
|
||||||
debug_inspector (0.0.2)
|
debug_inspector (0.0.2)
|
||||||
debugger-linecache (1.2.0)
|
devise (4.2.0)
|
||||||
devise (3.2.4)
|
|
||||||
bcrypt (~> 3.0)
|
bcrypt (~> 3.0)
|
||||||
orm_adapter (~> 0.1)
|
orm_adapter (~> 0.1)
|
||||||
railties (>= 3.2.6, < 5)
|
railties (>= 4.1.0, < 5.1)
|
||||||
thread_safe (~> 0.1)
|
responders
|
||||||
warden (~> 1.2.3)
|
warden (~> 1.2.3)
|
||||||
diff-lcs (1.1.3)
|
diff-lcs (1.2.5)
|
||||||
docile (1.1.5)
|
docile (1.1.5)
|
||||||
easy_translate (0.5.0)
|
easy_translate (0.5.0)
|
||||||
json
|
json
|
||||||
thread
|
thread
|
||||||
thread_safe
|
thread_safe
|
||||||
|
elasticsearch (2.0.0)
|
||||||
|
elasticsearch-api (= 2.0.0)
|
||||||
|
elasticsearch-transport (= 2.0.0)
|
||||||
|
elasticsearch-api (2.0.0)
|
||||||
|
multi_json
|
||||||
|
elasticsearch-model (0.1.9)
|
||||||
|
activesupport (> 3)
|
||||||
|
elasticsearch (> 0.4)
|
||||||
|
hashie
|
||||||
|
elasticsearch-rails (0.1.9)
|
||||||
|
elasticsearch-transport (2.0.0)
|
||||||
|
faraday
|
||||||
|
multi_json
|
||||||
erubis (2.7.0)
|
erubis (2.7.0)
|
||||||
execjs (2.2.2)
|
excon (0.54.0)
|
||||||
factory_girl (4.5.0)
|
execjs (2.7.0)
|
||||||
|
factory_girl (4.7.0)
|
||||||
activesupport (>= 3.0.0)
|
activesupport (>= 3.0.0)
|
||||||
factory_girl_rails (4.5.0)
|
factory_girl_rails (4.7.0)
|
||||||
factory_girl (~> 4.5.0)
|
factory_girl (~> 4.7.0)
|
||||||
railties (>= 3.0.0)
|
railties (>= 3.0.0)
|
||||||
figaro (1.0.0)
|
faraday (0.9.2)
|
||||||
|
multipart-post (>= 1.2, < 3)
|
||||||
|
ffi (1.9.14)
|
||||||
|
figaro (1.1.1)
|
||||||
thor (~> 0.14)
|
thor (~> 0.14)
|
||||||
flickraw (0.9.8)
|
flickraw (0.9.9)
|
||||||
friendly_id (4.0.10.1)
|
font-awesome-sass (4.6.2)
|
||||||
activerecord (>= 3.0, < 4.0)
|
sass (>= 3.2)
|
||||||
fssm (0.2.10)
|
formatador (0.2.5)
|
||||||
gibbon (1.1.4)
|
friendly_id (5.0.5)
|
||||||
|
activerecord (>= 4.0.0)
|
||||||
|
geocoder (1.3.7)
|
||||||
|
gibbon (1.2.1)
|
||||||
httparty
|
httparty
|
||||||
multi_json (>= 1.3.4)
|
multi_json (>= 1.9.0)
|
||||||
|
globalid (0.3.7)
|
||||||
|
activesupport (>= 4.1.0)
|
||||||
gravatar-ultimate (2.0.0)
|
gravatar-ultimate (2.0.0)
|
||||||
activesupport (>= 2.3.14)
|
activesupport (>= 2.3.14)
|
||||||
rack
|
rack
|
||||||
haml (4.0.5)
|
guard (2.14.0)
|
||||||
|
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.7.3)
|
||||||
|
guard (~> 2.1)
|
||||||
|
guard-compat (~> 1.1)
|
||||||
|
rspec (>= 2.99.0, < 4.0)
|
||||||
|
haml (4.0.7)
|
||||||
tilt
|
tilt
|
||||||
haml-rails (0.4)
|
haml-rails (0.9.0)
|
||||||
actionpack (>= 3.1, < 4.1)
|
actionpack (>= 4.0.1)
|
||||||
activesupport (>= 3.1, < 4.1)
|
activesupport (>= 4.0.1)
|
||||||
haml (>= 3.1, < 4.1)
|
haml (>= 4.0.6, < 5.0)
|
||||||
railties (>= 3.1, < 4.1)
|
html2haml (>= 1.0.1)
|
||||||
hashie (3.3.2)
|
railties (>= 4.0.1)
|
||||||
highline (1.6.21)
|
hashie (3.4.4)
|
||||||
hike (1.2.3)
|
heroku-api (0.4.2)
|
||||||
httparty (0.11.0)
|
excon (~> 0.45)
|
||||||
multi_json (~> 1.0)
|
multi_json (~> 1.8)
|
||||||
|
highline (1.7.8)
|
||||||
|
html2haml (2.0.0)
|
||||||
|
erubis (~> 2.7.0)
|
||||||
|
haml (~> 4.0.0)
|
||||||
|
nokogiri (~> 1.6.0)
|
||||||
|
ruby_parser (~> 3.5)
|
||||||
|
httparty (0.14.0)
|
||||||
multi_xml (>= 0.5.2)
|
multi_xml (>= 0.5.2)
|
||||||
i18n (0.6.1)
|
i18n (0.7.0)
|
||||||
i18n-tasks (0.7.8)
|
i18n-tasks (0.9.6)
|
||||||
activesupport
|
activesupport (>= 4.0.2)
|
||||||
|
ast (>= 2.1.0)
|
||||||
easy_translate (>= 0.5.0)
|
easy_translate (>= 0.5.0)
|
||||||
erubis
|
erubis
|
||||||
highline
|
highline (>= 1.7.3)
|
||||||
i18n
|
i18n
|
||||||
slop (>= 3.5.0)
|
parser (>= 2.2.3.0)
|
||||||
term-ansicolor
|
term-ansicolor (>= 1.3.2)
|
||||||
terminal-table
|
terminal-table (>= 1.5.1)
|
||||||
journey (1.0.4)
|
jquery-rails (4.2.1)
|
||||||
jquery-rails (3.1.2)
|
rails-dom-testing (>= 1, < 3)
|
||||||
railties (>= 3.0, < 5.0)
|
railties (>= 4.2.0)
|
||||||
thor (>= 0.14, < 2.0)
|
thor (>= 0.14, < 2.0)
|
||||||
jquery-ui-rails (4.1.2)
|
jquery-ui-rails (5.0.5)
|
||||||
railties (>= 3.1.0)
|
railties (>= 3.2.16)
|
||||||
js-routes (0.9.9)
|
js-routes (1.3.0)
|
||||||
railties (>= 3.2)
|
railties (>= 3.2)
|
||||||
sprockets-rails
|
sprockets-rails
|
||||||
json (1.7.7)
|
json (1.8.3)
|
||||||
kgio (2.9.2)
|
jwt (1.5.6)
|
||||||
|
kaminari (0.17.0)
|
||||||
|
actionpack (>= 3.0.0)
|
||||||
|
activesupport (>= 3.0.0)
|
||||||
|
kgio (2.10.0)
|
||||||
|
kramdown (1.13.1)
|
||||||
launchy (2.4.3)
|
launchy (2.4.3)
|
||||||
addressable (~> 2.3)
|
addressable (~> 2.3)
|
||||||
leaflet-markercluster-rails (0.7.0)
|
leaflet-markercluster-rails (0.7.0)
|
||||||
railties (>= 3.1)
|
railties (>= 3.1)
|
||||||
leaflet-rails (0.7.4)
|
leaflet-rails (0.7.7)
|
||||||
less (2.5.1)
|
letter_opener (1.4.1)
|
||||||
commonjs (~> 0.2.7)
|
|
||||||
less-rails (2.5.0)
|
|
||||||
actionpack (>= 3.1)
|
|
||||||
less (~> 2.5.0)
|
|
||||||
less-rails-bootstrap (3.2.0)
|
|
||||||
less-rails (~> 2.5.0)
|
|
||||||
letter_opener (1.2.0)
|
|
||||||
launchy (~> 2.2)
|
launchy (~> 2.2)
|
||||||
libv8 (3.16.14.7)
|
listen (3.1.5)
|
||||||
mail (2.5.4)
|
rb-fsevent (~> 0.9, >= 0.9.4)
|
||||||
mime-types (~> 1.16)
|
rb-inotify (~> 0.9, >= 0.9.7)
|
||||||
treetop (~> 1.4.8)
|
ruby_dep (~> 1.2)
|
||||||
|
loofah (2.0.3)
|
||||||
|
nokogiri (>= 1.5.9)
|
||||||
|
lumberjack (1.0.10)
|
||||||
|
mail (2.6.4)
|
||||||
|
mime-types (>= 1.16, < 4)
|
||||||
memcachier (0.0.2)
|
memcachier (0.0.2)
|
||||||
method_source (0.8.2)
|
method_source (0.8.2)
|
||||||
mime-types (1.25.1)
|
mime-types (3.1)
|
||||||
mini_portile (0.6.1)
|
mime-types-data (~> 3.2015)
|
||||||
multi_json (1.10.1)
|
mime-types-data (3.2016.0521)
|
||||||
|
mimemagic (0.3.2)
|
||||||
|
mini_portile2 (2.1.0)
|
||||||
|
minitest (5.9.1)
|
||||||
|
multi_json (1.11.3)
|
||||||
multi_xml (0.5.5)
|
multi_xml (0.5.5)
|
||||||
netrc (0.8.0)
|
multipart-post (2.0.0)
|
||||||
newrelic_rpm (3.9.7.266)
|
nenv (0.3.0)
|
||||||
nokogiri (1.6.5)
|
newrelic_rpm (3.17.1.326)
|
||||||
mini_portile (~> 0.6.0)
|
nokogiri (1.6.8.1)
|
||||||
oauth (0.4.7)
|
mini_portile2 (~> 2.1.0)
|
||||||
omniauth (1.2.2)
|
notiffany (0.1.1)
|
||||||
|
nenv (~> 0.1)
|
||||||
|
shellany (~> 0.0)
|
||||||
|
oauth (0.5.1)
|
||||||
|
oauth2 (1.2.0)
|
||||||
|
faraday (>= 0.8, < 0.10)
|
||||||
|
jwt (~> 1.0)
|
||||||
|
multi_json (~> 1.3)
|
||||||
|
multi_xml (~> 0.5)
|
||||||
|
rack (>= 1.2, < 3)
|
||||||
|
omniauth (1.3.1)
|
||||||
hashie (>= 1.2, < 4)
|
hashie (>= 1.2, < 4)
|
||||||
rack (~> 1.0)
|
rack (>= 1.0, < 3)
|
||||||
omniauth-flickr (0.0.15)
|
omniauth-facebook (3.0.0)
|
||||||
|
omniauth-oauth2 (~> 1.2)
|
||||||
|
omniauth-flickr (0.0.19)
|
||||||
|
multi_json (~> 1.11.0)
|
||||||
omniauth-oauth (~> 1.0)
|
omniauth-oauth (~> 1.0)
|
||||||
omniauth-oauth (1.0.1)
|
omniauth-oauth (1.1.0)
|
||||||
oauth
|
oauth
|
||||||
omniauth (~> 1.0)
|
omniauth (~> 1.0)
|
||||||
omniauth-twitter (1.1.0)
|
omniauth-oauth2 (1.4.0)
|
||||||
multi_json (~> 1.3)
|
oauth2 (~> 1.0)
|
||||||
omniauth-oauth (~> 1.0)
|
omniauth (~> 1.2)
|
||||||
|
omniauth-twitter (1.2.1)
|
||||||
|
json (~> 1.3)
|
||||||
|
omniauth-oauth (~> 1.1)
|
||||||
orm_adapter (0.5.0)
|
orm_adapter (0.5.0)
|
||||||
pg (0.17.1)
|
paperclip (5.1.0)
|
||||||
poltergeist (1.5.1)
|
activemodel (>= 4.2.0)
|
||||||
|
activesupport (>= 4.2.0)
|
||||||
|
cocaine (~> 0.5.5)
|
||||||
|
mime-types
|
||||||
|
mimemagic (~> 0.3.0)
|
||||||
|
parser (2.3.2.0)
|
||||||
|
ast (~> 2.2)
|
||||||
|
pg (0.19.0)
|
||||||
|
plupload-rails (1.2.1)
|
||||||
|
rails (>= 3.1)
|
||||||
|
poltergeist (1.11.0)
|
||||||
capybara (~> 2.1)
|
capybara (~> 2.1)
|
||||||
cliver (~> 0.3.1)
|
cliver (~> 0.3.1)
|
||||||
multi_json (~> 1.0)
|
|
||||||
websocket-driver (>= 0.2.0)
|
websocket-driver (>= 0.2.0)
|
||||||
polyglot (0.3.5)
|
powerpack (0.1.1)
|
||||||
pry (0.10.1)
|
pry (0.10.4)
|
||||||
coderay (~> 1.1.0)
|
coderay (~> 1.1.0)
|
||||||
method_source (~> 0.8.1)
|
method_source (~> 0.8.1)
|
||||||
slop (~> 3.4)
|
slop (~> 3.4)
|
||||||
rack (1.4.5)
|
public_suffix (2.0.4)
|
||||||
rack-cache (1.2)
|
quiet_assets (1.1.0)
|
||||||
rack (>= 0.4)
|
railties (>= 3.1, < 5.0)
|
||||||
rack-ssl (1.3.4)
|
rack (1.6.5)
|
||||||
|
rack-protection (1.5.3)
|
||||||
rack
|
rack
|
||||||
rack-test (0.6.2)
|
rack-test (0.6.3)
|
||||||
rack (>= 1.0)
|
rack (>= 1.0)
|
||||||
rails (3.2.13)
|
rails (4.2.7.1)
|
||||||
actionmailer (= 3.2.13)
|
actionmailer (= 4.2.7.1)
|
||||||
actionpack (= 3.2.13)
|
actionpack (= 4.2.7.1)
|
||||||
activerecord (= 3.2.13)
|
actionview (= 4.2.7.1)
|
||||||
activeresource (= 3.2.13)
|
activejob (= 4.2.7.1)
|
||||||
activesupport (= 3.2.13)
|
activemodel (= 4.2.7.1)
|
||||||
bundler (~> 1.0)
|
activerecord (= 4.2.7.1)
|
||||||
railties (= 3.2.13)
|
activesupport (= 4.2.7.1)
|
||||||
|
bundler (>= 1.3.0, < 2.0)
|
||||||
|
railties (= 4.2.7.1)
|
||||||
|
sprockets-rails
|
||||||
|
rails-deprecated_sanitizer (1.0.3)
|
||||||
|
activesupport (>= 4.2.0.alpha)
|
||||||
|
rails-dom-testing (1.0.7)
|
||||||
|
activesupport (>= 4.2.0.beta, < 5.0)
|
||||||
|
nokogiri (~> 1.6.0)
|
||||||
|
rails-deprecated_sanitizer (>= 1.0.1)
|
||||||
|
rails-html-sanitizer (1.0.3)
|
||||||
|
loofah (~> 2.0)
|
||||||
|
rails-i18n (4.0.9)
|
||||||
|
i18n (~> 0.7)
|
||||||
|
railties (~> 4.0)
|
||||||
rails_12factor (0.0.3)
|
rails_12factor (0.0.3)
|
||||||
rails_serve_static_assets
|
rails_serve_static_assets
|
||||||
rails_stdout_logging
|
rails_stdout_logging
|
||||||
rails_serve_static_assets (0.0.2)
|
rails_serve_static_assets (0.0.5)
|
||||||
rails_stdout_logging (0.0.3)
|
rails_stdout_logging (0.0.5)
|
||||||
railties (3.2.13)
|
railties (4.2.7.1)
|
||||||
actionpack (= 3.2.13)
|
actionpack (= 4.2.7.1)
|
||||||
activesupport (= 3.2.13)
|
activesupport (= 4.2.7.1)
|
||||||
rack-ssl (~> 1.3.2)
|
|
||||||
rake (>= 0.8.7)
|
rake (>= 0.8.7)
|
||||||
rdoc (~> 3.4)
|
thor (>= 0.18.1, < 2.0)
|
||||||
thor (>= 0.14.6, < 2.0)
|
rainbow (2.1.0)
|
||||||
raindrops (0.13.0)
|
raindrops (0.17.0)
|
||||||
rake (10.4.0)
|
rake (11.3.0)
|
||||||
rdoc (3.12.2)
|
rb-fsevent (0.9.8)
|
||||||
json (~> 1.4)
|
rb-inotify (0.9.7)
|
||||||
ref (1.0.5)
|
ffi (>= 0.5.0)
|
||||||
rest-client (1.7.2)
|
redis (3.3.2)
|
||||||
mime-types (>= 1.16, < 3.0)
|
responders (2.3.0)
|
||||||
netrc (~> 0.7)
|
railties (>= 4.2.0, < 5.1)
|
||||||
rspec-core (2.12.2)
|
rspec (3.5.0)
|
||||||
rspec-expectations (2.12.1)
|
rspec-core (~> 3.5.0)
|
||||||
diff-lcs (~> 1.1.3)
|
rspec-expectations (~> 3.5.0)
|
||||||
rspec-mocks (2.12.2)
|
rspec-mocks (~> 3.5.0)
|
||||||
rspec-rails (2.12.2)
|
rspec-activemodel-mocks (1.0.3)
|
||||||
|
activemodel (>= 3.0)
|
||||||
|
activesupport (>= 3.0)
|
||||||
|
rspec-mocks (>= 2.99, < 4.0)
|
||||||
|
rspec-core (3.5.4)
|
||||||
|
rspec-support (~> 3.5.0)
|
||||||
|
rspec-expectations (3.5.0)
|
||||||
|
diff-lcs (>= 1.2.0, < 2.0)
|
||||||
|
rspec-support (~> 3.5.0)
|
||||||
|
rspec-mocks (3.5.0)
|
||||||
|
diff-lcs (>= 1.2.0, < 2.0)
|
||||||
|
rspec-support (~> 3.5.0)
|
||||||
|
rspec-rails (3.5.2)
|
||||||
actionpack (>= 3.0)
|
actionpack (>= 3.0)
|
||||||
activesupport (>= 3.0)
|
activesupport (>= 3.0)
|
||||||
railties (>= 3.0)
|
railties (>= 3.0)
|
||||||
rspec-core (~> 2.12.0)
|
rspec-core (~> 3.5.0)
|
||||||
rspec-expectations (~> 2.12.0)
|
rspec-expectations (~> 3.5.0)
|
||||||
rspec-mocks (~> 2.12.0)
|
rspec-mocks (~> 3.5.0)
|
||||||
sass (3.2.19)
|
rspec-support (~> 3.5.0)
|
||||||
sass-rails (3.2.6)
|
rspec-support (3.5.0)
|
||||||
railties (~> 3.2.0)
|
rubocop (0.45.0)
|
||||||
sass (>= 3.1.10)
|
parser (>= 2.3.1.1, < 3.0)
|
||||||
tilt (~> 1.3)
|
powerpack (~> 0.1)
|
||||||
simplecov (0.9.1)
|
rainbow (>= 1.99.1, < 3.0)
|
||||||
|
ruby-progressbar (~> 1.7)
|
||||||
|
unicode-display_width (~> 1.0, >= 1.0.1)
|
||||||
|
ruby-progressbar (1.8.1)
|
||||||
|
ruby-units (2.0.1)
|
||||||
|
ruby_dep (1.4.0)
|
||||||
|
ruby_parser (3.8.3)
|
||||||
|
sexp_processor (~> 4.1)
|
||||||
|
rubyzip (1.2.0)
|
||||||
|
sass (3.4.22)
|
||||||
|
sass-rails (5.0.6)
|
||||||
|
railties (>= 4.0.0, < 6)
|
||||||
|
sass (~> 3.1)
|
||||||
|
sprockets (>= 2.8, < 4.0)
|
||||||
|
sprockets-rails (>= 2.0, < 4.0)
|
||||||
|
tilt (>= 1.1, < 3)
|
||||||
|
selenium-webdriver (2.53.4)
|
||||||
|
childprocess (~> 0.5)
|
||||||
|
rubyzip (~> 1.0)
|
||||||
|
websocket (~> 1.0)
|
||||||
|
sexp_processor (4.7.0)
|
||||||
|
shellany (0.0.1)
|
||||||
|
sidekiq (4.1.4)
|
||||||
|
concurrent-ruby (~> 1.0)
|
||||||
|
connection_pool (~> 2.2, >= 2.2.0)
|
||||||
|
redis (~> 3.2, >= 3.2.1)
|
||||||
|
sinatra (>= 1.4.7)
|
||||||
|
simplecov (0.12.0)
|
||||||
docile (~> 1.1.0)
|
docile (~> 1.1.0)
|
||||||
multi_json (~> 1.0)
|
json (>= 1.8, < 3)
|
||||||
simplecov-html (~> 0.8.0)
|
simplecov-html (~> 0.10.0)
|
||||||
simplecov-html (0.8.0)
|
simplecov-html (0.10.0)
|
||||||
|
sinatra (1.4.7)
|
||||||
|
rack (~> 1.5)
|
||||||
|
rack-protection (~> 1.4)
|
||||||
|
tilt (>= 1.3, < 3)
|
||||||
slop (3.6.0)
|
slop (3.6.0)
|
||||||
sprockets (2.2.3)
|
sparkpost_rails (1.4.0)
|
||||||
hike (~> 1.2)
|
rails (>= 4.0, < 5.1)
|
||||||
multi_json (~> 1.0)
|
sprockets (3.7.0)
|
||||||
rack (~> 1.0)
|
concurrent-ruby (~> 1.0)
|
||||||
tilt (~> 1.1, != 1.3.0)
|
rack (> 1, < 3)
|
||||||
sprockets-rails (0.0.1)
|
sprockets-rails (3.1.1)
|
||||||
sprockets (>= 1.0.2)
|
actionpack (>= 4.0)
|
||||||
term-ansicolor (1.3.0)
|
activesupport (>= 4.0)
|
||||||
|
sprockets (>= 3.0.0)
|
||||||
|
term-ansicolor (1.3.2)
|
||||||
tins (~> 1.0)
|
tins (~> 1.0)
|
||||||
terminal-table (1.4.5)
|
terminal-table (1.7.3)
|
||||||
therubyracer (0.12.1)
|
unicode-display_width (~> 1.1.1)
|
||||||
libv8 (~> 3.16.14.0)
|
thor (0.19.3)
|
||||||
ref
|
thread (0.2.2)
|
||||||
thor (0.19.1)
|
thread_safe (0.3.5)
|
||||||
thread (0.1.4)
|
tilt (2.0.5)
|
||||||
thread_safe (0.3.4)
|
tins (1.13.0)
|
||||||
tilt (1.4.1)
|
tzinfo (1.2.2)
|
||||||
tins (1.3.3)
|
thread_safe (~> 0.1)
|
||||||
treetop (1.4.15)
|
uglifier (2.7.2)
|
||||||
polyglot
|
|
||||||
polyglot (>= 0.3.1)
|
|
||||||
tzinfo (0.3.42)
|
|
||||||
uglifier (2.2.1)
|
|
||||||
execjs (>= 0.3.0)
|
execjs (>= 0.3.0)
|
||||||
multi_json (~> 1.0, >= 1.0.2)
|
json (>= 1.8.0)
|
||||||
unicorn (4.8.3)
|
unicode-display_width (1.1.1)
|
||||||
|
unicorn (5.1.0)
|
||||||
kgio (~> 2.6)
|
kgio (~> 2.6)
|
||||||
rack
|
|
||||||
raindrops (~> 0.7)
|
raindrops (~> 0.7)
|
||||||
warden (1.2.3)
|
warden (1.2.6)
|
||||||
rack (>= 1.0)
|
rack (>= 1.0)
|
||||||
webrat (0.7.3)
|
webrat (0.7.3)
|
||||||
nokogiri (>= 1.2.0)
|
nokogiri (>= 1.2.0)
|
||||||
rack (>= 1.0)
|
rack (>= 1.0)
|
||||||
rack-test (>= 0.5.3)
|
rack-test (>= 0.5.3)
|
||||||
websocket-driver (0.4.0)
|
websocket (1.2.3)
|
||||||
will_paginate (3.0.7)
|
websocket-driver (0.6.4)
|
||||||
|
websocket-extensions (>= 0.1.0)
|
||||||
|
websocket-extensions (0.1.2)
|
||||||
|
will_paginate (3.1.0)
|
||||||
xpath (2.0.0)
|
xpath (2.0.0)
|
||||||
nokogiri (~> 1.3)
|
nokogiri (~> 1.3)
|
||||||
|
|
||||||
@@ -322,61 +487,81 @@ PLATFORMS
|
|||||||
ruby
|
ruby
|
||||||
|
|
||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
active_utils (= 1.0.5)!
|
active_merchant-paypal-bogus-gateway
|
||||||
activemerchant (= 1.33.0)!
|
active_utils
|
||||||
|
activemerchant
|
||||||
better_errors
|
better_errors
|
||||||
binding_of_caller
|
binding_of_caller
|
||||||
bluecloth
|
bluecloth
|
||||||
|
bonsai-elasticsearch-rails
|
||||||
bootstrap-datepicker-rails
|
bootstrap-datepicker-rails
|
||||||
|
bootstrap-kaminari-views
|
||||||
|
bootstrap-sass (~> 3.3.6)
|
||||||
bundler (>= 1.1.5)
|
bundler (>= 1.1.5)
|
||||||
byebug
|
byebug
|
||||||
cancan
|
cancancan (~> 1.9)
|
||||||
capybara
|
capybara
|
||||||
capybara-email
|
capybara-email
|
||||||
coffee-rails (~> 3.2.1)
|
capybara-screenshot
|
||||||
compass-rails (~> 1.0.3)
|
codeclimate-test-reporter
|
||||||
|
coffee-rails (~> 4.1.0)
|
||||||
|
comfortable_mexican_sofa (~> 1.12.0)
|
||||||
coveralls
|
coveralls
|
||||||
csv_shaper
|
csv_shaper
|
||||||
dalli
|
dalli
|
||||||
database_cleaner (~> 1.3.0)
|
database_cleaner (~> 1.5.0)
|
||||||
devise (~> 3.2.0)
|
devise (>= 4.0.0)
|
||||||
factory_girl_rails (~> 4.0)
|
elasticsearch-model
|
||||||
|
elasticsearch-rails
|
||||||
|
factory_girl_rails
|
||||||
figaro
|
figaro
|
||||||
flickraw
|
flickraw
|
||||||
friendly_id (~> 4.0.10)
|
font-awesome-sass
|
||||||
geocoder!
|
friendly_id (~> 5.0.4)
|
||||||
gibbon
|
geocoder
|
||||||
|
gibbon (~> 1.2.0)
|
||||||
gravatar-ultimate
|
gravatar-ultimate
|
||||||
|
guard
|
||||||
|
guard-rspec
|
||||||
haml
|
haml
|
||||||
haml-rails
|
haml-rails
|
||||||
|
heroku-api
|
||||||
i18n-tasks
|
i18n-tasks
|
||||||
jquery-rails
|
jquery-rails
|
||||||
jquery-ui-rails
|
jquery-ui-rails (~> 5.0.2)
|
||||||
js-routes
|
js-routes
|
||||||
json (~> 1.7.7)
|
kaminari
|
||||||
leaflet-markercluster-rails
|
leaflet-markercluster-rails
|
||||||
leaflet-rails
|
leaflet-rails
|
||||||
less (~> 2.5.0)
|
|
||||||
less-rails (~> 2.5.0)
|
|
||||||
less-rails-bootstrap (~> 3.2.0)
|
|
||||||
letter_opener
|
letter_opener
|
||||||
libv8 (= 3.16.14.7)
|
|
||||||
memcachier
|
memcachier
|
||||||
newrelic_rpm
|
newrelic_rpm
|
||||||
omniauth
|
omniauth
|
||||||
|
omniauth-facebook
|
||||||
omniauth-flickr (>= 0.0.15)
|
omniauth-flickr (>= 0.0.15)
|
||||||
omniauth-twitter
|
omniauth-twitter
|
||||||
pg
|
pg
|
||||||
poltergeist (~> 1.5.1)
|
poltergeist
|
||||||
pry
|
pry
|
||||||
rack (~> 1.4.5)
|
quiet_assets
|
||||||
rails (= 3.2.13)
|
rails (~> 4.2.1)
|
||||||
rails_12factor
|
rails_12factor
|
||||||
rake (>= 10.0.0)
|
rake (>= 10.0.0)
|
||||||
rspec-rails (~> 2.12.1)
|
rspec-activemodel-mocks
|
||||||
sass-rails (~> 3.2.3)
|
rspec-rails
|
||||||
therubyracer (~> 0.12)
|
rubocop
|
||||||
uglifier (>= 1.0.3)
|
ruby-units
|
||||||
|
sass-rails (~> 5.0.4)
|
||||||
|
selenium-webdriver
|
||||||
|
sidekiq
|
||||||
|
sparkpost_rails
|
||||||
|
uglifier (~> 2.7.2)
|
||||||
unicorn
|
unicorn
|
||||||
webrat
|
webrat
|
||||||
will_paginate (~> 3.0)
|
will_paginate (~> 3.0)
|
||||||
|
|
||||||
|
RUBY VERSION
|
||||||
|
ruby 2.3.1p112
|
||||||
|
|
||||||
|
BUNDLED WITH
|
||||||
|
1.13.6
|
||||||
|
|||||||
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
|
||||||
13
README.md
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
[](https://travis-ci.org/Growstuff/growstuff)
|
[](https://travis-ci.org/Growstuff/growstuff)
|
||||||
[](https://coveralls.io/r/Growstuff/growstuff)
|
[](https://coveralls.io/r/Growstuff/growstuff)
|
||||||
|
[](https://codeclimate.com/github/Growstuff/growstuff)
|
||||||
|
|
||||||
Welcome to the Growstuff project.
|
Welcome to the Growstuff project.
|
||||||
|
|
||||||
@@ -18,8 +19,9 @@ encourage participation from people of all backgrounds and skill levels.
|
|||||||
|
|
||||||
* [Issues](http://github.com/Growstuff/growstuff/issues) (features we're
|
* [Issues](http://github.com/Growstuff/growstuff/issues) (features we're
|
||||||
working on, known bugs, etc)
|
working on, known bugs, etc)
|
||||||
* [Discussion forums](http://wiki.growstuff.org/index.php/Discussion_forums) (mailing lists, IRC, etc)
|
* [Discussion forums](http://talk.growstuff.org/) (design ideas, planning releases)
|
||||||
* [Wiki](http://wiki.growstuff.org/) (general documentation)
|
* [IRC](https://webchat.freenode.net/) growstuff channel (general chat, brainstorming and troubleshooting) or [Gitter](https://gitter.im/Growstuff/growstuff)
|
||||||
|
* [Wiki](https://github.com/Growstuff/growstuff/wiki) (general documentation, etc. Help by migrating from the [old wiki](https://web.archive.org/web/*/wiki.growstuff.org))
|
||||||
|
|
||||||
## For coders
|
## For coders
|
||||||
|
|
||||||
@@ -27,10 +29,10 @@ Growstuff is built in Ruby on Rails and also uses JavaScript for
|
|||||||
frontend features. We welcome contributions -- see
|
frontend features. We welcome contributions -- see
|
||||||
[CONTRIBUTING](CONTRIBUTING.md) for details.
|
[CONTRIBUTING](CONTRIBUTING.md) for details.
|
||||||
|
|
||||||
* To set up your development environment, see [Getting started](http://wiki.growstuff.org/index.php/Development/Getting_Started).
|
* To set up your development environment, see [Getting started](https://github.com/Growstuff/growstuff/wiki/New-contributor-guide).
|
||||||
* We encourage [pair programming](http://wiki.growstuff.org/index.php/Pairing), especially for newer developers. [Find a pair programming partner.](http://talk.growstuff.org/t/find-a-pair-programming-partner/13)
|
* We encourage [pair programming](http://wiki.growstuff.org/index.php/Pairing), especially for newer developers. [Find a pair programming partner.](http://talk.growstuff.org/t/find-a-pair-programming-partner/13)
|
||||||
* Drop in to one of our [discussion forums](http://wiki.growstuff.org/index.php/Discussion_forums) to chat to other developers, get help, etc.
|
* Drop in to our [discussion forums](http://talk.growstuff.org/), IRC or Gitter to chat to other developers, get help, etc.
|
||||||
* You may also be interested in our [API](http://wiki.growstuff.org/index.php/API).
|
* You may also be interested in our [API](https://github.com/Growstuff/growstuff/wiki/API).
|
||||||
|
|
||||||
## For designers, writers, researchers, data wranglers, and other contributors
|
## For designers, writers, researchers, data wranglers, and other contributors
|
||||||
|
|
||||||
@@ -49,6 +51,7 @@ Here on Github, you might find these useful:
|
|||||||
* [needs: visual design](https://github.com/Growstuff/growstuff/labels/needs:%20visual design) - tasks requiring visual/graphical design
|
* [needs: visual design](https://github.com/Growstuff/growstuff/labels/needs:%20visual design) - tasks requiring visual/graphical design
|
||||||
* [needs: documentation](https://github.com/Growstuff/growstuff/labels/needs:%20documentation)
|
* [needs: documentation](https://github.com/Growstuff/growstuff/labels/needs:%20documentation)
|
||||||
* [needs: data](https://github.com/Growstuff/growstuff/labels/needs:%20data) - tasks requiring data entry, data design, data import, or similar
|
* [needs: data](https://github.com/Growstuff/growstuff/labels/needs:%20data) - tasks requiring data entry, data design, data import, or similar
|
||||||
|
* [curated:beginner](https://github.com/Growstuff/growstuff/labels/curated:%20beginner) - tasks that are ideal for beginner programmers or people new to the project
|
||||||
|
|
||||||
Feel free to comment on any of the issues you find there, or open up a broader conversation on [Growstuff Talk](http://talk.growstuff.org).
|
Feel free to comment on any of the issues you find there, or open up a broader conversation on [Growstuff Talk](http://talk.growstuff.org).
|
||||||
|
|
||||||
|
|||||||
BIN
app/assets/images/facebook-login-splash.png
Normal file
|
After Width: | Height: | Size: 176 KiB |
BIN
app/assets/images/facebook-thumbnail.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 572 B After Width: | Height: | Size: 613 B |
BIN
app/assets/images/location-not-set.en.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
app/assets/images/sunniness_not specified.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
app/assets/images/sunniness_semi-shade.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
app/assets/images/sunniness_shade.png
Normal file
|
After Width: | Height: | Size: 9.3 KiB |
BIN
app/assets/images/sunniness_sun.png
Normal file
|
After Width: | Height: | Size: 5.8 KiB |
@@ -5,17 +5,15 @@
|
|||||||
jQuery ->
|
jQuery ->
|
||||||
|
|
||||||
el = $('.append-date')
|
el = $('.append-date')
|
||||||
|
|
||||||
el.datepicker({'format': 'yyyy-mm-dd'})
|
el.datepicker({'format': 'yyyy-mm-dd'})
|
||||||
|
|
||||||
href = el.attr('href')
|
|
||||||
|
|
||||||
originalText = el.text()
|
|
||||||
|
|
||||||
el.click (e) ->
|
el.click (e) ->
|
||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
|
|
||||||
|
originalText = $(this).text()
|
||||||
|
href = $(this).attr('href')
|
||||||
$(this).text('Confirm without date')
|
$(this).text('Confirm without date')
|
||||||
|
|
||||||
$(this).bind('click.confirm', (e) ->
|
$(this).bind('click.confirm', (e) ->
|
||||||
@@ -31,6 +29,8 @@ jQuery ->
|
|||||||
|
|
||||||
el.one 'changeDate', ->
|
el.one 'changeDate', ->
|
||||||
date = $(this).datepicker('getDate')
|
date = $(this).datepicker('getDate')
|
||||||
|
href = $(this).attr('href')
|
||||||
|
|
||||||
url = "#{href}&planting[finished_at]=#{date}"
|
url = "#{href}&planting[finished_at]=#{date}"
|
||||||
|
|
||||||
link = $("<a href='#{url}' data-method='put'></a>")
|
link = $("<a href='#{url}' data-method='put'></a>")
|
||||||
|
|||||||
@@ -15,8 +15,7 @@
|
|||||||
//= require js-routes
|
//= require js-routes
|
||||||
//= require jquery
|
//= require jquery
|
||||||
//= require jquery_ujs
|
//= require jquery_ujs
|
||||||
//= require jquery.ui.autocomplete
|
//= require jquery-ui/autocomplete
|
||||||
//= require twitter/bootstrap
|
//= require bootstrap-sprockets
|
||||||
//= require_tree .
|
|
||||||
//= require bootstrap-datepicker
|
//= require bootstrap-datepicker
|
||||||
|
//= require_tree .
|
||||||
|
|||||||
4
app/assets/javascripts/bootstrap-accessibility.min.js
vendored
Normal file
1
app/assets/javascripts/comfy/admin/cms/custom.js.coffee
Normal file
@@ -0,0 +1 @@
|
|||||||
|
# Custom JS for the admin area
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
if (document.getElementById("cropmap") !== null) {
|
if (document.getElementById("cropmap") !== null) {
|
||||||
mapbox_map_id = "<%= Rails.env == 'test' ? 0 : Growstuff::Application.config.mapbox_map_id %>";
|
mapbox_map_id = "<%= Rails.env == 'test' ? 0 : Growstuff::Application.config.mapbox_map_id %>";
|
||||||
mapbox_base_url = "https://c.tiles.mapbox.com/v3/" + mapbox_map_id + "/{z}/{x}/{y}.png";
|
mapbox_access_token = "<%= Rails.env == 'test' ? 0 : Growstuff::Application.config.mapbox_access_token %>";
|
||||||
|
mapbox_base_url = "http://a.tiles.mapbox.com/v4/" + mapbox_map_id + "/{z}/{x}/{y}.png?access_token=" + mapbox_access_token;
|
||||||
|
|
||||||
L.Icon.Default.imagePath = '/assets'
|
L.Icon.Default.imagePath = '/assets'
|
||||||
|
|
||||||
@@ -47,3 +48,7 @@ function showCropMap(cropmap) {
|
|||||||
|
|
||||||
cropmap.addLayer(markers);
|
cropmap.addLayer(markers);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$('.btn.toggle.crop-hierarchy').click(function () {
|
||||||
|
$('.toggle.crop-hierarchy').toggleClass('hide');
|
||||||
|
});
|
||||||
|
|||||||
@@ -9,11 +9,11 @@ jQuery ->
|
|||||||
finished = $('#planting_finished_at')
|
finished = $('#planting_finished_at')
|
||||||
if @checked
|
if @checked
|
||||||
if previousValue.length
|
if previousValue.length
|
||||||
date = previousValue
|
date = previousValue
|
||||||
finished.val(date)
|
finished.val(date)
|
||||||
else
|
else
|
||||||
finished.trigger('focus')
|
finished.trigger('focus')
|
||||||
else
|
else
|
||||||
previousValue = finished.val()
|
previousValue = finished.val()
|
||||||
finished.val('')
|
finished.val('')
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
if (document.getElementById("membermap") !== null) {
|
if (document.getElementById("membermap") !== null) {
|
||||||
mapbox_map_id = "<%= Rails.env == 'test' ? 0 : Growstuff::Application.config.mapbox_map_id %>";
|
mapbox_map_id = "<%= Rails.env == 'test' ? 0 : Growstuff::Application.config.mapbox_map_id %>";
|
||||||
mapbox_base_url = "https://c.tiles.mapbox.com/v3/" + mapbox_map_id + "/{z}/{x}/{y}.png";
|
mapbox_access_token = "<%= Rails.env == 'test' ? 0 : Growstuff::Application.config.mapbox_access_token %>";
|
||||||
|
mapbox_base_url = "http://a.tiles.mapbox.com/v4/" + mapbox_map_id + "/{z}/{x}/{y}.png?access_token=" + mapbox_access_token;
|
||||||
|
|
||||||
L.Icon.Default.imagePath = '/assets'
|
L.Icon.Default.imagePath = '/assets'
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
if (document.getElementById("placesmap") !== null) {
|
if (document.getElementById("placesmap") !== null) {
|
||||||
places_base_path = "/places";
|
places_base_path = "/places";
|
||||||
mapbox_map_id = "<%= Rails.env == 'test' ? 0 : Growstuff::Application.config.mapbox_map_id %>";
|
mapbox_map_id = "<%= Rails.env == 'test' ? 0 : Growstuff::Application.config.mapbox_map_id %>";
|
||||||
mapbox_base_url = "https://c.tiles.mapbox.com/v3/" + mapbox_map_id + "/{z}/{x}/{y}.png";
|
mapbox_access_token = "<%= Rails.env == 'test' ? 0 : Growstuff::Application.config.mapbox_access_token %>";
|
||||||
|
mapbox_base_url = "http://a.tiles.mapbox.com/v4/" + mapbox_map_id + "/{z}/{x}/{y}.png?access_token=" + mapbox_access_token;
|
||||||
nominatim_base_url = 'http://nominatim.openstreetmap.org/search/';
|
nominatim_base_url = 'http://nominatim.openstreetmap.org/search/';
|
||||||
nominatim_user_agent_email = "<%= Rails.env == 'test' ? 0 : Growstuff::Application.config.user_agent_email %>";
|
nominatim_user_agent_email = "<%= Rails.env == 'test' ? 0 : Growstuff::Application.config.user_agent_email %>";
|
||||||
|
|
||||||
|
|||||||
@@ -4,3 +4,41 @@
|
|||||||
|
|
||||||
jQuery ->
|
jQuery ->
|
||||||
$('.add-datepicker').datepicker('format' : 'yyyy-mm-dd')
|
$('.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,14 +0,0 @@
|
|||||||
/*
|
|
||||||
* This is a manifest file that'll automatically include all the stylesheets available in this directory
|
|
||||||
* and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
|
|
||||||
* the top of the compiled file, but it's generally better to create a new file per style scope.
|
|
||||||
*= require_self
|
|
||||||
*= require jquery.ui.autocomplete
|
|
||||||
*= require bootstrap-datepicker
|
|
||||||
*= require leaflet
|
|
||||||
*= require leaflet.markercluster
|
|
||||||
*= require leaflet.markercluster.default
|
|
||||||
*= require custom_bootstrap/custom_bootstrap
|
|
||||||
*= require overrides.css
|
|
||||||
*= require_tree .
|
|
||||||
*/
|
|
||||||
7
app/assets/stylesheets/application.sass
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
@import 'jquery-ui/autocomplete'
|
||||||
|
@import 'bootstrap-datepicker'
|
||||||
|
@import 'leaflet'
|
||||||
|
@import 'leaflet.markercluster'
|
||||||
|
@import 'leaflet.markercluster.default'
|
||||||
|
@import 'custom_bootstrap/custom_bootstrap'
|
||||||
|
@import 'overrides'
|
||||||
1
app/assets/stylesheets/bootstrap-accessibility.css
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
.btn:focus{outline:dotted 2px #000}div.active:focus{outline:dotted 1px #000}a:focus{outline:dotted 1px #000}.close:hover,.close:focus{outline:dotted 1px #000}.nav>li>a:hover,.nav>li>a:focus{outline:dotted 1px #000}.carousel-inner>.item{position:absolute;top:-999999em;display:block;-moz-transition:ease-in-out 0.6s left;-o-transition:ease-in-out 0.6s left;-webkit-transition:ease-in-out 0.6s left;transition:ease-in-out 0.6s left}.carousel-inner>.active{top:0}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{position:relative}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.alert-success{color:#2d4821}.alert-info{color:#214c62}.alert-warning{color:#6c4a00;background-color:#f9f1c6}.alert-danger{color:#d2322d}.alert-danger:hover{color:#a82824}
|
||||||
1
app/assets/stylesheets/comfy/admin/cms/custom.sass
Normal file
@@ -0,0 +1 @@
|
|||||||
|
// custom CSS for admin area
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
||||||
// !!! AUTOMATICALLY GENERATED FILE. DO NOT MODIFY !!!
|
|
||||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
||||||
|
|
||||||
// Core variables and mixins
|
|
||||||
@import "twitter/bootstrap/variables.less";
|
|
||||||
@import "custom_bootstrap/variables.less"; // Modify this for custom colors, font-sizes, etc
|
|
||||||
@import "twitter/bootstrap/mixins.less";
|
|
||||||
@import "custom_bootstrap/mixins.less"; // Modify this for custom mixins
|
|
||||||
|
|
||||||
// Reset and dependencies
|
|
||||||
@import "twitter/bootstrap/normalize.less";
|
|
||||||
@import "twitter/bootstrap/print.less";
|
|
||||||
@import "twitter/bootstrap/glyphicons.less";
|
|
||||||
|
|
||||||
// Core CSS
|
|
||||||
@import "twitter/bootstrap/scaffolding.less";
|
|
||||||
@import "twitter/bootstrap/type.less";
|
|
||||||
@import "twitter/bootstrap/code.less";
|
|
||||||
@import "twitter/bootstrap/grid.less";
|
|
||||||
@import "twitter/bootstrap/tables.less";
|
|
||||||
@import "twitter/bootstrap/forms.less";
|
|
||||||
@import "twitter/bootstrap/buttons.less";
|
|
||||||
|
|
||||||
// Components
|
|
||||||
@import "twitter/bootstrap/component-animations.less";
|
|
||||||
@import "twitter/bootstrap/dropdowns.less";
|
|
||||||
@import "twitter/bootstrap/button-groups.less";
|
|
||||||
@import "twitter/bootstrap/input-groups.less";
|
|
||||||
@import "twitter/bootstrap/navs.less";
|
|
||||||
@import "twitter/bootstrap/navbar.less";
|
|
||||||
@import "twitter/bootstrap/breadcrumbs.less";
|
|
||||||
@import "twitter/bootstrap/pagination.less";
|
|
||||||
@import "twitter/bootstrap/pager.less";
|
|
||||||
@import "twitter/bootstrap/labels.less";
|
|
||||||
@import "twitter/bootstrap/badges.less";
|
|
||||||
@import "twitter/bootstrap/jumbotron.less";
|
|
||||||
@import "twitter/bootstrap/thumbnails.less";
|
|
||||||
@import "twitter/bootstrap/alerts.less";
|
|
||||||
@import "twitter/bootstrap/progress-bars.less";
|
|
||||||
@import "twitter/bootstrap/media.less";
|
|
||||||
@import "twitter/bootstrap/list-group.less";
|
|
||||||
@import "twitter/bootstrap/panels.less";
|
|
||||||
@import "twitter/bootstrap/responsive-embed.less";
|
|
||||||
@import "twitter/bootstrap/wells.less";
|
|
||||||
@import "twitter/bootstrap/close.less";
|
|
||||||
|
|
||||||
// Components w/ JavaScript
|
|
||||||
@import "twitter/bootstrap/modals.less";
|
|
||||||
@import "twitter/bootstrap/tooltip.less";
|
|
||||||
@import "twitter/bootstrap/popovers.less";
|
|
||||||
@import "twitter/bootstrap/carousel.less";
|
|
||||||
|
|
||||||
// Utility classes
|
|
||||||
@import "twitter/bootstrap/utilities.less";
|
|
||||||
@import "twitter/bootstrap/responsive-utilities.less";
|
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||||
|
// !!! AUTOMATICALLY GENERATED FILE. DO NOT MODIFY !!!
|
||||||
|
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||||
|
|
||||||
|
// Core variables and mixins
|
||||||
|
@import "bootstrap-sprockets"
|
||||||
|
@import "bootstrap/variables"
|
||||||
|
// Modify this for custom colors, font-sizes, etc
|
||||||
|
@import "custom_bootstrap/variables"
|
||||||
|
@import "bootstrap/mixins"
|
||||||
|
// Modify this for custom mixins
|
||||||
|
@import "custom_bootstrap/mixins"
|
||||||
|
|
||||||
|
// Reset and dependencies
|
||||||
|
@import "bootstrap/normalize"
|
||||||
|
@import "bootstrap/print"
|
||||||
|
@import "bootstrap/glyphicons"
|
||||||
|
|
||||||
|
// Core CSS
|
||||||
|
@import "bootstrap/scaffolding"
|
||||||
|
@import "bootstrap/type"
|
||||||
|
@import "bootstrap/code"
|
||||||
|
@import "bootstrap/grid"
|
||||||
|
@import "bootstrap/tables"
|
||||||
|
@import "bootstrap/forms"
|
||||||
|
@import "bootstrap/buttons"
|
||||||
|
|
||||||
|
// Components
|
||||||
|
@import "bootstrap/component-animations"
|
||||||
|
@import "bootstrap/dropdowns"
|
||||||
|
@import "bootstrap/button-groups"
|
||||||
|
@import "bootstrap/input-groups"
|
||||||
|
@import "bootstrap/navs"
|
||||||
|
@import "bootstrap/navbar"
|
||||||
|
@import "bootstrap/breadcrumbs"
|
||||||
|
@import "bootstrap/pagination"
|
||||||
|
@import "bootstrap/pager"
|
||||||
|
@import "bootstrap/labels"
|
||||||
|
@import "bootstrap/badges"
|
||||||
|
@import "bootstrap/jumbotron"
|
||||||
|
@import "bootstrap/thumbnails"
|
||||||
|
@import "bootstrap/alerts"
|
||||||
|
@import "bootstrap/progress-bars"
|
||||||
|
@import "bootstrap/media"
|
||||||
|
@import "bootstrap/list-group"
|
||||||
|
@import "bootstrap/panels"
|
||||||
|
@import "bootstrap/responsive-embed"
|
||||||
|
@import "bootstrap/wells"
|
||||||
|
@import "bootstrap/close"
|
||||||
|
|
||||||
|
// Components w/ JavaScript
|
||||||
|
@import "bootstrap/modals"
|
||||||
|
@import "bootstrap/tooltip"
|
||||||
|
@import "bootstrap/popovers"
|
||||||
|
@import "bootstrap/carousel"
|
||||||
|
|
||||||
|
// Utility classes
|
||||||
|
@import "bootstrap/utilities"
|
||||||
|
@import "bootstrap/responsive-utilities"
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
// Use this file to override Twitter Bootstrap variables or define own variables.
|
|
||||||
|
|
||||||
// Import original variables so they can be used in overrides
|
|
||||||
@import "twitter/bootstrap/variables.less";
|
|
||||||
|
|
||||||
// Base colours
|
|
||||||
|
|
||||||
@beige: #f3f1ee;
|
|
||||||
@brown: #413f3b;
|
|
||||||
|
|
||||||
@green: #5f8e43;
|
|
||||||
@blue: #2f4365;
|
|
||||||
@red: #8e4d43;
|
|
||||||
@orange: #b2685c;
|
|
||||||
@yellow: #b2935c;
|
|
||||||
|
|
||||||
@body-bg: @beige;
|
|
||||||
@text-color: @brown;
|
|
||||||
@link-color: @green;
|
|
||||||
|
|
||||||
@brand-primary: @green;
|
|
||||||
|
|
||||||
@font-family-sans-serif: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
||||||
@font-family-serif: Georgia, "Times New Roman", Times, serif;
|
|
||||||
@font-family-mono: Monaco, Menlo, Consolas, "Courier New", monospace;
|
|
||||||
|
|
||||||
@font-size-base: 14px;
|
|
||||||
@font-family-base: @font-family-sans-serif;
|
|
||||||
@line-height-base: 1.5;
|
|
||||||
@alt-font-family: @font-family-serif;
|
|
||||||
|
|
||||||
@headings-font-family: @font-family-sans-serif;
|
|
||||||
@headings-font-weight: bold; // instead of browser default, bold
|
|
||||||
@headings-color: inherit; // empty to use BS default, @textColor
|
|
||||||
|
|
||||||
// Hero unit
|
|
||||||
@jumbotron-bg: darken(@body-bg, 10%);
|
|
||||||
|
|
||||||
// Nav bar
|
|
||||||
@navbar-default-bg: @brown;
|
|
||||||
@navbar-default-bg-highlight: @brown;
|
|
||||||
@navbar-default-color: @beige;
|
|
||||||
@navbar-default-link-color: darken(@beige, 20%);
|
|
||||||
@navbar-default-link-hover-color: @beige;
|
|
||||||
@navbar-default-link-active-color: @beige;
|
|
||||||
@navbar-default-brand-color: lighten(@green, 20%);
|
|
||||||
|
|
||||||
// Top nav collapse threshold
|
|
||||||
@grid-float-breakpoint: @screen-md-min;
|
|
||||||
|
|
||||||
@dropdown-bg: lighten(@beige, 10%);
|
|
||||||
@dropdown-link-color: @brown;
|
|
||||||
@dropdown-link-hover-color: @brown;
|
|
||||||
@dropdown-link-hover-bg: lighten(@green, 50%);
|
|
||||||
54
app/assets/stylesheets/custom_bootstrap/variables.sass
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
// Use this file to override Twitter Bootstrap variables or define own variables.
|
||||||
|
|
||||||
|
// Import original variables so they can be used in overrides
|
||||||
|
//@import 'bootstrap/variables.scss'
|
||||||
|
|
||||||
|
// Base colours
|
||||||
|
|
||||||
|
$beige: #f3f1ee
|
||||||
|
$brown: #413f3b
|
||||||
|
|
||||||
|
$green: #5f8e43
|
||||||
|
$blue: #2f4365
|
||||||
|
$red: #8e4d43
|
||||||
|
$orange: #b2685c
|
||||||
|
$yellow: #b2935c
|
||||||
|
|
||||||
|
$body-bg: $beige
|
||||||
|
$text-color: $brown
|
||||||
|
$link-color: $green
|
||||||
|
|
||||||
|
$brand-primary: $green
|
||||||
|
|
||||||
|
$font-family-sans-serif: "Helvetica Neue", Helvetica, Arial, sans-serif
|
||||||
|
$font-family-serif: Georgia, "Times New Roman", Times, serif
|
||||||
|
$font-family-mono: Monaco, Menlo, Consolas, "Courier New", monospace
|
||||||
|
|
||||||
|
$font-size-base: 14px
|
||||||
|
$font-family-base: $font-family-sans-serif
|
||||||
|
$line-height-base: 1.5
|
||||||
|
$alt-font-family: $font-family-serif
|
||||||
|
|
||||||
|
$headings-font-family: $font-family-sans-serif
|
||||||
|
$headings-font-weight: bold // instead of browser default, bold
|
||||||
|
$headings-color: inherit // empty to use BS default, $textColor
|
||||||
|
|
||||||
|
// Hero unit
|
||||||
|
$jumbotron-bg: darken($body-bg, 10%)
|
||||||
|
|
||||||
|
// Nav bar
|
||||||
|
$navbar-default-bg: $brown
|
||||||
|
$navbar-default-bg-highlight: $brown
|
||||||
|
$navbar-default-color: $beige
|
||||||
|
$navbar-default-link-color: darken($beige, 20%)
|
||||||
|
$navbar-default-link-hover-color: $beige
|
||||||
|
$navbar-default-link-active-color: darken($beige,80%)
|
||||||
|
$navbar-default-brand-color: lighten($green, 20%)
|
||||||
|
|
||||||
|
// Top nav collapse threshold
|
||||||
|
$grid-float-breakpoint: $screen-md-min
|
||||||
|
|
||||||
|
$dropdown-bg: lighten($beige, 10%)
|
||||||
|
$dropdown-link-color: $brown
|
||||||
|
$dropdown-link-hover-color: $brown
|
||||||
|
$dropdown-link-hover-bg: lighten($green, 50%)
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
.leaflet-popup-content-wrapper, .leaflet-popup-tip {
|
|
||||||
border: none;
|
|
||||||
}
|
|
||||||
10
app/assets/stylesheets/leaflet_overrides.sass
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
.leaflet-popup-content-wrapper,
|
||||||
|
.leaflet-popup-tip
|
||||||
|
border: none
|
||||||
|
|
||||||
|
.thumbnail
|
||||||
|
background: #fff !important
|
||||||
|
border: solid 1px whitesmoke
|
||||||
|
|
||||||
|
.thumbnail .crop-thumbnail .cropinfo
|
||||||
|
padding-top: 14px
|
||||||
@@ -1,263 +0,0 @@
|
|||||||
@import "twitter/bootstrap/bootstrap";
|
|
||||||
@import "custom_bootstrap/variables";
|
|
||||||
// this padding needs to be done before the responsive stuff is imported
|
|
||||||
body {
|
|
||||||
// modifying this for our promotional banner. can be replaced after if
|
|
||||||
// needed.
|
|
||||||
// padding-top: @navbar-height + 15px;
|
|
||||||
padding-top: @navbar-height;
|
|
||||||
}
|
|
||||||
|
|
||||||
//@import "twitter/bootstrap/responsive";
|
|
||||||
|
|
||||||
// Set the correct sprite paths
|
|
||||||
@iconSpritePath: asset-path("twitter/bootstrap/glyphicons-halflings");
|
|
||||||
@iconWhiteSpritePath: asset-path("twitter/bootstrap/glyphicons-halflings-white");
|
|
||||||
|
|
||||||
// Set the Font Awesome (Font Awesome is default. You can disable by commenting below lines)
|
|
||||||
@fontAwesomeEotPath: asset-url("fontawesome-webfont.eot");
|
|
||||||
@fontAwesomeEotPath_iefix: asset-url("fontawesome-webfont.eot#iefix");
|
|
||||||
@fontAwesomeWoffPath: asset-url("fontawesome-webfont.woff");
|
|
||||||
@fontAwesomeTtfPath: asset-url("fontawesome-webfont.ttf");
|
|
||||||
@fontAwesomeSvgPath: asset-url("fontawesome-webfont.svg#fontawesomeregular");
|
|
||||||
|
|
||||||
// Font Awesome
|
|
||||||
//@import "fontawesome/font-awesome";
|
|
||||||
|
|
||||||
// Glyphicons
|
|
||||||
//@import "twitter/bootstrap/sprites.less";
|
|
||||||
|
|
||||||
|
|
||||||
.list-inline > li.first {
|
|
||||||
padding-left: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
h2 {
|
|
||||||
font-size: 150%;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
#subtitle {
|
|
||||||
color: lighten(@brown, 30%);
|
|
||||||
margin-top: 0px;
|
|
||||||
padding-top: 0px;
|
|
||||||
padding-left: 1em;
|
|
||||||
font-style: italic;
|
|
||||||
font-weight: normal;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
h3 {
|
|
||||||
font-size: 120%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.main {
|
|
||||||
padding-right: 1em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sidebar {
|
|
||||||
margin-left: -1px;
|
|
||||||
border-left: 1px solid darken(@beige, 10%);
|
|
||||||
padding-left: 1em;
|
|
||||||
}
|
|
||||||
|
|
||||||
// this is used for eg. crops and members index pages
|
|
||||||
.six-across:nth-child(6n+1) {
|
|
||||||
margin-left: 0px
|
|
||||||
}
|
|
||||||
|
|
||||||
.three-across:nth-child(3n+1) {
|
|
||||||
margin-left: 0px;
|
|
||||||
clear: both;
|
|
||||||
}
|
|
||||||
|
|
||||||
// let's condense the hero unit a little
|
|
||||||
.jumbotron {
|
|
||||||
padding-top: 30px;
|
|
||||||
padding-bottom: 30px;
|
|
||||||
}
|
|
||||||
|
|
||||||
// info under the main heading on homepage
|
|
||||||
.jumbotron .info {
|
|
||||||
padding-top: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
// signup widget on homepage
|
|
||||||
.jumbotron .signup {
|
|
||||||
background-color: lighten(@green, 40%);
|
|
||||||
border: 1px solid lighten(@green, 20%);
|
|
||||||
border-radius: 6px;
|
|
||||||
padding: 15px;
|
|
||||||
text-align: center;
|
|
||||||
line-height: 200%;
|
|
||||||
}
|
|
||||||
|
|
||||||
// stats shown on homepage. eg. "999 members..."
|
|
||||||
p.stats {
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
.homepage-members {
|
|
||||||
height: 100px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.homepage-members:nth-child(odd) {
|
|
||||||
margin-left: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#placesmap, #cropmap {
|
|
||||||
height: 500px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#membermap {
|
|
||||||
height: 250px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.member-location {
|
|
||||||
font-size: small;
|
|
||||||
font-style: italic;
|
|
||||||
}
|
|
||||||
|
|
||||||
.member-location a {
|
|
||||||
color: @brown;
|
|
||||||
}
|
|
||||||
|
|
||||||
.crop-thumbnail {
|
|
||||||
position:relative;
|
|
||||||
padding:0;
|
|
||||||
img {
|
|
||||||
width:100%;
|
|
||||||
}
|
|
||||||
.text {
|
|
||||||
display:none;
|
|
||||||
color:#000;
|
|
||||||
position:absolute;
|
|
||||||
bottom:0;
|
|
||||||
background:rgba(0, 0, 0, 0.8);
|
|
||||||
width:100%;
|
|
||||||
margin:0;
|
|
||||||
}
|
|
||||||
p {
|
|
||||||
padding:5px;
|
|
||||||
margin:0;
|
|
||||||
color:#fff;
|
|
||||||
}
|
|
||||||
&:hover {
|
|
||||||
.text {
|
|
||||||
display:block;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.member-thumbnail {
|
|
||||||
img {
|
|
||||||
height: 85px;
|
|
||||||
width: 85px;
|
|
||||||
max-width: 85px
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.thumbnail {
|
|
||||||
margin-bottom: 1.5em;
|
|
||||||
|
|
||||||
.scientific-name small, .crop-name a {
|
|
||||||
display: inline-block;
|
|
||||||
max-width: 100%;
|
|
||||||
white-space: nowrap;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
line-height: 1em;
|
|
||||||
padding-bottom: 2px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.crop-name a {
|
|
||||||
padding-top: 2px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.scientific-name small {
|
|
||||||
margin-bottom: -2px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
li.crop-hierarchy {
|
|
||||||
list-style-type: disc;
|
|
||||||
}
|
|
||||||
|
|
||||||
.navbar-brand {
|
|
||||||
margin: 0px;
|
|
||||||
padding: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.navbar-bottom {
|
|
||||||
margin: 40px 0px 0px 0px !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
// navbar centering
|
|
||||||
footer .navbar .nav {
|
|
||||||
float: none;
|
|
||||||
display: inline-block;
|
|
||||||
*display: inline;
|
|
||||||
/* ie7 fix */
|
|
||||||
*zoom: 1;
|
|
||||||
/* hasLayout ie7 trigger */
|
|
||||||
vertical-align: top;
|
|
||||||
> li {
|
|
||||||
float: none;
|
|
||||||
display: inline-block;
|
|
||||||
*display: inline;
|
|
||||||
/* ie7 fix */
|
|
||||||
*zoom: 1;
|
|
||||||
/* hasLayout ie7 trigger */
|
|
||||||
vertical-align: top;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.navbar-bottom.navbar {
|
|
||||||
text-align: center;
|
|
||||||
border-radius: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.crop-image, .member-image {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Autosuggest
|
|
||||||
|
|
||||||
.ui-autocomplete {
|
|
||||||
z-index: @zindex-tooltip;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Crowdfunding campaign, Sep-Oct 2014
|
|
||||||
|
|
||||||
.crowdfunding-banner {
|
|
||||||
text-align: center;
|
|
||||||
font-weight: bold;
|
|
||||||
background-color: lighten(@green, 30%);
|
|
||||||
margin-top: 0px;
|
|
||||||
margin-bottom: 5px;
|
|
||||||
padding: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.crowdfunding-banner a {
|
|
||||||
color: @brown;
|
|
||||||
text-decoration: underline;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Overrides applying only to mobile view. This must be at the end of the overrides file.
|
|
||||||
|
|
||||||
@media only screen and (max-width: 767px) {
|
|
||||||
.sidebar {
|
|
||||||
margin-left: 0;
|
|
||||||
border-left: none;
|
|
||||||
padding-left: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#map {
|
|
||||||
height: 300px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.navbar .nav > li {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
338
app/assets/stylesheets/overrides.sass
Normal file
@@ -0,0 +1,338 @@
|
|||||||
|
@import "bootstrap-sprockets"
|
||||||
|
@import "bootstrap"
|
||||||
|
@import "custom_bootstrap/variables"
|
||||||
|
// this padding needs to be done before the responsive stuff is imported
|
||||||
|
body
|
||||||
|
// modifying this for our promotional banner. can be replaced after if
|
||||||
|
// needed.
|
||||||
|
// padding-top: $navbar-height + 15px
|
||||||
|
padding-top: $navbar-height
|
||||||
|
|
||||||
|
|
||||||
|
//@import "bootstrap/responsive"
|
||||||
|
|
||||||
|
// Font Awesome
|
||||||
|
@import "font-awesome-sprockets"
|
||||||
|
@import "font-awesome"
|
||||||
|
|
||||||
|
// Glyphicons
|
||||||
|
//@import "bootstrap/glyphicons"
|
||||||
|
|
||||||
|
|
||||||
|
.list-inline > li.first
|
||||||
|
padding-left: 0px
|
||||||
|
|
||||||
|
h2
|
||||||
|
font-size: 150%
|
||||||
|
|
||||||
|
|
||||||
|
//#subtitle
|
||||||
|
// color: lighten($brown, 30%)
|
||||||
|
// font-style: italic
|
||||||
|
// font-weight: normal
|
||||||
|
// margin-top: 0px
|
||||||
|
// padding-left: 1em
|
||||||
|
// padding-top: 0px
|
||||||
|
|
||||||
|
h3
|
||||||
|
font-size: 120%
|
||||||
|
|
||||||
|
.main
|
||||||
|
padding-right: 1em
|
||||||
|
|
||||||
|
.navbar .navbar-form
|
||||||
|
padding-top: 0
|
||||||
|
padding-bottom: 0
|
||||||
|
margin-right: 0
|
||||||
|
margin-left: 15px
|
||||||
|
border: 0
|
||||||
|
-webkit-box-shadow: none
|
||||||
|
box-shadow: none
|
||||||
|
|
||||||
|
.img-responsive
|
||||||
|
max-width: 100%
|
||||||
|
height: auto
|
||||||
|
|
||||||
|
.sidebar
|
||||||
|
border-left: 1px solid darken($beige, 10%)
|
||||||
|
margin-left: -1px
|
||||||
|
padding-left: 1em
|
||||||
|
|
||||||
|
// this is used for eg. crops and members index pages
|
||||||
|
.six-across:nth-child(6n+1)
|
||||||
|
margin-left: 0px
|
||||||
|
|
||||||
|
.three-across:nth-child(3n+1)
|
||||||
|
margin-left: 0px
|
||||||
|
clear: both
|
||||||
|
|
||||||
|
// let's condense the hero unit a little
|
||||||
|
.jumbotron
|
||||||
|
padding-top: 30px
|
||||||
|
padding-bottom: 30px
|
||||||
|
|
||||||
|
// info under the main heading on homepage
|
||||||
|
.jumbotron .info
|
||||||
|
padding-top: 15px
|
||||||
|
|
||||||
|
// signup widget on homepage
|
||||||
|
.jumbotron .signup
|
||||||
|
background-color: lighten($green, 40%)
|
||||||
|
border: 1px solid lighten($green, 20%)
|
||||||
|
border-radius: 6px
|
||||||
|
line-height: 200%
|
||||||
|
padding: 15px
|
||||||
|
text-align: center
|
||||||
|
|
||||||
|
// stats shown on homepage. eg. "999 members..."
|
||||||
|
p.stats
|
||||||
|
font-weight: bold
|
||||||
|
|
||||||
|
.member-cards
|
||||||
|
display: flex
|
||||||
|
flex: none
|
||||||
|
flex-wrap: wrap
|
||||||
|
justify-content: space-between
|
||||||
|
|
||||||
|
.member-thumbnail
|
||||||
|
padding: .25em
|
||||||
|
|
||||||
|
div
|
||||||
|
width: 5em
|
||||||
|
display: inline-block
|
||||||
|
vertical-align: top
|
||||||
|
|
||||||
|
.member-thumbnail div~div
|
||||||
|
padding-left: 1em
|
||||||
|
width: 15em
|
||||||
|
|
||||||
|
.planting
|
||||||
|
dl.planting-attributes
|
||||||
|
font-size: 85%
|
||||||
|
|
||||||
|
dt
|
||||||
|
text-align: left
|
||||||
|
dd
|
||||||
|
margin-left: auto
|
||||||
|
|
||||||
|
@media (min-width: $screen-md-min)
|
||||||
|
.planting-thumbnail
|
||||||
|
dl.planting-attributes
|
||||||
|
font-size: 85%
|
||||||
|
width: 100%
|
||||||
|
|
||||||
|
dt
|
||||||
|
text-align: left
|
||||||
|
width: 80px
|
||||||
|
dd
|
||||||
|
padding-left: 80px
|
||||||
|
margin-left: auto
|
||||||
|
|
||||||
|
.navbar .navbar-form
|
||||||
|
width: 250px
|
||||||
|
|
||||||
|
|
||||||
|
#placesmap, #cropmap
|
||||||
|
height: 500px
|
||||||
|
|
||||||
|
#membermap
|
||||||
|
height: 250px
|
||||||
|
|
||||||
|
.location-not-set
|
||||||
|
height: 250px
|
||||||
|
width: 100%
|
||||||
|
background-image: image-url('location-not-set.en.png')
|
||||||
|
background-repeat: no-repeat
|
||||||
|
background-position: center
|
||||||
|
|
||||||
|
.member-location
|
||||||
|
font-size: small
|
||||||
|
font-style: italic
|
||||||
|
|
||||||
|
|
||||||
|
.member-location a
|
||||||
|
color: $brown
|
||||||
|
|
||||||
|
|
||||||
|
.photo-thumbnail
|
||||||
|
padding: 0
|
||||||
|
position: relative
|
||||||
|
|
||||||
|
img
|
||||||
|
width: 100%
|
||||||
|
|
||||||
|
.text
|
||||||
|
display: none
|
||||||
|
color: #000
|
||||||
|
position: absolute
|
||||||
|
bottom: 0
|
||||||
|
background: rgba(0, 0, 0, 0.8)
|
||||||
|
width: 100%
|
||||||
|
margin: 0
|
||||||
|
|
||||||
|
p
|
||||||
|
padding: 5px
|
||||||
|
margin: 0
|
||||||
|
color: #fff
|
||||||
|
|
||||||
|
&:hover
|
||||||
|
.text
|
||||||
|
display: block
|
||||||
|
|
||||||
|
.thumbnail
|
||||||
|
border: none
|
||||||
|
text-align: center
|
||||||
|
margin-bottom: 1.5em
|
||||||
|
|
||||||
|
.member-thumbnail
|
||||||
|
text-align: left
|
||||||
|
img
|
||||||
|
height: 85px
|
||||||
|
width: 85px
|
||||||
|
max-width: 85px
|
||||||
|
|
||||||
|
.crop-thumbnail
|
||||||
|
height: 220px
|
||||||
|
.cropinfo
|
||||||
|
display: inline-block
|
||||||
|
max-width: 100%
|
||||||
|
white-space: nowrap
|
||||||
|
line-height: 1em
|
||||||
|
padding-bottom: 2px
|
||||||
|
|
||||||
|
.cropname
|
||||||
|
overflow: hidden
|
||||||
|
text-overflow: ellipsis
|
||||||
|
|
||||||
|
.scientificname
|
||||||
|
font-size: small
|
||||||
|
font-style: italic
|
||||||
|
overflow: hidden
|
||||||
|
text-overflow: ellipsis
|
||||||
|
|
||||||
|
.plantingcount
|
||||||
|
font-size: small
|
||||||
|
|
||||||
|
.crop-name a
|
||||||
|
padding-top: 2px
|
||||||
|
|
||||||
|
.scientific-name small
|
||||||
|
margin-bottom: -2px
|
||||||
|
|
||||||
|
li.crop-hierarchy
|
||||||
|
list-style-type: disc
|
||||||
|
|
||||||
|
.navbar-brand
|
||||||
|
margin: 0px
|
||||||
|
padding: 0px
|
||||||
|
|
||||||
|
.navbar-bottom
|
||||||
|
margin: 40px 0px 0px 0px !important
|
||||||
|
|
||||||
|
// footer
|
||||||
|
footer
|
||||||
|
#footer1, #footer2, #footer3
|
||||||
|
text-align: left
|
||||||
|
padding-top: 1em
|
||||||
|
padding-bottom: 2em
|
||||||
|
ul
|
||||||
|
list-style-type: none
|
||||||
|
list-style-position: outside
|
||||||
|
padding-left: 0px
|
||||||
|
margin-left: 0px
|
||||||
|
|
||||||
|
a
|
||||||
|
color: $navbar-default-link-color
|
||||||
|
text-decoration: none
|
||||||
|
|
||||||
|
a:hover
|
||||||
|
color: $navbar-default-link-hover-color
|
||||||
|
|
||||||
|
a:active
|
||||||
|
color: $navbar-default-link-active-color
|
||||||
|
|
||||||
|
.navbar-bottom.navbar
|
||||||
|
border-radius: 0
|
||||||
|
|
||||||
|
// ensure footer is pushed to bottom of browser window
|
||||||
|
|
||||||
|
#maincontainer
|
||||||
|
min-height: 80%
|
||||||
|
|
||||||
|
html, body
|
||||||
|
height: 100%
|
||||||
|
|
||||||
|
.crop-image, .member-image
|
||||||
|
width: 100%
|
||||||
|
height: 100%
|
||||||
|
|
||||||
|
// Autosuggest
|
||||||
|
|
||||||
|
.ui-autocomplete
|
||||||
|
background: white
|
||||||
|
z-index: $zindex-tooltip
|
||||||
|
|
||||||
|
.alert
|
||||||
|
a
|
||||||
|
font-weight: 800
|
||||||
|
|
||||||
|
// Overrides applying only to mobile view. This must be at the end of the overrides file.
|
||||||
|
|
||||||
|
@media only screen and (max-width: 767px)
|
||||||
|
.sidebar
|
||||||
|
margin-left: 0
|
||||||
|
border-left: none
|
||||||
|
padding-left: 0
|
||||||
|
|
||||||
|
#map
|
||||||
|
height: 300px
|
||||||
|
|
||||||
|
.navbar .nav > li
|
||||||
|
display: block
|
||||||
|
|
||||||
|
.navbar .navbar-form
|
||||||
|
width: 185px
|
||||||
|
padding-left: 0
|
||||||
|
padding-right: 0
|
||||||
|
|
||||||
|
/* override "info" alert boxes to be green, not blue, on Growstuff */
|
||||||
|
$state-info-text: darken($green, 10%)
|
||||||
|
$state-info-bg: lighten($green, 50%)
|
||||||
|
|
||||||
|
/* and set "success" to be the same, as it was just very slightly
|
||||||
|
* different because the default bootstrap green is slightly different
|
||||||
|
* from ours */
|
||||||
|
$state-success-text: darken($green, 10%)
|
||||||
|
$state-success-bg: lighten($green, 50%)
|
||||||
|
|
||||||
|
.hide
|
||||||
|
display: none
|
||||||
|
|
||||||
|
#add-sci_name-row, #remove-sci_name-row, #add-alt_name-row, #remove-alt_name-row
|
||||||
|
display: none
|
||||||
|
|
||||||
|
.panel-footer
|
||||||
|
height: 6em
|
||||||
|
|
||||||
|
.panel
|
||||||
|
.dl-horizontal
|
||||||
|
text-overflow: ellipsis
|
||||||
|
overflow: hidden
|
||||||
|
|
||||||
|
#gardens_panel_body
|
||||||
|
height: 20em
|
||||||
|
|
||||||
|
.form-group.required .control-label:before
|
||||||
|
content: "* "
|
||||||
|
color: red
|
||||||
|
|
||||||
|
.margin-bottom
|
||||||
|
margin-bottom: 1em
|
||||||
|
|
||||||
|
.red
|
||||||
|
color: red
|
||||||
|
|
||||||
|
.truncate
|
||||||
|
overflow: hidden
|
||||||
|
text-overflow: ellipsis
|
||||||
|
white-space: nowrap
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
class AboutController < ApplicationController
|
|
||||||
end
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
class AccountTypesController < ApplicationController
|
class AccountTypesController < ApplicationController
|
||||||
before_filter :authenticate_member!
|
before_filter :authenticate_member!
|
||||||
load_and_authorize_resource
|
load_and_authorize_resource
|
||||||
|
|
||||||
# GET /account_types
|
# GET /account_types
|
||||||
def index
|
def index
|
||||||
@account_types = AccountType.all
|
@account_types = AccountType.all
|
||||||
@@ -36,7 +36,7 @@ class AccountTypesController < ApplicationController
|
|||||||
|
|
||||||
# POST /account_types
|
# POST /account_types
|
||||||
def create
|
def create
|
||||||
@account_type = AccountType.new(params[:account_type])
|
@account_type = AccountType.new(account_type_params)
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @account_type.save
|
if @account_type.save
|
||||||
@@ -52,7 +52,7 @@ class AccountTypesController < ApplicationController
|
|||||||
@account_type = AccountType.find(params[:id])
|
@account_type = AccountType.find(params[:id])
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @account_type.update_attributes(params[:account_type])
|
if @account_type.update(account_type_params)
|
||||||
format.html { redirect_to @account_type, notice: 'Account type was successfully updated.' }
|
format.html { redirect_to @account_type, notice: 'Account type was successfully updated.' }
|
||||||
else
|
else
|
||||||
format.html { render action: "edit" }
|
format.html { render action: "edit" }
|
||||||
@@ -69,4 +69,10 @@ class AccountTypesController < ApplicationController
|
|||||||
format.html { redirect_to account_types_url, notice: 'Account type was successfully deleted.' }
|
format.html { redirect_to account_types_url, notice: 'Account type was successfully deleted.' }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def account_type_params
|
||||||
|
params.require(:account_type).permit(:is_paid, :is_permanent_paid, :name)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
class AccountsController < ApplicationController
|
class AccountsController < ApplicationController
|
||||||
before_filter :authenticate_member!
|
before_filter :authenticate_member!
|
||||||
load_and_authorize_resource
|
load_and_authorize_resource
|
||||||
|
|
||||||
# GET /accounts
|
# GET /accounts
|
||||||
def index
|
def index
|
||||||
@accounts = Account.all
|
@accounts = Account.all
|
||||||
@@ -30,7 +30,7 @@ class AccountsController < ApplicationController
|
|||||||
@account = Account.find(params[:id])
|
@account = Account.find(params[:id])
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @account.update_attributes(params[:account])
|
if @account.update(params[:account])
|
||||||
format.html { redirect_to @account, notice: 'Account detail was successfully updated.' }
|
format.html { redirect_to @account, notice: 'Account detail was successfully updated.' }
|
||||||
else
|
else
|
||||||
format.html { render action: "edit" }
|
format.html { render action: "edit" }
|
||||||
@@ -38,4 +38,9 @@ class AccountsController < ApplicationController
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def account_params
|
||||||
|
params.require(:account).permit(:account_type_id, :member_id, :paid_until)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ class Admin::OrdersController < ApplicationController
|
|||||||
|
|
||||||
def search
|
def search
|
||||||
authorize! :manage, :all
|
authorize! :manage, :all
|
||||||
@orders = Order.search({:by => params[:search_by], :for => params[:search_text]})
|
@orders = Order.search({ by: params[:search_by], for: params[:search_text] })
|
||||||
|
|
||||||
if @orders.empty?
|
if @orders.empty?
|
||||||
flash[:alert] = "Couldn't find order with #{params[:search_by]} = #{params[:search_text]}"
|
flash[:alert] = "Couldn't find order with #{params[:search_by]} = #{params[:search_text]}"
|
||||||
@@ -17,6 +17,5 @@ class Admin::OrdersController < ApplicationController
|
|||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html # index.html.haml
|
format.html # index.html.haml
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
class AlternateNamesController < ApplicationController
|
class AlternateNamesController < ApplicationController
|
||||||
before_filter :authenticate_member!, :except => [:index, :show]
|
before_filter :authenticate_member!, except: [:index, :show]
|
||||||
load_and_authorize_resource
|
load_and_authorize_resource
|
||||||
|
|
||||||
# GET /alternate_names
|
# GET /alternate_names
|
||||||
@@ -13,17 +13,6 @@ class AlternateNamesController < ApplicationController
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# GET /alternate_names/1
|
|
||||||
# GET /alternate_names/1.json
|
|
||||||
def show
|
|
||||||
@alternate_name = AlternateName.find(params[:id])
|
|
||||||
|
|
||||||
respond_to do |format|
|
|
||||||
format.html # show.html.haml
|
|
||||||
format.json { render json: @alternate_name }
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
# GET /alternate_names/new
|
# GET /alternate_names/new
|
||||||
# GET /alternate_names/new.json
|
# GET /alternate_names/new.json
|
||||||
def new
|
def new
|
||||||
@@ -45,7 +34,7 @@ class AlternateNamesController < ApplicationController
|
|||||||
# POST /alternate_names.json
|
# POST /alternate_names.json
|
||||||
def create
|
def create
|
||||||
params[:alternate_name][:creator_id] = current_member.id
|
params[:alternate_name][:creator_id] = current_member.id
|
||||||
@alternate_name = AlternateName.new(params[:alternate_name])
|
@alternate_name = AlternateName.new(alternate_name_params)
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @alternate_name.save
|
if @alternate_name.save
|
||||||
@@ -64,7 +53,7 @@ class AlternateNamesController < ApplicationController
|
|||||||
@alternate_name = AlternateName.find(params[:id])
|
@alternate_name = AlternateName.find(params[:id])
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @alternate_name.update_attributes(params[:alternate_name])
|
if @alternate_name.update(alternate_name_params)
|
||||||
format.html { redirect_to @alternate_name.crop, notice: 'Alternate name was successfully updated.' }
|
format.html { redirect_to @alternate_name.crop, notice: 'Alternate name was successfully updated.' }
|
||||||
format.json { head :no_content }
|
format.json { head :no_content }
|
||||||
else
|
else
|
||||||
@@ -88,4 +77,10 @@ class AlternateNamesController < ApplicationController
|
|||||||
format.json { head :no_content }
|
format.json { head :no_content }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def alternate_name_params
|
||||||
|
params.require(:alternate_name).permit(:crop_id, :name, :creator_id)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ class ApplicationController < ActionController::Base
|
|||||||
request.path != "/members/confirmation" &&
|
request.path != "/members/confirmation" &&
|
||||||
request.path != "/members/sign_out" &&
|
request.path != "/members/sign_out" &&
|
||||||
!request.xhr?)
|
!request.xhr?)
|
||||||
store_location_for(:member, request.fullpath)
|
store_location_for(:member, request.fullpath)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -22,6 +22,10 @@ class ApplicationController < ActionController::Base
|
|||||||
stored_location_for(:member) || root_path
|
stored_location_for(:member) || root_path
|
||||||
end
|
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
|
# 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
|
# this means that we use current_user in specs but current_member everywhere
|
||||||
# else in the code.
|
# else in the code.
|
||||||
@@ -31,9 +35,9 @@ class ApplicationController < ActionController::Base
|
|||||||
|
|
||||||
# CanCan error handling
|
# CanCan error handling
|
||||||
rescue_from CanCan::AccessDenied do |exception|
|
rescue_from CanCan::AccessDenied do |exception|
|
||||||
redirect_to request.referer || root_url, :alert => exception.message
|
redirect_to request.referer || root_url, alert: exception.message
|
||||||
end
|
end
|
||||||
|
|
||||||
def set_locale
|
def set_locale
|
||||||
I18n.locale = params[:locale] || extract_locale_from_subdomain || I18n.default_locale
|
I18n.locale = params[:locale] || extract_locale_from_subdomain || I18n.default_locale
|
||||||
end
|
end
|
||||||
@@ -43,4 +47,35 @@ class ApplicationController < ActionController::Base
|
|||||||
I18n.available_locales.map(&:to_s).include?(parsed_locale) ? parsed_locale : nil
|
I18n.available_locales.map(&:to_s).include?(parsed_locale) ? parsed_locale : nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
before_action :configure_permitted_parameters, if: :devise_controller?
|
||||||
|
|
||||||
|
protected
|
||||||
|
|
||||||
|
def configure_permitted_parameters
|
||||||
|
devise_parameter_sanitizer.permit(:sign_up) do |member|
|
||||||
|
member.permit(:login_name, :email, :password, :password_confirmation,
|
||||||
|
:remember_me, :login,
|
||||||
|
# terms of service
|
||||||
|
:tos_agreement,
|
||||||
|
# profile stuff
|
||||||
|
:bio, :location, :latitude, :longitude,
|
||||||
|
# email settings
|
||||||
|
:show_email, :newsletter, :send_notification_email, :send_planting_reminder
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
devise_parameter_sanitizer.permit(:account_update) do |member|
|
||||||
|
member.permit(:login_name, :email, :password, :password_confirmation,
|
||||||
|
:remember_me, :login,
|
||||||
|
# terms of service
|
||||||
|
:tos_agreement,
|
||||||
|
# profile stuff
|
||||||
|
:bio, :location, :latitude, :longitude,
|
||||||
|
# email settings
|
||||||
|
:show_email, :newsletter, :send_notification_email, :send_planting_reminder,
|
||||||
|
# update password
|
||||||
|
:current_password
|
||||||
|
)
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -2,37 +2,24 @@ class AuthenticationsController < ApplicationController
|
|||||||
before_filter :authenticate_member!
|
before_filter :authenticate_member!
|
||||||
load_and_authorize_resource
|
load_and_authorize_resource
|
||||||
|
|
||||||
# GET /authentications
|
|
||||||
def index
|
|
||||||
@authentications = current_member.authentications if member_signed_in?
|
|
||||||
|
|
||||||
respond_to do |format|
|
|
||||||
format.html # index.html.erb
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
# POST /authentications
|
# POST /authentications
|
||||||
def create
|
def create
|
||||||
auth = request.env['omniauth.auth']
|
auth = request.env['omniauth.auth']
|
||||||
@authentication = nil
|
@authentication = nil
|
||||||
if auth
|
if auth
|
||||||
|
name = Growstuff::OauthSignupAction.new.determine_name(auth)
|
||||||
|
|
||||||
name = ''
|
@authentication = current_member.authentications
|
||||||
case auth['provider']
|
.create_with(
|
||||||
when 'twitter'
|
name: name,
|
||||||
name = auth['info']['nickname']
|
token: auth['credentials']['token'],
|
||||||
when 'flickr'
|
secret: auth['credentials']['secret']
|
||||||
name = auth['info']['name']
|
)
|
||||||
else
|
.find_or_create_by(
|
||||||
name = auth['info']['name']
|
provider: auth['provider'],
|
||||||
end
|
uid: auth['uid'],
|
||||||
|
name: name)
|
||||||
|
|
||||||
@authentication = current_member.authentications.find_or_create_by_provider_and_uid(
|
|
||||||
:provider => auth['provider'],
|
|
||||||
:uid => auth['uid'],
|
|
||||||
:name => name,
|
|
||||||
:token => auth['credentials']['token'],
|
|
||||||
:secret => auth['credentials']['secret'])
|
|
||||||
flash[:notice] = "Authentication successful."
|
flash[:notice] = "Authentication successful."
|
||||||
else
|
else
|
||||||
flash[:notice] = "Authentication failed."
|
flash[:notice] = "Authentication failed."
|
||||||
|
|||||||
@@ -1,29 +1,16 @@
|
|||||||
class CommentsController < ApplicationController
|
class CommentsController < ApplicationController
|
||||||
before_filter :authenticate_member!, :except => [:index, :show]
|
before_filter :authenticate_member!, except: [:index, :show]
|
||||||
load_and_authorize_resource
|
load_and_authorize_resource
|
||||||
|
|
||||||
cache_sweeper :comment_sweeper
|
|
||||||
|
|
||||||
# GET /comments
|
# GET /comments
|
||||||
# GET /comments.json
|
# GET /comments.json
|
||||||
def index
|
def index
|
||||||
@comments = Comment.paginate(:page => params[:page])
|
@comments = Comment.paginate(page: params[:page])
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html # index.html.erb
|
format.html # index.html.erb
|
||||||
format.json { render json: @comments }
|
format.json { render json: @comments }
|
||||||
format.rss { render :layout => false }
|
format.rss { render layout: false }
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
# GET /comments/1
|
|
||||||
# GET /comments/1.json
|
|
||||||
def show
|
|
||||||
@comment = Comment.find(params[:id])
|
|
||||||
|
|
||||||
respond_to do |format|
|
|
||||||
format.html # show.html.erb
|
|
||||||
format.json { render json: @comment }
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -41,7 +28,7 @@ class CommentsController < ApplicationController
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
redirect_to request.referer || root_url,
|
redirect_to request.referer || root_url,
|
||||||
:alert => "Can't post a comment on a non-existent post"
|
alert: "Can't post a comment on a non-existent post"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -55,11 +42,11 @@ class CommentsController < ApplicationController
|
|||||||
# POST /comments.json
|
# POST /comments.json
|
||||||
def create
|
def create
|
||||||
params[:comment][:author_id] = current_member.id
|
params[:comment][:author_id] = current_member.id
|
||||||
@comment = Comment.new(params[:comment])
|
@comment = Comment.new(comment_params)
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @comment.save
|
if @comment.save
|
||||||
format.html { redirect_to @comment.post, notice: 'Comment was successfully created.' }
|
format.html { redirect_to @comment.post, notice: "Comment was successfully created." }
|
||||||
format.json { render json: @comment, status: :created, location: @comment }
|
format.json { render json: @comment, status: :created, location: @comment }
|
||||||
else
|
else
|
||||||
format.html { render action: "new" }
|
format.html { render action: "new" }
|
||||||
@@ -79,7 +66,7 @@ class CommentsController < ApplicationController
|
|||||||
params[:comment].delete("author_id")
|
params[:comment].delete("author_id")
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @comment.update_attributes(params[:comment])
|
if @comment.update(comment_params)
|
||||||
format.html { redirect_to @comment.post, notice: 'Comment was successfully updated.' }
|
format.html { redirect_to @comment.post, notice: 'Comment was successfully updated.' }
|
||||||
format.json { head :no_content }
|
format.json { head :no_content }
|
||||||
else
|
else
|
||||||
@@ -101,4 +88,10 @@ class CommentsController < ApplicationController
|
|||||||
format.json { head :no_content }
|
format.json { head :no_content }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def comment_params
|
||||||
|
params.require(:comment).permit(:author_id, :body, :post_id)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
class CropsController < ApplicationController
|
require 'will_paginate/array'
|
||||||
before_filter :authenticate_member!, :except => [:index, :hierarchy, :search, :show]
|
|
||||||
load_and_authorize_resource
|
|
||||||
skip_authorize_resource :only => [:hierarchy, :search]
|
|
||||||
|
|
||||||
cache_sweeper :crop_sweeper
|
class CropsController < ApplicationController
|
||||||
|
before_filter :authenticate_member!, except: [:index, :hierarchy, :search, :show]
|
||||||
|
load_and_authorize_resource
|
||||||
|
skip_authorize_resource only: [:hierarchy, :search]
|
||||||
|
|
||||||
# GET /crops
|
# GET /crops
|
||||||
# GET /crops.json
|
# GET /crops.json
|
||||||
@@ -11,30 +11,43 @@ class CropsController < ApplicationController
|
|||||||
@sort = params[:sort]
|
@sort = params[:sort]
|
||||||
if @sort == 'alpha'
|
if @sort == 'alpha'
|
||||||
# alphabetical order
|
# alphabetical order
|
||||||
@crops = Crop.includes(:scientific_names, {:plantings => :photos}).paginate(:page => params[:page])
|
@crops = Crop.includes(:scientific_names, { plantings: :photos })
|
||||||
|
@paginated_crops = @crops.approved.paginate(page: params[:page])
|
||||||
else
|
else
|
||||||
# default to sorting by popularity
|
# default to sorting by popularity
|
||||||
@crops = Crop.popular.includes(:scientific_names, {:plantings => :photos}).paginate(:page => params[:page])
|
@crops = Crop.popular.includes(:scientific_names, { plantings: :photos })
|
||||||
|
@paginated_crops = @crops.approved.paginate(page: params[:page])
|
||||||
end
|
end
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html
|
format.html
|
||||||
format.json { render :json => @crops }
|
format.json { render json: @crops }
|
||||||
format.rss do
|
format.rss do
|
||||||
@crops = Crop.recent.includes(:scientific_names, :creator)
|
@crops = Crop.recent.includes(:scientific_names, :creator)
|
||||||
render :rss => @crops
|
render rss: @crops
|
||||||
end
|
end
|
||||||
format.csv do
|
format.csv do
|
||||||
@filename = "Growstuff-Crops-#{Time.zone.now.to_s(:number)}.csv"
|
@filename = "Growstuff-Crops-#{Time.zone.now.to_s(:number)}.csv"
|
||||||
@crops = Crop.includes(:scientific_names, :plantings, :seeds, :creator)
|
@crops = Crop.includes(:scientific_names, :plantings, :seeds, :creator)
|
||||||
render :csv => @crops
|
render csv: @crops
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# GET /crops/wrangle
|
# GET /crops/wrangle
|
||||||
def wrangle
|
def wrangle
|
||||||
@crops = Crop.recent.paginate(:page => params[:page])
|
@approval_status = params[:approval_status]
|
||||||
|
@crops = case @approval_status
|
||||||
|
when "pending"
|
||||||
|
Crop.pending_approval
|
||||||
|
when "rejected"
|
||||||
|
Crop.rejected
|
||||||
|
else
|
||||||
|
Crop.recent
|
||||||
|
end
|
||||||
|
|
||||||
|
@crops = @crops.paginate(page: params[:page])
|
||||||
|
|
||||||
@crop_wranglers = Role.crop_wranglers
|
@crop_wranglers = Role.crop_wranglers
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html
|
format.html
|
||||||
@@ -51,33 +64,36 @@ class CropsController < ApplicationController
|
|||||||
|
|
||||||
# GET /crops/search
|
# GET /crops/search
|
||||||
def search
|
def search
|
||||||
@search = params[:search]
|
@term = params[:term]
|
||||||
@exact_match = Crop.find_by_name(params[:search])
|
@matches = Crop.search(@term)
|
||||||
|
@paginated_matches = @matches.paginate(page: params[:page])
|
||||||
@partial_matches = Crop.search(params[:search])
|
|
||||||
# exclude exact match from partial match list
|
|
||||||
@partial_matches.reject!{ |r| @exact_match && r.eql?(@exact_match) }
|
|
||||||
|
|
||||||
@fuzzy = Crop.search(params[:term])
|
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html
|
format.html
|
||||||
format.json { render :json => @fuzzy }
|
format.json { render json: @matches }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# GET /crops/1
|
# GET /crops/1
|
||||||
# GET /crops/1.json
|
# GET /crops/1.json
|
||||||
def show
|
def show
|
||||||
@crop = Crop.includes(:scientific_names, {:plantings => :photos}).find(params[:id])
|
@crop = Crop.includes(:scientific_names, { plantings: :photos }).find(params[:id])
|
||||||
@posts = @crop.posts.paginate(:page => params[:page])
|
@posts = @crop.posts.paginate(page: params[:page])
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html # show.html.haml
|
format.html # show.html.haml
|
||||||
format.json do
|
format.json do
|
||||||
render :json => @crop.to_json(:include => {
|
# TODO RABL or similar one day to avoid presentation logic here
|
||||||
:plantings => { :include => { :owner => { :only => [:id, :login_name, :location, :latitude, :longitude] }}}
|
owner_structure = {
|
||||||
})
|
owner: {
|
||||||
|
only: [:id, :login_name, :location, :latitude, :longitude]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
render json: @crop.to_json(include: {
|
||||||
|
plantings: {
|
||||||
|
include: owner_structure
|
||||||
|
}
|
||||||
|
})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -86,9 +102,9 @@ class CropsController < ApplicationController
|
|||||||
# GET /crops/new.json
|
# GET /crops/new.json
|
||||||
def new
|
def new
|
||||||
@crop = Crop.new
|
@crop = Crop.new
|
||||||
3.times do
|
@crop.alternate_names.build
|
||||||
@crop.scientific_names.build
|
@crop.scientific_names.build
|
||||||
end
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html # new.html.haml
|
format.html # new.html.haml
|
||||||
format.json { render json: @crop }
|
format.json { render json: @crop }
|
||||||
@@ -98,17 +114,39 @@ class CropsController < ApplicationController
|
|||||||
# GET /crops/1/edit
|
# GET /crops/1/edit
|
||||||
def edit
|
def edit
|
||||||
@crop = Crop.find(params[:id])
|
@crop = Crop.find(params[:id])
|
||||||
|
@crop.alternate_names.build if @crop.alternate_names.blank?
|
||||||
|
@crop.scientific_names.build if @crop.scientific_names.blank?
|
||||||
end
|
end
|
||||||
|
|
||||||
# POST /crops
|
# POST /crops
|
||||||
# POST /crops.json
|
# POST /crops.json
|
||||||
def create
|
def create
|
||||||
params[:crop][:creator_id] = current_member.id
|
@crop = Crop.new(crop_params)
|
||||||
@crop = Crop.new(params[:crop])
|
|
||||||
|
if current_member.has_role? :crop_wrangler
|
||||||
|
@crop.creator = current_member
|
||||||
|
success_msg = "Crop was successfully created."
|
||||||
|
else
|
||||||
|
@crop.requester = current_member
|
||||||
|
@crop.approval_status = "pending"
|
||||||
|
success_msg = "Crop was successfully requested."
|
||||||
|
end
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @crop.save
|
if @crop.save
|
||||||
format.html { redirect_to @crop, notice: 'Crop was successfully created.' }
|
params[:alt_name].each do |index, value|
|
||||||
|
create_name('alternate', value)
|
||||||
|
end
|
||||||
|
params[:sci_name].each do |index, value|
|
||||||
|
create_name('scientific', value)
|
||||||
|
end
|
||||||
|
unless current_member.has_role? :crop_wrangler
|
||||||
|
Role.crop_wranglers.each do |w|
|
||||||
|
Notifier.new_crop_request(w, @crop).deliver_later!
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
format.html { redirect_to @crop, notice: success_msg }
|
||||||
format.json { render json: @crop, status: :created, location: @crop }
|
format.json { render json: @crop, status: :created, location: @crop }
|
||||||
else
|
else
|
||||||
format.html { render action: "new" }
|
format.html { render action: "new" }
|
||||||
@@ -122,8 +160,21 @@ class CropsController < ApplicationController
|
|||||||
def update
|
def update
|
||||||
@crop = Crop.find(params[:id])
|
@crop = Crop.find(params[:id])
|
||||||
|
|
||||||
|
previous_status = @crop.approval_status
|
||||||
|
|
||||||
|
@crop.creator = current_member if previous_status == "pending"
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @crop.update_attributes(params[:crop])
|
if @crop.update(crop_params)
|
||||||
|
recreate_names('alt_name', 'alternate')
|
||||||
|
recreate_names('sci_name', 'scientific')
|
||||||
|
|
||||||
|
if previous_status == "pending"
|
||||||
|
requester = @crop.requester
|
||||||
|
new_status = @crop.approval_status
|
||||||
|
Notifier.crop_request_approved(requester, @crop).deliver_later! if new_status == "approved"
|
||||||
|
Notifier.crop_request_rejected(requester, @crop).deliver_later! if new_status == "rejected"
|
||||||
|
end
|
||||||
format.html { redirect_to @crop, notice: 'Crop was successfully updated.' }
|
format.html { redirect_to @crop, notice: 'Crop was successfully updated.' }
|
||||||
format.json { head :no_content }
|
format.json { head :no_content }
|
||||||
else
|
else
|
||||||
@@ -144,4 +195,37 @@ class CropsController < ApplicationController
|
|||||||
format.json { head :no_content }
|
format.json { head :no_content }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def recreate_names(param_name, name_type)
|
||||||
|
return unless params[param_name].present?
|
||||||
|
destroy_names(name_type)
|
||||||
|
params[param_name].each do |index, value|
|
||||||
|
create_name(name_type, value)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def destroy_names(name_type)
|
||||||
|
@crop.send("#{name_type}_names").each do |alt_name|
|
||||||
|
alt_name.destroy
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def create_name(name_type, value)
|
||||||
|
@crop.send("#{name_type}_names").create(name: value, creator_id: current_member.id)
|
||||||
|
end
|
||||||
|
|
||||||
|
def crop_params
|
||||||
|
params.require(:crop).permit(:en_wikipedia_url,
|
||||||
|
:name,
|
||||||
|
:parent_id,
|
||||||
|
:creator_id,
|
||||||
|
:approval_status,
|
||||||
|
:request_notes,
|
||||||
|
:reason_for_rejection,
|
||||||
|
:rejection_notes, scientific_names_attributes: [:scientific_name,
|
||||||
|
:_destroy,
|
||||||
|
:id])
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,11 +1,14 @@
|
|||||||
class FollowsController < ApplicationController
|
class FollowsController < ApplicationController
|
||||||
|
before_filter :authenticate_member!
|
||||||
|
load_and_authorize_resource
|
||||||
|
skip_load_resource only: :create
|
||||||
|
|
||||||
# POST /follows
|
# POST /follows
|
||||||
def create
|
def create
|
||||||
@follow = current_member.follows.build(:followed_id => params[:followed_id])
|
@follow = current_member.follows.build(followed_id: follow_params[:followed_id])
|
||||||
|
|
||||||
if @follow.save
|
if @follow.save
|
||||||
flash[:notice] = "Followed #{ @follow.followed.login_name }"
|
flash[:notice] = "Followed #{@follow.followed.login_name}"
|
||||||
redirect_to :back
|
redirect_to :back
|
||||||
else
|
else
|
||||||
flash[:error] = "Already following or error while following."
|
flash[:error] = "Already following or error while following."
|
||||||
@@ -15,11 +18,17 @@ class FollowsController < ApplicationController
|
|||||||
|
|
||||||
# DELETE /follows/1
|
# DELETE /follows/1
|
||||||
def destroy
|
def destroy
|
||||||
@follow = current_member.follows.find(params[:id])
|
@follow = current_member.follows.find(follow_params[:id])
|
||||||
unfollowed_name = @follow.followed.login_name
|
unfollowed_name = @follow.followed.login_name
|
||||||
@follow.destroy
|
@follow.destroy
|
||||||
|
|
||||||
flash[:notice] = "Unfollowed #{ unfollowed_name }"
|
flash[:notice] = "Unfollowed #{unfollowed_name}"
|
||||||
redirect_to root_path
|
redirect_to root_path
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def follow_params
|
||||||
|
params.permit(:id, :followed_id, :follower_id, :authenticity_token, :_method)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
class ForumsController < ApplicationController
|
class ForumsController < ApplicationController
|
||||||
load_and_authorize_resource
|
load_and_authorize_resource
|
||||||
|
|
||||||
cache_sweeper :forum_sweeper
|
|
||||||
|
|
||||||
# GET /forums
|
# GET /forums
|
||||||
# GET /forums.json
|
# GET /forums.json
|
||||||
def index
|
def index
|
||||||
@@ -44,7 +42,7 @@ class ForumsController < ApplicationController
|
|||||||
# POST /forums
|
# POST /forums
|
||||||
# POST /forums.json
|
# POST /forums.json
|
||||||
def create
|
def create
|
||||||
@forum = Forum.new(params[:forum])
|
@forum = Forum.new(forum_params)
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @forum.save
|
if @forum.save
|
||||||
@@ -63,7 +61,7 @@ class ForumsController < ApplicationController
|
|||||||
@forum = Forum.find(params[:id])
|
@forum = Forum.find(params[:id])
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @forum.update_attributes(params[:forum])
|
if @forum.update(forum_params)
|
||||||
format.html { redirect_to @forum, notice: 'Forum was successfully updated.' }
|
format.html { redirect_to @forum, notice: 'Forum was successfully updated.' }
|
||||||
format.json { head :no_content }
|
format.json { head :no_content }
|
||||||
else
|
else
|
||||||
@@ -84,4 +82,10 @@ class ForumsController < ApplicationController
|
|||||||
format.json { head :no_content }
|
format.json { head :no_content }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def forum_params
|
||||||
|
params.require(:forum).permit(:description, :name, :owner_id, :slug)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,16 +1,14 @@
|
|||||||
class GardensController < ApplicationController
|
class GardensController < ApplicationController
|
||||||
before_filter :authenticate_member!, :except => [:index, :show]
|
before_filter :authenticate_member!, except: [:index, :show]
|
||||||
load_and_authorize_resource
|
load_and_authorize_resource
|
||||||
|
|
||||||
cache_sweeper :garden_sweeper
|
|
||||||
|
|
||||||
# GET /gardens
|
# GET /gardens
|
||||||
# GET /gardens.json
|
# GET /gardens.json
|
||||||
def index
|
def index
|
||||||
@gardens = Garden.paginate(:page => params[:page])
|
@gardens = Garden.paginate(page: params[:page])
|
||||||
@owner = Member.find_by_slug(params[:owner])
|
@owner = Member.find_by_slug(params[:owner])
|
||||||
if @owner
|
if @owner
|
||||||
@gardens = @owner.gardens.paginate(:page => params[:page])
|
@gardens = @owner.gardens.paginate(page: params[:page])
|
||||||
end
|
end
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
@@ -50,12 +48,13 @@ class GardensController < ApplicationController
|
|||||||
# POST /gardens.json
|
# POST /gardens.json
|
||||||
def create
|
def create
|
||||||
params[:garden][:owner_id] = current_member.id
|
params[:garden][:owner_id] = current_member.id
|
||||||
@garden = Garden.new(params[:garden])
|
@garden = Garden.new(garden_params)
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @garden.save
|
if @garden.save
|
||||||
format.html { redirect_to @garden, notice: 'Garden was successfully created.' }
|
format.html { redirect_to @garden, notice: 'Garden was successfully created.' }
|
||||||
format.json { render json: @garden, status: :created, location: @garden }
|
format.json { render json: @garden, status: :created, location: @garden }
|
||||||
|
expire_fragment("homepage_stats")
|
||||||
else
|
else
|
||||||
format.html { render action: "new" }
|
format.html { render action: "new" }
|
||||||
format.json { render json: @garden.errors, status: :unprocessable_entity }
|
format.json { render json: @garden.errors, status: :unprocessable_entity }
|
||||||
@@ -69,7 +68,7 @@ class GardensController < ApplicationController
|
|||||||
@garden = Garden.find(params[:id])
|
@garden = Garden.find(params[:id])
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @garden.update_attributes(params[:garden])
|
if @garden.update(garden_params)
|
||||||
format.html { redirect_to @garden, notice: 'Garden was successfully updated.' }
|
format.html { redirect_to @garden, notice: 'Garden was successfully updated.' }
|
||||||
format.json { head :no_content }
|
format.json { head :no_content }
|
||||||
else
|
else
|
||||||
@@ -84,10 +83,20 @@ class GardensController < ApplicationController
|
|||||||
def destroy
|
def destroy
|
||||||
@garden = Garden.find(params[:id])
|
@garden = Garden.find(params[:id])
|
||||||
@garden.destroy
|
@garden.destroy
|
||||||
|
expire_fragment("homepage_stats")
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html { redirect_to gardens_by_owner_path(:owner => @garden.owner), notice: 'Garden was successfully deleted.' }
|
format.html do
|
||||||
|
redirect_to gardens_by_owner_path(owner: @garden.owner), notice: 'Garden was successfully deleted.'
|
||||||
|
end
|
||||||
format.json { head :no_content }
|
format.json { head :no_content }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def garden_params
|
||||||
|
params.require(:garden).permit(:name, :slug, :owner_id, :description, :active,
|
||||||
|
:location, :latitude, :longitude, :area, :area_unit)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,50 +1,38 @@
|
|||||||
class HarvestsController < ApplicationController
|
class HarvestsController < ApplicationController
|
||||||
before_filter :authenticate_member!, :except => [:index, :show]
|
before_filter :authenticate_member!, except: [:index, :show]
|
||||||
load_and_authorize_resource
|
load_and_authorize_resource
|
||||||
|
|
||||||
|
|
||||||
# GET /harvests
|
# GET /harvests
|
||||||
# GET /harvests.json
|
# GET /harvests.json
|
||||||
def index
|
def index
|
||||||
@owner = Member.find_by_slug(params[:owner])
|
@owner = Member.find_by_slug(params[:owner])
|
||||||
@crop = Crop.find_by_slug(params[:crop])
|
@crop = Crop.find_by_slug(params[:crop])
|
||||||
if @owner
|
@harvests = if @owner
|
||||||
@harvests = @owner.harvests.includes(:owner, :crop)
|
@owner.harvests.includes(:owner, :crop)
|
||||||
elsif @crop
|
elsif @crop
|
||||||
@harvests = @crop.harvests.includes(:owner, :crop)
|
@crop.harvests.includes(:owner, :crop)
|
||||||
else
|
else
|
||||||
@harvests = Harvest.includes(:owner, :crop)
|
Harvest.includes(:owner, :crop)
|
||||||
end
|
end
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html { @harvests = @harvests.paginate(:page => params[:page]) }
|
format.html { @harvests = @harvests.paginate(page: params[:page]) }
|
||||||
format.json { render json: @harvests }
|
format.json { render json: @harvests }
|
||||||
format.csv do
|
format.csv do
|
||||||
specifics = (@owner ? "#{@owner.name}-" : @crop ? "#{@crop.name}-" : nil)
|
specifics = (@owner ? "#{@owner.login_name}-" : @crop ? "#{@crop.name}-" : nil)
|
||||||
@filename = "Growstuff-#{specifics}Harvests-#{Time.zone.now.to_s(:number)}.csv"
|
@filename = "Growstuff-#{specifics}Harvests-#{Time.zone.now.to_s(:number)}.csv"
|
||||||
render :csv => @harvests
|
render csv: @harvests
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# GET /harvests/1
|
|
||||||
# GET /harvests/1.json
|
|
||||||
def show
|
|
||||||
@harvest = Harvest.find(params[:id])
|
|
||||||
|
|
||||||
respond_to do |format|
|
|
||||||
format.html # show.html.erb
|
|
||||||
format.json { render json: @harvest }
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
# GET /harvests/new
|
# GET /harvests/new
|
||||||
# GET /harvests/new.json
|
# GET /harvests/new.json
|
||||||
def new
|
def new
|
||||||
@harvest = Harvest.new('harvested_at' => Date.today)
|
@harvest = Harvest.new('harvested_at' => Date.today)
|
||||||
|
|
||||||
# using find_by_id here because it returns nil, unlike find
|
# using find_by_id here because it returns nil, unlike find
|
||||||
@crop = Crop.find_by_id(params[:crop_id]) || Crop.new
|
@crop = Crop.find_by_id(params[:crop_id]) || Crop.new
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html # new.html.erb
|
format.html # new.html.erb
|
||||||
@@ -62,7 +50,7 @@ class HarvestsController < ApplicationController
|
|||||||
def create
|
def create
|
||||||
params[:harvest][:owner_id] = current_member.id
|
params[:harvest][:owner_id] = current_member.id
|
||||||
params[:harvested_at] = parse_date(params[:harvested_at])
|
params[:harvested_at] = parse_date(params[:harvested_at])
|
||||||
@harvest = Harvest.new(params[:harvest])
|
@harvest = Harvest.new(harvest_params)
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @harvest.save
|
if @harvest.save
|
||||||
@@ -81,7 +69,7 @@ class HarvestsController < ApplicationController
|
|||||||
@harvest = Harvest.find(params[:id])
|
@harvest = Harvest.find(params[:id])
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @harvest.update_attributes(params[:harvest])
|
if @harvest.update(harvest_params)
|
||||||
format.html { redirect_to @harvest, notice: 'Harvest was successfully updated.' }
|
format.html { redirect_to @harvest, notice: 'Harvest was successfully updated.' }
|
||||||
format.json { head :no_content }
|
format.json { head :no_content }
|
||||||
else
|
else
|
||||||
@@ -102,4 +90,11 @@ class HarvestsController < ApplicationController
|
|||||||
format.json { head :no_content }
|
format.json { head :no_content }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def harvest_params
|
||||||
|
params.require(:harvest).permit(:crop_id, :harvested_at, :description, :owner_id,
|
||||||
|
:quantity, :unit, :weight_quantity, :weight_unit, :plant_part_id, :slug, :si_weight)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ class HomeController < ApplicationController
|
|||||||
skip_authorize_resource
|
skip_authorize_resource
|
||||||
|
|
||||||
def index
|
def index
|
||||||
|
|
||||||
# we were previously generating a lot of instance variables like
|
# we were previously generating a lot of instance variables like
|
||||||
# @members_count and @interesting_crops in here, but now we call
|
# @members_count and @interesting_crops in here, but now we call
|
||||||
# the relevant class methods directly in the view, so that fragment
|
# the relevant class methods directly in the view, so that fragment
|
||||||
@@ -12,5 +11,4 @@ class HomeController < ApplicationController
|
|||||||
format.html # index.html.haml
|
format.html # index.html.haml
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,47 +1,105 @@
|
|||||||
class MembersController < ApplicationController
|
class MembersController < ApplicationController
|
||||||
load_and_authorize_resource
|
load_and_authorize_resource
|
||||||
|
|
||||||
cache_sweeper :member_sweeper
|
skip_authorize_resource only: [:nearby, :unsubscribe, :finish_signup]
|
||||||
|
|
||||||
skip_authorize_resource :only => :nearby
|
after_action :expire_cache_fragments, only: :create
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@members = Member.confirmed.paginate(:page => params[:page])
|
@sort = params[:sort]
|
||||||
|
@members = if @sort == 'recently_joined'
|
||||||
|
Member.confirmed.recently_joined.paginate(page: params[:page])
|
||||||
|
else
|
||||||
|
Member.confirmed.paginate(page: params[:page])
|
||||||
|
end
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html # index.html.haml
|
format.html # index.html.haml
|
||||||
format.json { render :json => @members.to_json(:only => [:id, :login_name, :slug, :bio, :created_at, :location, :latitude, :longitude]) }
|
format.json {
|
||||||
|
render json: @members.to_json(only: [
|
||||||
|
:id, :login_name, :slug, :bio, :created_at, :location, :latitude, :longitude
|
||||||
|
])
|
||||||
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
@member = Member.confirmed.find(params[:id])
|
@member = Member.confirmed.find(params[:id])
|
||||||
@twitter_auth = @member.auth('twitter')
|
@twitter_auth = @member.auth('twitter')
|
||||||
@flickr_auth = @member.auth('flickr')
|
@flickr_auth = @member.auth('flickr')
|
||||||
@posts = @member.posts
|
@facebook_auth = @member.auth('facebook')
|
||||||
|
@posts = @member.posts
|
||||||
# The garden form partial is called from the "New Garden" tab;
|
# The garden form partial is called from the "New Garden" tab;
|
||||||
# it requires a garden to be passed in @garden.
|
# it requires a garden to be passed in @garden.
|
||||||
# The new garden is not persisted unless Garden#save is called.
|
# The new garden is not persisted unless Garden#save is called.
|
||||||
@garden = Garden.new
|
@garden = Garden.new
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html # show.html.haml
|
format.html # show.html.haml
|
||||||
format.json { render :json => @member.to_json(:only => [:id, :login_name, :bio, :created_at, :slug, :location, :latitude, :longitude]) }
|
format.json {
|
||||||
|
render json: @member.to_json(only: [
|
||||||
|
:id, :login_name, :bio, :created_at, :slug, :location, :latitude, :longitude
|
||||||
|
])
|
||||||
|
}
|
||||||
format.rss { render(
|
format.rss { render(
|
||||||
:layout => false,
|
layout: false,
|
||||||
:locals => { :member => @member }
|
locals: { member: @member }
|
||||||
)}
|
)}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def view_follows
|
def view_follows
|
||||||
@member = Member.confirmed.find(params[:login_name])
|
@member = Member.confirmed.find(params[:login_name])
|
||||||
@follows = @member.followed.paginate(:page => params[:page])
|
@follows = @member.followed.paginate(page: params[:page])
|
||||||
end
|
end
|
||||||
|
|
||||||
def view_followers
|
def view_followers
|
||||||
@member = Member.confirmed.find(params[:login_name])
|
@member = Member.confirmed.find(params[:login_name])
|
||||||
@followers = @member.followers.paginate(:page => params[:page])
|
@followers = @member.followers.paginate(page: params[:page])
|
||||||
end
|
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
|
||||||
|
|
||||||
|
def finish_signup
|
||||||
|
@member = current_member
|
||||||
|
if request.patch? && params[:member]
|
||||||
|
if @member.update(member_params)
|
||||||
|
@member.skip_reconfirmation!
|
||||||
|
bypass_sign_in(@member)
|
||||||
|
redirect_to root_path, notice: 'Welcome.'
|
||||||
|
else
|
||||||
|
flash[:alert] = 'Failed to complete signup'
|
||||||
|
@show_errors = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def expire_cache_fragments
|
||||||
|
expire_fragment("homepage_stats")
|
||||||
|
end
|
||||||
|
|
||||||
|
def member_params
|
||||||
|
params.require(:member).permit(:login_name, :tos_agreement, :email, :newsletter)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ class NotificationsController < ApplicationController
|
|||||||
|
|
||||||
# GET /notifications
|
# GET /notifications
|
||||||
def index
|
def index
|
||||||
@notifications = Notification.find_all_by_recipient_id(current_member)
|
@notifications = Notification.where(recipient_id: current_member).page(params[:page])
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html # index.html.erb
|
format.html # index.html.erb
|
||||||
@@ -36,6 +36,22 @@ class NotificationsController < ApplicationController
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# GET /notifications/1/reply
|
||||||
|
def reply
|
||||||
|
@notification = Notification.new
|
||||||
|
@sender_notification = Notification.find(params[:id])
|
||||||
|
@sender_notification.read = true
|
||||||
|
@sender_notification.save
|
||||||
|
@recipient = @sender_notification.sender
|
||||||
|
@subject = @sender_notification.subject =~ /^Re: / ?
|
||||||
|
@sender_notification.subject :
|
||||||
|
"Re: " + @sender_notification.subject
|
||||||
|
|
||||||
|
respond_to do |format|
|
||||||
|
format.html # reply.html.haml
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# DELETE /notifications/1
|
# DELETE /notifications/1
|
||||||
def destroy
|
def destroy
|
||||||
@notification = Notification.find(params[:id])
|
@notification = Notification.find(params[:id])
|
||||||
@@ -49,7 +65,7 @@ class NotificationsController < ApplicationController
|
|||||||
# POST /notifications
|
# POST /notifications
|
||||||
def create
|
def create
|
||||||
params[:notification][:sender_id] = current_member.id
|
params[:notification][:sender_id] = current_member.id
|
||||||
@notification = Notification.new(params[:notification])
|
@notification = Notification.new(notification_params)
|
||||||
@recipient = Member.find_by_id(params[:notification][:recipient_id])
|
@recipient = Member.find_by_id(params[:notification][:recipient_id])
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
@@ -60,4 +76,10 @@ class NotificationsController < ApplicationController
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def notification_params
|
||||||
|
params.require(:notification).permit(:sender_id, :recipient_id, :subject, :body, :post_id, :read)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
52
app/controllers/omniauth_callbacks_controller.rb
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
require './lib/actions/oauth_signup_action'
|
||||||
|
|
||||||
|
#
|
||||||
|
# Handle signup or signin
|
||||||
|
# from various oauth providers
|
||||||
|
#
|
||||||
|
# Heavily overlaps with Authentications controller
|
||||||
|
#
|
||||||
|
class OmniauthCallbacksController < Devise::OmniauthCallbacksController
|
||||||
|
def facebook
|
||||||
|
create
|
||||||
|
end
|
||||||
|
|
||||||
|
def failure
|
||||||
|
flash[:alert] = "Authentication failed."
|
||||||
|
redirect_to request.env['omniauth.origin'] || "/"
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def create
|
||||||
|
auth = request.env['omniauth.auth']
|
||||||
|
action = Growstuff::OauthSignupAction.new
|
||||||
|
|
||||||
|
@authentication = nil
|
||||||
|
if auth
|
||||||
|
member = action.find_or_create_from_authorization(auth)
|
||||||
|
@authentication = action.establish_authentication(auth, member)
|
||||||
|
|
||||||
|
unless action.member_created?
|
||||||
|
sign_in_and_redirect member, event: :authentication # this will throw if @user is not activated
|
||||||
|
set_flash_message(:notice, :success, kind: auth['provider']) if is_navigational_format?
|
||||||
|
else
|
||||||
|
raise "Invalid provider" unless ['facebook', 'twitter', 'flickr'].index(auth['provider'].to_s)
|
||||||
|
|
||||||
|
session["devise.#{auth['provider']}_data"] = request.env["omniauth.auth"]
|
||||||
|
sign_in member
|
||||||
|
redirect_to finish_signup_url(member)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
redirect_to request.env['omniauth.origin'] || edit_member_registration_path
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def after_sign_in_path_for(resource)
|
||||||
|
if resource.tos_agreement
|
||||||
|
super resource
|
||||||
|
else
|
||||||
|
finish_signup_path(resource)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -7,8 +7,8 @@ class OrderItemsController < ApplicationController
|
|||||||
if params[:order_item][:price]
|
if params[:order_item][:price]
|
||||||
params[:order_item][:price] = params[:order_item][:price].to_f * 100 # convert to cents
|
params[:order_item][:price] = params[:order_item][:price].to_f * 100 # convert to cents
|
||||||
end
|
end
|
||||||
@order_item = OrderItem.new(params[:order_item])
|
@order_item = OrderItem.new(order_item_params)
|
||||||
@order_item.order = current_member.current_order || Order.create(:member_id => current_member.id)
|
@order_item.order = current_member.current_order || Order.create(member_id: current_member.id)
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @order_item.save
|
if @order_item.save
|
||||||
@@ -20,4 +20,10 @@ class OrderItemsController < ApplicationController
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def order_item_params
|
||||||
|
params.require(:order_item).permit(:order_id, :price, :product_id, :quantity)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ class OrdersController < ApplicationController
|
|||||||
|
|
||||||
# GET /orders
|
# GET /orders
|
||||||
def index
|
def index
|
||||||
@orders = Order.find_all_by_member_id(current_member.id)
|
@orders = Order.where(member_id: current_member.id)
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html # index.html.erb
|
format.html # index.html.erb
|
||||||
@@ -34,22 +34,21 @@ class OrdersController < ApplicationController
|
|||||||
@order = Order.find(params[:id])
|
@order = Order.find(params[:id])
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @order.update_attributes(:referral_code => params[:referral_code])
|
if @order.update_attributes(referral_code: params[:referral_code])
|
||||||
response = EXPRESS_GATEWAY.setup_purchase(
|
response = EXPRESS_GATEWAY.setup_purchase(
|
||||||
@order.total,
|
@order.total,
|
||||||
:items => @order.activemerchant_items,
|
items: @order.activemerchant_items,
|
||||||
:currency => Growstuff::Application.config.currency,
|
currency: Growstuff::Application.config.currency,
|
||||||
:no_shipping => true,
|
no_shipping: true,
|
||||||
:ip => request.remote_ip,
|
ip: request.remote_ip,
|
||||||
:return_url => complete_order_url,
|
return_url: complete_order_url,
|
||||||
:cancel_return_url => shop_url
|
cancel_return_url: shop_url
|
||||||
)
|
)
|
||||||
format.html { redirect_to EXPRESS_GATEWAY.redirect_url_for(response.token) }
|
format.html { redirect_to EXPRESS_GATEWAY.redirect_url_for(response.token) }
|
||||||
else
|
else
|
||||||
format.html { render action: "show" }
|
format.html { render action: "show" }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def complete
|
def complete
|
||||||
@@ -58,10 +57,10 @@ class OrdersController < ApplicationController
|
|||||||
if (params[:token] && params['PayerID'])
|
if (params[:token] && params['PayerID'])
|
||||||
purchase = EXPRESS_GATEWAY.purchase(
|
purchase = EXPRESS_GATEWAY.purchase(
|
||||||
@order.total,
|
@order.total,
|
||||||
:currency => Growstuff::Application.config.currency,
|
currency: Growstuff::Application.config.currency,
|
||||||
:ip => request.remote_ip,
|
ip: request.remote_ip,
|
||||||
:payer_id => params['PayerID'],
|
payer_id: params['PayerID'],
|
||||||
:token => params[:token]
|
token: params[:token]
|
||||||
)
|
)
|
||||||
if purchase.success?
|
if purchase.success?
|
||||||
@order.completed_at = Time.zone.now
|
@order.completed_at = Time.zone.now
|
||||||
@@ -78,7 +77,6 @@ class OrdersController < ApplicationController
|
|||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html # new.html.erb
|
format.html # new.html.erb
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def cancel
|
def cancel
|
||||||
|
|||||||
6
app/controllers/pages_controller.rb
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
class PagesController < ApplicationController
|
||||||
|
def letsencrypt
|
||||||
|
# use your code here, not mine
|
||||||
|
render text: "y9KNck8wqkoQLnlr2RgA2TVwWtyYb4PeY_hzGNx0Tfs.dlIPqFhMDCLyQEccczY3roHZ1UWu6UqVeyb9mkRxheU"
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
class PasswordsController < Devise::PasswordsController
|
class PasswordsController < Devise::PasswordsController
|
||||||
|
protected
|
||||||
|
|
||||||
protected
|
|
||||||
def after_resetting_password_path_for(resource)
|
def after_resetting_password_path_for(resource)
|
||||||
root_path
|
root_path
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,13 +1,11 @@
|
|||||||
class PhotosController < ApplicationController
|
class PhotosController < ApplicationController
|
||||||
before_filter :authenticate_member!, :except => [:index, :show]
|
before_action :authenticate_member!, except: [:index, :show]
|
||||||
load_and_authorize_resource
|
load_and_authorize_resource
|
||||||
|
|
||||||
cache_sweeper :photo_sweeper
|
|
||||||
|
|
||||||
# GET /photos
|
# GET /photos
|
||||||
# GET /photos.json
|
# GET /photos.json
|
||||||
def index
|
def index
|
||||||
@photos = Photo.paginate(:page => params[:page])
|
@photos = Photo.paginate(page: params[:page])
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html # index.html.erb
|
format.html # index.html.erb
|
||||||
@@ -15,17 +13,6 @@ class PhotosController < ApplicationController
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# GET /photos/1
|
|
||||||
# GET /photos/1.json
|
|
||||||
def show
|
|
||||||
@photo = Photo.find(params[:id])
|
|
||||||
|
|
||||||
respond_to do |format|
|
|
||||||
format.html # show.html.erb
|
|
||||||
format.json { render json: @photo }
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
# GET /photos/new
|
# GET /photos/new
|
||||||
# GET /photos/new.json
|
# GET /photos/new.json
|
||||||
def new
|
def new
|
||||||
@@ -60,43 +47,12 @@ class PhotosController < ApplicationController
|
|||||||
# POST /photos
|
# POST /photos
|
||||||
# POST /photos.json
|
# POST /photos.json
|
||||||
def create
|
def create
|
||||||
@photo = Photo.find_by_flickr_photo_id(params[:photo][:flickr_photo_id]) ||
|
find_or_create_photo_from_flickr_photo
|
||||||
Photo.new(params[:photo])
|
add_photo_to_collection
|
||||||
@photo.owner_id = current_member.id
|
|
||||||
@photo.set_flickr_metadata
|
|
||||||
|
|
||||||
# several models can have photos. we need to know what model and the id
|
|
||||||
# for the entry to attach the photo to
|
|
||||||
valid_models = ["planting", "harvest"]
|
|
||||||
if params[:type]
|
|
||||||
if valid_models.include?(params[:type])
|
|
||||||
if params[:id]
|
|
||||||
item = params[:type].camelcase.constantize.find_by_id(params[:id])
|
|
||||||
if item
|
|
||||||
if item.owner.id == current_member.id
|
|
||||||
# This syntax is weird, so just know that it means this:
|
|
||||||
# @photo.harvests << item unless @photo.harvests.include?(item)
|
|
||||||
# but with the correct many-to-many relationship automatically referenced
|
|
||||||
(@photo.send "#{params[:type]}s") << item unless (@photo.send "#{params[:type]}s").include?(item)
|
|
||||||
else
|
|
||||||
flash[:alert] = "You must own both the #{params[:type]} and the photo."
|
|
||||||
end
|
|
||||||
else
|
|
||||||
flash[:alert] = "Couldn't find #{params[:type]} to connect to photo."
|
|
||||||
end
|
|
||||||
else
|
|
||||||
flash[:alert] = "Missing id parameter"
|
|
||||||
end
|
|
||||||
else
|
|
||||||
flash[:alert] = "Cannot attach photos to #{params[:type]}"
|
|
||||||
end
|
|
||||||
else
|
|
||||||
flash[:alert] = "Missing type parameter"
|
|
||||||
end
|
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @photo.save
|
if @photo.present? && @photo.save
|
||||||
format.html { redirect_to @photo, notice: 'Photo was successfully added.' }
|
format.html { redirect_to photo_path(@photo), notice: 'Photo was successfully added.' }
|
||||||
format.json { render json: @photo, status: :created, location: @photo }
|
format.json { render json: @photo, status: :created, location: @photo }
|
||||||
else
|
else
|
||||||
format.html { render action: "new" }
|
format.html { render action: "new" }
|
||||||
@@ -111,7 +67,7 @@ class PhotosController < ApplicationController
|
|||||||
@photo = Photo.find(params[:id])
|
@photo = Photo.find(params[:id])
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @photo.update_attributes(params[:photo])
|
if @photo.update(photo_params)
|
||||||
format.html { redirect_to @photo, notice: 'Photo was successfully updated.' }
|
format.html { redirect_to @photo, notice: 'Photo was successfully updated.' }
|
||||||
format.json { head :no_content }
|
format.json { head :no_content }
|
||||||
else
|
else
|
||||||
@@ -126,10 +82,67 @@ class PhotosController < ApplicationController
|
|||||||
def destroy
|
def destroy
|
||||||
@photo = Photo.find(params[:id])
|
@photo = Photo.find(params[:id])
|
||||||
@photo.destroy
|
@photo.destroy
|
||||||
|
flash[:alert] = "Photo successfully deleted."
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html { redirect_to photos_url }
|
format.html { redirect_to photos_url }
|
||||||
format.json { head :no_content }
|
format.json { head :no_content }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def item_id?
|
||||||
|
params.key? :id
|
||||||
|
end
|
||||||
|
|
||||||
|
def flickr_photo_id_param
|
||||||
|
params[:photo][:flickr_photo_id]
|
||||||
|
end
|
||||||
|
|
||||||
|
def photo_params
|
||||||
|
params.require(:photo).permit(:flickr_photo_id, :owner_id, :title, :license_name,
|
||||||
|
:license_url, :thumbnail_url, :fullsize_url, :link_url)
|
||||||
|
end
|
||||||
|
|
||||||
|
def find_or_create_photo_from_flickr_photo
|
||||||
|
@photo = Photo.find_by(flickr_photo_id: flickr_photo_id_param)
|
||||||
|
@photo = Photo.new(photo_params) unless @photo
|
||||||
|
@photo.owner_id = current_member.id
|
||||||
|
@photo.set_flickr_metadata
|
||||||
|
@photo
|
||||||
|
end
|
||||||
|
|
||||||
|
def which_collection?
|
||||||
|
case params[:type]
|
||||||
|
when "garden" then @photo.gardens
|
||||||
|
when "harvest" then @photo.harvests
|
||||||
|
when "planting" then @photo.plantings
|
||||||
|
else raise "Invalid type"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def add_photo_to_collection
|
||||||
|
collection = which_collection?
|
||||||
|
|
||||||
|
unless collection && item_id?
|
||||||
|
flash[:alert] = "Missing or invalid type or id parameter"
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
item = find_item_for_photo!
|
||||||
|
collection << item unless collection.include?(item)
|
||||||
|
rescue
|
||||||
|
flash[:alert] = "Could not find this item owned by you"
|
||||||
|
end
|
||||||
|
|
||||||
|
def find_item_for_photo!
|
||||||
|
item_class = case params[:type]
|
||||||
|
when "garden" then Garden
|
||||||
|
when "harvest" then Harvest
|
||||||
|
when "planting" then Planting
|
||||||
|
else raise "Invalid type"
|
||||||
|
end
|
||||||
|
item_class.find_by!(id: params[:id], owner_id: current_member.id)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -5,7 +5,11 @@ class PlacesController < ApplicationController
|
|||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html
|
format.html
|
||||||
# json response is whatever we want to map here
|
# json response is whatever we want to map here
|
||||||
format.json { render :json => Member.located.to_json(:only => [:id, :login_name, :slug, :location, :latitude, :longitude]) }
|
format.json do
|
||||||
|
render json: Member.located.to_json(only: [
|
||||||
|
:id, :login_name, :slug, :location, :latitude, :longitude
|
||||||
|
])
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -16,16 +20,27 @@ class PlacesController < ApplicationController
|
|||||||
@nearby_members = Member.nearest_to(params[:place])
|
@nearby_members = Member.nearest_to(params[:place])
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html # show.html.haml
|
format.html # show.html.haml
|
||||||
format.json { render :json => @nearby_members.to_json(:only => [:id, :login_name, :slug, :location, :latitude, :longitude]) }
|
format.json do
|
||||||
end
|
render json: @nearby_members.to_json(only: [
|
||||||
end
|
:id, :login_name, :slug, :location, :latitude, :longitude
|
||||||
|
])
|
||||||
def search
|
|
||||||
respond_to do |format|
|
|
||||||
format.html do
|
|
||||||
redirect_to place_path(params[:new_place])
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def search
|
||||||
|
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
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ class PlantPartsController < ApplicationController
|
|||||||
# POST /plant_parts
|
# POST /plant_parts
|
||||||
# POST /plant_parts.json
|
# POST /plant_parts.json
|
||||||
def create
|
def create
|
||||||
@plant_part = PlantPart.new(params[:plant_part])
|
@plant_part = PlantPart.new(plant_part_params)
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @plant_part.save
|
if @plant_part.save
|
||||||
@@ -61,7 +61,7 @@ class PlantPartsController < ApplicationController
|
|||||||
@plant_part = PlantPart.find(params[:id])
|
@plant_part = PlantPart.find(params[:id])
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @plant_part.update_attributes(params[:plant_part])
|
if @plant_part.update(plant_part_params)
|
||||||
format.html { redirect_to @plant_part, notice: 'Plant part was successfully updated.' }
|
format.html { redirect_to @plant_part, notice: 'Plant part was successfully updated.' }
|
||||||
format.json { head :no_content }
|
format.json { head :no_content }
|
||||||
else
|
else
|
||||||
@@ -82,4 +82,10 @@ class PlantPartsController < ApplicationController
|
|||||||
format.json { head :no_content }
|
format.json { head :no_content }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def plant_part_params
|
||||||
|
params.require(:plant_part).permit(:name, :slug)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,31 +1,28 @@
|
|||||||
class PlantingsController < ApplicationController
|
class PlantingsController < ApplicationController
|
||||||
before_filter :authenticate_member!, :except => [:index, :show]
|
before_filter :authenticate_member!, except: [:index, :show]
|
||||||
load_and_authorize_resource
|
load_and_authorize_resource
|
||||||
|
|
||||||
|
|
||||||
cache_sweeper :planting_sweeper
|
|
||||||
|
|
||||||
# GET /plantings
|
# GET /plantings
|
||||||
# GET /plantings.json
|
# GET /plantings.json
|
||||||
def index
|
def index
|
||||||
@owner = Member.find_by_slug(params[:owner])
|
@owner = Member.find_by_slug(params[:owner])
|
||||||
@crop = Crop.find_by_slug(params[:crop])
|
@crop = Crop.find_by_slug(params[:crop])
|
||||||
if @owner
|
@plantings = if @owner
|
||||||
@plantings = @owner.plantings.includes(:owner, :crop, :garden).paginate(:page => params[:page])
|
@owner.plantings.includes(:owner, :crop, :garden).paginate(page: params[:page])
|
||||||
elsif @crop
|
elsif @crop
|
||||||
@plantings = @crop.plantings.includes(:owner, :crop, :garden).paginate(:page => params[:page])
|
@crop.plantings.includes(:owner, :crop, :garden).paginate(page: params[:page])
|
||||||
else
|
else
|
||||||
@plantings = Planting.includes(:owner, :crop, :garden).paginate(:page => params[:page])
|
Planting.includes(:owner, :crop, :garden).paginate(page: params[:page])
|
||||||
end
|
end
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html { @plantings = @plantings.paginate(:page => params[:page]) }
|
format.html { @plantings = @plantings.paginate(page: params[:page]) }
|
||||||
format.json { render json: @plantings }
|
format.json { render json: @plantings }
|
||||||
format.rss { render :layout => false } #index.rss.builder
|
format.rss { render layout: false } # index.rss.builder
|
||||||
format.csv do
|
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"
|
@filename = "Growstuff-#{specifics}Plantings-#{Time.zone.now.to_s(:number)}.csv"
|
||||||
render :csv => @plantings
|
render csv: @plantings
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -33,7 +30,7 @@ class PlantingsController < ApplicationController
|
|||||||
# GET /plantings/1
|
# GET /plantings/1
|
||||||
# GET /plantings/1.json
|
# GET /plantings/1.json
|
||||||
def show
|
def show
|
||||||
@planting = Planting.includes(:owner, :crop, :garden, :photos).find(params[:id])
|
@planting = Planting.includes(:owner, :crop, :garden, :photos).friendly.find(params[:id])
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html # show.html.erb
|
format.html # show.html.erb
|
||||||
@@ -68,14 +65,17 @@ class PlantingsController < ApplicationController
|
|||||||
# POST /plantings
|
# POST /plantings
|
||||||
# POST /plantings.json
|
# POST /plantings.json
|
||||||
def create
|
def create
|
||||||
params[:planting][:owner_id] = current_member.id
|
|
||||||
params[:planted_at] = parse_date(params[:planted_at])
|
params[:planted_at] = parse_date(params[:planted_at])
|
||||||
@planting = Planting.new(params[:planting])
|
@planting = Planting.new(planting_params)
|
||||||
|
@planting.owner = current_member
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @planting.save
|
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.html { redirect_to @planting, notice: 'Planting was successfully created.' }
|
||||||
format.json { render json: @planting, status: :created, location: @planting }
|
format.json { render json: @planting, status: :created, location: @planting }
|
||||||
|
expire_fragment("homepage_stats")
|
||||||
else
|
else
|
||||||
format.html { render action: "new" }
|
format.html { render action: "new" }
|
||||||
format.json { render json: @planting.errors, status: :unprocessable_entity }
|
format.json { render json: @planting.errors, status: :unprocessable_entity }
|
||||||
@@ -90,7 +90,9 @@ class PlantingsController < ApplicationController
|
|||||||
params[:planted_at] = parse_date(params[:planted_at])
|
params[:planted_at] = parse_date(params[:planted_at])
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @planting.update_attributes(params[:planting])
|
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.html { redirect_to @planting, notice: 'Planting was successfully updated.' }
|
||||||
format.json { head :no_content }
|
format.json { head :no_content }
|
||||||
else
|
else
|
||||||
@@ -106,10 +108,27 @@ class PlantingsController < ApplicationController
|
|||||||
@planting = Planting.find(params[:id])
|
@planting = Planting.find(params[:id])
|
||||||
@garden = @planting.garden
|
@garden = @planting.garden
|
||||||
@planting.destroy
|
@planting.destroy
|
||||||
|
expire_fragment("homepage_stats")
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html { redirect_to @garden }
|
format.html { redirect_to @garden }
|
||||||
format.json { head :no_content }
|
format.json { head :no_content }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def planting_params
|
||||||
|
params.require(:planting).permit(:crop_id, :description, :garden_id, :planted_at,
|
||||||
|
: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
|
end
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
class PolicyController < ApplicationController
|
|
||||||
end
|
|
||||||
@@ -1,38 +1,36 @@
|
|||||||
class PostsController < ApplicationController
|
class PostsController < ApplicationController
|
||||||
before_filter :authenticate_member!, :except => [:index, :show]
|
before_filter :authenticate_member!, except: [:index, :show]
|
||||||
load_and_authorize_resource
|
load_and_authorize_resource
|
||||||
|
|
||||||
cache_sweeper :post_sweeper
|
|
||||||
|
|
||||||
# GET /posts
|
# GET /posts
|
||||||
# GET /posts.json
|
# GET /posts.json
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@author = Member.find_by_slug(params[:author])
|
@author = Member.find_by_slug(params[:author])
|
||||||
if @author
|
@posts = if @author
|
||||||
@posts = @author.posts.includes(:author, { :comments => :author }).paginate(:page => params[:page])
|
@author.posts.includes(:author, { comments: :author }).paginate(page: params[:page])
|
||||||
else
|
else
|
||||||
@posts = Post.includes(:author, { :comments => :author }).paginate(:page => params[:page])
|
Post.includes(:author, { comments: :author }).paginate(page: params[:page])
|
||||||
end
|
end
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html # index.html.haml
|
format.html # index.html.haml
|
||||||
format.json { render json: @posts }
|
format.json { render json: @posts }
|
||||||
format.rss { render :layout => false } #index.rss.builder
|
format.rss { render layout: false } # index.rss.builder
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# GET /posts/1
|
# GET /posts/1
|
||||||
# GET /posts/1.json
|
# GET /posts/1.json
|
||||||
def show
|
def show
|
||||||
@post = Post.includes(:author, { :comments => :author }).find(params[:id])
|
@post = Post.includes(:author, { comments: :author }).find(params[:id])
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html # show.html.haml
|
format.html # show.html.haml
|
||||||
format.json { render json: @post }
|
format.json { render json: @post }
|
||||||
format.rss { render(
|
format.rss { render(
|
||||||
:layout => false,
|
layout: false,
|
||||||
:locals => { :post => @post }
|
locals: { post: @post }
|
||||||
)}
|
)}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -58,7 +56,7 @@ class PostsController < ApplicationController
|
|||||||
# POST /posts.json
|
# POST /posts.json
|
||||||
def create
|
def create
|
||||||
params[:post][:author_id] = current_member.id
|
params[:post][:author_id] = current_member.id
|
||||||
@post = Post.new(params[:post])
|
@post = Post.new(post_params)
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @post.save
|
if @post.save
|
||||||
@@ -77,7 +75,7 @@ class PostsController < ApplicationController
|
|||||||
@post = Post.find(params[:id])
|
@post = Post.find(params[:id])
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @post.update_attributes(params[:post])
|
if @post.update(post_params)
|
||||||
format.html { redirect_to @post, notice: 'Post was successfully updated.' }
|
format.html { redirect_to @post, notice: 'Post was successfully updated.' }
|
||||||
format.json { head :no_content }
|
format.json { head :no_content }
|
||||||
else
|
else
|
||||||
@@ -98,4 +96,10 @@ class PostsController < ApplicationController
|
|||||||
format.json { head :no_content }
|
format.json { head :no_content }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def post_params
|
||||||
|
params.require(:post).permit(:body, :subject, :author_id, :forum_id)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ class ProductsController < ApplicationController
|
|||||||
|
|
||||||
# POST /products
|
# POST /products
|
||||||
def create
|
def create
|
||||||
@product = Product.new(params[:product])
|
@product = Product.new(product_params)
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @product.save
|
if @product.save
|
||||||
@@ -52,7 +52,7 @@ class ProductsController < ApplicationController
|
|||||||
@product = Product.find(params[:id])
|
@product = Product.find(params[:id])
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @product.update_attributes(params[:product])
|
if @product.update(product_params)
|
||||||
format.html { redirect_to @product, notice: 'Product was successfully updated.' }
|
format.html { redirect_to @product, notice: 'Product was successfully updated.' }
|
||||||
else
|
else
|
||||||
format.html { render action: "edit" }
|
format.html { render action: "edit" }
|
||||||
@@ -69,4 +69,11 @@ class ProductsController < ApplicationController
|
|||||||
format.html { redirect_to products_url }
|
format.html { redirect_to products_url }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def product_params
|
||||||
|
params.require(:product).permit(:description, :min_price, :recommended_price, :name,
|
||||||
|
:account_type_id, :paid_months)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,46 +1,44 @@
|
|||||||
class RegistrationsController < Devise::RegistrationsController
|
class RegistrationsController < Devise::RegistrationsController
|
||||||
|
respond_to :json
|
||||||
cache_sweeper :member_sweeper
|
|
||||||
|
|
||||||
def edit
|
def edit
|
||||||
@twitter_auth = current_member.auth('twitter')
|
@twitter_auth = current_member.auth('twitter')
|
||||||
@flickr_auth = current_member.auth('flickr')
|
@flickr_auth = current_member.auth('flickr')
|
||||||
|
@facebook_auth = current_member.auth('facebook')
|
||||||
render "edit"
|
render "edit"
|
||||||
end
|
end
|
||||||
|
|
||||||
# we need this subclassed method so that Devise doesn't force people to
|
# we need this subclassed method so that Devise doesn't force people to
|
||||||
# change their password every time they want to edit their settings.
|
# change their password every time they want to edit their settings.
|
||||||
# we also check that they give their current password to change their password.
|
# we also check that they give their current password to change their password.
|
||||||
# Code copied from
|
# Code copied from
|
||||||
# https://github.com/plataformatec/devise/wiki/How-To:-Allow-users-to-edit-their-account-without-providing-a-password
|
# https://github.com/plataformatec/devise/wiki/How-To:-Allow-users-to-edit-their-account-without-providing-a-password
|
||||||
|
|
||||||
def update
|
def update
|
||||||
|
|
||||||
@member = Member.find(current_member.id)
|
@member = Member.find(current_member.id)
|
||||||
|
|
||||||
successfully_updated = if needs_password?(@member, params)
|
if needs_password?(@member, params)
|
||||||
@member.update_with_password(devise_parameter_sanitizer.sanitize(:account_update))
|
successfully_updated = @member.update_with_password(devise_parameter_sanitizer.sanitize(:account_update))
|
||||||
else
|
else
|
||||||
# remove the virtual current_password attribute
|
# remove the virtual current_password attribute
|
||||||
# update_without_password doesn't know how to ignore it
|
# update_without_password doesn't know how to ignore it
|
||||||
params[:member].delete(:current_password)
|
params[:member].delete(:current_password)
|
||||||
@member.update_without_password(devise_parameter_sanitizer.sanitize(:account_update))
|
successfully_updated = @member.update_without_password(devise_parameter_sanitizer.sanitize(:account_update))
|
||||||
end
|
end
|
||||||
|
|
||||||
if successfully_updated
|
if successfully_updated
|
||||||
set_flash_message :notice, :updated
|
set_flash_message :notice, :updated
|
||||||
# Sign in the member bypassing validation in case their password changed
|
# Sign in the member bypassing validation in case their password changed
|
||||||
sign_in @member, :bypass => true
|
sign_in @member, bypass: true
|
||||||
redirect_to edit_member_registration_path
|
redirect_to edit_member_registration_path
|
||||||
else
|
else
|
||||||
render "edit"
|
render "edit"
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# check if we need the current password to update fields
|
# check if we need the current password to update fields
|
||||||
def needs_password?(member, params)
|
def needs_password?(member, params)
|
||||||
params[:member][:password].present? ||
|
params[:member][:password].present? ||
|
||||||
params[:member][:password_confirmation].present?
|
params[:member][:password_confirmation].present?
|
||||||
end
|
end
|
||||||
|
|||||||
15
app/controllers/robots_controller.rb
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
class RobotsController < ApplicationController
|
||||||
|
DEFAULT_FILENAME = 'config/robots.txt'.freeze
|
||||||
|
|
||||||
|
def robots
|
||||||
|
filename = "config/robots.#{subdomain}.txt" if subdomain && subdomain != 'www'
|
||||||
|
file_to_render = File.exist?(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
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
class RolesController < ApplicationController
|
class RolesController < ApplicationController
|
||||||
before_filter :authenticate_member!
|
before_filter :authenticate_member!
|
||||||
load_and_authorize_resource
|
load_and_authorize_resource
|
||||||
|
|
||||||
# GET /roles
|
# GET /roles
|
||||||
def index
|
def index
|
||||||
@roles = Role.all
|
@roles = Role.all
|
||||||
@@ -36,7 +36,7 @@ class RolesController < ApplicationController
|
|||||||
|
|
||||||
# POST /roles
|
# POST /roles
|
||||||
def create
|
def create
|
||||||
@role = Role.new(params[:role])
|
@role = Role.new(role_params)
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @role.save
|
if @role.save
|
||||||
@@ -52,7 +52,7 @@ class RolesController < ApplicationController
|
|||||||
@role = Role.find(params[:id])
|
@role = Role.find(params[:id])
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @role.update_attributes(params[:role])
|
if @role.update(role_params)
|
||||||
format.html { redirect_to @role, notice: 'Role was successfully updated.' }
|
format.html { redirect_to @role, notice: 'Role was successfully updated.' }
|
||||||
else
|
else
|
||||||
format.html { render action: "edit" }
|
format.html { render action: "edit" }
|
||||||
@@ -69,4 +69,10 @@ class RolesController < ApplicationController
|
|||||||
format.html { redirect_to roles_url }
|
format.html { redirect_to roles_url }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def role_params
|
||||||
|
params.require(:role).permit(:description, :name, :members, :slug)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
class ScientificNamesController < ApplicationController
|
class ScientificNamesController < ApplicationController
|
||||||
before_filter :authenticate_member!, :except => [:index, :show]
|
before_filter :authenticate_member!, except: [:index, :show]
|
||||||
load_and_authorize_resource
|
load_and_authorize_resource
|
||||||
|
|
||||||
cache_sweeper :scientific_name_sweeper
|
|
||||||
|
|
||||||
# GET /scientific_names
|
# GET /scientific_names
|
||||||
# GET /scientific_names.json
|
# GET /scientific_names.json
|
||||||
def index
|
def index
|
||||||
@@ -47,7 +45,7 @@ class ScientificNamesController < ApplicationController
|
|||||||
# POST /scientific_names.json
|
# POST /scientific_names.json
|
||||||
def create
|
def create
|
||||||
params[:scientific_name][:creator_id] = current_member.id
|
params[:scientific_name][:creator_id] = current_member.id
|
||||||
@scientific_name = ScientificName.new(params[:scientific_name])
|
@scientific_name = ScientificName.new(scientific_name_params)
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @scientific_name.save
|
if @scientific_name.save
|
||||||
@@ -66,7 +64,7 @@ class ScientificNamesController < ApplicationController
|
|||||||
@scientific_name = ScientificName.find(params[:id])
|
@scientific_name = ScientificName.find(params[:id])
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @scientific_name.update_attributes(params[:scientific_name])
|
if @scientific_name.update(scientific_name_params)
|
||||||
format.html { redirect_to @scientific_name.crop, notice: 'Scientific name was successfully updated.' }
|
format.html { redirect_to @scientific_name.crop, notice: 'Scientific name was successfully updated.' }
|
||||||
format.json { head :no_content }
|
format.json { head :no_content }
|
||||||
else
|
else
|
||||||
@@ -90,4 +88,10 @@ class ScientificNamesController < ApplicationController
|
|||||||
format.json { head :no_content }
|
format.json { head :no_content }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def scientific_name_params
|
||||||
|
params.require(:scientific_name).permit(:crop_id, :name, :creator_id)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,26 +1,24 @@
|
|||||||
class SeedsController < ApplicationController
|
class SeedsController < ApplicationController
|
||||||
before_filter :authenticate_member!, :except => [:index, :show]
|
before_filter :authenticate_member!, except: [:index, :show]
|
||||||
load_and_authorize_resource
|
load_and_authorize_resource
|
||||||
|
|
||||||
cache_sweeper :seed_sweeper
|
|
||||||
|
|
||||||
# GET /seeds
|
# GET /seeds
|
||||||
# GET /seeds.json
|
# GET /seeds.json
|
||||||
def index
|
def index
|
||||||
@owner = Member.find_by_slug(params[:owner])
|
@owner = Member.find_by_slug(params[:owner])
|
||||||
@crop = Crop.find_by_slug(params[:crop])
|
@crop = Crop.find_by_slug(params[:crop])
|
||||||
if @owner
|
@seeds = if @owner
|
||||||
@seeds = @owner.seeds.includes(:owner, :crop).paginate(:page => params[:page])
|
@owner.seeds.includes(:owner, :crop).paginate(page: params[:page])
|
||||||
elsif @crop
|
elsif @crop
|
||||||
@seeds = @crop.seeds.includes(:owner, :crop).paginate(:page => params[:page])
|
@crop.seeds.includes(:owner, :crop).paginate(page: params[:page])
|
||||||
else
|
else
|
||||||
@seeds = Seed.includes(:owner, :crop).paginate(:page => params[:page])
|
Seed.includes(:owner, :crop).paginate(page: params[:page])
|
||||||
end
|
end
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html # index.html.erb
|
format.html # index.html.erb
|
||||||
format.json { render json: @seeds }
|
format.json { render json: @seeds }
|
||||||
format.rss { render :layout => false } #index.rss.builder
|
format.rss { render layout: false } # index.rss.builder
|
||||||
format.csv do
|
format.csv do
|
||||||
if @owner
|
if @owner
|
||||||
@filename = "Growstuff-#{@owner}-Seeds-#{Time.zone.now.to_s(:number)}.csv"
|
@filename = "Growstuff-#{@owner}-Seeds-#{Time.zone.now.to_s(:number)}.csv"
|
||||||
@@ -29,7 +27,7 @@ class SeedsController < ApplicationController
|
|||||||
@filename = "Growstuff-Seeds-#{Time.zone.now.to_s(:number)}.csv"
|
@filename = "Growstuff-Seeds-#{Time.zone.now.to_s(:number)}.csv"
|
||||||
@seeds = Seed.includes(:owner, :crop)
|
@seeds = Seed.includes(:owner, :crop)
|
||||||
end
|
end
|
||||||
render :csv => @seeds
|
render csv: @seeds
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -51,7 +49,7 @@ class SeedsController < ApplicationController
|
|||||||
@seed = Seed.new
|
@seed = Seed.new
|
||||||
|
|
||||||
# using find_by_id here because it returns nil, unlike find
|
# using find_by_id here because it returns nil, unlike find
|
||||||
@crop = Crop.find_by_id(params[:crop_id]) || Crop.new
|
@crop = Crop.find_by_id(params[:crop_id]) || Crop.new
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html # new.html.erb
|
format.html # new.html.erb
|
||||||
@@ -68,7 +66,7 @@ class SeedsController < ApplicationController
|
|||||||
# POST /seeds.json
|
# POST /seeds.json
|
||||||
def create
|
def create
|
||||||
params[:seed][:owner_id] = current_member.id
|
params[:seed][:owner_id] = current_member.id
|
||||||
@seed = Seed.new(params[:seed])
|
@seed = Seed.new(seed_params)
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @seed.save
|
if @seed.save
|
||||||
@@ -87,7 +85,7 @@ class SeedsController < ApplicationController
|
|||||||
@seed = Seed.find(params[:id])
|
@seed = Seed.find(params[:id])
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @seed.update_attributes(params[:seed])
|
if @seed.update(seed_params)
|
||||||
format.html { redirect_to @seed, notice: 'Seed was successfully updated.' }
|
format.html { redirect_to @seed, notice: 'Seed was successfully updated.' }
|
||||||
format.json { head :no_content }
|
format.json { head :no_content }
|
||||||
else
|
else
|
||||||
@@ -108,4 +106,13 @@ class SeedsController < ApplicationController
|
|||||||
format.json { head :no_content }
|
format.json { head :no_content }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def seed_params
|
||||||
|
params.require(:seed).permit(
|
||||||
|
:owner_id, :crop_id, :description, :quantity, :plant_before,
|
||||||
|
:days_until_maturity_min, :days_until_maturity_max, :organic, :gmo,
|
||||||
|
:heirloom, :tradable_to, :slug)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
11
app/controllers/sessions_controller.rb
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
class SessionsController < Devise::SessionsController
|
||||||
|
respond_to :json
|
||||||
|
|
||||||
|
def create
|
||||||
|
super do |resource|
|
||||||
|
if Crop.pending_approval.present? && current_member.has_role?(:crop_wrangler)
|
||||||
|
flash[:alert] = "There are crops waiting to be wrangled."
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
class SupportController < ApplicationController
|
|
||||||
end
|
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
module ApplicationHelper
|
module ApplicationHelper
|
||||||
|
|
||||||
def price_in_dollars(price)
|
def price_in_dollars(price)
|
||||||
return sprintf('%.2f', price / 100.0)
|
return sprintf('%.2f', price / 100.0)
|
||||||
end
|
end
|
||||||
@@ -7,7 +6,7 @@ module ApplicationHelper
|
|||||||
# 999 cents becomes 9.99 AUD -- for products/orders/etc
|
# 999 cents becomes 9.99 AUD -- for products/orders/etc
|
||||||
def price_with_currency(price)
|
def price_with_currency(price)
|
||||||
return sprintf('%.2f %s', price / 100.0,
|
return sprintf('%.2f %s', price / 100.0,
|
||||||
Growstuff::Application.config.currency)
|
Growstuff::Application.config.currency)
|
||||||
end
|
end
|
||||||
|
|
||||||
def parse_date(str)
|
def parse_date(str)
|
||||||
@@ -19,10 +18,70 @@ module ApplicationHelper
|
|||||||
pid = price_in_dollars(price)
|
pid = price_in_dollars(price)
|
||||||
currency = Growstuff::Application.config.currency
|
currency = Growstuff::Application.config.currency
|
||||||
link = "http://www.wolframalpha.com/input/?i=#{pid}+#{currency}"
|
link = "http://www.wolframalpha.com/input/?i=#{pid}+#{currency}"
|
||||||
return link_to "(convert)",
|
|
||||||
link,
|
|
||||||
:target => "_blank"
|
|
||||||
end
|
|
||||||
|
|
||||||
|
link_to "(convert)", link, target: "_blank", rel: "noopener noreferrer"
|
||||||
|
end
|
||||||
|
|
||||||
|
def build_alert_classes(alert_type = :info)
|
||||||
|
classes = 'alert alert-dismissable '
|
||||||
|
case alert_type.to_sym
|
||||||
|
when :alert, :danger, :error, :validation_errors
|
||||||
|
classes += 'alert-danger'
|
||||||
|
when :warning, :todo
|
||||||
|
classes += 'alert-warning'
|
||||||
|
when :notice, :success
|
||||||
|
classes += 'alert-success'
|
||||||
|
when :info
|
||||||
|
classes += 'alert-info'
|
||||||
|
end
|
||||||
|
classes
|
||||||
|
end
|
||||||
|
|
||||||
|
# Produces a cache key for uniquely identifying cached fragments.
|
||||||
|
def cache_key_for(klass, identifier = "all")
|
||||||
|
count = klass.count
|
||||||
|
max_updated_at = klass.maximum(:updated_at).try(:utc).try(:to_s, :number)
|
||||||
|
"#{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)
|
||||||
|
if member.preferred_avatar_uri.present?
|
||||||
|
# Some avatars support different sizes
|
||||||
|
# http://graph.facebook.com/12345678/picture?width=150&height=150
|
||||||
|
uri = URI.parse(member.preferred_avatar_uri)
|
||||||
|
|
||||||
|
if uri.host == 'graph.facebook.com'
|
||||||
|
uri.query = "&width=#{size}&height=#{size}"
|
||||||
|
end
|
||||||
|
|
||||||
|
# TODO: Assess twitter - https://dev.twitter.com/overview/general/user-profile-images-and-banners
|
||||||
|
# TODO: Assess flickr - https://www.flickr.com/services/api/misc.buddyicons.html
|
||||||
|
|
||||||
|
return uri.to_s
|
||||||
|
end
|
||||||
|
|
||||||
|
Gravatar.new(member.email).image_url({
|
||||||
|
size: size,
|
||||||
|
default: :identicon
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
# Returns a string with the quantity and the right pluralization for a
|
||||||
|
# given collection and model.
|
||||||
|
def localize_plural(collection, model)
|
||||||
|
size = collection.size
|
||||||
|
model_name = model.model_name.human(count: size)
|
||||||
|
"#{size} #{model_name}"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
module AutoSuggestHelper
|
module AutoSuggestHelper
|
||||||
|
def auto_suggest(resource, source, options = {})
|
||||||
def auto_suggest(resource, source, options={})
|
|
||||||
if options[:default] && !options[:default].new_record?
|
if options[:default] && !options[:default].new_record?
|
||||||
default = options[:default]
|
default = options[:default]
|
||||||
default_id = options[:default].try(:id)
|
default_id = options[:default].try(:id)
|
||||||
@@ -13,10 +12,14 @@ module AutoSuggestHelper
|
|||||||
source_path = Rails.application.routes.url_helpers.send("#{source}s_search_path")
|
source_path = Rails.application.routes.url_helpers.send("#{source}s_search_path")
|
||||||
|
|
||||||
%Q{
|
%Q{
|
||||||
<input id="#{source}" class="auto-suggest #{options[:class]}" type="text" value="#{default}" data-source-url="#{source_path}", placeholder="e.g. lettuce">
|
<input id="#{source}" class="auto-suggest #{options[:class]}"
|
||||||
<noscript class="text-warning">Warning: Javascript must be available to search and match crops</noscript>
|
type="text" value="#{default}" data-source-url="#{source_path}",
|
||||||
<input id="#{resource}_#{source}_id" class="auto-suggest-id" type="hidden" name="#{resource}[#{source}_id]" value="#{default_id}">
|
placeholder="e.g. lettuce">
|
||||||
|
<noscript class="text-warning">
|
||||||
|
Warning: Javascript must be available to search and match crops
|
||||||
|
</noscript>
|
||||||
|
<input id="#{resource}_#{source}_id" class="auto-suggest-id"
|
||||||
|
type="hidden" name="#{resource}[#{source}_id]" value="#{default_id}">
|
||||||
}.html_safe
|
}.html_safe
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end
|
|
||||||
|
|||||||
21
app/helpers/crops_helper.rb
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
module CropsHelper
|
||||||
|
def display_seed_availability(member, crop)
|
||||||
|
total_quantity = 0
|
||||||
|
|
||||||
|
seeds = member.seeds.select { |seed| seed.crop.name == crop.name }
|
||||||
|
|
||||||
|
seeds.each do |seed|
|
||||||
|
total_quantity = total_quantity + seed.quantity if seed.quantity
|
||||||
|
end
|
||||||
|
|
||||||
|
if !seeds.any?
|
||||||
|
return "You don't have any seeds of this crop."
|
||||||
|
end
|
||||||
|
|
||||||
|
if (total_quantity != 0)
|
||||||
|
"You have #{total_quantity} #{Seed.model_name.human(count: total_quantity)} of this crop."
|
||||||
|
else
|
||||||
|
"You have an unknown quantity of seeds of this crop."
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
26
app/helpers/gardens_helper.rb
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
module GardensHelper
|
||||||
|
def display_garden_description(garden)
|
||||||
|
if garden.description.nil?
|
||||||
|
"no description provided."
|
||||||
|
else
|
||||||
|
truncate(garden.description, length: 130, separator: ' ', omission: '... ') do
|
||||||
|
link_to "Read more", garden_path(garden)
|
||||||
|
end
|
||||||
|
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
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
module HarvestsHelper
|
module HarvestsHelper
|
||||||
|
|
||||||
def display_quantity(harvest)
|
def display_quantity(harvest)
|
||||||
human_quantity = display_human_quantity(harvest)
|
human_quantity = display_human_quantity(harvest)
|
||||||
weight = display_weight(harvest)
|
weight = display_weight(harvest)
|
||||||
@@ -16,13 +15,13 @@ module HarvestsHelper
|
|||||||
end
|
end
|
||||||
|
|
||||||
def display_human_quantity(harvest)
|
def display_human_quantity(harvest)
|
||||||
if ! harvest.quantity.blank? && harvest.quantity > 0
|
if !harvest.quantity.blank? && harvest.quantity > 0
|
||||||
if harvest.unit == 'individual' # just the number
|
if harvest.unit == 'individual' # just the number
|
||||||
number_to_human(harvest.quantity, :strip_insignificant_zeros => true)
|
number_to_human(harvest.quantity, strip_insignificant_zeros: true)
|
||||||
elsif ! harvest.unit.blank? # pluralize anything else
|
elsif !harvest.unit.blank? # pluralize anything else
|
||||||
return pluralize(number_to_human(harvest.quantity, :strip_insignificant_zeros => true), harvest.unit)
|
return pluralize(number_to_human(harvest.quantity, strip_insignificant_zeros: true), harvest.unit)
|
||||||
else
|
else
|
||||||
return "#{number_to_human(harvest.quantity, :strip_insignificant_zeros => true)} #{harvest.unit}"
|
return "#{number_to_human(harvest.quantity, strip_insignificant_zeros: true)} #{harvest.unit}"
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
return nil
|
return nil
|
||||||
@@ -30,11 +29,18 @@ module HarvestsHelper
|
|||||||
end
|
end
|
||||||
|
|
||||||
def display_weight(harvest)
|
def display_weight(harvest)
|
||||||
if ! harvest.weight_quantity.blank? && harvest.weight_quantity > 0
|
if !harvest.weight_quantity.blank? && harvest.weight_quantity > 0
|
||||||
return "#{number_to_human(harvest.weight_quantity, :strip_insignificant_zeros => true)} #{harvest.weight_unit}"
|
return "#{number_to_human(harvest.weight_quantity, strip_insignificant_zeros: true)} #{harvest.weight_unit}"
|
||||||
else
|
else
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def display_harvest_description(harvest)
|
||||||
|
if harvest.description.empty?
|
||||||
|
"No description provided."
|
||||||
|
else
|
||||||
|
harvest.description
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -2,15 +2,10 @@ module NotificationsHelper
|
|||||||
def reply_link(notification)
|
def reply_link(notification)
|
||||||
if notification.post
|
if notification.post
|
||||||
# comment on the post in question
|
# comment on the post in question
|
||||||
new_comment_url(:post_id => notification.post.id)
|
new_comment_url(post_id: notification.post.id)
|
||||||
else
|
else
|
||||||
# by default, reply link sends a PM in return
|
# by default, reply link sends a PM in return
|
||||||
new_notification_url(
|
reply_notification_url(notification)
|
||||||
:recipient_id => notification.sender.id,
|
|
||||||
:subject => notification.subject =~ /^Re: / ?
|
|
||||||
notification.subject :
|
|
||||||
"Re: " + notification.subject
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
43
app/helpers/plantings_helper.rb
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
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.planted_at.nil? || 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
|
||||||
9
app/helpers/seeds_helper.rb
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
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,24 +2,53 @@ class Notifier < ActionMailer::Base
|
|||||||
include NotificationsHelper
|
include NotificationsHelper
|
||||||
default from: "Growstuff <noreply@growstuff.org>"
|
default from: "Growstuff <noreply@growstuff.org>"
|
||||||
|
|
||||||
|
def verifier
|
||||||
|
unless ENV['RAILS_SECRET_TOKEN']
|
||||||
|
raise "RAILS_SECRET_TOKEN environment variable"\
|
||||||
|
"not set - have you created config/application.yml?"
|
||||||
|
end
|
||||||
|
|
||||||
|
return ActiveSupport::MessageVerifier.new(ENV['RAILS_SECRET_TOKEN'])
|
||||||
|
end
|
||||||
|
|
||||||
def notify(notification)
|
def notify(notification)
|
||||||
@notification = notification
|
@notification = notification
|
||||||
@reply_link = reply_link(@notification)
|
@reply_link = reply_link(@notification)
|
||||||
|
|
||||||
mail(:to => @notification.recipient.email,
|
# Encrypting
|
||||||
:subject => @notification.subject)
|
@signed_message = verifier.generate ({ member_id: @notification.recipient.id, type: :send_notification_email })
|
||||||
|
|
||||||
|
mail(to: @notification.recipient.email,
|
||||||
|
subject: @notification.subject)
|
||||||
end
|
end
|
||||||
|
|
||||||
def planting_reminder(member)
|
def planting_reminder(member)
|
||||||
@member = member
|
@member = member
|
||||||
|
|
||||||
@plantings = @member.plantings.reorder.last(5)
|
@plantings = @member.plantings.first(5)
|
||||||
@harvests = @member.harvests.reorder.last(5)
|
@harvests = @member.harvests.first(5)
|
||||||
|
|
||||||
|
# Encrypting
|
||||||
|
@signed_message = verifier.generate ({ member_id: @member.id, type: :send_planting_reminder })
|
||||||
|
|
||||||
if @member.send_planting_reminder
|
if @member.send_planting_reminder
|
||||||
mail(:to => @member.email,
|
mail(to: @member.email,
|
||||||
:subject => "What have you planted lately?")
|
subject: "What have you planted lately?")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def new_crop_request(member, request)
|
||||||
|
@member, @request = member, request
|
||||||
|
mail(to: @member.email, subject: "#{@request.requester.login_name} has requested #{@request.name} as a new crop")
|
||||||
|
end
|
||||||
|
|
||||||
|
def crop_request_approved(member, crop)
|
||||||
|
@member, @crop = member, crop
|
||||||
|
mail(to: @member.email, subject: "#{crop.name.capitalize} has been approved")
|
||||||
|
end
|
||||||
|
|
||||||
|
def crop_request_rejected(member, crop)
|
||||||
|
@member, @crop = member, crop
|
||||||
|
mail(to: @member.email, subject: "#{crop.name.capitalize} has been rejected")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -21,14 +21,32 @@ class Ability
|
|||||||
cannot :read, Account
|
cannot :read, Account
|
||||||
cannot :read, AccountType
|
cannot :read, AccountType
|
||||||
|
|
||||||
|
# nobody should be able to view unapproved crops unless they
|
||||||
|
# are wranglers or admins
|
||||||
|
cannot :read, Crop
|
||||||
|
can :read, Crop, approval_status: "approved"
|
||||||
|
# scientific names should only be viewable if associated crop is approved
|
||||||
|
cannot :read, ScientificName
|
||||||
|
can :read, ScientificName do |sn|
|
||||||
|
sn.crop.approved?
|
||||||
|
end
|
||||||
|
# ... same for alternate names
|
||||||
|
cannot :read, AlternateName
|
||||||
|
can :read, AlternateName do |an|
|
||||||
|
an.crop.approved?
|
||||||
|
end
|
||||||
|
|
||||||
if member
|
if member
|
||||||
|
# members can see even rejected or pending crops if they requested it
|
||||||
|
can :read, Crop, requester_id: member.id
|
||||||
|
|
||||||
# managing your own user settings
|
# managing your own user settings
|
||||||
can :update, Member, :id => member.id
|
can :update, Member, id: member.id
|
||||||
|
|
||||||
# can read/delete notifications that were sent to them
|
# can read/delete notifications that were sent to them
|
||||||
can :read, Notification, :recipient_id => member.id
|
can :read, Notification, recipient_id: member.id
|
||||||
can :destroy, 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
|
# can send a private message to anyone but themselves
|
||||||
# note: sadly, we can't test for this from the view, but it works
|
# note: sadly, we can't test for this from the view, but it works
|
||||||
# for the model/controller
|
# for the model/controller
|
||||||
@@ -45,58 +63,63 @@ class Ability
|
|||||||
can :manage, AlternateName
|
can :manage, AlternateName
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# any member can create a crop provisionally
|
||||||
|
can :create, Crop
|
||||||
|
|
||||||
# can create & destroy their own authentications against other sites.
|
# can create & destroy their own authentications against other sites.
|
||||||
can :create, Authentication
|
can :create, Authentication
|
||||||
can :destroy, Authentication, :member_id => member.id
|
can :destroy, Authentication, member_id: member.id
|
||||||
|
|
||||||
# anyone can create a post, or comment on a post,
|
# anyone can create a post, or comment on a post,
|
||||||
# but only the author can edit/destroy it.
|
# but only the author can edit/destroy it.
|
||||||
can :create, Post
|
can :create, Post
|
||||||
can :update, Post, :author_id => member.id
|
can :update, Post, author_id: member.id
|
||||||
can :destroy, Post, :author_id => member.id
|
can :destroy, Post, author_id: member.id
|
||||||
can :create, Comment
|
can :create, Comment
|
||||||
can :update, Comment, :author_id => member.id
|
can :update, Comment, author_id: member.id
|
||||||
can :destroy, Comment, :author_id => member.id
|
can :destroy, Comment, author_id: member.id
|
||||||
|
|
||||||
# same deal for gardens and plantings
|
# same deal for gardens and plantings
|
||||||
can :create, Garden
|
can :create, Garden
|
||||||
can :update, Garden, :owner_id => member.id
|
can :update, Garden, owner_id: member.id
|
||||||
can :destroy, Garden, :owner_id => member.id
|
can :destroy, Garden, owner_id: member.id
|
||||||
|
|
||||||
can :create, Planting
|
can :create, Planting
|
||||||
can :update, Planting, :garden => { :owner_id => member.id }
|
can :update, Planting, garden: { owner_id: member.id }
|
||||||
can :destroy, Planting, :garden => { :owner_id => member.id }
|
can :destroy, Planting, garden: { owner_id: member.id }
|
||||||
|
|
||||||
can :create, Harvest
|
can :create, Harvest
|
||||||
can :update, Harvest, :owner_id => member.id
|
can :update, Harvest, owner_id: member.id
|
||||||
can :destroy, Harvest, :owner_id => member.id
|
can :destroy, Harvest, owner_id: member.id
|
||||||
|
|
||||||
can :create, Photo
|
can :create, Photo
|
||||||
can :update, Photo, :owner_id => member.id
|
can :update, Photo, owner_id: member.id
|
||||||
can :destroy, Photo, :owner_id => member.id
|
can :destroy, Photo, owner_id: member.id
|
||||||
|
|
||||||
can :create, Seed
|
can :create, Seed
|
||||||
can :update, Seed, :owner_id => member.id
|
can :update, Seed, owner_id: member.id
|
||||||
can :destroy, Seed, :owner_id => member.id
|
can :destroy, Seed, owner_id: member.id
|
||||||
|
|
||||||
# orders/shop/etc
|
# orders/shop/etc
|
||||||
can :create, Order
|
can :create, Order
|
||||||
can :read, Order, :member_id => member.id
|
can :read, Order, member_id: member.id
|
||||||
can :complete, Order, :member_id => member.id, :completed_at => nil
|
can :complete, Order, member_id: member.id, completed_at: nil
|
||||||
can :checkout, Order, :member_id => member.id, :completed_at => nil
|
can :checkout, Order, member_id: member.id, completed_at: nil
|
||||||
can :cancel, Order, :member_id => member.id, :completed_at => nil
|
can :cancel, Order, member_id: member.id, completed_at: nil
|
||||||
can :destroy, Order, :member_id => member.id, :completed_at => nil
|
can :destroy, Order, member_id: member.id, completed_at: nil
|
||||||
|
|
||||||
can :create, OrderItem
|
can :create, OrderItem
|
||||||
# for now, let's not let people mess with individual order items
|
# for now, let's not let people mess with individual order items
|
||||||
cannot :read, OrderItem, :order => { :member_id => member.id }
|
cannot :read, OrderItem, order: { member_id: member.id }
|
||||||
cannot :update, OrderItem, :order => { :member_id => member.id, :completed_at => nil }
|
cannot :update, OrderItem, order: { member_id: member.id, completed_at: nil }
|
||||||
cannot :destroy, OrderItem, :order => { :member_id => member.id, :completed_at => nil }
|
cannot :destroy, OrderItem, order: { member_id: member.id, completed_at: nil }
|
||||||
|
|
||||||
# following/unfollowing permissions
|
# following/unfollowing permissions
|
||||||
can :create, Follow do |f|
|
can :create, Follow
|
||||||
!member.already_following?(f.followed) && f.followed_id != member.id
|
cannot :create, Follow, followed_id: member.id # can't follow yourself
|
||||||
end
|
|
||||||
|
can :destroy, Follow
|
||||||
|
cannot :destroy, Follow, followed_id: member.id # can't unfollow yourself
|
||||||
|
|
||||||
if member.has_role? :admin
|
if member.has_role? :admin
|
||||||
|
|
||||||
|
|||||||
@@ -1,15 +1,14 @@
|
|||||||
class Account < ActiveRecord::Base
|
class Account < ActiveRecord::Base
|
||||||
attr_accessible :account_type_id, :member_id, :paid_until
|
|
||||||
belongs_to :member
|
belongs_to :member
|
||||||
belongs_to :account_type
|
belongs_to :account_type
|
||||||
|
|
||||||
validates :member_id, :uniqueness => {
|
validates :member_id, uniqueness: {
|
||||||
:message => 'already has account details associated with it'
|
message: 'already has account details associated with it'
|
||||||
}
|
}
|
||||||
|
|
||||||
before_create do |account|
|
before_create do |account|
|
||||||
unless account.account_type
|
unless account.account_type
|
||||||
account.account_type = AccountType.find_or_create_by_name(
|
account.account_type = AccountType.find_or_create_by(name:
|
||||||
Growstuff::Application.config.default_account_type
|
Growstuff::Application.config.default_account_type
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
@@ -22,5 +21,4 @@ class Account < ActiveRecord::Base
|
|||||||
return paid_until.to_s
|
return paid_until.to_s
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
class AccountType < ActiveRecord::Base
|
class AccountType < ActiveRecord::Base
|
||||||
attr_accessible :is_paid, :is_permanent_paid, :name
|
|
||||||
has_many :products
|
has_many :products
|
||||||
|
|
||||||
def to_s
|
def to_s
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
class AlternateName < ActiveRecord::Base
|
class AlternateName < ActiveRecord::Base
|
||||||
attr_accessible :crop_id, :name, :creator_id
|
after_commit { |an| an.crop.__elasticsearch__.index_document if an.crop && ENV['GROWSTUFF_ELASTICSEARCH'] == "true" }
|
||||||
belongs_to :crop
|
belongs_to :crop
|
||||||
belongs_to :creator, :class_name => 'Member'
|
belongs_to :creator, class_name: 'Member'
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
class Authentication < ActiveRecord::Base
|
class Authentication < ActiveRecord::Base
|
||||||
belongs_to :member
|
belongs_to :member
|
||||||
attr_accessible :provider, :uid, :token, :secret, :name
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
class Comment < ActiveRecord::Base
|
class Comment < ActiveRecord::Base
|
||||||
attr_accessible :author_id, :body, :post_id
|
belongs_to :author, class_name: 'Member'
|
||||||
belongs_to :author, :class_name => 'Member'
|
|
||||||
belongs_to :post
|
belongs_to :post
|
||||||
|
|
||||||
default_scope order("created_at DESC")
|
default_scope { order("created_at DESC") }
|
||||||
scope :post_order, reorder("created_at ASC") # for display on post page
|
scope :post_order, -> { reorder("created_at ASC") } # for display on post page
|
||||||
|
|
||||||
after_create do
|
after_create do
|
||||||
recipient = self.post.author.id
|
recipient = self.post.author.id
|
||||||
@@ -12,13 +11,12 @@ class Comment < ActiveRecord::Base
|
|||||||
# don't send notifications to yourself
|
# don't send notifications to yourself
|
||||||
if recipient != sender
|
if recipient != sender
|
||||||
Notification.create(
|
Notification.create(
|
||||||
:recipient_id => recipient,
|
recipient_id: recipient,
|
||||||
:sender_id => sender,
|
sender_id: sender,
|
||||||
:subject => "#{self.author} commented on #{self.post.subject}",
|
subject: "#{self.author} commented on #{self.post.subject}",
|
||||||
:body => self.body,
|
body: self.body,
|
||||||
:post_id => self.post.id
|
post_id: self.post.id
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,15 +0,0 @@
|
|||||||
class CommentSweeper < ActionController::Caching::Sweeper
|
|
||||||
observe Comment
|
|
||||||
|
|
||||||
def after_create(comment)
|
|
||||||
expire_fragment('recent_posts')
|
|
||||||
end
|
|
||||||
|
|
||||||
def after_update(comment)
|
|
||||||
end
|
|
||||||
|
|
||||||
def after_destroy(comment)
|
|
||||||
expire_fragment('recent_posts')
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
||||||
@@ -1,48 +1,134 @@
|
|||||||
class Crop < ActiveRecord::Base
|
class Crop < ActiveRecord::Base # rubocop:disable Metrics/ClassLength
|
||||||
extend FriendlyId
|
extend FriendlyId
|
||||||
friendly_id :name, use: :slugged
|
friendly_id :name, use: [:slugged, :finders]
|
||||||
attr_accessible :en_wikipedia_url, :name, :parent_id, :creator_id, :scientific_names_attributes
|
|
||||||
|
|
||||||
has_many :scientific_names
|
has_many :scientific_names, after_add: :update_index, after_remove: :update_index
|
||||||
accepts_nested_attributes_for :scientific_names,
|
accepts_nested_attributes_for :scientific_names,
|
||||||
:allow_destroy => true,
|
allow_destroy: true,
|
||||||
:reject_if => :all_blank
|
reject_if: :all_blank
|
||||||
|
|
||||||
has_many :alternate_names
|
has_many :alternate_names, after_add: :update_index, after_remove: :update_index, dependent: :destroy
|
||||||
has_many :plantings
|
has_many :plantings
|
||||||
has_many :photos, :through => :plantings
|
has_many :photos, through: :plantings
|
||||||
has_many :seeds
|
has_many :seeds
|
||||||
has_many :harvests
|
has_many :harvests
|
||||||
has_many :plant_parts, :through => :harvests, :uniq => :true
|
has_many :plant_parts, -> { uniq }, through: :harvests
|
||||||
belongs_to :creator, :class_name => 'Member'
|
belongs_to :creator, class_name: 'Member'
|
||||||
|
belongs_to :requester, class_name: 'Member'
|
||||||
|
|
||||||
belongs_to :parent, :class_name => 'Crop'
|
belongs_to :parent, class_name: 'Crop'
|
||||||
has_many :varieties, :class_name => 'Crop', :foreign_key => 'parent_id'
|
has_many :varieties, class_name: 'Crop', foreign_key: 'parent_id'
|
||||||
has_and_belongs_to_many :posts
|
has_and_belongs_to_many :posts
|
||||||
before_destroy {|crop| crop.posts.clear}
|
before_destroy { |crop| crop.posts.clear }
|
||||||
|
|
||||||
|
default_scope { order("lower(name) asc") }
|
||||||
|
scope :recent, lambda {
|
||||||
|
where(approval_status: "approved").reorder("created_at desc")
|
||||||
|
}
|
||||||
|
scope :toplevel, lambda {
|
||||||
|
where(approval_status: "approved", parent_id: nil)
|
||||||
|
}
|
||||||
|
scope :popular, lambda {
|
||||||
|
where(approval_status: "approved").reorder("plantings_count desc, lower(name) asc")
|
||||||
|
}
|
||||||
|
scope :randomized, lambda {
|
||||||
|
# ok on sqlite and psql, but not on mysql
|
||||||
|
where(approval_status: "approved").reorder('random()')
|
||||||
|
}
|
||||||
|
scope :pending_approval, -> { where(approval_status: "pending") }
|
||||||
|
scope :approved, -> { where(approval_status: "approved") }
|
||||||
|
scope :rejected, -> { where(approval_status: "rejected") }
|
||||||
|
|
||||||
default_scope order("lower(name) asc")
|
## Wikipedia urls are only necessary when approving a crop
|
||||||
scope :recent, reorder("created_at desc")
|
|
||||||
scope :toplevel, where(:parent_id => nil)
|
|
||||||
scope :popular, reorder("plantings_count desc, lower(name) asc")
|
|
||||||
scope :randomized, reorder('random()') # ok on sqlite and psql, but not on mysql
|
|
||||||
|
|
||||||
validates :en_wikipedia_url,
|
validates :en_wikipedia_url,
|
||||||
:format => {
|
format: {
|
||||||
:with => /^https?:\/\/en\.wikipedia\.org\/wiki/,
|
with: /\Ahttps?:\/\/en\.wikipedia\.org\/wiki\/[[:alnum:]%_]+\z/,
|
||||||
:message => 'is not a valid English Wikipedia URL'
|
message: 'is not a valid English Wikipedia URL'
|
||||||
}
|
},
|
||||||
|
if: :approved?
|
||||||
|
|
||||||
|
## Reasons are only necessary when rejecting
|
||||||
|
validates :reason_for_rejection, presence: true, if: :rejected?
|
||||||
|
|
||||||
|
## This validation addresses a race condition
|
||||||
|
validate :approval_status_cannot_be_changed_again
|
||||||
|
|
||||||
|
validate :must_be_rejected_if_rejected_reasons_present
|
||||||
|
|
||||||
|
validate :must_have_meaningful_reason_for_rejection
|
||||||
|
|
||||||
|
####################################
|
||||||
|
# Elastic search configuration
|
||||||
|
if ENV["GROWSTUFF_ELASTICSEARCH"] == "true"
|
||||||
|
include Elasticsearch::Model
|
||||||
|
include Elasticsearch::Model::Callbacks
|
||||||
|
# In order to avoid clashing between different environments,
|
||||||
|
# use Rails.env as a part of index name (eg. development_growstuff)
|
||||||
|
index_name [Rails.env, "growstuff"].join('_')
|
||||||
|
settings index: { number_of_shards: 1 },
|
||||||
|
analysis: {
|
||||||
|
tokenizer: {
|
||||||
|
gs_edgeNGram_tokenizer: {
|
||||||
|
type: "edgeNGram", # edgeNGram: NGram match from the start of a token
|
||||||
|
min_gram: 3,
|
||||||
|
max_gram: 10,
|
||||||
|
# token_chars: Elasticsearch will split on characters
|
||||||
|
# that don’t belong to any of these classes
|
||||||
|
token_chars: ["letter", "digit"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
analyzer: {
|
||||||
|
gs_edgeNGram_analyzer: {
|
||||||
|
tokenizer: "gs_edgeNGram_tokenizer",
|
||||||
|
filter: ["lowercase"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
} do
|
||||||
|
mappings dynamic: 'false' do
|
||||||
|
indexes :id, type: 'long'
|
||||||
|
indexes :name, type: 'string', analyzer: 'gs_edgeNGram_analyzer'
|
||||||
|
indexes :approval_status, type: 'string'
|
||||||
|
indexes :scientific_names do
|
||||||
|
indexes :name,
|
||||||
|
type: 'string',
|
||||||
|
analyzer: 'gs_edgeNGram_analyzer',
|
||||||
|
# Disabling field-length norm (norm). If the norm option is turned on(by default),
|
||||||
|
# higher weigh would be given for shorter fields, which in our case is irrelevant.
|
||||||
|
norms: { enabled: false }
|
||||||
|
end
|
||||||
|
indexes :alternate_names do
|
||||||
|
indexes :name, type: 'string', analyzer: 'gs_edgeNGram_analyzer'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def as_indexed_json(options = {})
|
||||||
|
self.as_json(
|
||||||
|
only: [:id, :name, :approval_status],
|
||||||
|
include: {
|
||||||
|
scientific_names: { only: :name },
|
||||||
|
alternate_names: { only: :name }
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
# update the Elasticsearch index (only if we're using it in this
|
||||||
|
# environment)
|
||||||
|
def update_index(name_obj)
|
||||||
|
if ENV["GROWSTUFF_ELASTICSEARCH"] == "true"
|
||||||
|
__elasticsearch__.index_document
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# End Elasticsearch section
|
||||||
|
|
||||||
def to_s
|
def to_s
|
||||||
return name
|
name
|
||||||
end
|
end
|
||||||
|
|
||||||
def default_scientific_name
|
def default_scientific_name
|
||||||
if scientific_names.count > 0
|
if scientific_names.size > 0
|
||||||
return scientific_names.first.scientific_name
|
scientific_names.first.name
|
||||||
else
|
|
||||||
return nil
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -51,7 +137,11 @@ class Crop < ActiveRecord::Base
|
|||||||
# later we can choose a default photo based on different criteria,
|
# later we can choose a default photo based on different criteria,
|
||||||
# eg. popularity
|
# eg. popularity
|
||||||
def default_photo
|
def default_photo
|
||||||
return photos.first
|
return photos.first if photos.any?
|
||||||
|
|
||||||
|
# Crop has no photos? Look for the most recent harvest with a photo.
|
||||||
|
harvest_with_photo = Harvest.where(crop_id: id).joins(:photos).order('harvests.id DESC').limit(1).first
|
||||||
|
harvest_with_photo.photos.first if harvest_with_photo
|
||||||
end
|
end
|
||||||
|
|
||||||
# crop.sunniness
|
# crop.sunniness
|
||||||
@@ -60,13 +150,7 @@ class Crop < ActiveRecord::Base
|
|||||||
# key: sunniness (eg. 'sun')
|
# key: sunniness (eg. 'sun')
|
||||||
# value: count of how many times it's been used by plantings
|
# value: count of how many times it's been used by plantings
|
||||||
def sunniness
|
def sunniness
|
||||||
sunniness = Hash.new(0)
|
count_uses_of_property 'sunniness'
|
||||||
plantings.each do |p|
|
|
||||||
if !p.sunniness.blank?
|
|
||||||
sunniness[p.sunniness] += 1
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return sunniness
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# crop.planted_from
|
# crop.planted_from
|
||||||
@@ -74,13 +158,7 @@ class Crop < ActiveRecord::Base
|
|||||||
# key: propagation method (eg. 'seed')
|
# key: propagation method (eg. 'seed')
|
||||||
# value: count of how many times it's been used by plantings
|
# value: count of how many times it's been used by plantings
|
||||||
def planted_from
|
def planted_from
|
||||||
planted_from = Hash.new(0)
|
count_uses_of_property 'planted_from'
|
||||||
plantings.each do |p|
|
|
||||||
if !p.planted_from.blank?
|
|
||||||
planted_from[p.planted_from] += 1
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return planted_from
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# crop.popular_plant_parts
|
# crop.popular_plant_parts
|
||||||
@@ -100,48 +178,68 @@ class Crop < ActiveRecord::Base
|
|||||||
def interesting?
|
def interesting?
|
||||||
min_plantings = 3 # needs this many plantings to be interesting
|
min_plantings = 3 # needs this many plantings to be interesting
|
||||||
min_photos = 3 # needs this many photos 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 false unless plantings_count >= min_plantings
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def pending?
|
||||||
|
approval_status == "pending"
|
||||||
|
end
|
||||||
|
|
||||||
|
def approved?
|
||||||
|
approval_status == "approved"
|
||||||
|
end
|
||||||
|
|
||||||
|
def rejected?
|
||||||
|
approval_status == "rejected"
|
||||||
|
end
|
||||||
|
|
||||||
|
def approval_statuses
|
||||||
|
['rejected', 'pending', 'approved']
|
||||||
|
end
|
||||||
|
|
||||||
|
def reasons_for_rejection
|
||||||
|
["already in database", "not edible", "not enough information", "other"]
|
||||||
|
end
|
||||||
|
|
||||||
# Crop.interesting
|
# Crop.interesting
|
||||||
# returns a list of interesting crops, for use on the homepage etc
|
# returns a list of interesting crops, for use on the homepage etc
|
||||||
def Crop.interesting
|
def Crop.interesting
|
||||||
howmany = 12 # max number to find
|
howmany = 12 # max number to find
|
||||||
interesting_crops = Array.new
|
interesting_crops = []
|
||||||
Crop.randomized.each do |c|
|
Crop.includes(:photos).randomized.each do |c|
|
||||||
break if interesting_crops.length == howmany
|
break if interesting_crops.size == howmany
|
||||||
next unless c.interesting?
|
next unless c.interesting?
|
||||||
interesting_crops.push(c)
|
interesting_crops.push(c)
|
||||||
end
|
end
|
||||||
return interesting_crops
|
return interesting_crops
|
||||||
end
|
end
|
||||||
|
|
||||||
# Crop.create_from_csv(row)
|
# Crop.create_from_csv(row)
|
||||||
# used by db/seeds.rb and rake growstuff:import_crops
|
# used by db/seeds.rb and rake growstuff:import_crops
|
||||||
# CSV fields:
|
# CSV fields:
|
||||||
# - name (required)
|
# - name (required)
|
||||||
# - en_wikipedia_url (required)
|
# - en_wikipedia_url (required)
|
||||||
# - parent (name, optional)
|
# - parent (name, optional)
|
||||||
# - scientific name (optional, can be picked up from parent if it has one)
|
# - scientific name (optional, can be picked up from parent if it has one)
|
||||||
|
|
||||||
def Crop.create_from_csv(row)
|
def Crop.create_from_csv(row)
|
||||||
name,en_wikipedia_url,parent,scientific_names,alternate_names = row
|
name, en_wikipedia_url, parent, scientific_names, alternate_names = row
|
||||||
|
|
||||||
cropbot = Member.find_by_login_name('cropbot')
|
cropbot = Member.find_by_login_name('cropbot')
|
||||||
raise "cropbot account not found: run rake db:seed" unless cropbot
|
raise "cropbot account not found: run rake db:seed" unless cropbot
|
||||||
|
|
||||||
crop = Crop.find_or_create_by_name(name)
|
crop = Crop.find_or_create_by(name: name)
|
||||||
crop.update_attributes(
|
crop.update_attributes(
|
||||||
:en_wikipedia_url => en_wikipedia_url,
|
en_wikipedia_url: en_wikipedia_url,
|
||||||
:creator_id => cropbot.id
|
creator_id: cropbot.id
|
||||||
)
|
)
|
||||||
|
|
||||||
if parent
|
if parent
|
||||||
parent = Crop.find_by_name(parent)
|
parent = Crop.find_by_name(parent)
|
||||||
if parent
|
if parent
|
||||||
crop.update_attributes(:parent_id => parent.id)
|
crop.update_attributes(parent_id: parent.id)
|
||||||
else
|
else
|
||||||
logger.warn("Warning: parent crop #{parent} not found")
|
logger.warn("Warning: parent crop #{parent} not found")
|
||||||
end
|
end
|
||||||
@@ -149,64 +247,146 @@ class Crop < ActiveRecord::Base
|
|||||||
|
|
||||||
crop.add_scientific_names_from_csv(scientific_names)
|
crop.add_scientific_names_from_csv(scientific_names)
|
||||||
crop.add_alternate_names_from_csv(alternate_names)
|
crop.add_alternate_names_from_csv(alternate_names)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def add_scientific_names_from_csv(scientific_names)
|
def add_scientific_names_from_csv(scientific_names)
|
||||||
names_to_add = []
|
names_to_add = []
|
||||||
if ! scientific_names.blank? # i.e. we actually passed something in, which isn't a given
|
if !scientific_names.blank? # i.e. we actually passed something in, which isn't a given
|
||||||
names_to_add = scientific_names.split(%r{,\s*})
|
names_to_add = scientific_names.split(%r{,\s*})
|
||||||
elsif parent && parent.scientific_names.size > 0 # pick up from parent
|
elsif parent && parent.scientific_names.size > 0 # pick up from parent
|
||||||
names_to_add = parent.scientific_names.map{|s| s.scientific_name}
|
names_to_add = parent.scientific_names.map { |s| s.name }
|
||||||
else
|
else
|
||||||
logger.warn("Warning: no scientific name (not even on parent crop) for #{self}")
|
logger.warn("Warning: no scientific name (not even on parent crop) for #{self}")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
cropbot = Member.find_by_login_name('cropbot')
|
||||||
|
|
||||||
if names_to_add.size > 0
|
if names_to_add.size > 0
|
||||||
cropbot = Member.find_by_login_name('cropbot')
|
|
||||||
raise "cropbot account not found: run rake db:seed" unless cropbot
|
raise "cropbot account not found: run rake db:seed" unless cropbot
|
||||||
|
|
||||||
names_to_add.each do |n|
|
add_names_to_list(names_to_add, 'scientific')
|
||||||
if self.scientific_names.exists?(:scientific_name => n)
|
|
||||||
logger.warn("Warning: skipping duplicate scientific name #{n} for #{self}")
|
|
||||||
else
|
|
||||||
|
|
||||||
self.scientific_names.create(
|
|
||||||
:scientific_name => n,
|
|
||||||
:creator_id => cropbot.id
|
|
||||||
)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def add_alternate_names_from_csv(alternate_names)
|
def add_alternate_names_from_csv(alternate_names)
|
||||||
|
cropbot = Member.find_by_login_name('cropbot')
|
||||||
|
|
||||||
names_to_add = []
|
names_to_add = []
|
||||||
if ! alternate_names.blank? # i.e. we actually passed something in, which isn't a given
|
|
||||||
cropbot = Member.find_by_login_name('cropbot')
|
if !alternate_names.blank? # i.e. we actually passed something in, which isn't a given
|
||||||
raise "cropbot account not found: run rake db:seed" unless cropbot
|
raise "cropbot account not found: run rake db:seed" unless cropbot
|
||||||
|
|
||||||
names_to_add = alternate_names.split(%r{,\s*})
|
names_to_add = alternate_names.split(%r{,\s*})
|
||||||
|
add_names_to_list(names_to_add, 'alternate')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
names_to_add.each do |n|
|
def rejection_explanation
|
||||||
if self.alternate_names.exists?(:name => n)
|
if reason_for_rejection == "other"
|
||||||
logger.warn("Warning: skipping duplicate alternate name #{n} for #{self}")
|
return rejection_notes
|
||||||
else
|
else
|
||||||
self.alternate_names.create(
|
return reason_for_rejection
|
||||||
:name => n,
|
|
||||||
:creator_id => cropbot.id
|
|
||||||
)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Crop.search(string)
|
# Crop.search(string)
|
||||||
# searches for crops whose names match the string given
|
|
||||||
# just uses SQL LIKE for now, but can be made fancier later
|
|
||||||
def self.search(query)
|
def self.search(query)
|
||||||
where("name ILIKE ?", "%#{query}%")
|
if ENV['GROWSTUFF_ELASTICSEARCH'] == "true"
|
||||||
|
search_str = query.nil? ? "" : query.downcase
|
||||||
|
response = __elasticsearch__.search({
|
||||||
|
# Finds documents which match any field, but uses the _score from
|
||||||
|
# the best field insead of adding up _score from each field.
|
||||||
|
query: {
|
||||||
|
multi_match: {
|
||||||
|
query: "#{search_str}",
|
||||||
|
analyzer: "standard",
|
||||||
|
fields: ["name",
|
||||||
|
"scientific_names.scientific_name",
|
||||||
|
"alternate_names.name"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
filter: {
|
||||||
|
term: { approval_status: "approved" }
|
||||||
|
},
|
||||||
|
size: 50
|
||||||
|
}
|
||||||
|
)
|
||||||
|
return response.records.to_a
|
||||||
|
else
|
||||||
|
# if we don't have elasticsearch, just do a basic SQL query.
|
||||||
|
# also, make sure it's an actual array not an activerecord
|
||||||
|
# collection, so it matches what we get from elasticsearch and we can
|
||||||
|
# manipulate it in the same ways (eg. deleting elements without deleting
|
||||||
|
# the whole record from the db)
|
||||||
|
matches = Crop.approved.where("name ILIKE ?", "%#{query}%").to_a
|
||||||
|
|
||||||
|
# we want to make sure that exact matches come first, even if not
|
||||||
|
# using elasticsearch (eg. in development)
|
||||||
|
exact_match = Crop.approved.find_by_name(query)
|
||||||
|
if exact_match
|
||||||
|
matches.delete(exact_match)
|
||||||
|
matches.unshift(exact_match)
|
||||||
|
end
|
||||||
|
|
||||||
|
return matches
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def add_names_to_list(names_to_add, list_name)
|
||||||
|
names_to_add.each do |n|
|
||||||
|
if name_already_exists(list_name, n)
|
||||||
|
logger.warn("Warning: skipping duplicate #{list_name} name #{n} for #{self}")
|
||||||
|
else
|
||||||
|
create_crop_in_list(list_name, n)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def create_crop_in_list(list_name, name)
|
||||||
|
cropbot = Member.find_by_login_name('cropbot')
|
||||||
|
create_hash = {
|
||||||
|
creator_id: "#{cropbot.id}",
|
||||||
|
name: name
|
||||||
|
}
|
||||||
|
self.send("#{list_name}_names").create(create_hash)
|
||||||
|
end
|
||||||
|
|
||||||
|
def name_already_exists(list_name, name)
|
||||||
|
self.send("#{list_name}_names").exists?(name: name)
|
||||||
|
end
|
||||||
|
|
||||||
|
def count_uses_of_property(col_name)
|
||||||
|
data = Hash.new(0)
|
||||||
|
plantings.each do |p|
|
||||||
|
if !p.send("#{col_name}").blank?
|
||||||
|
data[p.send("#{col_name}")] += 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
data
|
||||||
|
end
|
||||||
|
|
||||||
|
# Custom validations
|
||||||
|
|
||||||
|
def approval_status_cannot_be_changed_again
|
||||||
|
previous = previous_changes.include?(:approval_status) ? previous_changes.approval_status : {}
|
||||||
|
if previous.include?(:rejected) || previous.include?(:approved)
|
||||||
|
errors.add(:approval_status, "has already been set to #{approval_status}")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def must_be_rejected_if_rejected_reasons_present
|
||||||
|
unless rejected?
|
||||||
|
if reason_for_rejection.present? || rejection_notes.present?
|
||||||
|
errors.add(:approval_status, "must be rejected if a reason for rejection is present")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def must_have_meaningful_reason_for_rejection
|
||||||
|
if reason_for_rejection == "other" && rejection_notes.blank?
|
||||||
|
errors.add(:rejection_notes, "must be added if the reason for rejection is \"other\"")
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,21 +0,0 @@
|
|||||||
class CropSweeper < ActionController::Caching::Sweeper
|
|
||||||
observe Crop
|
|
||||||
|
|
||||||
def after_create(crop)
|
|
||||||
expire_fragment('homepage_stats')
|
|
||||||
expire_fragment('recent_crops')
|
|
||||||
expire_fragment('full_crop_hierarchy')
|
|
||||||
end
|
|
||||||
|
|
||||||
def after_update(crop)
|
|
||||||
expire_fragment("crop_image_#{crop.id}")
|
|
||||||
end
|
|
||||||
|
|
||||||
def after_destroy(crop)
|
|
||||||
expire_fragment('homepage_stats')
|
|
||||||
expire_fragment('recent_crops')
|
|
||||||
expire_fragment('full_crop_hierarchy')
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
@@ -1,17 +1,14 @@
|
|||||||
class Follow < ActiveRecord::Base
|
class Follow < ActiveRecord::Base
|
||||||
attr_accessible :followed_id, :follower_id
|
|
||||||
belongs_to :follower, class_name: "Member"
|
belongs_to :follower, class_name: "Member"
|
||||||
belongs_to :followed, class_name: "Member"
|
belongs_to :followed, class_name: "Member"
|
||||||
validates :follower_id, uniqueness: { :scope => :followed_id }
|
validates :follower_id, uniqueness: { scope: :followed_id }
|
||||||
|
|
||||||
after_create do
|
after_create do
|
||||||
Notification.create(
|
Notification.create(
|
||||||
:recipient_id => self.followed_id,
|
recipient_id: self.followed_id,
|
||||||
:sender_id => self.follower_id,
|
sender_id: self.follower_id,
|
||||||
:subject => "#{self.follower.login_name} is now following you",
|
subject: "#{self.follower.login_name} is now following you",
|
||||||
:body => "#{self.follower.login_name} just followed you on #{ENV["GROWSTUFF_SITE_NAME"]}. "
|
body: "#{self.follower.login_name} just followed you on #{ENV["GROWSTUFF_SITE_NAME"]}. "
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
class Forum < ActiveRecord::Base
|
class Forum < ActiveRecord::Base
|
||||||
extend FriendlyId
|
extend FriendlyId
|
||||||
friendly_id :name, use: :slugged
|
friendly_id :name, use: [:slugged, :finders]
|
||||||
attr_accessible :description, :name, :owner_id, :slug
|
|
||||||
has_many :posts
|
has_many :posts
|
||||||
belongs_to :owner, :class_name => "Member"
|
belongs_to :owner, class_name: "Member"
|
||||||
|
|
||||||
def to_s
|
def to_s
|
||||||
return name
|
return name
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,16 +0,0 @@
|
|||||||
class ForumSweeper < ActionController::Caching::Sweeper
|
|
||||||
observe Forum
|
|
||||||
|
|
||||||
def after_create(forum)
|
|
||||||
expire_fragment('homepage_forums')
|
|
||||||
end
|
|
||||||
|
|
||||||
def after_update(forum)
|
|
||||||
expire_fragment('homepage_forums')
|
|
||||||
end
|
|
||||||
|
|
||||||
def after_destroy(forum)
|
|
||||||
expire_fragment('homepage_forums')
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
||||||