Add ModsDecorator#form_title
parent
648a5438f9
commit
3e9edc1a17
|
@ -167,6 +167,14 @@ class ModDecorator < Draper::Decorator
|
|||
'factoriomods://' + Base64.strict_encode64(json_mod).to_s
|
||||
end
|
||||
|
||||
def form_title
|
||||
if mod.new_record?
|
||||
I18n.t('mods.new.new')
|
||||
else
|
||||
h.raw(I18n.t('mods.new.edit') + ' ' + h.link_to(mod.name, mod))
|
||||
end
|
||||
end
|
||||
|
||||
### Download button
|
||||
###################
|
||||
|
||||
|
|
|
@ -1,11 +1,6 @@
|
|||
- title @mod.new_record? ? t('.title') : t('.title_edit', name: @mod.name)
|
||||
.mods-edit
|
||||
- if @mod.new_record?
|
||||
%h2= t('.new')
|
||||
- else
|
||||
%h2
|
||||
= t('.edit')
|
||||
= link_to @mod.name, @mod
|
||||
%h1= @mod.decorate.form_title
|
||||
= semantic_form_for @mod do |f|
|
||||
= f.inputs do
|
||||
= f.input :name
|
||||
|
|
Loading…
Reference in New Issue