Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Changed to use the Twitter Bootstrap Framework. Updated Readme too.

  • Loading branch information...
commit f9771dda4fda8bade8ec8060357451ad6800498b 1 parent a00c128
@brandonjmckay authored
View
10 README.md
@@ -1,5 +1,13 @@
-# Haml-rails
+# A modification of Haml-rails
+This modification provides support for Twitter Bootstrap and HAML.
+To use this fork, add this line to your Gemfile:
+
+ gem 'haml-rails', :git => "git://github.com/brandonjmckay/haml-rails.git"
+
+Then type bundle into your command prompt. Cheers!
+
+--------------
Haml-rails provides Haml generators for Rails 3. It also enables Haml as the templating engine for you, so you don't have to screw around in your own application.rb when your Gemfile already clearly indicated what templating engine you have installed. Hurrah.
To use it, add this line to your Gemfile:
View
14 lib/generators/haml/scaffold/templates/_form.html.haml
@@ -1,15 +1,15 @@
-= form_for @<%= singular_table_name %> do |f|
+= form_for @<%= singular_table_name %>, :class => "form-horizontal" do |f|
-if @<%= singular_table_name %>.errors.any?
- .alert-box.alert
+ .alert.alert-error
%h2= "#{pluralize(@<%= singular_table_name %>.errors.count, "error")} prohibited this <%= singular_table_name %> from being saved:"
%ul
- @<%= singular_table_name %>.errors.full_messages.each do |msg|
%li= msg
<% for attribute in attributes -%>
- .field
- = f.label :<%= attribute.name %>
- = f.<%= attribute.field_type %> :<%= attribute.name %>, :placeholder => "<%= attribute.name %>"
+ .control-group
+ = f.label :<%= attribute.name %>, :class => "control-label"
+ .controls
+ = f.<%= attribute.field_type %> :<%= attribute.name %>, :placeholder => "<%= attribute.name %>"
<% end -%>
- .actions
- = f.submit 'Save'
+ = f.submit 'Save', :class => "btn"
View
21 lib/generators/haml/scaffold/templates/edit.html.haml
@@ -1,9 +1,14 @@
-%section.columns.twelve
- %header.row
- %h1 Editing <%= singular_table_name %>
+%section.row
+ .span12
+ %header.row
+ %h1 Editing <%= singular_table_name %>
+ .row
+ = render 'form'
- = render 'form'
-
- %aside.admin-links.absolute.top.right
- %span.edit.radius.label.secondary= link_to 'Show', @<%= singular_table_name %>
- %span.edit.radius.label= link_to 'Back', <%= index_helper %>_path
+ %aside.row.btn-group
+ = link_to @<%= singular_table_name %>, :class => "btn btn-group" do
+ %i.icon-eye-open
+ Show
+ = link_to <%= index_helper %>_path, :class => "btn btn-group" do
+ %i.icon-fast-backward
+ Back
View
28 lib/generators/haml/scaffold/templates/index.html.haml
@@ -1,14 +1,24 @@
-%section.columns.twelve
- %header.row
+%section.row
+ %header.span12
%h1 Listing <%= plural_table_name %>
- @<%= plural_table_name %>.each do |<%= singular_table_name %>|
- %article.columns.twelve.<%= singular_table_name %>
+ %article.span12.well.<%= singular_table_name %>
<% for attribute in attributes -%>
- .columns.four.<%= singular_table_name %>-<%= attribute.name %>= <%= singular_table_name %>.<%= attribute.name %>
+ .row
+ %h4.span4.<%= singular_table_name %>-<%= attribute.name %>
+ <%= attribute.name %>:
+ .span5
+ = <%= singular_table_name %>.<%= attribute.name %>
<% end -%>
- %aside.admin-links.absolute.top.right
- %span.show.radius.label.secondary= link_to 'Show', <%= singular_table_name %>
- %span.edit.radius.label= link_to 'Edit', edit_<%= singular_table_name %>_path(<%= singular_table_name %>)
- %span.delete.radius.label.alert= link_to 'Delete', <%= singular_table_name %>, :confirm => 'Are you sure?', :method => :delete
+ %aside.btn-group
+ = link_to <%= singular_table_name %>, :class => "btn btn-mini" do
+ %i.icon-eye-open
+ Show
+ = link_to edit_<%= singular_table_name %>_path(<%= singular_table_name %>), :class => "btn btn-mini" do
+ %i.icon-pencil
+ Edit
+ = link_to <%= singular_table_name %>, :confirm => 'Are you sure?', :method => :delete, :class => "btn btn-mini" do
+ %i.icon-trash
+ Delete
%footer
- = link_to 'New <%= human_name %>', new_<%= singular_table_name %>_path
+ = link_to 'New <%= human_name %>', new_<%= singular_table_name %>_path, :class => "btn"
View
17 lib/generators/haml/scaffold/templates/new.html.haml
@@ -1,7 +1,10 @@
-%section.columns.twelve
- %header.row
- %h1 New <%= singular_table_name %>
-
- = render 'form'
- %footer.row
- %span.radius.label= link_to 'Back to <%= plural_table_name %> list', <%= index_helper %>_path
+%section.row
+ .span12
+ %header.row
+ %h1 New <%= singular_table_name %>
+ .row
+ = render 'form'
+ %footer.row
+ = link_to <%= index_helper %>_path, :class => "btn" do
+ %i.icon-backward
+ Back to <%= plural_table_name %> list
View
29 lib/generators/haml/scaffold/templates/show.html.haml
@@ -1,14 +1,19 @@
-%section.columns.twelve
- %header.row
- -if notice
- .alert-box.notice= notice
+%section.row
+ .span12
+ %header.row
+ -if notice
+ .alert.alert-info.span12= notice
- <% for attribute in attributes -%>
- %p
- %strong <%= attribute.human_name %>:
- = @<%= singular_table_name %>.<%= attribute.name %>
- <% end -%>
+ <% for attribute in attributes -%>
+ .row
+ %strong.span3 <%= attribute.human_name %>:
+ .span8= @<%= singular_table_name %>.<%= attribute.name %>
+ <% end -%>
- %aside.admin-links.absolute.top.right
- %span.edit.radius.label= link_to 'Edit', edit_<%= singular_table_name %>_path(@<%= singular_table_name %>)
- %span.edit.radius.label= link_to 'Back', <%= index_helper %>_path
+ %aside.btn-group
+ = link_to edit_<%= singular_table_name %>_path(@<%= singular_table_name %>), :class => "btn btn-mini" do
+ %i.icon-pencil
+ Edit
+ = link_to <%= index_helper %>_path, :class => "btn btn-mini" do
+ %i.icon-backward
+ Back
Please sign in to comment.
Something went wrong with that request. Please try again.