bible270 0.14.0 → 0.14.1

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: 54e58fbb0af2af30cb7cdfd8f47c2d57526d464ece9c987365cec2dcb2331d43
4
- data.tar.gz: b508bbb3ea2cd450cade1173173c680a4fcb34ad41fd3a498bef32cb2b2d9fe5
3
+ metadata.gz: 663793ae728057f408f03f490d324349dc105dc07395b1e3f29ee6c410331039
4
+ data.tar.gz: 9243a5ee0e3f921de058155825317684776babbbac0488cfca6bb2cbf5c810ad
5
5
  SHA512:
6
- metadata.gz: b7880113db1ceb742f5857e004279ce00674b2adb385f2b3ebfaa16a5eaf910c31f2d452e29db91211f77d622d207a3bff3df64091c1d3b7908a4de93f72674c
7
- data.tar.gz: a7b080c48d3072eab3554ac4fe4696bf2d8bd0ad69ef202fb7248c134a2b8685597d950222e72b80ba15f7c9449f8007c45bf1f9ec99be38d0228007ddfa23bb
6
+ metadata.gz: 393484c84f487178ba20d52191a8bbdb79d7e9009e1f7761c0c9514ab894923c52c021b6f9a0c66e8dfcaa5563d953e44e702c49cc800dfedf4ad43037e5b79d
7
+ data.tar.gz: 5c9dee8f97be46ae34b22c6cdf11c6fba418ad3f914847cd57d191d45de72fb77e152d92b44b32bbf8505f0d1bb1557e3e10dcacc3261c46a83bb3c4dc4540b3
@@ -13,7 +13,8 @@ module Bible270
13
13
  @readers = @readers.sort_by { |r| -@days_completed[r.id] }
14
14
 
15
15
  @start_day = current_reader&.current_day || 1
16
- @today_day = current_reader&.calendar_day
16
+ # nil outside the plan's window, so no "Go to today" before it begins
17
+ @today_day = current_reader&.today_day
17
18
  @community_start_date = Bible270.config.start_date
18
19
  @allow_reader_start_date = Bible270.config.allow_reader_start_date
19
20
  end
@@ -336,6 +336,20 @@ module Bible270
336
336
  end
337
337
 
338
338
  # Raw, unclamped — lets callers distinguish "not started yet" / "finished".
339
+ # The plan day that today actually is, or nil when today falls outside the
340
+ # plan's window. calendar_day clamps, so before the start date it reports day
341
+ # 1 — which made day 1 claim to be "today" for anyone whose plan hadn't begun.
342
+ def today_day
343
+ raw = raw_calendar_day
344
+ return nil if raw.nil?
345
+
346
+ Plan.valid_day?(raw) ? raw : nil
347
+ end
348
+
349
+ def today?(day)
350
+ today_day == day
351
+ end
352
+
339
353
  def raw_calendar_day
340
354
  Plan.day_for(Date.current, effective_start_date, clamp: false)
341
355
  end
@@ -5,17 +5,17 @@
5
5
  <%= link_to 'Moderate reflections →', admin_comments_path %></p>
6
6
 
7
7
  <div class="b270-panel">
8
- <h2 class="b270-subhead">This run of the plan</h2>
8
+ <h2 class="b270-subhead">This run of the plan is <%= @enrollment_closed ? 'closed' : 'open' %> to new readers.</h2>
9
9
  <% if @enrollment_closed %>
10
- <p class="b270-startline"><strong>Closed to new readers</strong><% if @enrollment_closed_at %>
11
- since <%= @enrollment_closed_at.strftime('%B %-d, %Y') %><% end %>.
10
+ <% if @enrollment_closed_at %>
11
+ <p class="b270-startline">Enrollment closed
12
+ on <%= @enrollment_closed_at.strftime('%B %-d, %Y') %><% end %>.
12
13
  The <%= @readers.size %> reader<%= 's' unless @readers.size == 1 %> already taking part can
13
14
  still sign in and carry on.</p>
14
15
  <%= button_to 'Open to new readers', admin_enrollment_path, method: :patch,
15
16
  params: { state: 'open' }, class: 'b270-btn' %>
16
17
  <% else %>
17
- <p class="b270-startline"><strong>Open to new readers.</strong> Anyone signing in for the first
18
- time joins this run.</p>
18
+ <p class="b270-startline">Anyone signing in for the first time joins this run.</p>
19
19
  <%= button_to 'Close to new readers', admin_enrollment_path, method: :patch,
20
20
  params: { state: 'closed' }, class: 'b270-btn',
21
21
  form: { data: { turbo_confirm: 'Close this run? Existing readers keep their access.' } } %>
@@ -28,7 +28,9 @@
28
28
  <div class="b270-li">
29
29
  <%= b270_avatar(reader, size: 34) %>
30
30
  <div>
31
- <div class="name"><%= link_to reader.display_name, admin_reader_path(reader), style: 'text-decoration:none' %></div>
31
+ <div class="name"><%= link_to reader.display_name, admin_reader_path(reader), style: 'text-decoration:none' %>
32
+ <% if Bible270.config.admin?(reader) %> <span class="sub"><strong>[admin]</strong></span> <% end %>
33
+ </div>
32
34
  <div class="sub">
33
35
  <%= reader.email.presence || reader.provider %>
34
36
  · <%= @days_completed[reader.id] %>/<%= Bible270::Plan::DAYS %> days
@@ -6,7 +6,9 @@
6
6
  <%= @reader.email.presence || @reader.provider %> ·
7
7
  <%= @days_completed %> of <%= Bible270::Plan::DAYS %> days ·
8
8
  <%= @reader.completion_percent %>%
9
- <% if @reader.dated? %>· day <%= @reader.calendar_day %> today<% end %>
9
+ <% if @reader.today_day %>· day <%= @reader.today_day %> today
10
+ <% elsif @reader.not_started_yet? %>· starts <%= @reader.effective_start_date.strftime('%b %-d, %Y') %>
11
+ <% elsif @reader.past_end_date? %>· finished <%= @reader.plan_end_date.strftime('%b %-d, %Y') %><% end %>
10
12
  </p>
11
13
 
12
14
  <div class="b270-panel">
@@ -6,7 +6,7 @@
6
6
  <% if signed_in? && current_reader.dated? %>
7
7
  <div class="date">
8
8
  <%= current_reader.date_for_day(@day).strftime("%A, %B %-d, %Y") %>
9
- <% if current_reader.calendar_day == @day %><span class="b270-badge">Today</span><% end %>
9
+ <% if current_reader.today?(@day) %><span class="b270-badge">Today</span><% end %>
10
10
  </div>
11
11
  <% end %>
12
12
  </div>
@@ -86,9 +86,10 @@
86
86
  .b270-arrow:hover{border-color:var(--gold);color:var(--gold)}
87
87
  .b270-arrow.disabled{opacity:.35;pointer-events:none}
88
88
  .b270-dayhead{flex:1}
89
- .b270-dayhead .k{font-family:"Spectral",serif;font-size:24px;font-weight:600;line-height:1}
90
- .b270-badge{font-size:10.5px;font-weight:600;letter-spacing:.1em;text-transform:uppercase;color:#fff;background:var(--gold);padding:3px 8px;border-radius:20px;margin-left:9px}
91
- .b270-dayhead .date{color:var(--faint);font-size:13px;margin-top:2px}
89
+ .b270-dayhead .k{display:flex;align-items:center;flex-wrap:wrap;gap:9px;font-family:"Spectral",serif;font-size:24px;font-weight:600;line-height:1}
90
+ .b270-dayhead .date{display:flex;align-items:center;flex-wrap:wrap;gap:9px;color:var(--faint);font-size:13px;margin-top:4px}
91
+ .b270-dayhead .b270-badge{margin-left:0}
92
+ .b270-badge{display:inline-block;vertical-align:middle;line-height:1;font-size:10.5px;font-weight:600;letter-spacing:.1em;text-transform:uppercase;color:#fff;background:var(--gold-lite);padding:5px 8px 4px;border-radius:20px;margin-left:9px}
92
93
 
93
94
  /* readings */
94
95
  .b270-readings{background:var(--card);border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow);overflow:hidden}
@@ -130,7 +131,7 @@
130
131
  .b270-cdel{font-size:12px;color:var(--oxblood);background:none;border:none;cursor:pointer;padding:0;margin-left:8px}
131
132
  .b270-form textarea{width:100%;font:inherit;font-size:15px;border:1px solid var(--line);border-radius:10px;padding:11px 13px;background:#fff;resize:vertical;min-height:76px}
132
133
  .b270-form .row{display:flex;align-items:center;gap:10px;margin-top:10px}
133
- .b270 .b270-btn{border:none;border-radius:10px;padding:10px 16px;font:inherit;font-weight:600;font-size:14px;cursor:pointer;background:var(--ink);color:var(--paper);text-decoration:none;display:inline-block}
134
+ .b270 .b270-btn{border:none;border-radius:10px;padding:8px 16px;margin-top:4px;font:inherit;font-weight:600;font-size:14px;cursor:pointer;background:var(--ink);color:var(--paper);text-decoration:none;display:inline-block}
134
135
  .b270-btn:hover{background:#3a352b}
135
136
 
136
137
  /* community */
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bible270
4
- VERSION = '0.14.0'
4
+ VERSION = '0.14.1'
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.14.0
4
+ version: 0.14.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew vonderLuft