Merge branch 'master' of bitbucket.org:signum/debshots

Conflicts:
	debshots.komodoproject
This commit is contained in:
Christoph Haas 2013-08-21 23:09:54 +02:00
commit 93177ab578
10 changed files with 139 additions and 59 deletions

View file

@ -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'

View file

@ -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)

View file

@ -14,4 +14,5 @@
//= require jquery_ujs
//= require fancybox
//= require turbolinks
//= require twitter/bootstrap
//= require_tree .

View file

@ -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

View file

@ -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";

View file

@ -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

View file

@ -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"

View file

@ -1,6 +1,5 @@
<%= paginator.render do -%>
<div class="pagination">
<ul>
<ul class="pagination">
<%= first_page_tag unless current_page.first? %>
<%= prev_page_tag unless current_page.first? %>
<% each_page do |page| -%>
@ -12,6 +11,5 @@
<% end -%>
<%= next_page_tag unless current_page.last? %>
<%= last_page_tag unless current_page.last? %>
</ul>
</div>
</ul>
<% end -%>

View file

@ -1,31 +1,99 @@
<div class="navbar navbar-inverse navbar-fixed-top">
foo
</div>
<nav class="navbar navbar-default" role="navigation"
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Brand</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse navbar-ex1-collapse">
<ul class="nav navbar-nav">
<li class="active"><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#">Action</a></li>
<li><a href="#">Another action</a></li>
<li><a href="#">Something else here</a></li>
<li><a href="#">Separated link</a></li>
<li><a href="#">One more separated link</a></li>
</ul>
</li>
</ul>
<form class="navbar-form navbar-left" role="search">
<div class="form-group">
<input type="text" class="form-control" placeholder="Search">
</div>
<button type="submit" class="btn btn-default">Submit</button>
</form>
<ul class="nav navbar-nav navbar-right">
<li><a href="#">Link</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#">Action</a></li>
<li><a href="#">Another action</a></li>
<li><a href="#">Something else here</a></li>
<li><a href="#">Separated link</a></li>
</ul>
</li>
</ul>
</div><!-- /.navbar-collapse -->
</nav>
<div class="container">
<h1>Search for a package/description:</h1>
<%= form_tag(url_for, method: "get", class: "form-search") do %>
<div class="input-append">
<%= text_field_tag :search, params[:search], autofocus: true, placeholder: 'What are you looking for...', class: "search-query" %>
<button class="btn" type="submit">Search!</button>
<div class="btn-toolbar">
<%= form_tag(url_for, method: "get", class: "form-search") do %>
<div class="input-append">
<%= text_field_tag :search, params[:search], autofocus: true, placeholder: 'What are you looking for...', class: "search-query" %>
<button class="btn" type="submit">Search!</button>
</div>
<div class="btn-group">
<!--<a class="btn" href="#"><i class="icon-th"></i></a>-->
<!--<a class="btn" href="#"><i class="icon-th-list"></i></a>-->
<button type="button" class="btn" value="1">With screenshots only</button>
<button type="button" class="btn" value="0">Any</button>
</div>
<!--<label class="checkbox">-->
<!-- <%= check_box_tag 'with_screenshots', 'yes', params[:with_screenshots] %> -->
<!-- Show only packages with screenshots -->
<!--</label>-->
</div>
<div class="btn-toolbar">
<div class="btn-group">
<a class="btn" href="#"><i class="icon-align-left"></i></a>
<a class="btn" href="#"><i class="icon-align-center"></i></a>
<a class="btn" href="#"><i class="icon-align-right"></i></a>
<a class="btn" href="#"><i class="icon-align-justify"></i></a>
</div>
</div>
<label class="checkbox">
<%= check_box_tag 'with_screenshots', 'yes', params[:with_screenshots] %>
Show only packages with screenshots
</label>
<div class="btn-group" data-toggle="buttons">
<label class="btn btn-primary">
<input type="radio" name="options" id="option1"> Option 1
</label>
<label class="btn btn-primary">
<input type="radio" name="options" id="option2"> Option 2
</label>
<label class="btn btn-primary">
<input type="radio" name="options" id="option3"> Option 3
</label>
</div>
<% end %>
<div class="btn-toolbar">
<div class="btn-group">
<a class="btn" href="#"><i class="icon-align-left"></i></a>
<a class="btn" href="#"><i class="icon-align-center"></i></a>
<a class="btn" href="#"><i class="icon-align-right"></i></a>
<a class="btn" href="#"><i class="icon-align-justify"></i></a>
</div>
</div>
<%= render "packages_search_results", object: @packages %>
</div>

View file