5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-22 04:46:22 +00:00

Solo cambiar el diseño si es un skel

This commit is contained in:
f 2021-09-11 17:28:35 -03:00
parent b44e49194b
commit 827f44e2a6

View file

@ -44,36 +44,37 @@
.invalid-feedback= site.errors.messages[:description].join(', ')
%hr/
.form-group#design_id
%h2= t('.design.title')
%p.lead= t('.help.design')
- if invalid? site, :design_id
.alert.alert-info
= t('activerecord.errors.models.site.attributes.design_id.layout_incompatible.help',
layouts: site.incompatible_layouts.to_sentence)
.row.designs
-# Demasiado complejo para un f.collection_radio_buttons
- Design.all.find_each do |design|
.design.col-md-4.d-flex.flex-column
.custom-control.custom-radio
= f.radio_button :design_id, design.id,
checked: design.id == site.design_id,
disabled: design.disabled,
required: true, class: 'custom-control-input'
= f.label "design_id_#{design.id}", design.name,
class: 'custom-control-label'
.flex-fill
= sanitize_markdown design.description,
tags: %w[p a strong em]
- if site.new_record? || site.skel?
.form-group#design_id
%h2= t('.design.title')
%p.lead= t('.help.design')
- if invalid? site, :design_id
.alert.alert-info
= t('activerecord.errors.models.site.attributes.design_id.layout_incompatible.help',
layouts: site.incompatible_layouts.to_sentence)
.row.designs
-# Demasiado complejo para un f.collection_radio_buttons
- Design.all.find_each do |design|
.design.col-md-4.d-flex.flex-column
.custom-control.custom-radio
= f.radio_button :design_id, design.id,
checked: design.id == site.design_id,
disabled: design.disabled,
required: true, class: 'custom-control-input'
= f.label "design_id_#{design.id}", design.name,
class: 'custom-control-label'
.flex-fill
= sanitize_markdown design.description,
tags: %w[p a strong em]
.btn-group{ role: 'group', 'aria-label': t('.design.actions') }
- if design.url
= link_to t('.design.url'), design.url,
target: '_blank', class: 'btn'
- if design.license
= link_to t('.design.license'), design.license,
target: '_blank', class: 'btn'
%hr/
.btn-group{ role: 'group', 'aria-label': t('.design.actions') }
- if design.url
= link_to t('.design.url'), design.url,
target: '_blank', class: 'btn'
- if design.license
= link_to t('.design.license'), design.license,
target: '_blank', class: 'btn'
%hr/
.form-group.licenses#license_id
%h2= t('.licencia.title')