Add section elements
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
- content_for :head do
|
||||
= javascript_include_tag "admin/application"
|
||||
= form_for [:admin, @svg_element] do |f|
|
||||
= render 'error_messages', target: @svg_element
|
||||
= f.row :name
|
||||
.form-label= f.label :name
|
||||
.form-field= f.text_field :name
|
||||
= f.row :dpm
|
||||
.small-3.columns= f.label :dpm
|
||||
.small-3.columns= f.number_field :dpm
|
||||
.small-6.columns.attribute-info= f.error_message :dpm
|
||||
= f.row :box_width
|
||||
.small-3.columns= f.label :box_width
|
||||
.small-3.columns= f.number_field :box_width
|
||||
.small-6.columns.attribute-info
|
||||
= f.row :box_height
|
||||
.small-3.columns= f.label :box_height
|
||||
.small-3.columns= f.number_field :box_height
|
||||
.small-6.columns.attribute-info
|
||||
= f.row :svg
|
||||
.form-label= f.label :svg
|
||||
.form-field= f.text_area :svg
|
||||
= f.row :snap_code
|
||||
.form-label= f.label :snap_code
|
||||
.row: .small-12.columns= f.text_area :snap_code, rows: 20, class: ['snap-code-editor'], data: {target: '#svg-preview', preview: '#javascript-preview'}
|
||||
.row: .small-12.columns: pre#javascript-preview.hide
|
||||
.form-actions
|
||||
= f.submit nil, class: 'form-submit-button'
|
||||
'
|
||||
= link_to t("helpers.links.cancel"), admin_svg_elements_path, class: 'to-index-button'
|
||||
- content_for :sidebar do
|
||||
.row: .small-12.columns: svg#svg-preview
|
||||
@@ -0,0 +1,3 @@
|
||||
- model_class = SvgElement
|
||||
- title :edit, model_class
|
||||
= render 'form'
|
||||
@@ -0,0 +1,19 @@
|
||||
- model_class = SvgElement
|
||||
div.page-header= title :index, model_class
|
||||
- if @svg_elements.any?
|
||||
table.table
|
||||
thead
|
||||
tr
|
||||
th= model_class.human_attribute_name(:name)
|
||||
th=t 'helpers.actions.title'
|
||||
tbody
|
||||
- @svg_elements.each do |svg_element|
|
||||
tr
|
||||
td= link_to svg_element.name, [:admin, svg_element]
|
||||
td
|
||||
= link_to t('helpers.links.edit'), [:edit, :admin, svg_element], class: 'table-edit-button'
|
||||
'
|
||||
= link_to t("helpers.links.destroy"), [:admin, svg_element], method: :delete, data: {confirm: are_you_sure? }, class: 'table-destroy-button'
|
||||
- else
|
||||
= no_content_given model_class
|
||||
= link_to t("helpers.links.new"), new_admin_svg_element_path, class: 'record-new-button'
|
||||
@@ -0,0 +1,3 @@
|
||||
- model_class = SvgElement
|
||||
- title :new, model_class
|
||||
= render 'form'
|
||||
@@ -0,0 +1,16 @@
|
||||
- model_class = SvgElement
|
||||
.page-header= title :show, @svg_element
|
||||
|
||||
dl.dl-horizontal.show-list
|
||||
dt= model_class.human_attribute_name(:number)
|
||||
dd= @svg_element.number
|
||||
- if @svg_element.supplier.present?
|
||||
dt= Supplier.model_name.human
|
||||
dd= link_to @svg_element.supplier.name, [:admin, @svg_element.supplier]
|
||||
|
||||
.form-actions
|
||||
= link_to t("helpers.links.back"), admin_svg_elements_path, class: 'btn'
|
||||
'
|
||||
= link_to t('helpers.links.edit'), [:edit, :admin, @svg_element], class: 'btn'
|
||||
'
|
||||
= link_to t("helpers.links.destroy"), [:admin, @svg_element], method: :delete, data: {confirm: are_you_sure? }, class: 'btn btn-danger'
|
||||
Reference in New Issue
Block a user