mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-05-29 11:15:29 -04:00
Compare commits
31 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0289786891 | ||
|
|
7dc66cb199 | ||
|
|
417602cb85 | ||
|
|
7a2760b086 | ||
|
|
9e0e21b565 | ||
|
|
a481cb7c06 | ||
|
|
a177a53d57 | ||
|
|
abbe9ee7ca | ||
|
|
48d2f0a224 | ||
|
|
074644d5c8 | ||
|
|
2e2e47d405 | ||
|
|
0544abcd8f | ||
|
|
73fb43fc4f | ||
|
|
532afafa0e | ||
|
|
378bd0d8f1 | ||
|
|
bb943fe0c6 | ||
|
|
28742d4936 | ||
|
|
d7e28e79fe | ||
|
|
322bca9281 | ||
|
|
7c081541eb | ||
|
|
475514a8f0 | ||
|
|
bb3fd3bcb7 | ||
|
|
5c86622823 | ||
|
|
fefd387481 | ||
|
|
93de9b35bc | ||
|
|
8044640023 | ||
|
|
ab29de3d04 | ||
|
|
9ae90c1b7e | ||
|
|
e7090631ab | ||
|
|
fadf5154e4 | ||
|
|
13ed098172 |
@@ -1,7 +1,13 @@
|
|||||||
.crop-icon {
|
.crop-icon {
|
||||||
height: 1em;
|
height: 1em;
|
||||||
}
|
}
|
||||||
|
.card-footer {
|
||||||
|
.btn-group-vertical {
|
||||||
|
.btn {
|
||||||
|
text-wrap: initial
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
.crop-thumbnail {
|
.crop-thumbnail {
|
||||||
.text {
|
.text {
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
// stats shown on homepage. eg. "999 members..."
|
// stats shown on homepage. eg. "999 members..."
|
||||||
.stats {
|
.stats {
|
||||||
font-weight: bold;
|
a {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.crops,
|
.crops,
|
||||||
|
|||||||
@@ -10,9 +10,33 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.navbar .nav > li {
|
#navbarSupportedContent {
|
||||||
|
ul {
|
||||||
|
flex-direction: column-reverse;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
|
||||||
|
li.nav-item {
|
||||||
|
display: block;
|
||||||
|
a {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 2em 1fr 2em;
|
||||||
|
}
|
||||||
|
a.dropdown-toggle::after {
|
||||||
|
width: 100%;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.crop-actions {
|
||||||
|
flex-direction: column;
|
||||||
|
width: 100%;
|
||||||
|
a {
|
||||||
|
margin: auto;
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.navbar .navbar-form {
|
.navbar .navbar-form {
|
||||||
padding-left: 0;
|
padding-left: 0;
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ body {
|
|||||||
|
|
||||||
.navbar {
|
.navbar {
|
||||||
flex-wrap: nowrap;
|
flex-wrap: nowrap;
|
||||||
|
align-items: flex-start
|
||||||
}
|
}
|
||||||
.navbar-brand {
|
.navbar-brand {
|
||||||
.site-name {
|
.site-name {
|
||||||
@@ -367,9 +368,6 @@ ul.thumbnail-buttons {
|
|||||||
h1 {
|
h1 {
|
||||||
font-size: 400%;
|
font-size: 400%;
|
||||||
}
|
}
|
||||||
.stats a {
|
|
||||||
color: $black;
|
|
||||||
}
|
|
||||||
|
|
||||||
// signup widget on homepage
|
// signup widget on homepage
|
||||||
.signup {
|
.signup {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ class GardensController < DataController
|
|||||||
def index
|
def index
|
||||||
@owner = Member.find_by(slug: params[:member_slug])
|
@owner = Member.find_by(slug: params[:member_slug])
|
||||||
@show_all = params[:all] == '1'
|
@show_all = params[:all] == '1'
|
||||||
@show_jump_to = params[:member_slug].present? ? true : false
|
@show_jump_to = params[:member_slug].present? || false
|
||||||
|
|
||||||
@gardens = @gardens.includes(:owner)
|
@gardens = @gardens.includes(:owner)
|
||||||
@gardens = @gardens.active unless @show_all
|
@gardens = @gardens.active unless @show_all
|
||||||
@@ -18,7 +18,7 @@ class GardensController < DataController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
@current_plantings = @garden.plantings.current.includes(:crop, :owner).order(planted_at: :desc)
|
@current_plantings = @garden.plantings.current.where.not(failed: true).includes(:crop, :owner).order(planted_at: :desc)
|
||||||
@current_activities = @garden.activities.current.includes(:owner).order(created_at: :desc)
|
@current_activities = @garden.activities.current.includes(:owner).order(created_at: :desc)
|
||||||
@finished_plantings = @garden.plantings.finished.includes(:crop)
|
@finished_plantings = @garden.plantings.finished.includes(:crop)
|
||||||
@suggested_companions = Crop.approved.where(
|
@suggested_companions = Crop.approved.where(
|
||||||
|
|||||||
@@ -19,9 +19,7 @@ class SeedsController < DataController
|
|||||||
where['parent_planting'] = @planting.id
|
where['parent_planting'] = @planting.id
|
||||||
end
|
end
|
||||||
|
|
||||||
if params[:tradeable_to].present?
|
where['tradeable_to'] = params[:tradeable_to] if params[:tradeable_to].present?
|
||||||
where['tradeable_to'] = params[:tradeable_to]
|
|
||||||
end
|
|
||||||
|
|
||||||
@show_all = (params[:all] == '1')
|
@show_all = (params[:all] == '1')
|
||||||
where['finished'] = false unless @show_all
|
where['finished'] = false unless @show_all
|
||||||
@@ -58,6 +56,7 @@ class SeedsController < DataController
|
|||||||
|
|
||||||
def create
|
def create
|
||||||
@seed = Seed.new(seed_params)
|
@seed = Seed.new(seed_params)
|
||||||
|
@seed.finished ||= false
|
||||||
@seed.owner = current_member
|
@seed.owner = current_member
|
||||||
@seed.crop = @seed.parent_planting.crop if @seed.parent_planting
|
@seed.crop = @seed.parent_planting.crop if @seed.parent_planting
|
||||||
flash[:notice] = "Successfully added #{@seed.crop} seed to your stash." if @seed.save
|
flash[:notice] = "Successfully added #{@seed.crop} seed to your stash." if @seed.save
|
||||||
|
|||||||
@@ -21,6 +21,10 @@ module ApplicationHelper
|
|||||||
classes
|
classes
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def count_github_contibutors
|
||||||
|
File.open(Rails.root.join('CONTRIBUTORS.md')).readlines.grep(/^-/).size
|
||||||
|
end
|
||||||
|
|
||||||
# Produces a cache key for uniquely identifying cached fragments.
|
# Produces a cache key for uniquely identifying cached fragments.
|
||||||
def cache_key_for(klass, identifier = "all")
|
def cache_key_for(klass, identifier = "all")
|
||||||
count = klass.count
|
count = klass.count
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ module ButtonsHelper
|
|||||||
link_to t('buttons.mark_as_inactive'),
|
link_to t('buttons.mark_as_inactive'),
|
||||||
garden_path(garden, garden: { active: 0 }),
|
garden_path(garden, garden: { active: 0 }),
|
||||||
method: :put, class: classes,
|
method: :put, class: classes,
|
||||||
data: { confirm: 'All plantings associated with this garden will be marked as finished. Are you sure?' }
|
data: { confirm: I18n.t('gardens.confirm_deactivate') }
|
||||||
end
|
end
|
||||||
|
|
||||||
def create_button(model_to_create, path, icon, label)
|
def create_button(model_to_create, path, icon, label)
|
||||||
|
|||||||
@@ -39,10 +39,6 @@ module OpenFarmData
|
|||||||
fetch_attr('common_names')
|
fetch_attr('common_names')
|
||||||
end
|
end
|
||||||
|
|
||||||
def guides_count
|
|
||||||
fetch_attr('guides_count')
|
|
||||||
end
|
|
||||||
|
|
||||||
def binomial_name
|
def binomial_name
|
||||||
fetch_attr('binomial_name')
|
fetch_attr('binomial_name')
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -94,9 +94,9 @@ module PredictPlanting
|
|||||||
private
|
private
|
||||||
|
|
||||||
def calculate_percentage_grown
|
def calculate_percentage_grown
|
||||||
return 0 if age_in_days < 0
|
return 0 if age_in_days.to_i < 0
|
||||||
|
|
||||||
percent = (age_in_days / expected_lifespan.to_f) * 100
|
percent = (age_in_days.to_f / expected_lifespan.to_f) * 100
|
||||||
(percent > 100 ? 100 : percent)
|
(percent > 100 ? 100 : percent)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -59,7 +59,8 @@ module SearchSeeds
|
|||||||
search('*', limit:,
|
search('*', limit:,
|
||||||
where: {
|
where: {
|
||||||
finished: false,
|
finished: false,
|
||||||
tradable: true
|
tradable: true,
|
||||||
|
_or: [{ plant_before: nil }, { plant_before: { lt: Date.today } }]
|
||||||
},
|
},
|
||||||
boost_by: [:created_at],
|
boost_by: [:created_at],
|
||||||
load: false)
|
load: false)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
- if crop.approved? && signed_in?
|
- if crop.approved? && signed_in?
|
||||||
|
|
||||||
.btn-group{"aria-label" => "Crop Actions", role: "group"}
|
.btn-group.crop-actions{"aria-label" => "Crop Actions", role: "group"}
|
||||||
= render 'plantings/modal', planting: Planting.new(crop: crop, owner: current_member)
|
= render 'plantings/modal', planting: Planting.new(crop: crop, owner: current_member)
|
||||||
= render 'harvests/modal', harvest: Harvest.new(crop: @crop, owner: current_member)
|
= render 'harvests/modal', harvest: Harvest.new(crop: @crop, owner: current_member)
|
||||||
= render 'seeds/modal', seed: Seed.new(crop: @crop, owner: current_member)
|
= render 'seeds/modal', seed: Seed.new(crop: @crop, owner: current_member)
|
||||||
|
|||||||
@@ -25,9 +25,9 @@
|
|||||||
Last harvest expected
|
Last harvest expected
|
||||||
%strong= crop.median_days_to_last_harvest
|
%strong= crop.median_days_to_last_harvest
|
||||||
days after planting
|
days after planting
|
||||||
- if member_signed_in?
|
- if member_signed_in?
|
||||||
.card-footer
|
.card-footer
|
||||||
.d-flex.justify-content-between
|
.d-flex.btn-group-vertical
|
||||||
= render 'plantings/modal', planting: Planting.new(crop: crop, owner: current_member)
|
= render 'plantings/modal', planting: Planting.new(crop: crop, owner: current_member)
|
||||||
- #= render 'harvests/modal', harvest: Harvest.new(crop: crop, owner: current_member)
|
- #= render 'harvests/modal', harvest: Harvest.new(crop: crop, owner: current_member)
|
||||||
= render 'seeds/modal', seed: Seed.new(crop: crop, owner: current_member)
|
= render 'seeds/modal', seed: Seed.new(crop: crop, owner: current_member)
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
- if crop.guides_count.present? && crop.guides_count.positive?
|
|
||||||
%p
|
|
||||||
There are
|
|
||||||
= link_to "https://openfarm.cc/en/crops/#{CGI.escape @crop.name.gsub(' ', '-').downcase}" do
|
|
||||||
#{crop.guides_count} growing guides on Open Farm
|
|
||||||
|
|
||||||
@@ -74,7 +74,6 @@
|
|||||||
.card-body
|
.card-body
|
||||||
%h4 How to grow #{@crop.name.pluralize}
|
%h4 How to grow #{@crop.name.pluralize}
|
||||||
= render 'grown_for', crop: @crop
|
= render 'grown_for', crop: @crop
|
||||||
= render 'planting_advice', crop: @crop
|
|
||||||
- if @crop.parent
|
- if @crop.parent
|
||||||
%hr/
|
%hr/
|
||||||
%p.parent-crop
|
%p.parent-crop
|
||||||
@@ -124,13 +123,6 @@
|
|||||||
= icon 'fas', 'external-link-alt'
|
= icon 'fas', 'external-link-alt'
|
||||||
Wikipedia (English)
|
Wikipedia (English)
|
||||||
|
|
||||||
%li.list-group-item
|
|
||||||
= link_to "https://openfarm.cc/en/crops/#{CGI.escape @crop.name.gsub(' ', '-')}",
|
|
||||||
class: 'card-link',
|
|
||||||
target: "_blank",
|
|
||||||
rel: "noopener noreferrer" do
|
|
||||||
= icon 'fas', 'external-link-alt'
|
|
||||||
OpenFarm - Growing guide
|
|
||||||
%li.list-group-item
|
%li.list-group-item
|
||||||
= link_to "https://www.gardenate.com/plant/#{CGI.escape @crop.name}",
|
= link_to "https://www.gardenate.com/plant/#{CGI.escape @crop.name}",
|
||||||
target: "_blank",
|
target: "_blank",
|
||||||
|
|||||||
@@ -15,5 +15,4 @@
|
|||||||
|
|
||||||
- if can?(:destroy, garden)
|
- if can?(:destroy, garden)
|
||||||
.dropdown-divider
|
.dropdown-divider
|
||||||
= delete_button(garden, classes: 'dropdown-item text-danger',
|
= delete_button(garden, classes: 'dropdown-item text-danger', message: 'gardens.confirm_delete')
|
||||||
message: 'All plantings associated with this garden will also be deleted. Are you sure?')
|
|
||||||
|
|||||||
@@ -66,8 +66,7 @@
|
|||||||
|
|
||||||
- if can?(:destroy, @garden)
|
- if can?(:destroy, @garden)
|
||||||
.dropdown-divider
|
.dropdown-divider
|
||||||
= delete_button(@garden, classes: 'dropdown-item text-danger',
|
= delete_button(@garden, classes: 'dropdown-item text-danger', message: 'gardens.confirm_delete')
|
||||||
message: 'All plantings associated with this garden will also be deleted. Are you sure?')
|
|
||||||
|
|
||||||
%section
|
%section
|
||||||
%h2 Current activities in garden
|
%h2 Current activities in garden
|
||||||
|
|||||||
@@ -4,6 +4,6 @@
|
|||||||
member: link_to(t('.member_linktext', count: Member.confirmed.size.to_i), members_path),
|
member: link_to(t('.member_linktext', count: Member.confirmed.size.to_i), members_path),
|
||||||
number_crops: link_to(t('.number_crops_linktext', count: Crop.count.to_i), crops_path),
|
number_crops: link_to(t('.number_crops_linktext', count: Crop.count.to_i), crops_path),
|
||||||
number_plantings: link_to(t('.number_plantings_linktext', count: Planting.count.to_i), plantings_path),
|
number_plantings: link_to(t('.number_plantings_linktext', count: Planting.count.to_i), plantings_path),
|
||||||
number_gardens: link_to(t('.number_gardens_linktext', count: Garden.count.to_i), gardens_path))
|
number_gardens: link_to(t('.number_gardens_linktext', count: Garden.count.to_i), gardens_path),
|
||||||
|
contributors: link_to(count_github_contibutors, 'http://github.com/Growstuff/growstuff/CONTRIBUTORS.md', target: '_blank', rel: 'noopener'),
|
||||||
|
github: link_to('GitHub', 'http://github.com/Growstuff/growstuff', target: '_blank', rel: 'noopener'))
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
%p= render 'stats', cached: true
|
%p= render 'stats', cached: true
|
||||||
.col
|
.col
|
||||||
|
%br
|
||||||
%p
|
%p
|
||||||
- if current_member.plantings.active.any?
|
- if current_member.plantings.active.any?
|
||||||
= link_to member_path(current_member, anchor: "#content"), class: 'btn btn-dark' do
|
= link_to member_path(current_member, anchor: "#content"), class: 'btn btn-dark' do
|
||||||
@@ -61,3 +62,16 @@
|
|||||||
%section.members
|
%section.members
|
||||||
= cute_icon
|
= cute_icon
|
||||||
= render 'members', cached: true
|
= render 'members', cached: true
|
||||||
|
.col-12.col-lg-6
|
||||||
|
%section.pwa-install
|
||||||
|
= cute_icon
|
||||||
|
%h2.text-center= t('home.pwa_title')
|
||||||
|
.index-cards
|
||||||
|
.card
|
||||||
|
.card-body
|
||||||
|
%h3= t('home.pwa_ios_title')
|
||||||
|
%p= t('home.pwa_ios_steps_html')
|
||||||
|
.card
|
||||||
|
.card-body
|
||||||
|
%h3= t('home.pwa_android_title')
|
||||||
|
%p= t('home.pwa_android_steps_html')
|
||||||
@@ -6,6 +6,6 @@
|
|||||||
%span.site-name Growstuff
|
%span.site-name Growstuff
|
||||||
.nav= render 'crops/search_bar'
|
.nav= render 'crops/search_bar'
|
||||||
.nav
|
.nav
|
||||||
%button.navbar-toggler{ "aria-controls" => "navbarSupportedContent", "aria-expanded" => "false", "aria-label" => "Toggle navigation", "data-bs-target" => "#navbarSupportedContent", "data-bs-toggle" => "collapse", type: "button" }
|
%button.navbar-toggler.ml-auto{ "aria-controls" => "navbarSupportedContent", "aria-expanded" => "false", "aria-label" => "Toggle navigation", "data-bs-target" => "#navbarSupportedContent", "data-bs-toggle" => "collapse", type: "button" }
|
||||||
%i.fas.fa-ellipsis-v.navbar-toggler-icon
|
%span.navbar-toggler-icon
|
||||||
= render 'layouts/menu'
|
= render 'layouts/menu'
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#navbarSupportedContent.collapse.navbar-collapse
|
#navbarSupportedContent.collapse.navbar-collapse
|
||||||
%ul.navbar-nav.mr-auto
|
%ul.navbar-nav.mr-auto.bg-dark
|
||||||
- if signed_in?
|
- if signed_in?
|
||||||
%li.nav-item
|
%li.nav-item
|
||||||
= link_to timeline_index_path, method: :get, class: 'nav-link text-white' do
|
= link_to timeline_index_path, method: :get, class: 'nav-link text-white' do
|
||||||
@@ -30,7 +30,9 @@
|
|||||||
|
|
||||||
- cache("everyone-menu", expires_in: 1.week) do
|
- cache("everyone-menu", expires_in: 1.week) do
|
||||||
%li.nav-item.dropdown
|
%li.nav-item.dropdown
|
||||||
%a.nav-link.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-bs-toggle" => "dropdown", href: "#", role: "button"}= t('.crops')
|
%a.nav-link.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-bs-toggle" => "dropdown", href: "#", role: "button"}
|
||||||
|
%span
|
||||||
|
= t('.crops')
|
||||||
.dropdown-menu
|
.dropdown-menu
|
||||||
= link_to crops_path, class: 'dropdown-item' do
|
= link_to crops_path, class: 'dropdown-item' do
|
||||||
= t('.browse_crops')
|
= t('.browse_crops')
|
||||||
@@ -44,7 +46,9 @@
|
|||||||
= harvest_icon
|
= harvest_icon
|
||||||
= t('.harvests')
|
= t('.harvests')
|
||||||
%li.nav-item.dropdown
|
%li.nav-item.dropdown
|
||||||
%a.nav-link.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-bs-toggle" => "dropdown", href: "#", role: "button"}= t('.community')
|
%a.nav-link.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-bs-toggle" => "dropdown", href: "#", role: "button"}
|
||||||
|
%span
|
||||||
|
= t('.community')
|
||||||
.dropdown-menu{"aria-labelledby" => "navbarDropdown"}
|
.dropdown-menu{"aria-labelledby" => "navbarDropdown"}
|
||||||
= link_to t('.community_map'), places_path, class: 'dropdown-item'
|
= link_to t('.community_map'), places_path, class: 'dropdown-item'
|
||||||
= link_to t('.browse_members'), members_path, class: 'dropdown-item'
|
= link_to t('.browse_members'), members_path, class: 'dropdown-item'
|
||||||
@@ -54,7 +58,9 @@
|
|||||||
- if member_signed_in?
|
- if member_signed_in?
|
||||||
- if current_member.role?(:crop_wrangler) || current_member.role?(:admin)
|
- if current_member.role?(:crop_wrangler) || current_member.role?(:admin)
|
||||||
%li.nav-item.dropdown
|
%li.nav-item.dropdown
|
||||||
%a.nav-link.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-bs-toggle" => "dropdown", href: "#", role: "button"}= t('.admin')
|
%a.nav-link.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-bs-toggle" => "dropdown", href: "#", role: "button"}
|
||||||
|
%span
|
||||||
|
= t('.admin')
|
||||||
.dropdown-menu{"aria-labelledby" => "navbarDropdown"}
|
.dropdown-menu{"aria-labelledby" => "navbarDropdown"}
|
||||||
- if current_member.role?(:crop_wrangler)
|
- if current_member.role?(:crop_wrangler)
|
||||||
= link_to t('.crop_wrangling'), wrangle_crops_path, class: 'dropdown-item'
|
= link_to t('.crop_wrangling'), wrangle_crops_path, class: 'dropdown-item'
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
- cache member do
|
- cache member do
|
||||||
.card.card-double
|
.card
|
||||||
.card-body
|
.card-body
|
||||||
%h4.login-name= link_to member, member
|
%h4.login-name= link_to member, member
|
||||||
%div
|
%div
|
||||||
|
|||||||
@@ -82,8 +82,8 @@
|
|||||||
.col-md-10#content
|
.col-md-10#content
|
||||||
.row
|
.row
|
||||||
%section.order-3.order-md-1.col-12= render "map", member: @member
|
%section.order-3.order-md-1.col-12= render "map", member: @member
|
||||||
- if @harvesting.size.positive?
|
- if @harvesting.size.positive?
|
||||||
%section.harvests.order-2.order-md-1
|
%section.harvests.order-2.order-md-1.col-12
|
||||||
%h2 Ready to harvest
|
%h2 Ready to harvest
|
||||||
.index-cards
|
.index-cards
|
||||||
- @harvesting.each do |planting|
|
- @harvesting.each do |planting|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
- if planting.finish_is_predicatable?
|
- if planting.finish_is_predicatable?
|
||||||
.card.fact-card
|
.card.fact-card
|
||||||
%h3 Progress
|
%h3 Progress
|
||||||
- if planting.age_in_days < 0
|
- if planting.age_in_days.to_i < 0
|
||||||
%strong Planned
|
%strong Planned
|
||||||
- else
|
- else
|
||||||
%strong #{planting.age_in_days}/#{planting.expected_lifespan}
|
%strong #{planting.age_in_days}/#{planting.expected_lifespan}
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
%h3 Growing
|
%h3 Growing
|
||||||
%strong= seedling_icon
|
%strong= seedling_icon
|
||||||
%span
|
%span
|
||||||
- if planting.age_in_days < 0
|
- if planting.age_in_days.to_i < 0
|
||||||
Planting planned
|
Planting planned
|
||||||
- else
|
- else
|
||||||
Planting is still growing today
|
Planting is still growing today
|
||||||
|
|||||||
@@ -39,10 +39,10 @@
|
|||||||
- elsif @planting.percentage_grown.present?
|
- elsif @planting.percentage_grown.present?
|
||||||
#{@planting.percentage_grown.to_i}%
|
#{@planting.percentage_grown.to_i}%
|
||||||
- if @planting.finish_is_predicatable?
|
- if @planting.finish_is_predicatable?
|
||||||
- if @planting.age_in_days < 0
|
- if @planting.age_in_days.to_i < 0
|
||||||
%strong Planned
|
%strong Planned
|
||||||
- else
|
- else
|
||||||
%strong #{@planting.age_in_days}/#{@planting.expected_lifespan} days
|
%strong #{@planting.age_in_days.to_i}/#{@planting.expected_lifespan} days
|
||||||
|
|
||||||
= render 'timeline', planting: @planting
|
= render 'timeline', planting: @planting
|
||||||
= render 'likes/likes', object: @planting
|
= render 'likes/likes', object: @planting
|
||||||
|
|||||||
@@ -16,14 +16,20 @@
|
|||||||
%p
|
%p
|
||||||
- if seed.quantity
|
- if seed.quantity
|
||||||
.badge.badge-info #{seed.quantity} seeds
|
.badge.badge-info #{seed.quantity} seeds
|
||||||
- if seed.organic != 'unknown'
|
%ul
|
||||||
.badge.badge-success.seedtitle--organic= seed.organic
|
- if seed.organic != 'unknown'
|
||||||
- if seed.gmo != 'unknown'
|
%li
|
||||||
.badge.badge-success.seedtitle--gmo= seed.gmo
|
%small.seedtitle--organic= seed.organic
|
||||||
- if seed.heirloom != 'unknown'
|
- if seed.gmo != 'unknown'
|
||||||
.badge.badge-success.seedtitle--heirloom= seed.heirloom
|
%li
|
||||||
- if seed.tradable
|
%small.seedtitle--gmo= seed.gmo
|
||||||
.card-footer
|
- if seed.heirloom != 'unknown'
|
||||||
.d-flex.w-100.justify-content-between
|
%li
|
||||||
|
%small.seedtitle--heirloom= seed.heirloom
|
||||||
|
|
||||||
|
.card-footer
|
||||||
|
.d-flex.w-100.justify-content-between
|
||||||
|
- if seed.tradable
|
||||||
%small Will trade #{seed.tradable_to}
|
%small Will trade #{seed.tradable_to}
|
||||||
/ %a.btn.btn-sm{href: "#"} Request
|
- if seed.plant_before
|
||||||
|
%small Plant before #{seed.plant_before}
|
||||||
|
|||||||
@@ -123,6 +123,8 @@ en:
|
|||||||
no_plantings: no plantings
|
no_plantings: no plantings
|
||||||
plantingsthumbnail: plantings/thumbnail
|
plantingsthumbnail: plantings/thumbnail
|
||||||
updated: Garden was successfully updated.
|
updated: Garden was successfully updated.
|
||||||
|
confirm_delete: All plantings associated with this garden will also be deleted. Are you sure?
|
||||||
|
confirm_deactivate: All plantings associated with this garden will be marked as finished. Are you sure?
|
||||||
harvests:
|
harvests:
|
||||||
created: Harvest was successfully created.
|
created: Harvest was successfully created.
|
||||||
harvest_something: Harvest something
|
harvest_something: Harvest something
|
||||||
@@ -175,7 +177,6 @@ en:
|
|||||||
Our team includes volunteers from all walks of life and all skill levels. To get involved,
|
Our team includes volunteers from all walks of life and all skill levels. To get involved,
|
||||||
visit %{talk_link} or find more information on the %{wiki_link}.
|
visit %{talk_link} or find more information on the %{wiki_link}.
|
||||||
get_involved_title: Get Involved
|
get_involved_title: Get Involved
|
||||||
github_linktext: Github
|
|
||||||
open_data_body_html: >
|
open_data_body_html: >
|
||||||
We're building a database of crops, planting advice, seed sources, and other information that anyone
|
We're building a database of crops, planting advice, seed sources, and other information that anyone
|
||||||
can use for free, under a %{creative_commons_link}. You can use this data for research, to build apps,
|
can use for free, under a %{creative_commons_link}. You can use this data for research, to build apps,
|
||||||
@@ -207,10 +208,15 @@ en:
|
|||||||
view_all: View all seeds
|
view_all: View all seeds
|
||||||
stats:
|
stats:
|
||||||
member_linktext: "%{count} members"
|
member_linktext: "%{count} members"
|
||||||
message_html: So far, %{member} have planted %{number_crops} %{number_plantings} in %{number_gardens}.
|
message_html: So far, %{member} have planted %{number_crops} %{number_plantings} in %{number_gardens}; and %{contributors} people have contributed to our code on %{github}!
|
||||||
number_crops_linktext: "%{count} crops"
|
number_crops_linktext: "%{count} crops"
|
||||||
number_gardens_linktext: "%{count} gardens"
|
number_gardens_linktext: "%{count} gardens"
|
||||||
number_plantings_linktext: "%{count} times"
|
number_plantings_linktext: "%{count} times"
|
||||||
|
pwa_android_steps_html: 1. Tap the three dots in the top right corner of Chrome.<br>2. Tap <strong>Install app</strong> or <strong>Add to Home screen</strong>.
|
||||||
|
pwa_android_title: For Android
|
||||||
|
pwa_ios_steps_html: 1. Tap the <strong>Share</strong> button in Safari.<br>2. Scroll down and tap <strong>Add to Home Screen</strong>'.
|
||||||
|
pwa_ios_title: For iOS (iPhone/iPad)
|
||||||
|
pwa_title: Want to install Growstuff on your phone?
|
||||||
label:
|
label:
|
||||||
days_until_harvest: "%{number} days"
|
days_until_harvest: "%{number} days"
|
||||||
weeks_until_harvest: "%{number} weeks until harvest"
|
weeks_until_harvest: "%{number} weeks until harvest"
|
||||||
|
|||||||
@@ -173,7 +173,8 @@ def load_test_users
|
|||||||
organic: select_random_item(Seed::ORGANIC_VALUES),
|
organic: select_random_item(Seed::ORGANIC_VALUES),
|
||||||
gmo: select_random_item(['certified GMO-free', 'non-certified GMO-free', 'GMO', 'unknown']), # Strangely, this doesn't want to work as Seed:GMO_VALUES
|
gmo: select_random_item(['certified GMO-free', 'non-certified GMO-free', 'GMO', 'unknown']), # Strangely, this doesn't want to work as Seed:GMO_VALUES
|
||||||
heirloom: select_random_item(Seed::HEIRLOOM_VALUES),
|
heirloom: select_random_item(Seed::HEIRLOOM_VALUES),
|
||||||
parent_planting: @user.plantings.first
|
parent_planting: @user.plantings.first,
|
||||||
|
finished: false
|
||||||
)
|
)
|
||||||
|
|
||||||
photo = Photo.create!(
|
photo = Photo.create!(
|
||||||
|
|||||||
@@ -76,10 +76,6 @@ describe "crop detail page", :js do
|
|||||||
expect(page).to have_link "Wikipedia (English)", href: crop.en_wikipedia_url
|
expect(page).to have_link "Wikipedia (English)", href: crop.en_wikipedia_url
|
||||||
end
|
end
|
||||||
|
|
||||||
it "has a link to OpenFarm" do
|
|
||||||
expect(page).to have_link "OpenFarm - Growing guide"
|
|
||||||
end
|
|
||||||
|
|
||||||
it "has a link to gardenate" do
|
it "has a link to gardenate" do
|
||||||
expect(page).to have_link "Gardenate - Planting reminders",
|
expect(page).to have_link "Gardenate - Planting reminders",
|
||||||
href: "https://www.gardenate.com/plant/#{CGI.escape crop.name}"
|
href: "https://www.gardenate.com/plant/#{CGI.escape crop.name}"
|
||||||
@@ -144,7 +140,7 @@ describe "crop detail page", :js do
|
|||||||
let(:crop) { FactoryBot.create(:annual_crop) }
|
let(:crop) { FactoryBot.create(:annual_crop) }
|
||||||
|
|
||||||
describe 'with harvests' do
|
describe 'with harvests' do
|
||||||
include_examples "predicts harvest"
|
it_behaves_like "predicts harvest"
|
||||||
end
|
end
|
||||||
|
|
||||||
it "predicts lifespan" do
|
it "predicts lifespan" do
|
||||||
@@ -165,7 +161,7 @@ describe "crop detail page", :js do
|
|||||||
end
|
end
|
||||||
|
|
||||||
describe 'with harvests' do
|
describe 'with harvests' do
|
||||||
include_examples "predicts harvest"
|
it_behaves_like "predicts harvest"
|
||||||
end
|
end
|
||||||
|
|
||||||
it "describes Perennial crops" do
|
it "describes Perennial crops" do
|
||||||
@@ -181,7 +177,7 @@ describe "crop detail page", :js do
|
|||||||
end
|
end
|
||||||
|
|
||||||
describe 'with harvests' do
|
describe 'with harvests' do
|
||||||
include_examples "predicts harvest"
|
it_behaves_like "predicts harvest"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -85,21 +85,22 @@ describe "home page", :search do
|
|||||||
end
|
end
|
||||||
|
|
||||||
context 'when anonymous' do
|
context 'when anonymous' do
|
||||||
include_examples 'show crops'
|
it_behaves_like 'show crops'
|
||||||
include_examples 'show plantings'
|
it_behaves_like 'show plantings'
|
||||||
include_examples 'show harvests'
|
it_behaves_like 'show harvests'
|
||||||
include_examples 'shows seeds'
|
it_behaves_like 'shows seeds'
|
||||||
include_examples 'is accessible'
|
it_behaves_like 'is accessible'
|
||||||
it { is_expected.to have_text 'community of food gardeners' }
|
it { is_expected.to have_text 'community of food gardeners' }
|
||||||
|
it { is_expected.to have_text 'Want to install Growstuff on your phone?' }
|
||||||
end
|
end
|
||||||
|
|
||||||
context "when signed in" do
|
context "when signed in" do
|
||||||
include_context 'signed in member'
|
include_context 'signed in member'
|
||||||
include_examples 'show crops'
|
it_behaves_like 'show crops'
|
||||||
include_examples 'show plantings'
|
it_behaves_like 'show plantings'
|
||||||
include_examples 'show harvests'
|
it_behaves_like 'show harvests'
|
||||||
include_examples 'shows seeds'
|
it_behaves_like 'shows seeds'
|
||||||
include_examples 'is accessible'
|
it_behaves_like 'is accessible'
|
||||||
|
|
||||||
describe 'should say welcome' do
|
describe 'should say welcome' do
|
||||||
before { visit root_path }
|
before { visit root_path }
|
||||||
|
|||||||
Reference in New Issue
Block a user