end of day commit

This commit is contained in:
2012-08-28 20:08:13 +02:00
parent 0b16614d41
commit 89700f36e9
43 changed files with 896 additions and 26 deletions
+18
View File
@@ -0,0 +1,18 @@
= form_for @section, html: {class: 'form-horizontal' } do |f|
= render 'error_messages', target: @section
.control-group class=(@section.errors[:title].any? ? 'error' : nil)
= f.label :title, class: 'control-label'
.controls
= f.text_field :title, class: 'text_field'
.control-group class=(@section.errors[:path].any? ? 'error' : nil)
= f.label :path, class: 'control-label'
.controls
= f.text_field :path, class: 'text_field'
.control-group class=(@section.errors[:supplier_id].any? ? 'error' : nil)
= f.label :supplier_id, Supplier.model_name.human, class: 'control-label'
.controls
= f.collection_select :supplier_id, @suppliers, :id, :name, include_blank: nil
.form-actions
= f.submit nil, class: 'btn btn-primary'
'
= link_to t("helpers.links.cancel"), sections_path, class: 'btn'
+4
View File
@@ -0,0 +1,4 @@
- model_class = Section
.page-header
= title :edit, model_class
= render 'form'
+26
View File
@@ -0,0 +1,26 @@
- model_class = Section
.page-header= title :index, model_class
- if @sections.any?
table.table.table-striped
thead
tr
th= model_class.human_attribute_name(:title)
th= model_class.human_attribute_name(:path)
th= Supplier.model_name.human
th= model_class.human_attribute_name(:created_at)
th=t 'helpers.actions'
tbody
- @sections.each do |section|
tr
td= link_to section.title, section
td= section.path
td= link_to_if section.supplier.present?, section.supplier.try(:name), section.supplier
td=l section.created_at, format: :short
td
= link_to t('helpers.links.edit'), [:edit, section], class: 'btn btn-mini'
'
= link_to t("helpers.links.destroy"), section, method: :delete, data: {confirm: are_you_sure? }, class: 'btn btn-mini btn-danger'
- else
= no_content_given model_class
= link_to t("helpers.links.new"), new_section_path, class: 'btn btn-primary'
+4
View File
@@ -0,0 +1,4 @@
- model_class = Section
.page-header
= title :new, model_class
= render 'form'
+18
View File
@@ -0,0 +1,18 @@
- model_class = Section
.page-header= title :show, @section
dl.dl-horizontal.show-list
dt= model_class.human_attribute_name(:title)
dd= @section.title
dt= model_class.human_attribute_name(:path)
dd= @section.path
- if @section.supplier.present?
dt= Supplier.model_name.human
dd= link_to @section.supplier.name, @section.supplier
.form-actions
= link_to t("helpers.links.back"), sections_path, class: 'btn'
'
= link_to t('helpers.links.edit'), [:edit, @section], class: 'btn'
'
= link_to t("helpers.links.destroy"), @section, method: :delete, data: {confirm: are_you_sure? }, class: 'btn btn-danger'