piccle 0.1.0.rc1 → 0.1.1.pre
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/{agpl-3.0.md → LICENSE.md} +0 -0
- data/NOTES.md +8 -17
- data/README.md +66 -18
- data/assets/css/default.css +87 -19
- data/bin/piccle +31 -18
- data/db/migrations/006_create_people_and_join_table.rb +14 -0
- data/db/migrations/007_add_indexes.rb +14 -0
- data/lib/piccle.rb +3 -2
- data/lib/piccle/extractor.rb +14 -5
- data/lib/piccle/js_renderer.rb +4 -2
- data/lib/piccle/models/person.rb +6 -0
- data/lib/piccle/models/photo.rb +28 -4
- data/lib/piccle/parser.rb +7 -1
- data/lib/piccle/renderer.rb +61 -10
- data/lib/piccle/streams/base_stream.rb +7 -3
- data/lib/piccle/streams/date_stream.rb +1 -1
- data/lib/piccle/streams/event_stream.rb +34 -11
- data/lib/piccle/streams/keyword_stream.rb +2 -1
- data/lib/piccle/streams/person_stream.rb +16 -0
- data/lib/piccle/version.rb +1 -1
- data/templates/_header.handlebars.slim +8 -4
- data/templates/index.html.handlebars.slim +55 -13
- data/templates/show.html.handlebars.slim +59 -57
- metadata +7 -4
- data/.travis.yml +0 -5
@@ -10,7 +10,8 @@ class Piccle::Streams::KeywordStream < Piccle::Streams::BaseStream
|
|
10
10
|
def data_for(photo)
|
11
11
|
result = { namespace => {
|
12
12
|
:friendly_name => "By Topic",
|
13
|
-
:interesting => true
|
13
|
+
:interesting => true,
|
14
|
+
:min_for_nav => 2
|
14
15
|
}}
|
15
16
|
photo.keywords.each do |kw|
|
16
17
|
result[namespace][slugify(kw.name)] = { friendly_name: kw.name, interesting: true, photos: [photo.md5] }
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Browse photos by person.
|
4
|
+
class Piccle::Streams::PersonStream < Piccle::Streams::BaseStream
|
5
|
+
def namespace
|
6
|
+
"by-person"
|
7
|
+
end
|
8
|
+
|
9
|
+
def data_for(photo)
|
10
|
+
result = { namespace => { :friendly_name => "By Person", :interesting => true, :min_for_nav => 2 } }
|
11
|
+
photo.people.each do |person|
|
12
|
+
result[namespace][slugify(person.name)] = { friendly_name: person.name, interesting: true, photos: [photo.md5] }
|
13
|
+
end
|
14
|
+
result
|
15
|
+
end
|
16
|
+
end
|
data/lib/piccle/version.rb
CHANGED
@@ -2,6 +2,7 @@ head
|
|
2
2
|
meta charset="utf-8"
|
3
3
|
meta name="viewport" content="width=device-width, initial-scale=1"
|
4
4
|
title Photography by {{site_metadata.author_name}}
|
5
|
+
meta name="description" content="{{page_description}}"
|
5
6
|
link rel="stylesheet" href="{{include_prefix}}css/normalize.css"
|
6
7
|
link rel="stylesheet" href="{{include_prefix}}css/default.css"
|
7
8
|
link rel="icon" href="{{include_prefix}}icons/favicon.ico"
|
@@ -14,14 +15,17 @@ head
|
|
14
15
|
{{#if canonical}}
|
15
16
|
<link rel="canonical" href="{{include_prefix}}{{canonical}}" />
|
16
17
|
{{/if}}
|
17
|
-
{{#if prev_link}}
|
18
|
-
<link rel="prev" href="{{
|
18
|
+
{{#if prev_link}} {{! Previous and next links don't need the include prefix; they're always in the current directory. }}
|
19
|
+
<link rel="prev" href="{{prev_link}}" />
|
19
20
|
{{/if}}
|
20
21
|
{{#if next_link}}
|
21
|
-
<link rel="next" href="{{
|
22
|
+
<link rel="next" href="{{next_link}}" />
|
22
23
|
{{/if}}
|
23
24
|
{{#if site_url}}
|
24
|
-
<link rel="alternate" type="application/atom+xml" href="{{include_prefix}}
|
25
|
+
<link rel="alternate" type="application/atom+xml" href="{{include_prefix}}feed.atom" title="All photos" />
|
26
|
+
{{#if selector}}
|
27
|
+
<link rel="alternate" type="application/atom+xml" href="{{include_prefix}}{{join selector '/'}}/feed.atom" title="{{open_graph.title}}" />
|
28
|
+
{{/if}}
|
25
29
|
{{/if}}
|
26
30
|
{{#if open_graph}}
|
27
31
|
<meta property="og:type" content="website" />
|
@@ -1,36 +1,78 @@
|
|
1
1
|
doctype html
|
2
|
-
html
|
2
|
+
html lang="en"
|
3
3
|
== Piccle::TemplateHelpers.render_partial "header"
|
4
4
|
|
5
5
|
body.photos_index
|
6
6
|
header
|
7
|
-
|
|
8
|
-
{{#if selector}}
|
9
|
-
<h1><a href="{{include_prefix}}index.html">Photography by {{site_metadata.author_name}}</a></h1>
|
10
|
-
{{else}}
|
11
|
-
<h1>Photography by {{site_metadata.author_name}}</a></h1>
|
12
|
-
{{/if}}
|
7
|
+
| <h1><a href="{{include_prefix}}index.html">Photography by {{site_metadata.author_name}}</a></h1>
|
13
8
|
== Piccle::TemplateHelpers.render_partial "breadcrumbs"
|
14
9
|
main
|
15
10
|
== Piccle::TemplateHelpers.render_partial "navigation"
|
16
11
|
|
17
|
-
|
12
|
+
#photos
|
18
13
|
|
|
19
14
|
{{#each photos as |photo|}}
|
20
15
|
{{#if (lookup ../event_ends photo.hash)}}
|
21
16
|
{{#with (lookup ../event_ends hash)}}
|
22
|
-
|
17
|
+
{{#if collapsed}} {{! Collapsed events don't show photos, only an initial end tile. }}
|
18
|
+
<p class="event_block collapsed" style="background-image: url('{{../include_prefix}}{{join selector '/'}}/quilt.jpg');">
|
19
|
+
<a href="{{../include_prefix}}{{join selector '/'}}/index.html">{{name}}</a>
|
20
|
+
</p>
|
21
|
+
{{else}} {{! Not collapsed, show the photo here }}
|
22
|
+
<p class="event_block event_end">
|
23
|
+
<a href="{{../include_prefix}}{{join selector '/'}}/index.html">{{name}}</a>
|
24
|
+
</p>
|
25
|
+
<a href="{{../include_prefix}}{{../selector_path}}{{photo.hash}}.html#photo">
|
26
|
+
<img class="thumbnail" src="{{../include_prefix}}images/thumbnails/{{photo.hash}}.{{photo.file_name}}" alt="{{photo.title}}" width="#{Piccle::THUMBNAIL_SIZE}" height="#{Piccle::THUMBNAIL_SIZE}" />
|
27
|
+
</a>
|
28
|
+
{{/if}}
|
23
29
|
{{/with}}
|
30
|
+
{{else}} {{! Not an event end tile, always show the photo }}
|
31
|
+
<a href="{{../include_prefix}}{{../selector_path}}{{photo.hash}}.html#photo">
|
32
|
+
<img class="thumbnail" src="{{../include_prefix}}images/thumbnails/{{photo.hash}}.{{photo.file_name}}" alt="{{photo.title}}" width="#{Piccle::THUMBNAIL_SIZE}" height="#{Piccle::THUMBNAIL_SIZE}" />
|
33
|
+
</a>
|
24
34
|
{{/if}}
|
25
|
-
<a href="{{../include_prefix}}{{../selector_path}}{{photo.hash}}.html#photo">
|
26
|
-
<img class="thumbnail" src="{{../include_prefix}}images/thumbnails/{{photo.hash}}.{{photo.file_name}}" alt="{{photo.title}}" />
|
27
|
-
</a>
|
28
35
|
{{#if (lookup ../event_starts photo.hash)}}
|
29
36
|
{{#with (lookup ../event_starts hash)}}
|
30
|
-
|
37
|
+
{{#unless collapsed}}
|
38
|
+
<p class="event_block event_start"><a href="{{../include_prefix}}{{join selector '/'}}/index.html">{{name}}</a></p>
|
39
|
+
{{/unless}}
|
31
40
|
{{/with}}
|
32
41
|
{{/if}}
|
33
42
|
{{/each}}
|
34
43
|
|
44
|
+
|
|
45
|
+
{{#if pagination}}
|
46
|
+
<div class="pagination">
|
47
|
+
{{#unless pagination.is_first_page}}
|
48
|
+
{{#if selector}}
|
49
|
+
<a href="{{include_prefix}}{{join selector '/'}}/{{pagination.previous_page_name}}.html#photos">« Previous</a>
|
50
|
+
{{else}}
|
51
|
+
<a href="{{include_prefix}}{{pagination.previous_page_name}}.html#photos">« Previous</a>
|
52
|
+
{{/if}}
|
53
|
+
{{/unless}}
|
54
|
+
<ol>
|
55
|
+
{{#each pagination.pages}}
|
56
|
+
{{#if this.is_current}}
|
57
|
+
<li class="current">{{this.label}}</li>
|
58
|
+
{{else}}
|
59
|
+
{{#if selector}}
|
60
|
+
<li><a href="{{include_prefix}}{{join selector '/'}}/{{this.page_name}}.html#photos">{{this.label}}</a></li>
|
61
|
+
{{else}}
|
62
|
+
<li><a href="{{include_prefix}}{{this.page_name}}.html#photos">{{this.label}}</a></li>
|
63
|
+
{{/if}}
|
64
|
+
{{/if}}
|
65
|
+
{{/each}}
|
66
|
+
</ol>
|
67
|
+
{{#unless pagination.is_last_page}}
|
68
|
+
{{#if selector}}
|
69
|
+
<a href="{{include_prefix}}{{join selector '/'}}/{{pagination.next_page_name}}.html#photos">Next »</a>
|
70
|
+
{{else}}
|
71
|
+
<a href="{{include_prefix}}{{pagination.next_page_name}}.html#photos">Next »</a>
|
72
|
+
{{/if}}
|
73
|
+
{{/unless}}
|
74
|
+
</div>
|
75
|
+
{{/if}}
|
76
|
+
|
35
77
|
== Piccle::TemplateHelpers.render_partial "footer"
|
36
78
|
|
@@ -1,64 +1,66 @@
|
|
1
|
-
|
1
|
+
doctype html
|
2
|
+
html lang="en"
|
3
|
+
== Piccle::TemplateHelpers.render_partial "header"
|
2
4
|
|
3
|
-
body.photo_show
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
5
|
+
body.photo_show
|
6
|
+
header
|
7
|
+
h1
|
8
|
+
a href="{{include_prefix}}index.html" Photography by {{site_metadata.author_name}}
|
9
|
+
== Piccle::TemplateHelpers.render_partial "breadcrumbs"
|
10
|
+
main#photo
|
11
|
+
h2
|
12
|
+
| {{photo.title}}
|
13
|
+
.photo_with_pagination
|
14
|
+
| {{#if prev_link}}
|
15
|
+
<a class="navigation_arrow" href="{{include_prefix}}{{prev_link}}#photo">«</a>
|
16
|
+
{{else}}
|
17
|
+
<span class="navigation_arrow"> </span>
|
18
|
+
{{/if}}
|
19
|
+
img src="{{include_prefix}}images/photos/{{photo.hash}}.{{photo.file_name}}"
|
20
|
+
| {{#if next_link}}
|
21
|
+
<a class="navigation_arrow" href="{{include_prefix}}{{next_link}}#photo">»</a>
|
22
|
+
{{else}}
|
23
|
+
<span class="navigation_arrow"> </span>
|
24
|
+
{{/if}}
|
25
|
+
|
26
|
+
p.description
|
27
|
+
| {{photo.description}}
|
28
|
+
p.settings
|
29
|
+
| {{#if camera_link}}
|
30
|
+
<a href="{{include_prefix}}{{camera_link.link}}">{{camera_link.friendly_name}}</a>{{/if}}{{#if photo.focal_length}}, {{photo.focal_length}}{{/if}}{{#if photo.aperture}}, f/{{photo.aperture}}{{/if}}{{#if photo.shutter_speed}}, {{photo.shutter_speed}}{{/if}}{{#if photo.iso}}, ISO {{photo.iso}}{{/if}}.
|
31
|
+
| {{#if photo.taken_at}}
|
32
|
+
<p class="date">
|
33
|
+
{{#if day_link}}<a href="{{include_prefix}}{{day_link.link}}">{{day_link.friendly_name}}</a>{{/if}}
|
34
|
+
{{#if month_link}}<a href="{{include_prefix}}{{month_link.link}}">{{month_link.friendly_name}}</a>, {{/if}}
|
35
|
+
{{#if year_link}}<a href="{{include_prefix}}{{year_link.link}}">{{year_link.friendly_name}}</a>.{{/if}}
|
36
|
+
</p>
|
16
37
|
{{/if}}
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
38
|
+
{{#if photo.has_location}}
|
39
|
+
<ul class="location">
|
40
|
+
{{#if city_link}}<li><a href="{{include_prefix}}{{city_link.link}}">{{city_link.friendly_name}}</a></li>{{/if}}
|
41
|
+
{{#if state_link}}<li><a href="{{include_prefix}}{{state_link.link}}">{{state_link.friendly_name}}</a></li>{{/if}}
|
42
|
+
{{#if country_link}}<li><a href="{{include_prefix}}{{country_link.link}}">{{country_link.friendly_name}}</a></li>{{/if}}
|
43
|
+
</ul>
|
22
44
|
{{/if}}
|
23
45
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
{{#if day_link}}<a href="{{include_prefix}}{{day_link.link}}">{{day_link.friendly_name}}</a>{{/if}}
|
32
|
-
{{#if month_link}}<a href="{{include_prefix}}{{month_link.link}}">{{month_link.friendly_name}}</a>, {{/if}}
|
33
|
-
{{#if year_link}}<a href="{{include_prefix}}{{year_link.link}}">{{year_link.friendly_name}}</a>.{{/if}}
|
34
|
-
</p>
|
35
|
-
{{/if}}
|
36
|
-
{{#if photo.has_location}}
|
37
|
-
<ul class="location">
|
38
|
-
{{#if city_link}}<li><a href="{{include_prefix}}{{city_link.link}}">{{city_link.friendly_name}}</a></li>{{/if}}
|
39
|
-
{{#if state_link}}<li><a href="{{include_prefix}}{{state_link.link}}">{{state_link.friendly_name}}</a></li>{{/if}}
|
40
|
-
{{#if country_link}}<li><a href="{{include_prefix}}{{country_link.link}}">{{country_link.friendly_name}}</a></li>{{/if}}
|
41
|
-
</ul>
|
42
|
-
{{/if}}
|
46
|
+
| {{#if keywords}}
|
47
|
+
<div class="keywords">
|
48
|
+
{{#each keywords as |keyword|}}
|
49
|
+
<a href="{{../include_prefix}}{{keyword.link}}">{{keyword.friendly_name}}</a>
|
50
|
+
{{/each}}
|
51
|
+
</div>
|
52
|
+
{{/if}}
|
43
53
|
|
44
|
-
|
45
|
-
|
46
|
-
{{#each
|
47
|
-
|
54
|
+
.streams
|
55
|
+
|
|
56
|
+
{{#each substreams as |stream|}}
|
57
|
+
<section>
|
58
|
+
<h2>{{stream.title}}</h2>
|
59
|
+
<div class="stream">
|
60
|
+
== Piccle::TemplateHelpers.render_partial "substream"
|
61
|
+
|
|
62
|
+
</div>
|
63
|
+
</section>
|
48
64
|
{{/each}}
|
49
|
-
</div>
|
50
|
-
{{/if}}
|
51
|
-
|
52
|
-
.streams
|
53
|
-
|
|
54
|
-
{{#each substreams as |stream|}}
|
55
|
-
<section>
|
56
|
-
<h2>{{stream.title}}</h2>
|
57
|
-
<div class="stream">
|
58
|
-
== Piccle::TemplateHelpers.render_partial "substream"
|
59
|
-
|
|
60
|
-
</div>
|
61
|
-
</section>
|
62
|
-
{{/each}}
|
63
65
|
|
64
|
-
== Piccle::TemplateHelpers.render_partial "footer"
|
66
|
+
== Piccle::TemplateHelpers.render_partial "footer"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: piccle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1.pre
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Pounds
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-02-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -260,12 +260,11 @@ extra_rdoc_files: []
|
|
260
260
|
files:
|
261
261
|
- ".gitignore"
|
262
262
|
- ".rspec"
|
263
|
-
- ".travis.yml"
|
264
263
|
- Gemfile
|
264
|
+
- LICENSE.md
|
265
265
|
- NOTES.md
|
266
266
|
- README.md
|
267
267
|
- Rakefile
|
268
|
-
- agpl-3.0.md
|
269
268
|
- assets/css/default.css
|
270
269
|
- assets/css/normalize.css
|
271
270
|
- assets/icons/android-chrome-192x192.png
|
@@ -282,6 +281,8 @@ files:
|
|
282
281
|
- db/migrations/003_create_keywords_and_join_table.rb
|
283
282
|
- db/migrations/004_add_focal_length.rb
|
284
283
|
- db/migrations/005_create_locations.rb
|
284
|
+
- db/migrations/006_create_people_and_join_table.rb
|
285
|
+
- db/migrations/007_add_indexes.rb
|
285
286
|
- js-renderer/handlebars.min-v4.7.6.js
|
286
287
|
- js-renderer/renderer.js
|
287
288
|
- lib/piccle.rb
|
@@ -292,6 +293,7 @@ files:
|
|
292
293
|
- lib/piccle/js_renderer.rb
|
293
294
|
- lib/piccle/models/keyword.rb
|
294
295
|
- lib/piccle/models/location.rb
|
296
|
+
- lib/piccle/models/person.rb
|
295
297
|
- lib/piccle/models/photo.rb
|
296
298
|
- lib/piccle/parser.rb
|
297
299
|
- lib/piccle/quilt_generator.rb
|
@@ -303,6 +305,7 @@ files:
|
|
303
305
|
- lib/piccle/streams/event_stream.rb
|
304
306
|
- lib/piccle/streams/keyword_stream.rb
|
305
307
|
- lib/piccle/streams/location_stream.rb
|
308
|
+
- lib/piccle/streams/person_stream.rb
|
306
309
|
- lib/piccle/template_helpers.rb
|
307
310
|
- lib/piccle/version.rb
|
308
311
|
- lib/tasks/development.rake
|