blacklight-table 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 61ecd23339f01a5c14bd8cc2d0396d37033ddfa9
4
+ data.tar.gz: 35029d96e1ba2211af522eb3f138e477717e6f11
5
+ SHA512:
6
+ metadata.gz: b01751112e1a2528bfc9173cd140d1775e61be2804a31a95d27c23d2b459d8eba97294e70964614fcd56cb785f8653e57a199cdce06453d50b49ca5cd7ace1e5
7
+ data.tar.gz: 0ab91a0cdd569c639f9b2ddcc73ac51b7884ed97a5655ac6054f1de18bb2ad59fb4b3815af80d2921b09867531e36efeab5e705c5487ee6db4ab4e4b1efff3f5
@@ -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
@@ -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
data/Gemfile ADDED
@@ -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
data/LICENSE ADDED
@@ -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.
@@ -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
@@ -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
@@ -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>
@@ -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>
@@ -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
@@ -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,0 +1,6 @@
1
+ require "blacklight/table/version"
2
+ module Blacklight
3
+ module Table
4
+ require "blacklight/table/engine"
5
+ end
6
+ end
@@ -0,0 +1,10 @@
1
+ require 'blacklight'
2
+
3
+ module Blacklight
4
+ module Table
5
+ class Engine < Rails::Engine
6
+ Blacklight::Configuration.default_values[:view].table.icon_class = "glyphicon-calendar"
7
+ Blacklight::Configuration.default_values[:view].table.partials = []
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,5 @@
1
+ module Blacklight
2
+ module Table
3
+ VERSION = "0.0.1"
4
+ end
5
+ end
@@ -0,0 +1,9 @@
1
+ require 'rails/generators'
2
+
3
+ module BlacklightGallery
4
+ class Install < Rails::Generators::Base
5
+
6
+ def assets
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,10 @@
1
+ require 'spec_helper'
2
+
3
+ describe "Table view" do
4
+ before { visit catalog_index_path :q => 'medicine', :view => 'table' }
5
+
6
+ it "should display results in a galley view" do
7
+ expect(page).to have_selector("table#documents")
8
+ expect(page).to have_content("Strong Medicine speaks")
9
+ end
10
+ end
@@ -0,0 +1,10 @@
1
+ ENV["RAILS_ENV"] ||= 'test'
2
+
3
+ require 'blacklight'
4
+ require 'blacklight/table'
5
+
6
+ require 'engine_cart'
7
+ EngineCart.load_application!
8
+
9
+ require 'rspec/rails'
10
+ require 'capybara/rspec'
@@ -0,0 +1,22 @@
1
+ platforms :jruby do
2
+ gem 'jdbc-sqlite3'
3
+ gem 'mediashelf-loggable', '>= 0.4.8'
4
+ gem 'therubyrhino'
5
+ end
6
+
7
+ platforms :ruby do
8
+ gem 'sqlite3'
9
+ end
10
+
11
+ gem 'jquery-rails'
12
+
13
+ group :test do
14
+ gem 'rspec-rails', '~> 2.13'
15
+ gem 'generator_spec'
16
+ gem 'poltergeist'
17
+ gem 'simplecov'
18
+ end
19
+
20
+ gem 'jettywrapper', '>= 1.2.0'
21
+
22
+ gem 'blacklight'
@@ -0,0 +1,24 @@
1
+ require 'rails/generators'
2
+
3
+ class TestAppGenerator < Rails::Generators::Base
4
+ source_root File.expand_path("../../../../test_app_templates", __FILE__)
5
+
6
+ def remove_index
7
+ remove_file "public/index.html"
8
+ end
9
+
10
+ def run_blacklight_generator
11
+ say_status("warning", "GENERATING BL", :yellow)
12
+
13
+ Bundler.with_clean_env do
14
+ run "bundle install"
15
+ end
16
+
17
+ generate 'blacklight:install'
18
+ end
19
+
20
+ def run_gallery_install
21
+ generate 'blacklight_table:install'
22
+ end
23
+
24
+ end
metadata ADDED
@@ -0,0 +1,164 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: blacklight-table
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Chris Beer
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-02-06 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: blacklight
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '5.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '5.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.5'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.5'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec-rails
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: jettywrapper
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: engine_cart
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: capybara
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ description:
112
+ email:
113
+ - cabeer@stanford.edu
114
+ executables: []
115
+ extensions: []
116
+ extra_rdoc_files: []
117
+ files:
118
+ - ".gitignore"
119
+ - ".travis.yml"
120
+ - Gemfile
121
+ - LICENSE
122
+ - README.md
123
+ - Rakefile
124
+ - app/views/catalog/_document_row.html.erb
125
+ - app/views/catalog/_document_table.html.erb
126
+ - blacklight-table.gemspec
127
+ - config/locales/blacklight-table.en.yml
128
+ - lib/blacklight/table.rb
129
+ - lib/blacklight/table/engine.rb
130
+ - lib/blacklight/table/version.rb
131
+ - lib/generators/blacklight_table/install_generator.rb
132
+ - spec/features/table_spec.rb
133
+ - spec/spec_helper.rb
134
+ - spec/test_app_templates/Gemfile.extra
135
+ - spec/test_app_templates/lib/generators/test_app_generator.rb
136
+ homepage: ''
137
+ licenses:
138
+ - Apache 2.0
139
+ metadata: {}
140
+ post_install_message:
141
+ rdoc_options: []
142
+ require_paths:
143
+ - lib
144
+ required_ruby_version: !ruby/object:Gem::Requirement
145
+ requirements:
146
+ - - ">="
147
+ - !ruby/object:Gem::Version
148
+ version: '0'
149
+ required_rubygems_version: !ruby/object:Gem::Requirement
150
+ requirements:
151
+ - - ">="
152
+ - !ruby/object:Gem::Version
153
+ version: '0'
154
+ requirements: []
155
+ rubyforge_project:
156
+ rubygems_version: 2.2.0
157
+ signing_key:
158
+ specification_version: 4
159
+ summary: Tabular results view for Blacklight
160
+ test_files:
161
+ - spec/features/table_spec.rb
162
+ - spec/spec_helper.rb
163
+ - spec/test_app_templates/Gemfile.extra
164
+ - spec/test_app_templates/lib/generators/test_app_generator.rb