mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-11-02 11:14:23 -05:00
Remove unused garden_plant_something_button and adjust layout in garden show view to enhance planting suggestions display
This commit is contained in:
1 parent
4576b1a2ed
commit
d1fac8f24f
2 files changed
+10
-16
No files matched your search
@@ -4,14 +4,6 @@ module ButtonsHelper
|
||||
include IconsHelper
|
||||
include PhotosHelper
|
||||
|
||||
def garden_plant_something_button(garden, classes: "btn btn-outline-secondary")
|
||||
return unless can? :edit, garden
|
||||
|
||||
link_to new_planting_path(garden_id: garden.id), class: classes do
|
||||
planting_icon + ' ' + t('buttons.plant_something_here')
|
||||
end
|
||||
end
|
||||
|
||||
def garden_plan_something_button(garden, classes: "btn btn-outline-secondary")
|
||||
return unless can? :edit, garden
|
||||
|
||||
|
||||
@@ -39,6 +39,10 @@
|
||||
- if can? :edit, @garden
|
||||
= link_to 'Set it to active', edit_garden_path(@garden)
|
||||
to plant something in this garden.
|
||||
- if @suggestion_count&.positive?
|
||||
.mb-3
|
||||
= render 'jobs/ideas_banner', href: suggestions_path, open: false,
|
||||
text: t('.suggested_plantings', count: @suggestion_count), go: t('.suggested_plantings_go')
|
||||
- if @garden.active
|
||||
-# Points people at the layout page, showing either the current bed map or a teaser to create one.
|
||||
= link_to layout_member_garden_path(@garden.owner, @garden), class: 'garden-layout-teaser' do
|
||||
@@ -102,7 +106,12 @@
|
||||
= render 'plantings/progress_list', plantings: @garden.plantings.active.limit(10)
|
||||
|
||||
%section
|
||||
%h2 Current plantings in garden
|
||||
.section-header
|
||||
%h2 Current plantings in garden
|
||||
- if can?(:edit, @garden)
|
||||
= link_to new_planting_path(garden_id: @garden.id), class: 'btn btn-sm section-add' do
|
||||
= icon 'fas', 'plus'
|
||||
add
|
||||
.index-cards
|
||||
- if @current_plantings.size.positive?
|
||||
- @current_plantings.each do |planting|
|
||||
@@ -110,13 +119,6 @@
|
||||
- else
|
||||
.col-md-12
|
||||
%p Nothing is currently planted here.
|
||||
- if can?(:edit, @garden)
|
||||
.col-md-12
|
||||
= garden_plant_something_button(@garden)
|
||||
- if @suggestion_count&.positive?
|
||||
.col-md-12
|
||||
= render 'jobs/ideas_banner', href: suggestions_path, open: false,
|
||||
text: t('.suggested_plantings', count: @suggestion_count), go: t('.suggested_plantings_go')
|
||||
|
||||
- if @notepad
|
||||
%section
|
||||
|
||||
Reference in new issue
Block a user