mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-05-25 09:19:15 -04:00
Compare commits
33 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3bfe2329f1 | ||
|
|
941001c743 | ||
|
|
40cf5ba63a | ||
|
|
9a40449f08 | ||
|
|
90a88cf69d | ||
|
|
044a992d25 | ||
|
|
4b066ec37f | ||
|
|
c2dc2c5836 | ||
|
|
58452204aa | ||
|
|
711ba73d6b | ||
|
|
5354f2732f | ||
|
|
9bbaaa2211 | ||
|
|
93c47d774e | ||
|
|
d8ad697d09 | ||
|
|
7308a7cf9a | ||
|
|
c9c49a7e5e | ||
|
|
dba6b2a291 | ||
|
|
7d3991b295 | ||
|
|
e4c0ecfb5a | ||
|
|
fdb0e842de | ||
|
|
85ff36198b | ||
|
|
e38321aa33 | ||
|
|
d1438d1b2e | ||
|
|
b6f848ef66 | ||
|
|
ff47784aee | ||
|
|
1dba711057 | ||
|
|
6911f7b24b | ||
|
|
1e94abd063 | ||
|
|
4b87977e24 | ||
|
|
dfa28264c6 | ||
|
|
f0c1d6d4c2 | ||
|
|
427b98a157 | ||
|
|
8f5000443f |
@@ -70,3 +70,4 @@ submit the change with your pull request.
|
||||
- Eric Tillberg / [Thrillberg](https://github.com/Thrillberg)
|
||||
- Lucas Nogueira / [lucasnogueira](https://github.com/lucasnogueira)
|
||||
- Charley Lewittes / [ctlewitt](https://github.com/ctlewitt)
|
||||
- Kristine Nicole Polvoriza / [polveenomials](https://github.com/polveenomials)
|
||||
111
Gemfile.lock
111
Gemfile.lock
@@ -1,21 +1,21 @@
|
||||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
actionmailer (4.2.6)
|
||||
actionpack (= 4.2.6)
|
||||
actionview (= 4.2.6)
|
||||
activejob (= 4.2.6)
|
||||
actionmailer (4.2.7.1)
|
||||
actionpack (= 4.2.7.1)
|
||||
actionview (= 4.2.7.1)
|
||||
activejob (= 4.2.7.1)
|
||||
mail (~> 2.5, >= 2.5.4)
|
||||
rails-dom-testing (~> 1.0, >= 1.0.5)
|
||||
actionpack (4.2.6)
|
||||
actionview (= 4.2.6)
|
||||
activesupport (= 4.2.6)
|
||||
actionpack (4.2.7.1)
|
||||
actionview (= 4.2.7.1)
|
||||
activesupport (= 4.2.7.1)
|
||||
rack (~> 1.6)
|
||||
rack-test (~> 0.6.2)
|
||||
rails-dom-testing (~> 1.0, >= 1.0.5)
|
||||
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
||||
actionview (4.2.6)
|
||||
activesupport (= 4.2.6)
|
||||
actionview (4.2.7.1)
|
||||
activesupport (= 4.2.7.1)
|
||||
builder (~> 3.1)
|
||||
erubis (~> 2.7.0)
|
||||
rails-dom-testing (~> 1.0, >= 1.0.5)
|
||||
@@ -24,25 +24,25 @@ GEM
|
||||
actionpack
|
||||
active_merchant-paypal-bogus-gateway (0.1.0)
|
||||
activemerchant
|
||||
active_utils (3.2.0)
|
||||
activesupport (>= 3.2)
|
||||
active_utils (3.2.2)
|
||||
activesupport (>= 3.2, < 5.1.0)
|
||||
i18n
|
||||
activejob (4.2.6)
|
||||
activesupport (= 4.2.6)
|
||||
activejob (4.2.7.1)
|
||||
activesupport (= 4.2.7.1)
|
||||
globalid (>= 0.3.0)
|
||||
activemerchant (1.59.0)
|
||||
activemerchant (1.60.0)
|
||||
activesupport (>= 3.2.14, < 5.1)
|
||||
builder (>= 2.1.2, < 4.0.0)
|
||||
i18n (>= 0.6.9)
|
||||
nokogiri (~> 1.4)
|
||||
activemodel (4.2.6)
|
||||
activesupport (= 4.2.6)
|
||||
activemodel (4.2.7.1)
|
||||
activesupport (= 4.2.7.1)
|
||||
builder (~> 3.1)
|
||||
activerecord (4.2.6)
|
||||
activemodel (= 4.2.6)
|
||||
activesupport (= 4.2.6)
|
||||
activerecord (4.2.7.1)
|
||||
activemodel (= 4.2.7.1)
|
||||
activesupport (= 4.2.7.1)
|
||||
arel (~> 6.0)
|
||||
activesupport (4.2.6)
|
||||
activesupport (4.2.7.1)
|
||||
i18n (~> 0.7)
|
||||
json (~> 1.7, >= 1.7.7)
|
||||
minitest (~> 5.1)
|
||||
@@ -51,7 +51,7 @@ GEM
|
||||
addressable (2.4.0)
|
||||
arel (6.0.3)
|
||||
ast (2.3.0)
|
||||
autoprefixer-rails (6.3.6.2)
|
||||
autoprefixer-rails (6.4.0.2)
|
||||
execjs
|
||||
bcrypt (3.1.11)
|
||||
better_errors (2.1.1)
|
||||
@@ -67,10 +67,10 @@ GEM
|
||||
bootstrap-kaminari-views (0.0.5)
|
||||
kaminari (>= 0.13)
|
||||
rails (>= 3.1)
|
||||
bootstrap-sass (3.3.6)
|
||||
bootstrap-sass (3.3.7)
|
||||
autoprefixer-rails (>= 5.2.1)
|
||||
sass (>= 3.3.4)
|
||||
bootstrap_form (2.3.0)
|
||||
bootstrap_form (2.5.0)
|
||||
builder (3.2.2)
|
||||
byebug (9.0.5)
|
||||
cancancan (1.15.0)
|
||||
@@ -96,8 +96,8 @@ GEM
|
||||
climate_control (>= 0.0.3, < 1.0)
|
||||
codeclimate-test-reporter (0.6.0)
|
||||
simplecov (>= 0.7.1, < 1.0.0)
|
||||
codemirror-rails (5.11)
|
||||
railties (>= 3.0, < 5)
|
||||
codemirror-rails (5.16.0)
|
||||
railties (>= 3.0, < 6.0)
|
||||
coderay (1.1.1)
|
||||
coffee-rails (4.1.1)
|
||||
coffee-script (>= 2.2.0)
|
||||
@@ -122,18 +122,18 @@ GEM
|
||||
rails-i18n (>= 4.0.0)
|
||||
sass-rails (>= 4.0.3)
|
||||
concurrent-ruby (1.0.2)
|
||||
coveralls (0.8.13)
|
||||
json (~> 1.8)
|
||||
simplecov (~> 0.11.0)
|
||||
coveralls (0.8.15)
|
||||
json (>= 1.8, < 3)
|
||||
simplecov (~> 0.12.0)
|
||||
term-ansicolor (~> 1.3)
|
||||
thor (~> 0.19.1)
|
||||
tins (~> 1.6.0)
|
||||
tins (>= 1.6.0, < 2)
|
||||
csv_shaper (1.2.0)
|
||||
activesupport (>= 3.0.0)
|
||||
dalli (2.7.6)
|
||||
database_cleaner (1.5.3)
|
||||
debug_inspector (0.0.2)
|
||||
devise (4.1.1)
|
||||
devise (4.2.0)
|
||||
bcrypt (~> 3.0)
|
||||
orm_adapter (~> 0.1)
|
||||
railties (>= 4.1.0, < 5.1)
|
||||
@@ -159,7 +159,7 @@ GEM
|
||||
faraday
|
||||
multi_json
|
||||
erubis (2.7.0)
|
||||
excon (0.50.1)
|
||||
excon (0.51.0)
|
||||
execjs (2.7.0)
|
||||
factory_girl (4.7.0)
|
||||
activesupport (>= 3.0.0)
|
||||
@@ -168,7 +168,7 @@ GEM
|
||||
railties (>= 3.0.0)
|
||||
faraday (0.9.2)
|
||||
multipart-post (>= 1.2, < 3)
|
||||
ffi (1.9.10)
|
||||
ffi (1.9.14)
|
||||
figaro (1.1.1)
|
||||
thor (~> 0.14)
|
||||
flickraw (0.9.9)
|
||||
@@ -181,7 +181,7 @@ GEM
|
||||
gibbon (1.2.1)
|
||||
httparty
|
||||
multi_json (>= 1.9.0)
|
||||
globalid (0.3.6)
|
||||
globalid (0.3.7)
|
||||
activesupport (>= 4.1.0)
|
||||
gravatar-ultimate (2.0.0)
|
||||
activesupport (>= 2.3.14)
|
||||
@@ -218,8 +218,7 @@ GEM
|
||||
haml (~> 4.0.0)
|
||||
nokogiri (~> 1.6.0)
|
||||
ruby_parser (~> 3.5)
|
||||
httparty (0.13.7)
|
||||
json (~> 1.8)
|
||||
httparty (0.14.0)
|
||||
multi_xml (>= 0.5.2)
|
||||
i18n (0.7.0)
|
||||
i18n-tasks (0.9.5)
|
||||
@@ -238,7 +237,7 @@ GEM
|
||||
thor (>= 0.14, < 2.0)
|
||||
jquery-ui-rails (5.0.5)
|
||||
railties (>= 3.2.16)
|
||||
js-routes (1.2.6)
|
||||
js-routes (1.2.9)
|
||||
railties (>= 3.2)
|
||||
sprockets-rails
|
||||
json (1.8.3)
|
||||
@@ -246,7 +245,7 @@ GEM
|
||||
actionpack (>= 3.0.0)
|
||||
activesupport (>= 3.0.0)
|
||||
kgio (2.10.0)
|
||||
kramdown (1.11.1)
|
||||
kramdown (1.12.0)
|
||||
launchy (2.4.3)
|
||||
addressable (~> 2.3)
|
||||
leaflet-markercluster-rails (0.7.0)
|
||||
@@ -279,7 +278,7 @@ GEM
|
||||
nokogiri (1.6.8)
|
||||
mini_portile2 (~> 2.1.0)
|
||||
pkg-config (~> 1.1.7)
|
||||
notiffany (0.1.0)
|
||||
notiffany (0.1.1)
|
||||
nenv (~> 0.1)
|
||||
shellany (~> 0.0)
|
||||
oauth (0.5.1)
|
||||
@@ -312,7 +311,7 @@ GEM
|
||||
capybara (~> 2.1)
|
||||
cliver (~> 0.3.1)
|
||||
websocket-driver (>= 0.2.0)
|
||||
pry (0.10.3)
|
||||
pry (0.10.4)
|
||||
coderay (~> 1.1.0)
|
||||
method_source (~> 0.8.1)
|
||||
slop (~> 3.4)
|
||||
@@ -321,16 +320,16 @@ GEM
|
||||
rack (1.6.4)
|
||||
rack-test (0.6.3)
|
||||
rack (>= 1.0)
|
||||
rails (4.2.6)
|
||||
actionmailer (= 4.2.6)
|
||||
actionpack (= 4.2.6)
|
||||
actionview (= 4.2.6)
|
||||
activejob (= 4.2.6)
|
||||
activemodel (= 4.2.6)
|
||||
activerecord (= 4.2.6)
|
||||
activesupport (= 4.2.6)
|
||||
rails (4.2.7.1)
|
||||
actionmailer (= 4.2.7.1)
|
||||
actionpack (= 4.2.7.1)
|
||||
actionview (= 4.2.7.1)
|
||||
activejob (= 4.2.7.1)
|
||||
activemodel (= 4.2.7.1)
|
||||
activerecord (= 4.2.7.1)
|
||||
activesupport (= 4.2.7.1)
|
||||
bundler (>= 1.3.0, < 2.0)
|
||||
railties (= 4.2.6)
|
||||
railties (= 4.2.7.1)
|
||||
sprockets-rails
|
||||
rails-deprecated_sanitizer (1.0.3)
|
||||
activesupport (>= 4.2.0.alpha)
|
||||
@@ -348,9 +347,9 @@ GEM
|
||||
rails_stdout_logging
|
||||
rails_serve_static_assets (0.0.5)
|
||||
rails_stdout_logging (0.0.5)
|
||||
railties (4.2.6)
|
||||
actionpack (= 4.2.6)
|
||||
activesupport (= 4.2.6)
|
||||
railties (4.2.7.1)
|
||||
actionpack (= 4.2.7.1)
|
||||
activesupport (= 4.2.7.1)
|
||||
rake (>= 0.8.7)
|
||||
thor (>= 0.18.1, < 2.0)
|
||||
raindrops (0.16.0)
|
||||
@@ -391,7 +390,7 @@ GEM
|
||||
sexp_processor (~> 4.1)
|
||||
rubyzip (1.2.0)
|
||||
sass (3.4.22)
|
||||
sass-rails (5.0.5)
|
||||
sass-rails (5.0.6)
|
||||
railties (>= 4.0.0, < 6)
|
||||
sass (~> 3.1)
|
||||
sprockets (>= 2.8, < 4.0)
|
||||
@@ -403,13 +402,13 @@ GEM
|
||||
websocket (~> 1.0)
|
||||
sexp_processor (4.7.0)
|
||||
shellany (0.0.1)
|
||||
simplecov (0.11.2)
|
||||
simplecov (0.12.0)
|
||||
docile (~> 1.1.0)
|
||||
json (~> 1.8)
|
||||
json (>= 1.8, < 3)
|
||||
simplecov-html (~> 0.10.0)
|
||||
simplecov-html (0.10.0)
|
||||
slop (3.6.0)
|
||||
sprockets (3.6.2)
|
||||
sprockets (3.7.0)
|
||||
concurrent-ruby (~> 1.0)
|
||||
rack (> 1, < 3)
|
||||
sprockets-rails (3.1.1)
|
||||
@@ -423,7 +422,7 @@ GEM
|
||||
thread (0.2.2)
|
||||
thread_safe (0.3.5)
|
||||
tilt (2.0.5)
|
||||
tins (1.6.0)
|
||||
tins (1.12.0)
|
||||
tzinfo (1.2.2)
|
||||
thread_safe (~> 0.1)
|
||||
uglifier (2.7.2)
|
||||
|
||||
@@ -8,13 +8,12 @@ jQuery ->
|
||||
|
||||
el.datepicker({'format': 'yyyy-mm-dd'})
|
||||
|
||||
href = el.attr('href')
|
||||
|
||||
el.click (e) ->
|
||||
e.stopPropagation()
|
||||
e.preventDefault()
|
||||
|
||||
originalText = $(this).text()
|
||||
href = $(this).attr('href')
|
||||
$(this).text('Confirm without date')
|
||||
|
||||
$(this).bind('click.confirm', (e) ->
|
||||
@@ -30,6 +29,8 @@ jQuery ->
|
||||
|
||||
el.one 'changeDate', ->
|
||||
date = $(this).datepicker('getDate')
|
||||
href = $(this).attr('href')
|
||||
|
||||
url = "#{href}&planting[finished_at]=#{date}"
|
||||
|
||||
link = $("<a href='#{url}' data-method='put'></a>")
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
if (document.getElementById("cropmap") !== null) {
|
||||
mapbox_map_id = "<%= Rails.env == 'test' ? 0 : Growstuff::Application.config.mapbox_map_id %>";
|
||||
mapbox_base_url = "https://c.tiles.mapbox.com/v3/" + mapbox_map_id + "/{z}/{x}/{y}.png";
|
||||
mapbox_access_token = "<%= Rails.env == 'test' ? 0 : Growstuff::Application.config.mapbox_access_token %>";
|
||||
mapbox_base_url = "http://a.tiles.mapbox.com/v4/" + mapbox_map_id + "/{z}/{x}/{y}.png?access_token=" + mapbox_access_token;
|
||||
|
||||
L.Icon.Default.imagePath = '/assets'
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
if (document.getElementById("membermap") !== null) {
|
||||
mapbox_map_id = "<%= Rails.env == 'test' ? 0 : Growstuff::Application.config.mapbox_map_id %>";
|
||||
mapbox_base_url = "https://c.tiles.mapbox.com/v3/" + mapbox_map_id + "/{z}/{x}/{y}.png";
|
||||
mapbox_access_token = "<%= Rails.env == 'test' ? 0 : Growstuff::Application.config.mapbox_access_token %>";
|
||||
mapbox_base_url = "http://a.tiles.mapbox.com/v4/" + mapbox_map_id + "/{z}/{x}/{y}.png?access_token=" + mapbox_access_token;
|
||||
|
||||
L.Icon.Default.imagePath = '/assets'
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
if (document.getElementById("placesmap") !== null) {
|
||||
places_base_path = "/places";
|
||||
mapbox_map_id = "<%= Rails.env == 'test' ? 0 : Growstuff::Application.config.mapbox_map_id %>";
|
||||
mapbox_base_url = "https://c.tiles.mapbox.com/v3/" + mapbox_map_id + "/{z}/{x}/{y}.png";
|
||||
mapbox_access_token = "<%= Rails.env == 'test' ? 0 : Growstuff::Application.config.mapbox_access_token %>";
|
||||
mapbox_base_url = "http://a.tiles.mapbox.com/v4/" + mapbox_map_id + "/{z}/{x}/{y}.png?access_token=" + mapbox_access_token;
|
||||
nominatim_base_url = 'http://nominatim.openstreetmap.org/search/';
|
||||
nominatim_user_agent_email = "<%= Rails.env == 'test' ? 0 : Growstuff::Application.config.user_agent_email %>";
|
||||
|
||||
|
||||
@@ -40,6 +40,19 @@ h3
|
||||
.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
|
||||
@@ -115,6 +128,10 @@ p.stats
|
||||
padding-left: 80px
|
||||
margin-left: auto
|
||||
|
||||
.navbar .navbar-form
|
||||
width: 250px
|
||||
|
||||
|
||||
#placesmap, #cropmap
|
||||
height: 500px
|
||||
|
||||
@@ -273,6 +290,11 @@ html, body
|
||||
.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%)
|
||||
|
||||
@@ -20,7 +20,7 @@ module ApplicationHelper
|
||||
currency = Growstuff::Application.config.currency
|
||||
link = "http://www.wolframalpha.com/input/?i=#{pid}+#{currency}"
|
||||
|
||||
link_to "(convert)", link, target: "_blank"
|
||||
link_to "(convert)", link, target: "_blank", rel: "noopener noreferrer"
|
||||
end
|
||||
|
||||
def build_alert_classes(alert_type = :info)
|
||||
|
||||
@@ -128,7 +128,11 @@ class Crop < ActiveRecord::Base
|
||||
# later we can choose a default photo based on different criteria,
|
||||
# eg. popularity
|
||||
def default_photo
|
||||
return photos.first
|
||||
return photos.first if photos.any?
|
||||
|
||||
# Crop has no photos? Look for the most recent harvest with a photo.
|
||||
harvest_with_photo = Harvest.where(crop_id: id).joins(:photos).order('harvests.id DESC').limit(1).first
|
||||
return harvest_with_photo.photos.first if harvest_with_photo
|
||||
end
|
||||
|
||||
# crop.sunniness
|
||||
|
||||
@@ -132,7 +132,7 @@ class Harvest < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def default_photo
|
||||
return photos.first
|
||||
return photos.first || crop.default_photo
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
%h4 Find #{ crop.name } seeds
|
||||
- if crop.seeds.empty?
|
||||
%p
|
||||
There are no seeds available to trade.
|
||||
There are no seeds available to trade on Growstuff right now.
|
||||
- else
|
||||
%ul
|
||||
- crop.seeds.tradable.each do |seed|
|
||||
@@ -10,6 +10,8 @@
|
||||
= render :partial => 'members/location', :locals => { :member => seed.owner }
|
||||
%p
|
||||
= link_to "View all #{crop.name} seeds", seeds_by_crop_path(crop)
|
||||
%p
|
||||
= link_to "Purchase seeds via Ebay", "http://rover.ebay.com/rover/1/705-53470-19255-0/1?icep_ff3=9&pub=5575213277&toolid=10001&campid=5337940151&customid=&icep_uq=#{URI.escape crop.name}&icep_sellerId=&icep_ex_kw=&icep_sortBy=12&icep_catId=181003&icep_minPrice=&icep_maxPrice=&ipn=psmain&icep_vectorid=229515&kwid=902099&mtid=824&kw=lg", target: "_blank", rel: "noopener noreferrer"
|
||||
- if crop.approved?
|
||||
- if current_member
|
||||
%p= link_to "List #{crop.name} seeds to trade", new_seed_path(:crop_id => crop.id)
|
||||
|
||||
@@ -91,4 +91,9 @@
|
||||
|
||||
%h4 Learn more about #{ @crop.name.pluralize }
|
||||
%ul
|
||||
%li= link_to 'Wikipedia (English)', @crop.en_wikipedia_url
|
||||
%li= link_to 'Wikipedia (English)', @crop.en_wikipedia_url, target: "_blank", rel: "noopener noreferrer"
|
||||
%li
|
||||
= link_to "Gardenate - Planting reminders", "http://www.gardenate.com/plant/#{URI.escape @crop.name}", target: "_blank", rel: "noopener noreferrer"
|
||||
- if current_member && current_member.location
|
||||
%li
|
||||
= link_to "Google", "http://www.google.com/search?q=#{URI.escape ["Growing", @crop.name, current_member.location].join(" ")}", target: "_blank", rel: "noopener noreferrer"
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
.panel-body
|
||||
.row
|
||||
.col-md-4
|
||||
= link_to image_tag((harvest.crop.default_photo ? harvest.crop.default_photo.thumbnail_url : 'placeholder_150.png'), :alt => harvest.crop.name, :class => 'img'), harvest.crop
|
||||
= link_to image_tag((harvest.default_photo ? harvest.default_photo.thumbnail_url : 'placeholder_150.png'), :alt => harvest.crop.name, :class => 'img'), harvest.crop
|
||||
.col-md-8
|
||||
%dl.dl-horizontal
|
||||
%dt Crop :
|
||||
|
||||
@@ -8,16 +8,24 @@
|
||||
%span.icon-bar
|
||||
%span.icon-bar
|
||||
%span.icon-bar
|
||||
%a.navbar-brand(href=root_path)
|
||||
%a.navbar-brand.hidden-xs(href=root_path)
|
||||
= image_tag("growstuff-brand.png", :size => "200x50", :alt => ENV['GROWSTUFF_SITE_NAME'])
|
||||
= form_tag crops_search_path, :method => :get, :id => 'navbar-search', :class => 'navbar-form pull-right' do
|
||||
.input
|
||||
%a.navbar-brand.visible-xs(href=root_path)
|
||||
= image_tag("growstuff-apple-touch-icon-precomposed.png", :size => "50x50", :class=>"img-responsive", :alt => ENV['GROWSTUFF_SITE_NAME'])
|
||||
|
||||
.form.navbar-form.pull-left
|
||||
= form_tag crops_search_path, :method => :get, :id => 'navbar-search' do
|
||||
= label_tag :term, "Search crop database:", :class => 'sr-only'
|
||||
= text_field_tag 'term', nil, :class => 'search-query input-medium form-control', :placeholder => 'Search crops'
|
||||
= submit_tag "Search", :class => 'btn sr-only'
|
||||
.input
|
||||
.input-group
|
||||
= text_field_tag 'term', nil, :class => 'search-query input-medium form-control', :placeholder => 'Search crops'
|
||||
.input-group-btn
|
||||
%button.btn.btn-default{:style => "height: 34px;"}
|
||||
= submit_tag "Search", :class => 'btn sr-only'
|
||||
%span.glyphicon.glyphicon-search
|
||||
|
||||
.navbar-collapse.collapse#navbar-collapse
|
||||
%ul.nav.navbar-nav.pull-right
|
||||
%ul.nav.navbar-nav.navbar-right
|
||||
%li.dropdown<
|
||||
%a.dropdown-toggle{'data-toggle' => 'dropdown', :href => crops_path}
|
||||
Crops
|
||||
|
||||
@@ -69,5 +69,9 @@
|
||||
- if @seed.owner.location
|
||||
%p
|
||||
%small
|
||||
View other seeds, members and more near
|
||||
= link_to @seed.owner.location, place_path(@seed.owner.location, anchor: "seeds")
|
||||
View other seeds, members to trade with and more near
|
||||
= link_to @seed.owner.location, place_path(@seed.owner.location, anchor: "seeds")
|
||||
%p
|
||||
%small
|
||||
Or
|
||||
= link_to "purchase seeds via Ebay", "http://rover.ebay.com/rover/1/705-53470-19255-0/1?icep_ff3=9&pub=5575213277&toolid=10001&campid=5337940151&customid=&icep_uq=#{URI.escape @seed.crop.name}&icep_sellerId=&icep_ex_kw=&icep_sortBy=12&icep_catId=181003&icep_minPrice=&icep_maxPrice=&ipn=psmain&icep_vectorid=229515&kwid=902099&mtid=824&kw=lg", target: "_blank", rel: "noopener noreferrer"
|
||||
@@ -61,6 +61,7 @@ Growstuff::Application.configure do
|
||||
# this config variable cannot be put in application.yml as it is needed
|
||||
# by the assets pipeline, which doesn't have access to ENV.
|
||||
config.mapbox_map_id = 'growstuff.i3n2il6a'
|
||||
config.mapbox_access_token = 'pk.eyJ1IjoiZ3Jvd3N0dWZmIiwiYSI6IkdxMkx4alUifQ.n0igaBsw97s14zMa0lwKCA'
|
||||
|
||||
config.after_initialize do
|
||||
ActiveMerchant::Billing::Base.mode = :test
|
||||
|
||||
@@ -89,6 +89,7 @@ Growstuff::Application.configure do
|
||||
# this config variable cannot be put in application.yml as it is needed
|
||||
# by the assets pipeline, which doesn't have access to ENV.
|
||||
config.mapbox_map_id = 'growstuff.i3n2c4ie'
|
||||
config.mapbox_access_token = ' pk.eyJ1IjoiZ3Jvd3N0dWZmIiwiYSI6IkdxMkx4alUifQ.n0igaBsw97s14zMa0lwKCA'
|
||||
|
||||
config.after_initialize do
|
||||
ActiveMerchant::Billing::Base.mode = :production
|
||||
|
||||
@@ -87,6 +87,7 @@ Growstuff::Application.configure do
|
||||
# this config variable cannot be put in application.yml as it is needed
|
||||
# by the assets pipeline, which doesn't have access to ENV.
|
||||
config.mapbox_map_id = 'growstuff.i3n2hao7'
|
||||
config.mapbox_access_token = 'pk.eyJ1IjoiZ3Jvd3N0dWZmIiwiYSI6IkdxMkx4alUifQ.n0igaBsw97s14zMa0lwKCA'
|
||||
|
||||
config.after_initialize do
|
||||
ActiveMerchant::Billing::Base.mode = :test
|
||||
|
||||
@@ -135,7 +135,9 @@ feature "crop detail page", js: true do
|
||||
expect(page).to have_content "Learn more about #{ crop.name }"
|
||||
expect(page).to have_link "Wikipedia (English)", href: crop.en_wikipedia_url
|
||||
end
|
||||
|
||||
scenario "has a link to gardenate" do
|
||||
expect(page).to have_link "Gardenate - Planting reminders", href: "http://www.gardenate.com/plant/#{URI.escape crop.name}"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -108,12 +108,52 @@ describe Crop do
|
||||
end
|
||||
|
||||
context 'photos' do
|
||||
it 'has a default photo' do
|
||||
before :each do
|
||||
@crop = FactoryGirl.create(:tomato)
|
||||
@planting = FactoryGirl.create(:planting, crop: @crop)
|
||||
@photo = FactoryGirl.create(:photo)
|
||||
@planting.photos << @photo
|
||||
@crop.default_photo.should be_an_instance_of Photo
|
||||
end
|
||||
context 'with a planting photo' do
|
||||
before :each do
|
||||
@planting = FactoryGirl.create(:planting, crop: @crop)
|
||||
@photo = FactoryGirl.create(:photo)
|
||||
@planting.photos << @photo
|
||||
end
|
||||
|
||||
it 'has a default photo' do
|
||||
@crop.default_photo.should be_an_instance_of Photo
|
||||
@crop.default_photo.id.should eq @photo.id
|
||||
end
|
||||
end
|
||||
|
||||
context 'with a harvest photo' do
|
||||
before :each do
|
||||
@harvest = FactoryGirl.create(:harvest, crop: @crop)
|
||||
@photo = FactoryGirl.create(:photo)
|
||||
@harvest.photos << @photo
|
||||
end
|
||||
|
||||
it 'has a default photo' do
|
||||
@crop.default_photo.should be_an_instance_of Photo
|
||||
@crop.default_photo.id.should eq @photo.id
|
||||
end
|
||||
|
||||
context 'and planting photo' do
|
||||
before :each do
|
||||
@planting = FactoryGirl.create(:planting, crop: @crop)
|
||||
@planting_photo = FactoryGirl.create(:photo)
|
||||
@planting.photos << @planting_photo
|
||||
end
|
||||
|
||||
it 'should prefer the planting photo' do
|
||||
@crop.default_photo.id.should eq @planting_photo.id
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
context 'with no plantings or harvests' do
|
||||
it 'has no default photo' do
|
||||
@crop.default_photo.should eq nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -233,31 +233,72 @@ describe Harvest do
|
||||
|
||||
context 'photos' do
|
||||
|
||||
let(:harvest) { FactoryGirl.create(:harvest) }
|
||||
let(:photo) { FactoryGirl.create(:photo) }
|
||||
|
||||
before do
|
||||
harvest.photos << photo
|
||||
before :each do
|
||||
@harvest = FactoryGirl.create(:harvest)
|
||||
end
|
||||
|
||||
it 'has a photo' do
|
||||
harvest.photos.first.should eq photo
|
||||
context 'without a photo' do
|
||||
it 'should have no default photo' do
|
||||
@harvest.default_photo.should eq nil
|
||||
end
|
||||
|
||||
context 'and with a crop(planting) photo' do
|
||||
before :each do
|
||||
@photo = FactoryGirl.create(:photo)
|
||||
@planting = FactoryGirl.create(:planting, crop: @harvest.crop)
|
||||
@planting.photos << @photo
|
||||
end
|
||||
|
||||
it 'should have a default photo' do
|
||||
@harvest.default_photo.should eq @photo
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
it 'deletes association with photos when photo is deleted' do
|
||||
photo.destroy
|
||||
harvest.reload
|
||||
harvest.photos.should be_empty
|
||||
end
|
||||
context 'with a photo' do
|
||||
before do
|
||||
@photo = FactoryGirl.create(:photo)
|
||||
|
||||
it 'has a default photo' do
|
||||
harvest.default_photo.should eq photo
|
||||
end
|
||||
@harvest.photos << @photo
|
||||
end
|
||||
|
||||
it 'chooses the most recent photo' do
|
||||
@photo2 = FactoryGirl.create(:photo)
|
||||
harvest.photos << @photo2
|
||||
harvest.default_photo.should eq @photo2
|
||||
it 'has a photo' do
|
||||
@harvest.photos.first.should eq @photo
|
||||
end
|
||||
|
||||
it 'deletes association with photos when photo is deleted' do
|
||||
@photo.destroy
|
||||
@harvest.reload
|
||||
@harvest.photos.should be_empty
|
||||
end
|
||||
|
||||
it 'has a default photo' do
|
||||
@harvest.default_photo.should eq @photo
|
||||
end
|
||||
|
||||
context 'and with a crop(planting) photo' do
|
||||
before :each do
|
||||
@crop_photo = FactoryGirl.create(:photo)
|
||||
@planting = FactoryGirl.create(:planting, crop: @harvest.crop)
|
||||
@planting.photos << @crop_photo
|
||||
end
|
||||
|
||||
it 'should prefer the harvest photo' do
|
||||
@harvest.default_photo.should eq @photo
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
context 'and a second photo' do
|
||||
before :each do
|
||||
@photo2 = FactoryGirl.create(:photo)
|
||||
@harvest.photos << @photo2
|
||||
end
|
||||
|
||||
it 'chooses the most recent photo' do
|
||||
@harvest.default_photo.should eq @photo2
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -96,7 +96,7 @@ RSpec.configure do |config|
|
||||
|
||||
# controller specs require this to work with Devise
|
||||
# see https://github.com/plataformatec/devise/wiki/How-To%3a-Controllers-and-Views-tests-with-Rails-3-%28and-rspec%29
|
||||
config.include Devise::TestHelpers, type: :controller
|
||||
config.include Devise::Test::ControllerHelpers, type: :controller
|
||||
config.extend ControllerMacros, type: :controller
|
||||
|
||||
# Allow just create(:factory) instead of needing to specify FactoryGirl.create(:factory)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
RSpec.configure do |config|
|
||||
config.include Devise::TestHelpers, type: :controller
|
||||
config.include Devise::TestHelpers, type: :view
|
||||
config.include Devise::Test::ControllerHelpers, type: :controller
|
||||
config.include Devise::Test::ControllerHelpers, type: :view
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user