Louis | Adds agencies

This commit is contained in:
Loos
2014-09-21 18:23:15 -05:00
parent 36e7c1624f
commit 7ed3fce648
14 changed files with 180 additions and 3 deletions
+42
View File
@@ -0,0 +1,42 @@
- disabled ||= false
.form-horizontal
.form-group
= f.label "Name of Agency:", class: "col-sm-2 control-label"
.col-sm-10
= f.text_field :agency_name, class: "form-control", disabled: disabled
.form-group
= f.label "Contact Name:", class: "col-sm-2 control-label"
.col-sm-10
= f.text_field :contact_name, class: "form-control", disabled: disabled
.form-group
= f.label "Street Address:", class: "col-sm-2 control-label"
.col-sm-10
= f.text_field :street_address, class: "form-control", disabled: disabled
.form-group
= f.label "City:", class: "col-sm-2 control-label"
.col-sm-10
= f.text_field :city, class: "form-control", disabled: disabled
.form-group
= f.label "State:", class: "col-sm-2 control-label"
.col-sm-10
= f.text_field :state, class: "form-control", disabled: disabled
.form-group
= f.label "Postal Code:", class: "col-sm-2 control-label"
.col-sm-10
= f.text_field :postal_code, class: "form-control", disabled: disabled
.form-group
= f.label "Phone Number", class: "col-sm-2 control-label"
.col-sm-10
= f.text_field :phone_number, class: "form-control", disabled: disabled
.form-group
= f.label "email", class: "col-sm-2 control-label"
.col-sm-10
= f.text_field :email, class: "form-control", disabled: disabled
+11
View File
@@ -0,0 +1,11 @@
= form_for @agency, html: {class: 'form-horizontal'} do |f|
- if @agency.errors.any?
#error_explanation
%h2= pluralize(@agency.errors.count, "error") + " prohibited this agency from being saved:"
%ul
- @agency.errors.full_messages.each do |msg|
%li= msg
= render 'fields', f: f
.row
.actions.col-sm-offset-2
= f.submit class: "btn btn-default"
+6
View File
@@ -0,0 +1,6 @@
.container
%h1 Edit Agency
= render 'form'
= link_to 'Show', @agency
|
= link_to 'Back', agencies_path
+20
View File
@@ -0,0 +1,20 @@
.container
%h1 Agencies
%table.table.table-striped.table-bordered.table-hover
%thead
%tr
%th Agency
%th
%th
%th
%tbody
- @agencies.each do |agency|
%tr
%td= agency.agency_name
%td= link_to 'Show', agency
%td= link_to 'Edit', edit_agency_path(agency)
%td= link_to 'Destroy', agency, method: :delete, data: { confirm: 'Are you sure?' }
%br
= link_to ' + New Agency', new_agency_path, class: "btn btn-default"
+4
View File
@@ -0,0 +1,4 @@
.container
%h1 New Agency
= render 'form'
= link_to 'Back', agencies_path
+7
View File
@@ -0,0 +1,7 @@
.container
%p#notice= notice
= form_for(@agency) do |f|
= render 'fields', f: f, disabled: true
= link_to 'Edit', edit_agency_path(@agency)
|
= link_to 'Back', agencies_path
+1 -1
View File
@@ -1,7 +1,7 @@
= form_for @client, html: {class: 'form-horizontal'} do |f|
- if @client.errors.any?
#error_explanation
%h2= pluralize(@client.errors.count, "error") + " prohibited this bike from being saved:"
%h2= pluralize(@client.errors.count, "error") + " prohibited this client from being saved:"
%ul
- @client.errors.full_messages.each do |msg|
%li= msg
+1 -1
View File
@@ -1,5 +1,5 @@
.container
%h1 Editing client
%h1 Edit client
= render 'form'
= link_to 'Show', @client
|
+2
View File
@@ -10,3 +10,5 @@
= link_to "Clients", clients_path
%br
= link_to "Print Bikes", print_select_bikes_path
%br
= link_to "Agencies", agencies_path