Skip to content
This repository
Browse code

twitter bootstrap adjustments

  • Loading branch information...
commit 416f052d18602a26ffeef96a8214663c96d79584 1 parent 7a880e2
Sławosz authored
1  .gitignore
@@ -5,3 +5,4 @@ test/dummy/db/*.sqlite3
5 5 test/dummy/log/*.log
6 6 test/dummy/tmp/
7 7 *.swp
  8 +tags
4 Gemfile.lock
@@ -5,8 +5,8 @@ PATH
5 5 formtastic
6 6 formtastic-bootstrap
7 7 kaminari
8   - libv8
9 8 rails (~> 3.1.1)
  9 + therubyracer
10 10 twitter-bootstrap-rails
11 11
12 12 GEM
@@ -118,6 +118,8 @@ GEM
118 118 rack (~> 1.0)
119 119 tilt (~> 1.1, != 1.3.0)
120 120 sqlite3 (1.3.5)
  121 + therubyracer (0.10.1)
  122 + libv8 (~> 3.3.10)
121 123 thor (0.14.6)
122 124 tilt (1.3.3)
123 125 treetop (1.4.10)
0  app/assets/javascripts/application.js
No changes.
2  app/assets/javascripts/rails_panel/application.js
@@ -8,4 +8,4 @@
8 8 //= require jquery_ujs
9 9 //= require jquery-ui
10 10 //= require twitter/bootstrap
11   -//= require_tree ../appliaction
  11 +//= require ../application
24 app/helpers/rails_panel/link_helper.rb
... ... @@ -1,7 +1,7 @@
@@ -9,15 +9,31 @@ def link_to_show(resource, anchor = '')
5 app/helpers/rails_panel/resources_helper.rb
@@ -5,9 +5,10 @@ module ResourcesHelper
5 5
6 6 def render_resources_menu
7 7 return if @resources_menu.nil?
8   - html = '<ul class="pills">'
  8 + html = '<ul class="nav nav-pills">'
9 9 @resources_menu.each do |title, path|
10   - html << "<li>" + link_to(title, path) + "</li>"
  10 + css_class = (path == request.fullpath || request.fullpath[/(.*)\/.*/,1] == path) ? 'active' : ''
  11 + html << "<li class='#{css_class}'>" + link_to(title, path) + "</li>"
11 12 end
12 13 html << "</ul>"
13 14 html.html_safe
29 app/views/layouts/rails_panel/twitter_bootstrap.html.erb
@@ -42,21 +42,26 @@
42 42
43 43 <div class="container">
44 44 <div class="content">
  45 + <%= render_resources_menu %>
  46 + <h1><%= yield :title %> <small><%= yield :subtitle %></small></h1>
45 47 <div class="row">
46   - <div class="span9">
  48 + <div class="span10">
  49 + <%= render :partial => 'shared/notices' %>
47 50 <%= yield %>
48 51 </div>
49   - <div class="span3">
50   - <div class="well sidebar-nav">
51   - <h3>Sidebar</h3>
52   - <ul class="nav nav-list">
53   - <li class="nav-header">Sidebar</li>
54   - <li><%= link_to "Link1", "/path1" %></li>
55   - <li><%= link_to "Link2", "/path2" %></li>
56   - <li><%= link_to "Link3", "/path3" %></li>
57   - </ul>
58   - </div><!--/.well -->
59   - </div><!--/span-->
  52 + <% if false %>
  53 + <div class="span2">
  54 + <div class="well sidebar-nav">
  55 + <h3>Sidebar</h3>
  56 + <ul class="nav nav-list">
  57 + <li class="nav-header">Sidebar</li>
  58 + <li><%= link_to "Link1", "/path1" %></li>
  59 + <li><%= link_to "Link2", "/path2" %></li>
  60 + <li><%= link_to "Link3", "/path3" %></li>
  61 + </ul>
  62 + </div><!--/.well -->
  63 + </div><!--/span-->
  64 + <% end %>
60 65 </div><!--/row-->
61 66 </div><!--/content-->
62 67
2  app/views/rails_panel/resources/_has_many.html.erb
@@ -4,7 +4,7 @@
4 4 <ul class='input-list'>
5 5 <% form_data.call.each do |associated_record| %>
6 6 <li>
7   - <%= check_box_tag "#{current_model_params_key}[#{form_field.to_s.pluralize}][]", associated_record.id, current_resource.send(association).include?(associated_record) %>
  7 + <%= check_box_tag "#{model_representer_params_key}[#{form_field.to_s.pluralize}][]", associated_record.id, current_resource.send(association).include?(associated_record) %>
8 8 <span><%= associated_record._name %></span>
9 9 </li>
10 10 <% end %>
10 app/views/rails_panel/resources/_index.html.erb
... ... @@ -1,10 +1,14 @@
1 1 <%= paginate current_resources, :theme => 'rails_panel' %>
2   -<%= link_to_new %>
3   -<table class='condensed-table'>
  2 +<div class="well">
  3 + <%= link_to_new %> <b>Currently <%= pluralize(@resources.count, 'resource') %></b>
  4 +</div>
  5 +<table class='table table-striped'>
4 6 <%= render 'resource_header' %>
5 7 <% @resources.each do |resource| %>
6 8 <%= render :partial => 'resource_row', :locals => {:resource => resource} %>
7 9 <% end %>
8 10 <table>
9   -<%= link_to_new %>
  11 +<div class="well">
  12 + <%= link_to_new %>
  13 +</div>
10 14 <%= paginate current_resources, :theme => 'rails_panel' %>
2  app/views/rails_panel/resources/_resource_header.html.erb
... ... @@ -1,6 +1,6 @@
1 1 <tr>
2 2 <% table_attributes_keys.each do |key| %>
3   - <th><%= key %></th>
  3 + <th><%= key.to_s.titleize %></th>
4 4 <% end %>
5 5 <th></th>
6 6 <th></th>
6 app/views/shared/_notices.html.erb
... ... @@ -1,10 +1,12 @@
1 1 <% if flash[:notice] %>
2   - <div class='alert-message success'>
  2 + <div class='alert alert-success'>
  3 + <button class="close" data-dismiss="alert">×</button>
3 4 <%= flash[:notice] %>
4 5 </div>
5 6 <% end %>
6 7 <% if flash[:alert] %>
7   - <div class='alert-message error'>
  8 + <div class='alert alert-error'>
  9 + <button class="close" data-dismiss="alert">×</button>
8 10 <%= flash[:alert] %>
9 11 </div>
10 12 <% end %>
1  lib/rails_panel.rb
... ... @@ -1,4 +1,5 @@
1 1 require "rails_panel/engine"
  2 +require "twitter-bootstrap-rails"
2 3
3 4 module RailsPanel
4 5 mattr_accessor :controllers_without_model_mappings
2  rails_panel.gemspec
@@ -21,7 +21,7 @@ Gem::Specification.new do |s|
21 21 s.add_dependency "formtastic-bootstrap"
22 22 s.add_dependency "kaminari"
23 23 s.add_dependency "twitter-bootstrap-rails"
24   - s.add_dependency "libv8"
  24 + s.add_dependency "therubyracer"
25 25
26 26 s.add_development_dependency "sqlite3"
27 27 s.add_development_dependency "rspec-rails"

0 comments on commit 416f052

Please sign in to comment.
Something went wrong with that request. Please try again.