mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-03-27 11:14:31 -04:00
DRY the icons
This commit is contained in:
17
app/helpers/icons_helper.rb
Normal file
17
app/helpers/icons_helper.rb
Normal file
@@ -0,0 +1,17 @@
|
||||
module IconsHelper
|
||||
def garden_icon
|
||||
icon('far', 'square')
|
||||
end
|
||||
|
||||
def planting_icon
|
||||
icon('fas', 'seedling')
|
||||
end
|
||||
|
||||
def harvest_icon
|
||||
icon('fas', 'carrot')
|
||||
end
|
||||
|
||||
def seed_icon
|
||||
icon('fas', 'heart')
|
||||
end
|
||||
end
|
||||
@@ -2,12 +2,15 @@
|
||||
.btn-group
|
||||
- if can? :create, Planting
|
||||
= link_to new_planting_path(crop_id: crop.id), class: 'btn btn-default' do
|
||||
= planting_icon
|
||||
= t('buttons.plant_crop', crop_name: crop.name)
|
||||
|
||||
- if can? :create, Harvest
|
||||
= link_to new_harvest_path(crop_id: crop.id), class: 'btn btn-default' do
|
||||
= harvest_icon
|
||||
= t('buttons.harvest_crop', crop_name: crop.name)
|
||||
|
||||
|
||||
- if can? :create, Seed
|
||||
= link_to new_seed_path(crop_id: crop.id), class: 'btn btn-default' do
|
||||
= seed_icon
|
||||
= t('buttons.add_seed_to_stash', crop_name: crop.name)
|
||||
|
||||
@@ -1,19 +1,22 @@
|
||||
- if signed_in?
|
||||
.global-actions
|
||||
.global-actions.pull-right
|
||||
.btn-group
|
||||
= link_to gardens_by_owner_path(owner: current_member.slug), class: 'btn btn-default' do
|
||||
= t('links.my_gardens')
|
||||
|
||||
= garden_icon
|
||||
= t('links.my_gardens')
|
||||
|
||||
.btn-group
|
||||
= link_to new_planting_path, class: 'btn btn-default' do
|
||||
= planting_icon
|
||||
= t('plantings.plant_something')
|
||||
|
||||
= link_to new_harvest_path, class: 'btn btn-default' do
|
||||
= harvest_icon
|
||||
= t('harvests.harvest_something')
|
||||
|
||||
= link_to new_seed_path, class: 'btn btn-default' do
|
||||
= seed_icon
|
||||
= t('buttons.save_seeds')
|
||||
|
||||
.btn-group
|
||||
= link_to t('posts.write_blog_post'), new_post_path, class: 'btn btn-default'
|
||||
|
||||
- content_for(:attributions) do
|
||||
seed by Template from the Noun Project
|
||||
Reference in New Issue
Block a user