bible270 0.15.1 → 0.15.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b0d1b963495f4293f7e9c2a2bfdd6e6bf22c70d632ee6c233f7a977c2e46e124
4
- data.tar.gz: 5ef68e1d13d4e475a674bea5301ba2eed3e7054b1acb29a8cabce68700bf3870
3
+ metadata.gz: 30168f88726808151fb47d82b1ccca08afdbdec56f1005d41d64575d85e21384
4
+ data.tar.gz: 9e63ced217294948d3e9e248ca0fc88da6b6be56e5d1b7988ac0b999661024a4
5
5
  SHA512:
6
- metadata.gz: 55d02aad22edc399886cd67823b186414f1f989e5b672213bfa201445b10feeefdc94350be403689a3d57fa68f7acdcb42258a01f162d5fd71fc1514e292c2ea
7
- data.tar.gz: f6fe740f3208ed91c46e129133cdf533095a121ed76b74c2dc303f5aa5af440dcd14a3b10d7b55a40ac1577387898bc146459de8ee1dea7c928cbbfe61199f81
6
+ metadata.gz: 0b01ce5346e5a2689c8a203f2962edc2a6b826ebcab1952a0a44a1ffcfe43a56b570c7f3c3806da442c822e6b58d7bc409708e9f2f507fb387df9d628f05d776
7
+ data.tar.gz: 132d37fcdaa158e96a3e293ab293cb5934064c1514736df913743189b24cf75bacd980b2b333b0ea71407a629e4edbbf15faf289ad59c8f4533b914d2946ea23
data/README.md CHANGED
@@ -14,7 +14,7 @@ Three readings a day, sized by **verse count** so each day takes roughly the sam
14
14
  - **New Testament** — once through, a reading every day. 260 chapters over 270 days, long chapters are divided to even out the daily reading
15
15
  - **Psalms & Proverbs** — once each, interleaved in one track. 181 chapters have to cover 270 days, so some are divided, shared between the two books by verse load. **A psalm of 25 verses or fewer is never divided**, keeping 131 of the 150 whole; longer psalms and Proverbs chapters break at their turns of thought (see `CHAPTER_BREAKS`). **Psalm 119 is 11 sections of 16 verses** — two of its eight-verse acrostic stanzas each. Proverbs lands on 89 days, near its proportional share. **A divided chapter is always read on consecutive days**, so nothing is inserted between the parts of a split psalm.
16
16
 
17
- Genesis → Malachi and Revelation 22 both land on day 270, as does the second Proverbs 31 — the first falls on day 135, the midpoint. Psalm 150 comes in on day 269. Every day carries all three tracks. A typical day is ~119 verses (range 76–175).
17
+ Genesis → Malachi and Revelation 22 both land on day 270, as does the second part of Proverbs 31. Every day carries all three tracks. A typical day is ~119 verses (range 76–175).
18
18
 
19
19
  The schedule is pure deterministic Ruby (`Bible270::Plan`) — none of it is stored. Portions come from per-chapter verse counts in `Bible270::Versification`. The DB only holds readers, check-offs, comments, and sign-in tokens.
20
20
 
@@ -7,7 +7,8 @@ module Bible270
7
7
  counts = Checkoff.group(:reader_id, :day).count
8
8
  @days_completed = Hash.new(0)
9
9
  counts.each { |(rid, day), n| @days_completed[rid] += 1 if n >= Plan.total_parts(day) }
10
- @readers.sort_by! { |r| [-@days_completed[r.id], r.display_name.to_s] }
10
+ # Progress first, then by name — the same name ordering the admin list uses.
11
+ @readers.sort_by! { |r| [-@days_completed[r.id], r.sort_name] }
11
12
  end
12
13
 
13
14
  # The reader's own progress. Deliberately open to visitors: the panel shows an
@@ -51,6 +51,19 @@ module Bible270
51
51
  end
52
52
  end
53
53
 
54
+ # The mark beside the title in the header. Larger than the favicon and inlined
55
+ # as SVG, so it stays crisp at any size and needs no asset pipeline.
56
+ def b270_mark(size: 38)
57
+ configured = Bible270.config.header_mark
58
+ return nil if configured == false
59
+
60
+ if configured.is_a?(String) && configured.present?
61
+ return image_tag(configured, width: size, height: size, alt: '', class: 'b270-mark')
62
+ end
63
+
64
+ content_tag :span, Favicon.inline_svg(size: size).html_safe, class: 'b270-mark'
65
+ end
66
+
54
67
  def b270_favicon_tag
55
68
  favicon = Bible270.config.favicon
56
69
  return if favicon == false
@@ -136,8 +136,12 @@ module Bible270
136
136
  update(bible_version: Translations.normalize(code))
137
137
  end
138
138
 
139
+ # Readers are listed by first name, matching how they are shown — the display
140
+ # name is "First Last", so sorting on it needs only case folding. Surname
141
+ # order was inconsistent with the community page and read oddly next to names
142
+ # displayed first-name-first.
139
143
  def sort_name
140
- [last_name, first_name].map { |n| n.to_s.strip.downcase }.join(' ').strip.presence || display_name.to_s.downcase
144
+ display_name.to_s.strip.downcase
141
145
  end
142
146
 
143
147
  # ---- staying signed in -------------------------------------------------
@@ -1,7 +1,12 @@
1
1
  <header class="b270-topbar">
2
2
  <div class="b270-brand">
3
- <%= link_to Bible270.config.app_name, root_path, class: "b270-title" %>
4
- <span class="b270-tagline"><%= Bible270.config.tagline %></span>
3
+ <%= link_to root_path, class: "b270-brandlink" do %>
4
+ <%= b270_mark %>
5
+ <span class="b270-brandtext">
6
+ <span class="b270-title"><%= Bible270.config.app_name %></span>
7
+ <span class="b270-tagline"><%= Bible270.config.tagline %></span>
8
+ </span>
9
+ <% end %>
5
10
  </div>
6
11
  <nav class="b270-nav">
7
12
  <%= link_to "Plan", root_path %>
@@ -14,7 +14,12 @@
14
14
  .b270-wrap{max-width:820px;margin:0 auto;padding:clamp(14px,3.5vw,36px) clamp(14px,4vw,40px) 64px}
15
15
 
16
16
  .b270-topbar{display:flex;align-items:center;gap:16px;flex-wrap:wrap;padding-bottom:20px;border-bottom:1px solid var(--line-soft);margin-bottom:26px}
17
- .b270-brand{display:flex;flex-direction:column;margin-right:auto}
17
+ .b270-brand{display:flex;margin-right:auto}
18
+ /* The whole brand is one link, so the mark and the words highlight together. */
19
+ .b270-brandlink{display:flex;align-items:center;gap:12px;text-decoration:none}
20
+ .b270-brandtext{display:flex;flex-direction:column}
21
+ .b270-mark{display:flex;align-items:center;flex:none;line-height:0}
22
+ .b270-mark svg,.b270-mark img{display:block;border-radius:8px}
18
23
  .b270-title{font-family:"Spectral",Georgia,serif;font-weight:600;font-size:22px;text-decoration:none}
19
24
  .b270-tagline{font-size:12px;color:var(--faint);letter-spacing:.04em}
20
25
  .b270-nav{display:flex;align-items:center;gap:16px;font-size:14px}
@@ -292,7 +292,7 @@ module Bible270
292
292
  # from, so without this the notice names the reader but cannot link to them.
293
293
  attr_accessor :mailer_host
294
294
 
295
- attr_accessor :after_sign_out_path, :email_sign_in_max_per_window, :passage_url_builder, :tagline, :footer_html, :footer, :favicon, :avatar_max_bytes, :chapter_breaks, :admin_emails, :admin_resolver, :bible_version, :require_sign_in_to_participate
295
+ attr_accessor :after_sign_out_path, :email_sign_in_max_per_window, :passage_url_builder, :tagline, :footer_html, :footer, :favicon, :avatar_max_bytes, :chapter_breaks, :admin_emails, :admin_resolver, :bible_version, :remember_for, :require_sign_in_to_participate
296
296
 
297
297
  # Public labels.
298
298
  attr_accessor :app_name
@@ -318,7 +318,10 @@ module Bible270
318
318
  #
319
319
  # Expressed in seconds rather than 1.year because this file has to load
320
320
  # without ActiveSupport.
321
- attr_accessor :remember_for
321
+ # The mark beside the title in the header. nil uses the built-in loaf, false
322
+ # shows none, and a string is used as an image source — so a host can put its
323
+ # own logo there without overriding the partial.
324
+ attr_accessor :header_mark
322
325
 
323
326
  def remember_signed_in?
324
327
  remember_for.to_i.positive?
@@ -340,6 +343,7 @@ module Bible270
340
343
  end
341
344
  @app_name = 'Daily Bread'
342
345
  @tagline = 'Journeying through Scripture in 9 months'
346
+ @header_mark = nil
343
347
  @remember_for = 365 * 24 * 60 * 60
344
348
  @require_sign_in_to_participate = true
345
349
  self.mount_at = '/daily-bread'
@@ -32,5 +32,16 @@ module Bible270
32
32
  compact = SVG.gsub(%r{\s+}, ' ').strip
33
33
  "data:image/svg+xml,#{compact.gsub(' ', '%20')}"
34
34
  end
35
+
36
+ # The same mark for inline use in a page, at whatever size. The percent
37
+ # encoding above is only correct inside a data URI: inlined into HTML,
38
+ # '%23231f18' is not a colour, so it is decoded here.
39
+ def inline_svg(size: nil)
40
+ markup = SVG.gsub('%23', '#').strip
41
+ return markup if size.nil?
42
+
43
+ pixels = size.to_i
44
+ markup.sub('<svg ', "<svg width='#{pixels}' height='#{pixels}' ")
45
+ end
35
46
  end
36
47
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bible270
4
- VERSION = '0.15.1'
4
+ VERSION = '0.15.2'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bible270
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.1
4
+ version: 0.15.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew vonderLuft