mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-05-14 11:15:48 -04:00
Dry the gglypicons
This commit is contained in:
1
app/views/shared/_glyphicon.html.haml
Normal file
1
app/views/shared/_glyphicon.html.haml
Normal file
@@ -0,0 +1 @@
|
||||
%span{class: "glyphicon.glyphicon-#{icon}", title: t(title) }
|
||||
@@ -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')
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user