diff --git a/Gemfile b/Gemfile index 81c3482..cfd940f 100644 --- a/Gemfile +++ b/Gemfile @@ -16,7 +16,7 @@ gem 'uglifier', '>= 1.3.0' gem 'coffee-rails', '~> 4.0.0' # See https://github.com/sstephenson/execjs#readme for more supported runtimes -# gem 'therubyracer', platforms: :ruby +gem 'therubyracer', platforms: :ruby # Use jquery as the JavaScript library gem 'jquery-rails' @@ -56,8 +56,10 @@ group :development do end # Twitter Bootstrap template -gem 'bootstrap-sass' - +#gem 'bootstrap-sass' +#gem 'anjlab-bootstrap-rails', '>= 3.0.0.0' +gem 'anjlab-bootstrap-rails', :require => 'bootstrap-rails', + :github => 'anjlab/bootstrap-rails' # Pagination # Hint: rails generate kaminari:views bootstrap gem 'kaminari' diff --git a/Gemfile.lock b/Gemfile.lock index 68548cb..f9b189f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,3 +1,11 @@ +GIT + remote: git://github.com/anjlab/bootstrap-rails.git + revision: 056c63f1128a255688da1d064c5a2854ab5c8a9a + specs: + anjlab-bootstrap-rails (3.0.0.1) + railties (>= 3.0) + sass (>= 3.2) + GEM remote: https://rubygems.org/ specs: @@ -26,14 +34,12 @@ GEM thread_safe (~> 0.1) tzinfo (~> 0.3.37) arel (4.0.0) - atomic (1.1.10) + atomic (1.1.13) better_errors (0.9.0) coderay (>= 1.0.0) erubis (>= 2.6.6) binding_of_caller (0.7.2) debug_inspector (>= 0.0.1) - bootstrap-sass (2.3.2.1) - sass (~> 3.2) builder (3.1.4) callsite (0.0.11) coderay (1.0.9) @@ -46,13 +52,12 @@ GEM coffee-script-source (1.6.3) debug_inspector (0.0.2) erubis (2.7.0) - execjs (1.4.0) - multi_json (~> 1.0) + execjs (2.0.0) fancybox2-rails (0.2.4) railties (>= 3.1.0) hike (1.2.3) - i18n (0.6.4) - jbuilder (1.4.2) + i18n (0.6.5) + jbuilder (1.5.0) activesupport (>= 3.0.0) multi_json (>= 1.2.0) jquery-rails (3.0.4) @@ -62,6 +67,7 @@ GEM kaminari (0.14.1) actionpack (>= 3.0.0) activesupport (>= 3.0.0) + libv8 (3.16.14.3) mail (2.5.4) mime-types (~> 1.16) treetop (~> 1.4.8) @@ -69,9 +75,9 @@ GEM callsite rack-contrib railties - mime-types (1.23) + mime-types (1.24) minitest (4.7.5) - multi_json (1.7.7) + multi_json (1.7.9) pg (0.16.0) polyglot (0.3.3) rack (1.5.2) @@ -95,7 +101,8 @@ GEM rake (10.1.0) rdoc (3.12.2) json (~> 1.4) - sass (3.2.9) + ref (1.0.5) + sass (3.2.10) sass-rails (4.0.0) railties (>= 4.0.0.beta, < 5.0) sass (>= 3.1.10) @@ -112,12 +119,15 @@ GEM actionpack (>= 3.0) activesupport (>= 3.0) sprockets (~> 2.8) - sqlite3 (1.3.7) + sqlite3 (1.3.8) + therubyracer (0.12.0) + libv8 (~> 3.16.14.0) + ref thor (0.18.1) thread_safe (0.1.2) atomic tilt (1.4.1) - treetop (1.4.14) + treetop (1.4.15) polyglot polyglot (>= 0.3.1) turbolinks (1.3.0) @@ -131,9 +141,9 @@ PLATFORMS ruby DEPENDENCIES + anjlab-bootstrap-rails! better_errors binding_of_caller - bootstrap-sass coffee-rails (~> 4.0.0) fancybox2-rails (~> 0.2.4) jbuilder (~> 1.2) @@ -145,5 +155,6 @@ DEPENDENCIES sass-rails (~> 4.0.0) sdoc sqlite3 + therubyracer turbolinks uglifier (>= 1.3.0) diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 828d085..d5d0bc3 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -14,4 +14,5 @@ //= require jquery_ujs //= require fancybox //= require turbolinks +//= require twitter/bootstrap //= require_tree . diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css deleted file mode 100644 index 16f277e..0000000 --- a/app/assets/stylesheets/application.css +++ /dev/null @@ -1,16 +0,0 @@ -/* - * This is a manifest file that'll be compiled into application.css, which will include all the files - * listed below. - * - * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, - * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path. - * - * 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_self - *= require_tree . - *= require fancybox - */ - -//= require bootstrap diff --git a/app/assets/stylesheets/application.css.scss b/app/assets/stylesheets/application.css.scss index c4b7e51..78200e6 100644 --- a/app/assets/stylesheets/application.css.scss +++ b/app/assets/stylesheets/application.css.scss @@ -1,2 +1,16 @@ -@import 'bootstrap'; -@import 'bootstrap-responsive'; +/* + * This is a manifest file that'll be compiled into application.css, which will include all the files + * listed below. + * + * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, + * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path. + * + * 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_self + *= require_tree . + *= require fancybox + */ + +@import "twitter/bootstrap"; diff --git a/app/models/package.rb b/app/models/package.rb index d1ac5fc..9aa97cc 100644 --- a/app/models/package.rb +++ b/app/models/package.rb @@ -16,7 +16,7 @@ class Package < ActiveRecord::Base to_tsvector('english', packages.description) @@ plainto_tsquery(:q) ", q: query).order("#{rank} desc") else - scoped + all end end end diff --git a/app/models/screenshot.rb b/app/models/screenshot.rb index 79ffb5f..a0618d3 100644 --- a/app/models/screenshot.rb +++ b/app/models/screenshot.rb @@ -1,6 +1,8 @@ class Screenshot < ActiveRecord::Base belongs_to :package, :inverse_of=>:screenshots - default_scope order('uploaddatetime DESC') + default_scope { + order('uploaddatetime DESC') + } def image_url(size) "/screenshots/#{self.package.name[0]}/#{self.package.name}/#{self.id}_#{size}.png" diff --git a/app/views/kaminari/_paginator.html.erb b/app/views/kaminari/_paginator.html.erb index 03d508e..e06a967 100644 --- a/app/views/kaminari/_paginator.html.erb +++ b/app/views/kaminari/_paginator.html.erb @@ -1,6 +1,5 @@ <%= paginator.render do -%> - + <% end -%> diff --git a/app/views/packages/index.html.erb b/app/views/packages/index.html.erb index 18130de..133c86a 100644 --- a/app/views/packages/index.html.erb +++ b/app/views/packages/index.html.erb @@ -1,31 +1,99 @@ - + + + +

Search for a package/description:

- <%= form_tag(url_for, method: "get", class: "form-search") do %> -
- <%= text_field_tag :search, params[:search], autofocus: true, placeholder: 'What are you looking for...', class: "search-query" %> - +
+ <%= form_tag(url_for, method: "get", class: "form-search") do %> +
+ <%= text_field_tag :search, params[:search], autofocus: true, placeholder: 'What are you looking for...', class: "search-query" %> + +
+ +
+ + + + +
+ + + + +
+
+
+ + + + +
+
- +
+ + + +
<% end %> -
-
- - - - -
-
<%= render "packages_search_results", object: @packages %>
diff --git a/hello, rails b/hello, rails deleted file mode 100644 index e69de29..0000000