Skip to content

Commit 2e34654

Browse files
committed
Initial commit
0 parents  commit 2e34654

File tree

18 files changed

+303
-0
lines changed

18 files changed

+303
-0
lines changed

.gitignore

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
*.gem
2+
*.rbc
3+
.bundle
4+
.config
5+
.yardoc
6+
Gemfile.lock
7+
InstalledFiles
8+
_yardoc
9+
coverage
10+
doc/
11+
lib/bundler/man
12+
pkg
13+
rdoc
14+
spec/reports
15+
test/tmp
16+
test/version_tmp
17+
tmp
18+
jetty
19+
spec/internal

.travis.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
notifications:
2+
email: false
3+
4+
rvm:
5+
- 2.1.0
6+
- 2.0.0
7+
- 1.9.3
8+
- jruby-19mode
9+
10+
notifications:
11+
irc: "irc.freenode.org#blacklight"
12+
email:
13+
- blacklight-commits@googlegroups.com
14+
15+
env:
16+
global:
17+
- JRUBY_OPTS="-J-Xms512m -J-Xmx1024m"
18+
- NOKOGIRI_USE_SYSTEM_LIBRARIES=true

Gemfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
source 'https://rubygems.org'
2+
3+
# Specify your gem's dependencies in blacklight-table.gemspec
4+
gemspec
5+
6+
group :test do
7+
gem "bootstrap-sass"
8+
gem 'turbolinks'
9+
gem 'sass-rails'
10+
end
11+
12+
gem 'activerecord-jdbcsqlite3-adapter', :platform => :jruby
13+
14+
if File.exists?('spec/test_app_templates/Gemfile.extra')
15+
eval File.read('spec/test_app_templates/Gemfile.extra'), nil, 'spec/test_app_templates/Gemfile.extra'
16+
end

LICENSE

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Copyright 2014 Chris Beer.
2+
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
7+
http://www.apache.org/licenses/LICENSE-2.0
8+
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License.

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Blacklight::Table
2+
3+
Table views for Blacklight search results
4+
5+
## Installation
6+
7+
Add this line to your Blacklight application's Gemfile:
8+
9+
gem 'blacklight-table'
10+
11+
And then execute:
12+
13+
$ bundle
14+
15+
Or install it yourself as:
16+
17+
$ gem install blacklight-table
18+
19+
## Usage
20+
21+
Run the table generator:
22+
23+
$ rails g blacklight_table:install
24+
25+
26+
27+
## Contributing
28+
29+
1. Fork it ( http://github.com/<my-github-username>/blacklight-table/fork )
30+
2. Create your feature branch (`git checkout -b my-new-feature`)
31+
3. Commit your changes (`git commit -am 'Add some feature'`)
32+
4. Push to the branch (`git push origin my-new-feature`)
33+
5. Create new Pull Request

Rakefile

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
require "bundler/gem_tasks"
2+
3+
ZIP_URL = "https://github.com/projectblacklight/blacklight-jetty/archive/v4.6.0.zip"
4+
APP_ROOT = File.dirname(__FILE__)
5+
6+
require 'rspec/core/rake_task'
7+
require 'engine_cart/rake_task'
8+
9+
require 'jettywrapper'
10+
require 'blacklight'
11+
12+
task :default => :ci
13+
14+
desc "Run specs"
15+
RSpec::Core::RakeTask.new do |t|
16+
17+
end
18+
19+
desc "Load fixtures"
20+
task :fixtures => ['engine_cart:generate'] do
21+
within_test_app do
22+
system "rake blacklight:solr:seed RAILS_ENV=test"
23+
abort "Error running fixtures" unless $?.success?
24+
end
25+
end
26+
27+
desc "Execute Continuous Integration build"
28+
task :ci => ['jetty:clean', 'engine_cart:generate'] do
29+
30+
require 'jettywrapper'
31+
jetty_params = {
32+
:jetty_home => File.expand_path(File.dirname(__FILE__) + '/jetty'),
33+
:quiet => false,
34+
:jetty_port => 8888,
35+
:solr_home => File.expand_path(File.dirname(__FILE__) + '/jetty/solr'),
36+
:startup_wait => 30
37+
}
38+
39+
error = Jettywrapper.wrap(jetty_params) do
40+
Rake::Task['fixtures'].invoke
41+
Rake::Task['spec'].invoke
42+
end
43+
raise "test failures: #{error}" if error
44+
end
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<% counter = document_counter_with_offset(document_counter) %>
2+
3+
<tr class="document-row <%= render_document_class document %>" itemscope itemtype="<%= document.itemtype %>">
4+
<td class="counter"><%= counter %></td>
5+
<td class="index_title"><%= link_to_document document, label:document_show_link_field(document) %></td>
6+
<td>
7+
<%= render_index_doc_actions document, wrapping_class: "index-document-functions col-sm-3 col-lg-2" %>
8+
</td>
9+
<% fields.each do |key, config| %>
10+
<td><%= render_index_field_value document, field: key %></td>
11+
<% end %>
12+
</tr>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<table id="documents" class="table table-striped">
2+
<thead>
3+
<tr>
4+
<th><%= t('blacklight.table.counter') %></th>
5+
<th><%= t('blacklight.table.title') %></th>
6+
<th><%= t('blacklight.table.document_actions') %></th>
7+
<% index_fields.each do |key, field| %>
8+
<th><%= render_index_field_label field: key %></th>
9+
<% end %>
10+
</tr>
11+
</thead>
12+
<tbody>
13+
<%= render partial: "document_row", collection: documents, as: :document, locals: { fields: index_fields } %>
14+
</tbody>
15+
</table>

blacklight-table.gemspec

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# coding: utf-8
2+
lib = File.expand_path('../lib', __FILE__)
3+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4+
require 'blacklight/table/version'
5+
6+
Gem::Specification.new do |spec|
7+
spec.name = "blacklight-table"
8+
spec.version = Blacklight::Table::VERSION
9+
spec.authors = ["Chris Beer"]
10+
spec.email = ["cabeer@stanford.edu"]
11+
spec.summary = %q{Tabular results view for Blacklight}
12+
spec.homepage = ""
13+
spec.license = "Apache 2.0"
14+
15+
spec.files = `git ls-files`.split($/)
16+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
17+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18+
spec.require_paths = ["lib"]
19+
20+
spec.add_dependency "blacklight", "~> 5.0"
21+
22+
spec.add_development_dependency "bundler", "~> 1.5"
23+
spec.add_development_dependency "rake"
24+
spec.add_development_dependency "rspec-rails"
25+
spec.add_development_dependency "jettywrapper"
26+
spec.add_development_dependency "engine_cart"
27+
spec.add_development_dependency "capybara"
28+
end
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
en:
2+
blacklight:
3+
search:
4+
view:
5+
table: "Table"
6+
table:
7+
counter: ""
8+
title: "Title"
9+
document_actions: ""

0 commit comments

Comments
 (0)