annotot 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 73ff37edcbe6076b7c13b627f604e810444a3ef2
4
- data.tar.gz: 48dc1b3a6e082c65ad30059de75efef4795dd69e
3
+ metadata.gz: c5bd1207b3ba2bb60701673db33de0b9953e1e77
4
+ data.tar.gz: f9bb150456f7b2762f746aec0e66f1ed065b98af
5
5
  SHA512:
6
- metadata.gz: 3b9cd548ed28a8d7bea2fbff4012fcf5cc0325dd798c4af622479100b645a3d8b614187bb4b2e5177c9c1ca1726d80a2b0aba7661eb78772fae49f60ac295a36
7
- data.tar.gz: 7b60a2cb545fcb9aae0a58a243f298bebc762fc39a50bd89ac0c567b878907f68cc0325d0a138d80138d6950dcbe42c10fc482f19277050a3e6605e64783eb9a
6
+ metadata.gz: 8f34b47a7bfa1d9d8bf350504d84ea16f86542485c44986de3a8aa96fc92ca0eab528398eb8c18c04644237c94c719dbd9f1099528e574a5fb34f5b91f6ef6a9
7
+ data.tar.gz: b40be90b397744e72359223532cdcfa3e7e594f0b9701c66faf3c1ad6cb6376f1abc1955404dff3124be238ab6a54a2a5f6ff099e8434eb29b1d7e484a224957
data/README.md CHANGED
@@ -3,6 +3,8 @@
3
3
 
4
4
  Need to persist annotations quick and easily? Annotot, the original mini annotation API is for you. Don't annotate, annotot instead.
5
5
 
6
+ h/t @efahy for the inspiration and name
7
+
6
8
  ![](annotot.png)
7
9
 
8
10
  This logo, "Annotot", is a derivative of "[Sweet Potato Tator Tots](https://www.flickr.com/photos/flyfarther79/6270223411/)" by [Lisa Brettschneider](https://www.flickr.com/photos/flyfarther79/) used under [CC BY-NC 2.0](https://creativecommons.org/licenses/by-nc/2.0/). "Annotot" is also licensed under [CC BY-NC 2.0](https://creativecommons.org/licenses/by-nc/2.0/).
@@ -9,6 +9,11 @@ module Annotot
9
9
  @annotations = Annotation.where(canvas: annotation_search_params)
10
10
  end
11
11
 
12
+ # Get /annotations/lists
13
+ def lists
14
+ @annotations = Annotation.where(canvas: annotation_search_params)
15
+ end
16
+
12
17
  # POST /annotations
13
18
  def create
14
19
  @annotation = Annotation.new(annotation_params)
@@ -0,0 +1,4 @@
1
+ json.set! '@context', 'http://iiif.io/api/presentation/2/context.json'
2
+ json.set! '@id', request.original_url
3
+ json.set! '@type', 'sc:AnnotationList'
4
+ json.resources(@annotations.map { |a| JSON.parse(a.data) })
data/config/routes.rb CHANGED
@@ -1,3 +1,7 @@
1
1
  Annotot::Engine.routes.draw do
2
- resources :annotations, except: %i[new edit show], defaults: { format: :json }
2
+ resources :annotations, except: %i[new edit show], defaults: { format: :json } do
3
+ collection do
4
+ get 'lists'
5
+ end
6
+ end
3
7
  end
@@ -1,3 +1,3 @@
1
1
  module Annotot
2
- VERSION = '0.1.0'
2
+ VERSION = '0.2.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: annotot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jack Reed
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-02-20 00:00:00.000000000 Z
11
+ date: 2018-02-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -116,6 +116,7 @@ files:
116
116
  - app/models/annotot/annotation.rb
117
117
  - app/models/annotot/application_record.rb
118
118
  - app/views/annotot/annotations/index.json.erb
119
+ - app/views/annotot/annotations/list.json.jbuilder
119
120
  - app/views/layouts/annotot/application.html.erb
120
121
  - config/routes.rb
121
122
  - db/migrate/20180215183225_create_annotot_annotations.rb