erb -> haml

This commit is contained in:
loos
2014-03-20 16:59:36 -05:00
parent 8b17200b97
commit 8bf01921a3
28 changed files with 203 additions and 287 deletions
-23
View File
@@ -1,23 +0,0 @@
<% disabled ||= false %>
<div class="form-group">
<%= f.label "Name", class: "col-sm-2 control-label" %>
<div class="col-sm-10">
<%= f.text_field :name, class: "form-control", disabled: disabled %>
</div>
</div>
<div class="form-group">
<%= f.label "Email address:", class: "col-sm-2 control-label" %>
<div class="col-sm-10">
<%= f.text_field :email, class: "form-control", disabled: disabled %>
</div>
</div>
<div class="form-group">
<%= f.label "Phone Number:", class: "col-sm-2 control-label" %>
<div class="col-sm-10">
<%= f.text_field :phone, class: "form-control", disabled: disabled %>
</div>
</div>
+17
View File
@@ -0,0 +1,17 @@
- disabled ||= false
.form-group
= f.label "Name", class: "col-sm-2 control-label"
.col-sm-10
= f.text_field :name, class: "form-control", disabled: disabled
.form-group
= f.label "Email address:", class: "col-sm-2 control-label"
.col-sm-10
= f.text_field :email, class: "form-control", disabled: disabled
.form-group
= f.label "Phone Number:", class: "col-sm-2 control-label"
.col-sm-10
= f.text_field :phone, class: "form-control", disabled: disabled
-23
View File
@@ -1,23 +0,0 @@
<div class="container">
<%= form_for @volunteer, html: {class: 'form-horizontal'} do |f| %>
<% if @volunteer.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@volunteer.errors.count, "error") %> prohibited this volunteer from being saved:</h2>
<ul>
<% @volunteer.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
<%= render 'fields', f: f %>
<div class="row">
<div class="actions col-sm-offset-2">
<%= f.submit class: "btn btn-default" %>
</div>
</div>
<% end %>
</div>
+12
View File
@@ -0,0 +1,12 @@
.container
= form_for @volunteer, html: {class: 'form-horizontal'} do |f|
- if @volunteer.errors.any?
#error_explanation
%h2= pluralize(@volunteer.errors.count, "error") + "prohibited this volunteer from being saved:"
%ul
- @volunteer.errors.full_messages.each do |msg|
%li= msg
= render 'fields', f: f
.row
.actions.col-sm-offset-2
= f.submit class: "btn btn-default"
-8
View File
@@ -1,8 +0,0 @@
<div class="container">
<h1>Editing Volunteer Information</h1>
<%= render 'form' %>
<%= link_to 'Show', @volunteer %> |
<%= link_to 'Back', volunteers_path %>
</div>
+6
View File
@@ -0,0 +1,6 @@
.container
%h1 Editing Volunteer Information
= render 'form'
= link_to 'Show', @volunteer
|
= link_to 'Back', volunteers_path
-30
View File
@@ -1,30 +0,0 @@
<div class="container">
<h1>Volunteers</h1>
<table class="table table-striped table-bordered table-hover">
<thead>
<tr>
<th> Name </th>
<th> Phone </th>
<th> Email </th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<% @volunteers.each do |volunteer| %>
<tr>
<td><%= volunteer.name %></td>
<td><%= volunteer.phone %></td>
<td><%= volunteer.email %></td>
<td><%= link_to 'Show', volunteer %></td>
<td><%= link_to 'Edit', edit_volunteer_path(volunteer) %></td>
<td><%= link_to 'Destroy', volunteer, method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
<% end %>
</tbody>
</table>
<%= link_to '+ Add Volunteer', new_volunteer_path, class: "btn btn-default" %>
</div>
+23
View File
@@ -0,0 +1,23 @@
.container
%h1 Volunteers
%table.table.table-striped.table-bordered.table-hover
%thead
%tr
%th Name
%th Phone
%th Email
%th
%th
%th
%tbody
- @volunteers.each do |volunteer|
%tr
%td= volunteer.name
%td= volunteer.phone
%td= volunteer.email
%td= link_to 'Show', volunteer
%td= link_to 'Edit', edit_volunteer_path(volunteer)
%td= link_to 'Destroy', volunteer, method: :delete, data: { confirm: 'Are you sure?' }
= link_to '+ Add Volunteer', new_volunteer_path, class: "btn btn-default"
-5
View File
@@ -1,5 +0,0 @@
<h1>New Volunteer</h1>
<%= render 'form' %>
<%= link_to 'Back', volunteers_path %>
+3
View File
@@ -0,0 +1,3 @@
%h1 New Volunteer
= render 'form'
= link_to 'Back', volunteers_path
-9
View File
@@ -1,9 +0,0 @@
<div class="container">
<p id="notice"><%= notice %></p>
<%= form_for(@volunteer) do |f| %>
<%= render 'fields', f: f, disabled: true %>
<% end %>
<%= link_to 'Edit', edit_volunteer_path(@volunteer) %> |
<%= link_to 'Back', volunteers_path %>
</div>
+7
View File
@@ -0,0 +1,7 @@
.container
%p#notice= notice
= form_for(@volunteer) do |f|
= render 'fields', f: f, disabled: true
= link_to 'Edit', edit_volunteer_path(@volunteer)
|
= link_to 'Back', volunteers_path