Permalink
Browse files

Apply Twitter bootstrap

  • Loading branch information...
iain committed Nov 5, 2011
1 parent 4a847ef commit 0a9f5a8ab5e9a82ce90c092aab2b628211f7036b
Showing with 2,719 additions and 1,096 deletions.
  1. +1 −1 Gemfile
  2. +9 −4 Gemfile.lock
  3. +4 −2 app/assets/stylesheets/application.css
  4. +0 −6 app/assets/stylesheets/backend.css
  5. +45 −0 app/assets/stylesheets/backend.css.sass
  6. +0 −9 app/assets/stylesheets/backend/definition_lists.css.sass
  7. +0 −50 app/assets/stylesheets/backend/forms.css.sass
  8. +7 −4 app/views/backend/products/_form.html.haml
  9. +6 −4 app/views/backend/resource/_form.html.haml
  10. +24 −28 app/views/backend/resource/_index.html.haml
  11. +9 −10 app/views/backend/resource/edit.html.haml
  12. +7 −11 app/views/backend/resource/new.html.haml
  13. +10 −13 app/views/backend/resource/show.html.haml
  14. +9 −5 app/views/backend/widgets/_form.html.haml
  15. +2 −0 app/views/kaminari/_first_page.html.erb
  16. +3 −1 app/views/kaminari/_gap.html.erb
  17. +2 −0 app/views/kaminari/_last_page.html.erb
  18. +2 −0 app/views/kaminari/_next_page.html.erb
  19. +2 −2 app/views/kaminari/_page.html.erb
  20. +12 −10 app/views/kaminari/_paginator.html.erb
  21. +2 −0 app/views/kaminari/_prev_page.html.erb
  22. +29 −30 app/views/layouts/backend/application.html.haml
  23. +1 −1 config/initializers/kaminari_config.rb
  24. +66 −32 config/initializers/simple_form.rb
  25. BIN vendor/assets/images/arrow.png
  26. BIN vendor/assets/images/bgd.jpg
  27. BIN vendor/assets/images/boxbar-background.png
  28. BIN vendor/assets/images/button-background-active.png
  29. BIN vendor/assets/images/button-background.png
  30. BIN vendor/assets/images/messages/error.png
  31. BIN vendor/assets/images/messages/notice.png
  32. BIN vendor/assets/images/messages/warning.png
  33. +2,467 −0 vendor/assets/stylesheets/bootstrap.css
  34. +0 −410 vendor/assets/stylesheets/web-app-theme/base.css
  35. +0 −463 vendor/assets/stylesheets/web-app-theme/style.css
@@ -14,7 +14,7 @@ end
gem 'therubyracer'
gem 'jquery-rails'

gem 'simple_form'
gem 'simple_form', :git => 'git://github.com/plataformatec/simple_form.git'
gem 'inherited_resources'
gem 'kaminari'
gem 'has_scope', git: 'git://github.com/plataformatec/has_scope.git'
@@ -4,6 +4,14 @@ GIT
specs:
has_scope (0.5.1)

GIT
remote: git://github.com/plataformatec/simple_form.git
revision: 6c283ec3d29eb13a3b4014cc8fac25a655733786
specs:
simple_form (2.0.0.dev)
actionpack (~> 3.0)
activemodel (~> 3.0)

GEM
remote: http://rubygems.org/
specs:
@@ -106,9 +114,6 @@ GEM
sass (>= 3.1.4)
sprockets (~> 2.0.0)
tilt (~> 1.3.2)
simple_form (1.5.2)
actionpack (~> 3.0)
activemodel (~> 3.0)
sprockets (2.0.3)
hike (~> 1.2)
rack (~> 1.0)
@@ -141,7 +146,7 @@ DEPENDENCIES
pg
rails (= 3.1.1)
sass-rails (~> 3.1.0)
simple_form
simple_form!
therubyracer
turn
uglifier
@@ -2,6 +2,8 @@
* This is a manifest file that'll automatically include all the stylesheets available in this directory
* and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
* the top of the compiled file, but it's generally better to create a new file per style scope.
*= require bootstrap
*= require_self
*= require_tree .
*/
*/

body { padding: 20px; }

This file was deleted.

Oops, something went wrong.
@@ -0,0 +1,45 @@
//= require bootstrap

html, body
background-color: #eee

body
padding-top: 40px

.container > footer p
text-align: center

.container
width: 820px


.content
background-color: white
padding: 20px
margin: 0 -20px
-webkit-border-radius: 0 0 6px 6px
-moz-border-radius: 0 0 6px 6px
border-radius: 0 0 6px 6px
-webkit-box-shadow: 0 1px 2px rgba(0,0,0,.15)
-moz-box-shadow: 0 1px 2px rgba(0,0,0,.15)
box-shadow: 0 1px 2px rgba(0,0,0,.15)

.page-header
background: #f5f5f5
padding: 20px 20px 10px
margin: -20px -20px 20px

.content
.span10, .span4
min-height: 500px

.span4
margin-left: 10px
padding-left: 9px
border-left: 1px solid #eee

.alert-message
margin-left: 20px

.row-actions
text-align: right

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.
@@ -1,4 +1,7 @@
= simple_form_for resource do |f|
- attributes.each do |attr|
= f.input attr
= f.submit
= simple_form_for resource, :wrapper => :inline do |f|
%fieldset
- attributes.each do |attr|
= f.input attr
.actions
= f.submit :class => "btn primary"
%button.btn{:type => "reset"} Cancel
@@ -1,4 +1,6 @@
= simple_form_for [ :backend, resource ] do |f|
- attributes.each do |attr|
= f.input attr
= f.submit
= simple_form_for [ :backend, resource ], :wrapper => :inline do |f|
%fieldset
%legend Fields
- attributes.each do |attr|
= f.input attr
= f.submit :class => "primary"
@@ -1,30 +1,26 @@
.block
.content
%h2= resource_class.model_name.human(count: 2)
.inner
%table.table
%thead
%tr
- attributes.each do |attr|
%th= resource_class.human_attribute_name(attr)
%th  
%tbody
- collection.each do |resource|
%tr[resource]{odd_or_even}
- attributes.each do |attr|
%td= resource.public_send(attr).to_s.truncate(20)
%td
= link_to 'show', resource_path(resource)
|
= link_to 'edit', edit_resource_path(resource)
|
= link_to 'destroy', resource_path(resource), method: :delete, confirm: "Are you sure?"
- content_for :header do
%h1= resource_class.model_name.human(count: 2)

.actions-bar.wat-cf
= paginate collection
%ul.tabs
%li.active= link_to "Index", "#"
%li= link_to "New", new_resource_path

= content_for :sidebar do
.block
%h3 Navigation
%ul.navigation
%li= link_to "New #{resource_class.model_name.human}", new_resource_path
%table.zebra-striped
%thead
%tr
- attributes.each do |attr|
%th= resource_class.human_attribute_name(attr)
%th  
%tbody
- collection.each do |resource|
%tr[resource]{odd_or_even}
- attributes.each do |attr|
%td= resource.public_send(attr).to_s.truncate(20)
%td.row-actions
= link_to 'show', resource_path(resource)
|
= link_to 'edit', edit_resource_path(resource)
|
= link_to 'destroy', resource_path(resource), method: :delete, confirm: "Are you sure?"

= paginate collection
@@ -1,12 +1,11 @@
.block
.content
%h2 Edit #{resource_class.model_name.human}
- content_for :header do
%h1 Edit #{resource_class.model_name.human}

.inner
= render "form", attributes: attributes
%ul.tabs
%li= link_to "Index", collection_path
%li= link_to "New", new_resource_path
%li= link_to "Show", resource_path
%li.active= link_to "Edit", "#"
%li= link_to "Destroy", resource_path, method: :delete, confirm: "Are you sure?"

= content_for :sidebar do
.block
%h3 Navigation
%ul.navigation
%li= link_to "Back", resource_path
= render "form", attributes: attributes
@@ -1,13 +1,9 @@
.block
.content
%h2 New #{resource_class.model_name.human}
- content_for :header do
%h1 New #{resource_class.model_name.human}

.inner
- attributes = resource_class.attribute_names - %w(id created_at updated_at)
= render "form", attributes: attributes
%ul.tabs
%li= link_to "Index", collection_path
%li.active= link_to "New", "#"

= content_for :sidebar do
.block
%h3 Navigation
%ul.navigation
%li= link_to "Back", collection_path
- attributes = resource_class.attribute_names - %w(id created_at updated_at)
= render "form", attributes: attributes
@@ -1,14 +1,11 @@
.block
.content
%h2= resource_class.model_name.human
.inner
= render "show"
- content_for :header do
%h1= resource_class.model_name.human

= content_for :sidebar do
.block
%h3 Navigation
%ul.navigation
%li= link_to "Back", collection_path
%li= link_to "Edit", edit_resource_path
%li= link_to "Destroy", resource_path, method: :delete, confirm: "Are you sure?"
= yield :actions
%ul.tabs
%li= link_to "Index", collection_path
%li= link_to "New", new_resource_path
%li.active= link_to 'Show', '#'
%li= link_to "Edit", edit_resource_path
%li= link_to "Destroy", resource_path, method: :delete, confirm: "Are you sure?"

= render "show"
@@ -1,5 +1,9 @@
= simple_form_for [ :backend, resource ] do |f|
= f.input :name
= f.association :product
= f.input :active
= f.submit
= simple_form_for [ :backend, resource ], :wrapper => :inline do |f|
%fieldset
%legend Please enter some widget info
= f.input :name
= f.association :product
= f.input :active
.actions
= f.submit :class => "btn primary"
%button.btn{:type => "reset"} Cancel
@@ -6,4 +6,6 @@
per_page: number of items to fetch per page
remote: data-remote
-%>
<li>
<%= link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, :remote => remote %>
</li>
@@ -5,4 +5,6 @@
per_page: number of items to fetch per page
remote: data-remote
-%>
<span class="page gap"><%= raw(t 'views.pagination.truncate') %></span>
<li class="disabled">
<a href="#"><%= raw(t 'views.pagination.truncate') %></a>
</li>
@@ -6,4 +6,6 @@
per_page: number of items to fetch per page
remote: data-remote
-%>
<li>
<%= link_to_unless current_page.last?, raw(t 'views.pagination.last'), url, {:remote => remote} %>
</li>
@@ -6,4 +6,6 @@
per_page: number of items to fetch per page
remote: data-remote
-%>
<li>
<%= link_to_unless current_page.last?, raw(t 'views.pagination.next'), url, :rel => 'next', :remote => remote %>
</li>
@@ -8,7 +8,7 @@
remote: data-remote
-%>
<% if page.current? %>
<span class="current"><%= page %></span>
<li class="active"><a href="#"><%= page %></a></li>
<% else %>
<%= link_to_unless page.current?, page, url, opts = {:remote => remote, :rel => page.next? ? 'next' : page.prev? ? 'prev' : nil} %>
<li><%= link_to_unless page.current?, page, url, opts = {:remote => remote, :rel => page.next? ? 'next' : page.prev? ? 'prev' : nil} %></li>
<% end %>
@@ -8,16 +8,18 @@
-%>
<%= paginator.render do -%>
<nav class="pagination">
<%= first_page_tag unless current_page.first? %>
<%= prev_page_tag unless current_page.first? %>
<% each_page do |page| -%>
<% if page.left_outer? || page.right_outer? || page.inside_window? -%>
<%= page_tag page %>
<% elsif !page.was_truncated? -%>
<%= gap_tag %>
<ul>
<%= first_page_tag unless current_page.first? %>
<%= prev_page_tag unless current_page.first? %>
<% each_page do |page| -%>
<% if page.left_outer? || page.right_outer? || page.inside_window? -%>
<%= page_tag page %>
<% elsif !page.was_truncated? -%>
<%= gap_tag %>
<% end -%>
<% end -%>
<% end -%>
<%= next_page_tag unless current_page.last? %>
<%= last_page_tag unless current_page.last? %>
<%= next_page_tag unless current_page.last? %>
<%= last_page_tag unless current_page.last? %>
</ul>
</nav>
<% end -%>
Oops, something went wrong.

0 comments on commit 0a9f5a8

Please sign in to comment.