From 0b16614d4128ee22ae71b4eb3cbef07bb6ed402c Mon Sep 17 00:00:00 2001 From: Benjamin ter Kuile Date: Mon, 27 Aug 2012 21:52:54 +0200 Subject: [PATCH] update suppliers bootstrap themed --- app/views/suppliers/_form.html.slim | 40 +++++++++++++++++++++++++++++ app/views/suppliers/index.html.slim | 22 +++++++++++++++- app/views/suppliers/show.html.slim | 25 +++++++++++++++--- 3 files changed, 83 insertions(+), 4 deletions(-) diff --git a/app/views/suppliers/_form.html.slim b/app/views/suppliers/_form.html.slim index f88d3eb8..db9d74cb 100644 --- a/app/views/suppliers/_form.html.slim +++ b/app/views/suppliers/_form.html.slim @@ -1,5 +1,45 @@ = form_for @supplier, html: {class: 'form-horizontal' } do |f| = render 'error_messages', target: @supplier + .control-group class=(@supplier.errors[:email].any? ? 'error' : nil) + = f.label :email, class: 'control-label' + .controls + = f.text_field :email, class: 'text_field' + .control-group class=(@supplier.errors[:encrypted_password].any? ? 'error' : nil) + = f.label :encrypted_password, class: 'control-label' + .controls + = f.text_field :encrypted_password, class: 'text_field' + .control-group class=(@supplier.errors[:remember_created_at].any? ? 'error' : nil) + = f.label :remember_created_at, class: 'control-label' + .controls + = f.text_field :remember_created_at, class: 'text_field' + .control-group class=(@supplier.errors[:reset_password_token].any? ? 'error' : nil) + = f.label :reset_password_token, class: 'control-label' + .controls + = f.text_field :reset_password_token, class: 'text_field' + .control-group class=(@supplier.errors[:reset_password_sent_at].any? ? 'error' : nil) + = f.label :reset_password_sent_at, class: 'control-label' + .controls + = f.text_field :reset_password_sent_at, class: 'text_field' + .control-group class=(@supplier.errors[:sign_in_count].any? ? 'error' : nil) + = f.label :sign_in_count, class: 'control-label' + .controls + = f.text_field :sign_in_count, class: 'text_field' + .control-group class=(@supplier.errors[:current_sign_in_at].any? ? 'error' : nil) + = f.label :current_sign_in_at, class: 'control-label' + .controls + = f.text_field :current_sign_in_at, class: 'text_field' + .control-group class=(@supplier.errors[:last_sign_in_at].any? ? 'error' : nil) + = f.label :last_sign_in_at, class: 'control-label' + .controls + = f.text_field :last_sign_in_at, class: 'text_field' + .control-group class=(@supplier.errors[:current_sign_in_ip].any? ? 'error' : nil) + = f.label :current_sign_in_ip, class: 'control-label' + .controls + = f.text_field :current_sign_in_ip, class: 'text_field' + .control-group class=(@supplier.errors[:last_sign_in_ip].any? ? 'error' : nil) + = f.label :last_sign_in_ip, class: 'control-label' + .controls + = f.text_field :last_sign_in_ip, class: 'text_field' .control-group class=(@supplier.errors[:name].any? ? 'error' : nil) = f.label :name, class: 'control-label' .controls diff --git a/app/views/suppliers/index.html.slim b/app/views/suppliers/index.html.slim index 3d554fd0..215755ab 100644 --- a/app/views/suppliers/index.html.slim +++ b/app/views/suppliers/index.html.slim @@ -4,13 +4,33 @@ div.page-header= title :index, model_class table.table.table-striped thead tr + th= model_class.human_attribute_name(:email) + th= model_class.human_attribute_name(:encrypted_password) + th= model_class.human_attribute_name(:remember_created_at) + th= model_class.human_attribute_name(:reset_password_token) + th= model_class.human_attribute_name(:reset_password_sent_at) + th= model_class.human_attribute_name(:sign_in_count) + th= model_class.human_attribute_name(:current_sign_in_at) + th= model_class.human_attribute_name(:last_sign_in_at) + th= model_class.human_attribute_name(:current_sign_in_ip) + th= model_class.human_attribute_name(:last_sign_in_ip) th= model_class.human_attribute_name(:name) th= model_class.human_attribute_name(:created_at) th=t 'helpers.actions' tbody - @suppliers.each do |supplier| tr - td= link_to supplier.name, supplier + td= link_to supplier.email, supplier + td= supplier.encrypted_password + td= supplier.remember_created_at + td= supplier.reset_password_token + td= supplier.reset_password_sent_at + td= supplier.sign_in_count + td= supplier.current_sign_in_at + td= supplier.last_sign_in_at + td= supplier.current_sign_in_ip + td= supplier.last_sign_in_ip + td= supplier.name td=l supplier.created_at, format: :short td = link_to t('helpers.links.edit'), [:edit, supplier], class: 'btn btn-mini' diff --git a/app/views/suppliers/show.html.slim b/app/views/suppliers/show.html.slim index ba29b60f..4e838b6c 100644 --- a/app/views/suppliers/show.html.slim +++ b/app/views/suppliers/show.html.slim @@ -1,9 +1,28 @@ - model_class = Supplier -.page-header - = title :show, @supplier +.page-header= title :show, @supplier dl.dl-horizontal.show-list - dt= model_class.human_attribute_name(:name) + ':' + dt= model_class.human_attribute_name(:email) + dd= @supplier.email + dt= model_class.human_attribute_name(:encrypted_password) + dd= @supplier.encrypted_password + dt= model_class.human_attribute_name(:remember_created_at) + dd= @supplier.remember_created_at + dt= model_class.human_attribute_name(:reset_password_token) + dd= @supplier.reset_password_token + dt= model_class.human_attribute_name(:reset_password_sent_at) + dd= @supplier.reset_password_sent_at + dt= model_class.human_attribute_name(:sign_in_count) + dd= @supplier.sign_in_count + dt= model_class.human_attribute_name(:current_sign_in_at) + dd= @supplier.current_sign_in_at + dt= model_class.human_attribute_name(:last_sign_in_at) + dd= @supplier.last_sign_in_at + dt= model_class.human_attribute_name(:current_sign_in_ip) + dd= @supplier.current_sign_in_ip + dt= model_class.human_attribute_name(:last_sign_in_ip) + dd= @supplier.last_sign_in_ip + dt= model_class.human_attribute_name(:name) dd= @supplier.name .form-actions