Dry the gglypicons

This commit is contained in:
Brenda Wallace
2019-01-21 14:13:12 +13:00
parent 30255a24d2
commit 6c16dca9b4
8 changed files with 9 additions and 8 deletions

View File

@@ -0,0 +1 @@
%span{class: "glyphicon.glyphicon-#{icon}", title: t(title) }

View File

@@ -1,4 +1,4 @@
- if can?(:create, Photo)
= link_to path, class: 'btn btn-default btn-xs' do
%span.glyphicon.glyphicon-camera{ title: t('buttons.add_photo') }
= render 'shared/glyphicon', icon: 'camera', title: 'buttons.add_photo'
=t('buttons.add_photo')

View File

@@ -1,4 +1,4 @@
= link_to path, method: :delete,
data: { confirm: t(:are_you_sure?) }, class: 'btn btn-default btn-xs' do
%span.glyphicon.glyphicon-trash{ title: t('buttons.delete') }
= render 'shared/glyphicon', icon: 'trash', title: 'buttons.delete'
=t('buttons.delete')

View File

@@ -1,3 +1,3 @@
= link_to path, class: 'btn btn-default btn-xs' do
%span.glyphicon.glyphicon-pencil{ title: t('buttons.edit') }
= render 'shared/glyphicon', icon: 'pencil', title: 'buttons.edit'
=t('buttons.edit')

View File

@@ -1,5 +1,5 @@
- if can?(:edit, planting) && !planting.finished
= link_to planting_path(planting, planting: { finished: 1 }),
method: :put, class: 'btn btn-default btn-xs append-date' do
%span.glyphicon.glyphicon-ok{ title: t('buttons.finished') }
=t('buttons.mark_as_finished')
= render 'shared/glyphicon', icon: 'ok', title: 'buttons.finished'
= t('buttons.mark_as_finished')

View File

@@ -1,5 +1,5 @@
- unless seed.finished
= link_to seed_path(seed, seed: { finished: 1 }),
method: :put, class: 'btn btn-default btn-xs append-date' do
%span.glyphicon.glyphicon-ok{ title: t('buttons.finished') }
= render 'shared/glyphicon', icon: 'ok', title: 'buttons.finished'
=t('buttons.mark_as_finished')

View File

@@ -1,4 +1,4 @@
- planting.active? && if can?(:create, Harvest) && can?(:edit, planting)
= link_to new_planting_harvest_path(planting), class: 'btn btn-default btn-xs' do
%span.glyphicon.glyphicon-leaf{ title: = t('buttons.harvest') }
= render 'shared/glyphicon', icon: 'leaf', title: 'buttons.harvest'
= t('buttons.harvest')

View File

@@ -1,4 +1,4 @@
- if planting.active?
= link_to new_planting_seed_path(planting), class: 'btn btn-default btn-xs' do
%span.glyphicon.glyphicon-heart{ title: t('buttons.save_seeds') }
= render 'shared/glyphicon', icon: 'heart', title: 'buttons.save_seeds'
= t('buttons.save_seeds')